/* Variables para colores (hace el código más limpio) */
:root {
    --color-sobre-asignatura: #E9C37A;
    --color-encargos: #FC9248;
    --color-tarea-1: #E9C37A;
    --color-tarea-2: #FC9248;
    --color-tarea-3: #FC6E3E;
    --color-tarea-4: #FB3260;
    --color-sobre-mi: #FB3260;
    --color-texto-claro: #D9D9D9;
}

/* Box-sizing universal */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Estilos base del documento */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Alegreya Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000000;
    color: #f0f8ff;
    position: relative;
}

/* Contenedor principal para centrar el contenido */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 60px;
}

/*Sección de P5.js  */
#intro-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #f0f8ff;
    z-index: -1;
}

/* Barra de Menú */
#main-menu {
    width: 100%;
    height: 116px;
    background-color: white;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    margin-top: calc(100vh - 116px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease-out;
}

.menu-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: #333;
}

.left-section h2 { font-size: 2.2em; margin: 0; font-weight: 700; }
.left-section p { font-size: 1.3em; margin: 0; font-weight: 400; line-height: 1.2; }
.left-section .author-name { font-size: 1em; font-weight: 300; }

.right-section ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 60px; }
.right-section ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 400;
    font-size: 1.3em;
    transition: color 0.3s ease;
}
.right-section ul li a:hover { color: #FB3260; }

/*  Secciones de Contenido */
main {
    position: relative;
    z-index: 20;
    background-color: #000000;
}

.content-section {
    padding: 150px 0;
    position: relative;
    z-index: 20;
    background-color: #000000;
}

/* Títulos con colores específicos */
.title-sobre-asignatura { color: var(--color-sobre-asignatura); }
.title-encargos { color: var(--color-encargos); }
.title-sobre-mi { color: var(--color-sobre-mi); }

/* Alineación de las secciones */
.right-aligned-content {
    margin-left: auto;
    text-align: right;
    width: 100%;
    max-width: 500px;
}

/* Estilos para los textos de reflexión y descripciones (tamaño más pequeño) */
.reflection-text, .section-description, .task-description {
    color: var(--color-texto-claro);
    font-size: 1.1em; /* Reducido a 1.1em para que sea más pequeño */
    line-height: 1.6;
}

/* Estilos de las Tareas (alternadas) */
.task-item {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 80px;
}

.task-item.right-aligned-task {
    flex-direction: row-reverse;
}

.task-item .task-text-content {
    flex: 1;
}

.task-media-content {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.task-media-content a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
}

.task-media-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

/* Efectos al pasar el mouse */
.task-media-content a:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* Colores de borde específicos para cada tarea */
.task-img-t1:hover { border-color: var(--color-tarea-1); }
.task-img-t2:hover { border-color: var(--color-tarea-2); }
.task-img-t3:hover { border-color: var(--color-tarea-3); }
.task-img-t4:hover { border-color: var(--color-tarea-4); }

/* Estilos para los subtítulos y enlaces de la tarea */
/* --- Secciones de Contenido (Ajuste de tamaños y estilos) --- */

.content-section h2 {
    font-size: 2.2em; /* Títulos principales de las secciones */
    margin-bottom: 20px;
}

/* Títulos con colores específicos */
.title-sobre-asignatura { color: var(--color-sobre-asignatura); }
.title-encargos { color: var(--color-encargos); }
.title-sobre-mi { color: var(--color-sobre-mi); }

/* Estilos para los subtítulos y enlaces de la tarea */
.task-subtitle {
    font-size: 1.5em; /* Tamaño reducido para que parezca un subtítulo */
    color: #F0F8FF;
    margin: 0 0 15px;
    font-style: italic; /* Texto en itálica */
}

/* El resto para las tareas puede mantenerse igual */

.task-link a {
    color: var(--color-texto-claro);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--color-texto-claro);
    padding-bottom: 2px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.task-link a:hover {
    color: var(--color-encargos);
    border-color: var(--color-encargos);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .menu-content { flex-direction: column; text-align: center; }
    .left-section h2, .left-section p { text-align: center; }
    .right-section ul { gap: 20px; justify-content: center; margin-top: 10px; }
    .content-section .content-wrapper { max-width: 100%; }
    .right-aligned-content { margin: 0; text-align: center; }
    .task-item, .task-item.right-aligned-task { flex-direction: column; }
    .task-text-content, .task-media-content { max-width: 100%; text-align: center; }
    .task-media-content a { width: 200px; height: 200px; }
    .task-link a { text-align: center; display: inline-block; }
}

/* --- Arreglos de Estilo para la Sección "Sobre la Asignatura" --- */

.wiki-link a {
    color: var(--color-texto-claro);
    text-decoration: none;
    transition: color 0.3s ease;
}

.wiki-link a:hover {
    color: var(--color-sobre-asignatura);
}

/* --- Efectos de Texto en Títulos --- */

.content-section h2 {
    font-size: 2.2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4); /* Sombra de texto */
}

/* --- Efectos de Imagen en Miniaturas de Tareas --- */

.task-media-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease, filter 0.3s ease; /* Añadimos 'filter' a la transición */
    filter: grayscale(100%); /* Filtro inicial de escala de grises */
}

.task-media-content a:hover img {
    filter: none; /* Quitamos el filtro al pasar el mouse */
}

/* Los colores de borde específicos para cada tarea se mantienen */
.task-img-t1:hover { border-color: var(--color-tarea-1); }
.task-img-t2:hover { border-color: var(--color-tarea-2); }
.task-img-t3:hover { border-color: var(--color-tarea-3); }
.task-img-t4:hover { border-color: var(--color-tarea-4); }

/* transición también esté en el selector principal */
.task-media-content a:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* --- Estilos para la sección "Sobre Mí" --- */
.sobre-mi-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.sobre-mi-text {
    color: var(--color-texto-claro);
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

.sobre-mi-links {
    list-style: none; /* Elimina los puntos */
    padding: 0;
    margin: 0;
}

.sobre-mi-links a {
    color: var(--color-texto-claro); /* Color inicial del texto */
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.sobre-mi-links a:hover {
    color: var(--color-sobre-mi); /* Color al pasar el mouse */
    border-color: var(--color-sobre-mi);
}

/* Estilos para el título de las secciones (para que sean consistentes) */
.title-sobre-asignatura,
.title-encargos,
.title-sobre-mi {
    font-size: 2em;
    margin-bottom: 40px;
}

/* Estilos de la nueva sub-sección */
.experimentacion-section {
    width: 100%;
    max-width: 900px;
    margin-left: 0 auto;
}

.experimentacion-subtitle {
    font-size: 1.8em;
    color: #F0F8FF;
    margin: 0 0 20px;
    font-style: italic;
}

.toggle-button-container {
    margin-bottom: 20px;
}

.toggle-button {
    background: none;
    border: 1px solid var(--color-texto-claro);
    color: var(--color-texto-claro);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Alegreya Sans', sans-serif;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.toggle-button:hover {
    background-color: rgba(217, 217, 217, 0.1);
}

.arrow-icon {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.projects-container {
    display: none; /* Se mantiene oculto por defecto */
    overflow: hidden;
    transition: all 0.5s ease-in-out;
    max-width: 900px; /* Le da el ancho que ya estaba en otra parte del código */
    margin: 0 auto; /* ¡CLAVE! Esto centra el contenedor en la página */
    padding: 0 20px; /* Añade un pequeño margen interno para evitar que los círculos toquen los bordes */
}

.projects-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    margin-top: 20px;
}

.project-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
}

.project-image {
    width: 100px;
    height: 100px;
    border-radius: 50%; /* Esto hace la imagen circular */
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.project-image:hover {
    transform: scale(1.1);
}

.project-link {
    margin-top: 10px;
    text-decoration: none;
    color: var(--color-texto-claro);
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--color-sobre-mi);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .menu-content { flex-direction: column; text-align: center; }
    .left-section h2, .left-section p { text-align: center; }
    .right-section ul { gap: 20px; justify-content: center; margin-top: 10px; }
    .content-section .content-wrapper { max-width: 100%; }
    .right-aligned-content { margin: 0; text-align: center; }
    .task-item, .task-item.right-aligned-task { flex-direction: column; }
    .task-text-content, .task-media-content { max-width: 100%; text-align: center; }
    .task-media-content a { width: 200px; height: 200px; }
    .task-link a { text-align: center; display: inline-block; }
    
    .sobre-mi-container { gap: 40px; }
    .projects-grid { flex-wrap: wrap; justify-content: center; }
    .project-item { min-width: 80px; }
    .project-image { width: 80px; height: 80px; }
}