/* =====================================================
   VARIABLES GENERALES
===================================================== */

:root {
    --violeta: #7c3aed;
    --violeta-claro: #a855f7;
    --violeta-oscuro: #5b21b6;
    --glow-violeta: rgba(168, 85, 247, 0.42);
    --negro: #111;
    --negro-profundo: #09090f;
    --gris-fondo: #f2f2f2;
    --texto: #111;
    --texto-suave: #666;
    --blanco: #fff;
    --radio: 22px;
    --max-width: 1100px;
}


/* =====================================================
   RESET / BASE
===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

html {
    /* scroll-behavior: smooth aplicado aquí Y en body para cubrir ambos contenedores */
    scroll-behavior: smooth;
    /* IMPORTANTE: NO fijar height:100% en html — hacerlo mueve el scroll container
       al body y deja a html sin poder aplicar scroll-behavior. */
}

body {
    overflow-x: hidden;
    /* min-height en vez de height: el cuerpo puede crecer más que la pantalla
       sin convertirse en el único contenedor de scroll. */
    min-height: 100%;
    scroll-behavior: smooth;              /* fallback: scroll suave también en body */
    font-family: Arial, Helvetica, sans-serif;
    color: var(--texto);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 12% 18%, rgba(168, 85, 247, 0.15), transparent 26%),
        radial-gradient(circle at 88% 62%, rgba(124, 58, 237, 0.12), transparent 28%),
        linear-gradient(135deg, #f7f7f9 0%, #eceaf2 50%, #f7f7f9 100%);
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

::selection {
    background-color: var(--violeta-claro);
    color: var(--blanco);
}

main {
    flex: 1;
}

main,
.footer {
    position: relative;
    z-index: 2;
}

/* ── Scroll-margin: espacio libre sobre cada sección al navegar con anclas ──
   Evita que el header fijo tape el inicio de la sección al hacer scroll.
   El header mide ~62px; se agrega un pequeño margen extra. */
.hero,
#foja,
#equipo,
#datos,
#proyectos {
    scroll-margin-top: 76px;
}


/* =====================================================
   FONDO GENERAL: GRILLA, GLOW Y PARTÍCULAS
===================================================== */

.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.18) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
    animation: gridMove 18s linear infinite;
}

.bg-orb {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.34;
    animation: orbFloat 10s ease-in-out infinite alternate;
}

.orb-uno {
    top: 10%;
    left: -100px;
    background-color: var(--violeta-claro);
}

.orb-dos {
    right: -120px;
    bottom: 8%;
    background-color: var(--violeta-oscuro);
    animation-delay: -4s;
}

.particles {
    position: absolute;
    inset: 0;
}

.particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(124, 58, 237, 0.58);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.8);
    animation: particleFloat linear infinite;
}


/* =====================================================
   CURSOR PERSONALIZADO
===================================================== */

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: block;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(168, 85, 247, 0.9);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    mix-blend-mode: multiply;
    backdrop-filter: blur(1px);
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.55);
    transition:
        width 0.18s ease,
        height 0.18s ease,
        opacity 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.custom-cursor.cursor-visible {
    opacity: 1;
}

.custom-cursor.cursor-hover {
    width: 46px;
    height: 46px;
    border-color: rgba(255, 255, 255, 0.95);
    background-color: rgba(168, 85, 247, 0.18);
    box-shadow:
        0 0 32px rgba(168, 85, 247, 0.75),
        inset 0 0 12px rgba(255, 255, 255, 0.35);
}

@media (hover: none), (pointer: coarse) {
    * {
        cursor: auto !important;
    }

    .custom-cursor {
        display: none !important;
    }
}


/* =====================================================
   HEADER / NAVBAR
===================================================== */

.header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(11, 11, 18, 0.82);
    border-bottom: 1px solid rgba(168, 85, 247, 0.22);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.header h2 {
    color: transparent;
    background: linear-gradient(90deg, var(--violeta), var(--violeta-claro), #111, var(--violeta));
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

.navbar {
    max-width: var(--max-width);
    margin: auto;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.logo img {
    display: block;
    width: auto;
    max-height: 42px;
}

.logo:hover {
    opacity: 0.82;
    transform: translateY(-1px);
    filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.55));
}

#menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.menu-icon span {
    width: 28px;
    height: 3px;
    background-color: var(--blanco);
    border-radius: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.2s ease;
}

.menu-icon:hover span {
    background-color: var(--violeta-claro);
}

#menu-toggle:checked ~ .menu-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#menu-toggle:checked ~ .menu-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menu-toggle:checked ~ .menu-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    position: relative;
    padding: 8px 2px;
    color: var(--blanco);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--violeta), var(--violeta-claro), white);
    box-shadow: 0 0 12px var(--glow-violeta);
    transition: width 0.25s ease;
}

.nav-links a:hover {
    color: var(--violeta-claro);
    text-shadow: 0 0 16px var(--glow-violeta);
}

.nav-links a:hover::after {
    width: 100%;
}


/* =====================================================
   ANIMACIONES GENERALES
===================================================== */

.fade-up {
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.fade-up:nth-child(1) { animation-delay: 0.1s; }
.fade-up:nth-child(2) { animation-delay: 0.2s; }
.fade-up:nth-child(3) { animation-delay: 0.3s; }
.fade-up:nth-child(4) { animation-delay: 0.4s; }
.fade-up:nth-child(5) { animation-delay: 0.5s; }

.scroll-reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* =====================================================
   HERO / PERFIL
===================================================== */

.hero {
    position: relative;
    max-width: var(--max-width);
    min-height: 85vh;
    margin: auto;
    padding: 80px 40px;
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 40px 0;
    z-index: -1;
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.14));
    backdrop-filter: blur(4px);
}


.foto-perfil {
    position: relative;
    width: 320px;
    height: 400px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.65);
    border-radius: var(--radio);
    background-color: #ddd;
    transform-style: preserve-3d;
    animation: glowPulse 3.4s ease-in-out infinite;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.foto-perfil::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.42), transparent 80%);
    transform: translateX(-120%);
    transition: transform 0.65s ease;
}

.foto-perfil:hover {
    border-color: var(--blanco);
    transform: perspective(900px) rotateX(2deg) rotateY(-5deg) scale(1.025);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.36);
}

.foto-perfil:hover::before {
    transform: translateX(120%);
}

.foto-perfil img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.etiqueta {
    color: var(--violeta);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
}

.hero h1 {
    margin: 15px 0;
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1;
    letter-spacing: -3px;
}

.hero h1 span {
    color: transparent;
    background: linear-gradient(90deg, var(--violeta), var(--violeta-claro), #111, var(--violeta));
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

.subtitulo {
    margin-bottom: 25px;
    color: var(--texto-suave);
}

.descripcion {
    max-width: 500px;
    margin-bottom: 25px;
    color: #333;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badges span {
    position: relative;
    overflow: hidden;
    padding: 8px 14px;
    border: 1px solid rgba(124, 58, 237, 0.9);
    border-radius: 30px;
    background-color: var(--negro);
    color: var(--blanco);
    font-size: 13px;
    box-shadow: 0 0 22px rgba(124, 58, 237, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badges span::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: linear-gradient(90deg, var(--violeta), var(--violeta-claro), #111);
    background-size: 240% 100%;
    animation: gradientShift 4s ease infinite;
    transition: opacity 0.2s ease;
}

.badges span:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.34);
}

.badges span:hover::before {
    opacity: 1;
}


/* =====================================================
   PARTÍCULAS LATERALES DEL HERO
===================================================== */
.hero-particles {
    position: absolute;
    inset: -30%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    border-radius: 34px;
}

.hero-particles::before,
.hero-particles::after {
    content: "";
    position: absolute;
    inset: -12%;
    opacity: 0.85;
    filter: blur(0.25px);

    --particle-mask: linear-gradient(
        90deg,
        #000 0 18%,
        rgba(0, 0, 0, 0.55) 34%,
        transparent 50%,
        rgba(0, 0, 0, 0.55) 66%,
        #000 82% 100%
    );

    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
        radial-gradient(circle, rgba(168, 85, 247, 0.85) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(124, 58, 237, 0.75) 0 2px, transparent 2.5px);
    background-size: 95px 95px, 145px 145px, 210px 210px;
    background-position: 0 0, 35px 70px, 90px 40px;

    mask-image: var(--particle-mask);
    -webkit-mask-image: var(--particle-mask);

    animation: particlesSideMove 5s linear infinite;
}

.hero-particles::after {
    opacity: 0.45;
    filter: blur(1.5px);
    transform: scale(1.08);
    animation: particlesSideMove 9s linear infinite reverse;
    background-size: 130px 130px, 190px 190px, 260px 260px;
}

@keyframes particlesSideMove {
    from {
        background-position: 0 0, 35px 70px, 90px 40px;
    }

    to {
        background-position: 95px 95px, 180px 215px, 300px 250px;
    }
}
/* =====================================================
   SECCIONES GENERALES
===================================================== */

.section {
    max-width: var(--max-width);
    margin: auto;
    padding: 70px 20px;
}

.section-title {
    margin-bottom: 30px;
}

.section-title p {
    color: var(--violeta);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
}

.section-title h2 {
    margin-top: 8px;
    font-size: 38px;
}


/* =====================================================
   FOJA ACADÉMICA / TIMELINE
===================================================== */

#foja {
    position: relative;
    max-width: none;
    overflow: hidden;
    color: var(--blanco);
    background:
        radial-gradient(circle at 18% 15%, rgba(168, 85, 247, 0.24), transparent 28%),
        linear-gradient(135deg, #08080d, #11111a 45%, #08080d);
}

#foja::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(168, 85, 247, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168, 85, 247, 0.08) 1px, transparent 1px);
    background-size: 42px 42px;
    animation: gridMove 22s linear infinite;
}

#foja .section-title,
#foja .timeline {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin-right: auto;
    margin-left: auto;
}

#foja .section-title h2 {
    color: var(--blanco);
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 8px;
    width: 3px;
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(to bottom, transparent, var(--violeta-claro), white, var(--violeta), transparent);
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.6);
}

.timeline-year {
    position: relative;
    margin-bottom: 22px;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.18);
    border-radius: 18px;
    background-color: rgba(28, 28, 38, 0.72);
    backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-year:hover {
    border-color: var(--violeta);
    transform: translateX(4px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25), 0 0 30px rgba(168, 85, 247, 0.16);
}

.timeline-year::before {
    content: "";
    position: absolute;
    top: 22px;
    left: -29px;
    width: 15px;
    height: 15px;
    border: 3px solid var(--negro);
    border-radius: 50%;
    background-color: var(--violeta-claro);
    box-shadow: 0 0 18px var(--glow-violeta);
    transition: transform 0.25s ease;
}

.timeline-year:hover::before {
    transform: scale(1.3);
}

.timeline-year summary {
    padding: 20px 24px;
    list-style: none;
    color: var(--violeta-claro);
    background-color: rgba(255, 255, 255, 0.04);
    font-size: 22px;
    font-weight: bold;
    transition: background-color 0.2s ease, letter-spacing 0.2s ease;
}

.timeline-year summary:hover {
    background-color: rgba(168, 85, 247, 0.11);
    letter-spacing: 1px;
}

.timeline-year summary::-webkit-details-marker {
    display: none;
}

.timeline-year summary::after {
    content: "+";
    float: right;
    color: var(--blanco);
    transition: transform 0.3s ease;
}

.timeline-year[open] summary::after {
    content: "–";
    transform: rotate(180deg);
}

.timeline-content {
    padding: 20px 24px;
    animation: fadeUp 0.3s ease;
}

.timeline-content h3 {
    margin: 18px 0 8px;
    color: var(--violeta-claro);
    font-size: 17px;
}

.timeline-content h3:first-child {
    margin-top: 0;
}

.timeline-content p {
    padding: 12px 0;
    border-bottom: 1px solid #333;
    color: #f2f2f2;
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.timeline-content p:hover {
    padding-left: 8px;
    color: var(--violeta-claro);
}

.timeline-content p:last-child {
    border-bottom: none;
}


/* =====================================================
   EQUIPO
===================================================== */

.equipo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.integrante {
    position: relative;
    overflow: hidden;
    padding: 25px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: var(--radio);
    background-color: rgba(255, 255, 255, 0.78);
    color: var(--texto);
    text-align: center;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.integrante::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, transparent, rgba(168, 85, 247, 0.13), transparent);
    transition: opacity 0.25s ease;
}

.integrante:hover {
    border-color: var(--violeta);
    transform: translateY(-7px);
    box-shadow: 0 18px 44px rgba(124, 58, 237, 0.18);
}

.integrante:hover::before {
    opacity: 1;
}

.integrante h3,
.integrante p,
.avatar {
    position: relative;
    z-index: 1;
}

.avatar {
    width: 76px;
    height: 76px;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 2px solid var(--violeta);
    border-radius: 50%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.integrante:hover .avatar {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 0 26px rgba(168, 85, 247, 0.45);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.integrante h3 {
    font-size: 16px;
}

.integrante p {
    color: var(--texto-suave);
    font-size: 14px;
}


/* =====================================================
   DATOS ACADÉMICOS
===================================================== */

.datos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.dato-card {
    position: relative;
    overflow: hidden;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--radio);
    background-color: rgba(17, 17, 26, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.dato-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, transparent, rgba(168, 85, 247, 0.13), transparent);
    transition: opacity 0.25s ease;
}

.dato-card:hover {
    border-color: var(--violeta);
    transform: translateY(-7px);
    box-shadow: 0 18px 44px rgba(124, 58, 237, 0.18);
}

.dato-card:hover::before {
    opacity: 1;
}

.dato-card h3,
.dato-card p {
    position: relative;
    z-index: 1;
}

.dato-card h3 {
    margin-bottom: 12px;
    padding: 8px 20px;
    border-radius: 8px;
    color: var(--blanco);
    background: linear-gradient(90deg, var(--violeta), var(--violeta-claro), var(--violeta-oscuro));
    background-size: 220% 100%;
    animation: gradientShift 6s ease infinite;
}

.dato-card p {
    margin-bottom: 8px;
    color: #dcdcdc;
}

.dato-card strong {
    color: var(--blanco);
}


/* =====================================================
   FOOTER
===================================================== */

.footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 35px 40px;
    border-top: 1px solid rgba(168, 85, 247, 0.22);
    background-color: rgba(11, 11, 18, 0.96);
    color: var(--blanco);
    font-size: 14px;
}

.footer p {
    max-width: var(--max-width);
    margin: auto;
    color: #888;
    transition: color 0.3s ease;
}

.footer p:hover {
    color: #ccc;
}


/* =====================================================
   KEYFRAMES
===================================================== */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gridMove {
    from { background-position: 0 0; }
    to { background-position: 54px 54px; }
}

@keyframes orbFloat {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(36px, -26px, 0) scale(1.12); }
}

@keyframes particleFloat {
    0% { transform: translateY(0) scale(0.7); opacity: 0; }
    18% { opacity: 1; }
    100% { transform: translateY(-120px) scale(1.2); opacity: 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 26px rgba(168, 85, 247, 0.22); }
    50% { box-shadow: 0 0 48px rgba(168, 85, 247, 0.48); }
}

@keyframes heroLightSweep {
    0%, 100% { background-position: 0% 50%; opacity: 0.45; }
    50% { background-position: 100% 50%; opacity: 0.9; }
}

@keyframes sideParticleBurst {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.25) rotate(0deg);
        filter: blur(1px);
    }
    8% {
        opacity: 1;
        filter: blur(0);
    }
    62% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--burst-x), var(--burst-y), 0) scale(1.35) rotate(var(--burst-rotate));
        filter: blur(1.5px);
    }
}

@keyframes sideGlowPulse {
    from {
        opacity: 0.25;
        transform: scaleY(0.88);
    }
    to {
        opacity: 0.68;
        transform: scaleY(1.08);
    }
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {
    .navbar {
        position: relative;
    }

    .menu-icon {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 20px;
        right: 20px;
        width: auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
        border: 1px solid rgba(168, 85, 247, 0.22);
        border-radius: 0 0 18px 18px;
        background-color: rgba(11, 11, 18, 0.96);
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26);
        backdrop-filter: blur(18px);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    #menu-toggle:checked ~ .nav-links {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .hero {
        min-height: auto;
        padding-top: 70px;
        padding-bottom: 70px;
        flex-direction: column;
        align-items: flex-start;
        gap: 35px;
    }

    .hero::before {
        inset: 20px 12px;
    }

    .hero-particles {
        inset: -8% -22%;
    }

    .hero-particles span:nth-child(3n) {
        height: 20px;
    }

    .foto-perfil {
        width: 100%;
        height: 380px;
    }

    .hero h1 {
        letter-spacing: -2px;
    }

    .section-title h2 {
        font-size: 30px;
    }

    .timeline {
        padding-left: 22px;
    }

    .timeline::before {
        left: 5px;
    }

    .timeline-year::before {
        left: -24px;
    }

    .timeline-year:hover {
        transform: none;
    }

    .timeline-year summary {
        padding: 18px;
        font-size: 19px;
    }

    .timeline-content {
        padding: 16px 18px;
    }

    .equipo-grid,
    .datos-grid {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =====================================================
   ACCESIBILIDAD: REDUCIR MOVIMIENTO
===================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================================================
   MENÚ LATERAL FIJO (side-nav) — overlay lateral
   Desktop: barra glass full-height colapsada a puntos, expandible en hover.
   Mobile: línea brillante fija a la izquierda, expandible al tocar.
===================================================== */

.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 48px;
    z-index: 1100;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 74px 0 28px;

    background: rgba(15, 10, 30, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid rgba(168, 85, 247, 0.22);
    box-shadow: 8px 0 28px rgba(15, 10, 30, 0.12);

    overflow: hidden;
    pointer-events: auto;
    transition:
        width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.32s ease,
        box-shadow 0.32s ease;
}

.side-nav::before {
    content: "";
    position: absolute;
    top: 78px;
    bottom: 28px;
    left: 23px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(168, 85, 247, 0.78),
        rgba(255, 255, 255, 0.72),
        rgba(168, 85, 247, 0.78),
        transparent
    );
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.7);
    opacity: 0.75;
    pointer-events: none;
}

.side-nav:hover,
.side-nav.is-open {
    width: 198px;
    background: rgba(15, 10, 30, 0.34);
    box-shadow: 14px 0 34px rgba(15, 10, 30, 0.18);
}

.side-nav-toggle {
    display: none;
}

.side-nav ul {
    position: relative;
    z-index: 1;
    width: 198px;
    margin: auto 0;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
}

.side-nav li {
    display: flex;
}

.side-nav-link {
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 12px;

    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.25px;
    white-space: nowrap;

    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.side-nav-link::before {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: rgba(168, 85, 247, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.28);
    transition:
        transform 0.22s ease,
        background-color 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.side-nav-link::after {
    content: none;
}

.side-nav-label {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transform: translateX(-8px);
    pointer-events: none;
    transition:
        max-width 0.25s ease,
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.25s ease;
}

.side-nav:hover .side-nav-label,
.side-nav.is-open .side-nav-label {
    max-width: 140px;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.side-nav-link:hover {
    background: rgba(168, 85, 247, 0.13);
    color: var(--blanco);
}

.side-nav-link:hover::before {
    background-color: var(--violeta-claro);
    border-color: rgba(255, 255, 255, 0.75);
    transform: scale(1.28);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.82);
}

.side-nav-link.active {
    background: rgba(168, 85, 247, 0.18);
    color: var(--blanco);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.28);
}


/* Foco de teclado sin dejar el menú desplegado después del click */
.side-nav-link:focus {
    outline: none;
}

.side-nav-link:focus-visible {
    outline: 1px solid rgba(168, 85, 247, 0.75);
    outline-offset: 2px;
}

.side-nav-link.active::before {
    background-color: var(--violeta-claro);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.55);
    box-shadow:
        0 0 8px rgba(255, 255, 255, 0.72),
        0 0 18px rgba(168, 85, 247, 0.95);
}

/* =====================================================
   BANNER / CARRUSEL DE PROYECTOS
   Agregado para la sección de galería de proyectos.
===================================================== */

/* Sección contenedora — hereda .section pero sobrescribe padding lateral */
.proyectos-section {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}

/* El título sí respeta el ancho máximo de la página */
.proyectos-section .section-title {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Wrapper externo: máscara estrecha — solo ~2 tarjetas visibles en el centro */
.banner-track-wrapper {
    position: relative;
    overflow: hidden;
    max-width: 680px;                     /* limita el ancho total del carrusel */
    margin: 0 auto;                       /* centra el carrusel en la página */
    /* Máscara de fundido: oculta casi todo excepto el centro */
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 20%,
        black 80%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 20%,
        black 80%,
        transparent 100%
    );
}

/* Pista animada — velocidad reducida para 3 tarjetas */
.banner-track {
    display: flex;
    gap: 20px;
    padding: 16px 20px 24px;
    width: max-content;
    animation: bannerScroll 18s linear infinite;
}

/* Pausa el scroll cuando el usuario pasa el mouse */
.banner-track-wrapper:hover .banner-track {
    animation-play-state: paused;
}

/* Tarjeta individual — ancho reducido para que quepan ~2 en la ventana */
.banner-card {
    flex-shrink: 0;
    width: 240px;
    border-radius: var(--radio);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(124, 58, 237, 0.16);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.banner-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--violeta);
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.22);
}

/* Área de imagen (placeholder hasta que se agreguen fotos reales) */
.banner-img-placeholder {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(168, 85, 247, 0.28)),
        repeating-linear-gradient(
            45deg,
            rgba(168, 85, 247, 0.07) 0px,
            rgba(168, 85, 247, 0.07) 1px,
            transparent 1px,
            transparent 18px
        );
    overflow: hidden;
}

/* Efecto de shimmer sobre el placeholder */
.banner-img-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: bannerShimmer 2.4s ease infinite;
}

.banner-img-placeholder span {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: bold;
    color: var(--violeta);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
}

/*
   Para reemplazar un placeholder por una imagen real, dentro de .banner-card
   cambiá el <div class="banner-img-placeholder"> por:
       <img src="img/tu-imagen.jpg" alt="Descripción" class="banner-img-real">
   y usá esta clase:
*/
.banner-img-real {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* Pie de la tarjeta */
.banner-caption {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--texto-suave);
    text-align: center;
    border-top: 1px solid rgba(124, 58, 237, 0.1);
}

/* Keyframe: desplazamiento horizontal continuo */
@keyframes bannerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }   /* 50% porque la pista está duplicada */
}

/* Keyframe: shimmer sobre placeholders */
@keyframes bannerShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* =====================================================
   RESPONSIVE — side-nav y banner
===================================================== */

/* La side-nav es overlay: no empuja el layout en ningún tamaño */
@media (min-width: 901px) {
    main,
    .footer {
        margin-left: 0;
    }
}

@media (max-width: 900px) {
    main,
    .footer {
        margin-left: 0;
    }

    body {
        padding-bottom: 0;
    }

    .side-nav {
        left: 0;
        top: 0;
        bottom: auto;
        width: 18px;
        height: 100vh;
        max-width: none;
        padding: 74px 0 24px;
        transform: none;

        background: rgba(15, 10, 30, 0.08);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 0;
        border-right: 1px solid rgba(168, 85, 247, 0.24);
        border-radius: 0;
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.16);

        overflow: hidden;
        transition:
            width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
            background 0.32s ease,
            box-shadow 0.32s ease;
    }

    .side-nav::before {
        top: 82px;
        bottom: 28px;
        left: 8px;
        width: 2px;
        opacity: 1;
        background: linear-gradient(
            to bottom,
            transparent,
            rgba(168, 85, 247, 0.95),
            rgba(255, 255, 255, 0.9),
            rgba(168, 85, 247, 0.95),
            transparent
        );
        box-shadow:
            0 0 10px rgba(168, 85, 247, 0.95),
            0 0 22px rgba(168, 85, 247, 0.55);
    }

    .side-nav:hover {
        width: 18px;
    }

    .side-nav.is-open {
        width: min(210px, 72vw);
        background: rgba(15, 10, 30, 0.48);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-right: 1px solid rgba(168, 85, 247, 0.32);
        box-shadow: 12px 0 36px rgba(15, 10, 30, 0.28);
    }

    .side-nav-toggle {
        position: absolute;
        inset: 0 auto 0 0;
        z-index: 4;
        display: block;
        width: 18px;
        height: 100%;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .side-nav-toggle span {
        position: absolute;
        top: 50%;
        left: 7px;
        width: 4px;
        height: 52px;
        border-radius: 999px;
        background: rgba(168, 85, 247, 0.85);
        box-shadow:
            0 0 10px rgba(168, 85, 247, 0.95),
            0 0 22px rgba(168, 85, 247, 0.55);
        transform: translateY(-50%);
    }

    .side-nav.is-open .side-nav-toggle {
        width: 100%;
        pointer-events: none;
    }

    .side-nav ul {
        width: min(210px, 72vw);
        padding: 0 12px 0 22px;
        gap: 8px;
        opacity: 1;
        transform: translateX(-4px);
        transition: transform 0.25s ease;
    }

    .side-nav.is-open ul {
        transform: translateX(0);
    }

    .side-nav-link {
        min-height: 40px;
        padding: 9px 10px;
        gap: 11px;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
    }

    .side-nav-label {
        max-width: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .side-nav.is-open .side-nav-label {
        max-width: 145px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .side-nav-link::before {
        width: 8px;
        height: 8px;
        background-color: rgba(168, 85, 247, 0.44);
        border-color: rgba(255, 255, 255, 0.28);
    }

    .side-nav-link.active {
        background: transparent;
        box-shadow: none;
    }

    .side-nav.is-open .side-nav-link.active {
        background: rgba(168, 85, 247, 0.18);
        box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.22);
    }

    .side-nav-link.active::before {
        background-color: var(--violeta-claro);
        box-shadow:
            0 0 8px rgba(255, 255, 255, 0.72),
            0 0 18px rgba(168, 85, 247, 0.95);
        transform: scale(1.5);
    }

    .banner-track-wrapper {
        max-width: 100%;
        mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
    }

    .banner-card {
        width: 190px;
    }

    .banner-img-placeholder,
    .banner-img-real {
        height: 130px;
    }
}



/* =====================================================
   FOJA ACADÉMICA — SCROLL INTERNO EN LA LÍNEA DE TIEMPO
   Muestra los primeros años y permite recorrer el resto
   dentro del mismo bloque, sin alargar toda la sección.
===================================================== */
.timeline {
    max-height: min(64vh, 620px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 14px;
    overscroll-behavior-y: auto;
    scrollbar-gutter: stable;
}

.timeline::-webkit-scrollbar {
    width: 8px;
}

.timeline::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
}

.timeline::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(to bottom, var(--violeta-claro), var(--violeta));
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.55);
}

.timeline::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #c084fc, var(--violeta-claro));
}

/* Firefox */
.timeline {
    scrollbar-width: thin;
    scrollbar-color: var(--violeta-claro) rgba(255, 255, 255, 0.05);
}

/* Pequeños fundidos para que se entienda que hay más contenido scrolleable */
#foja .timeline {
    mask-image: linear-gradient(to bottom, black 0%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 88%, transparent 100%);
}

@media (max-width: 768px) {
    .timeline {
        max-height: 520px;
        padding-right: 10px;
    }
}


/* =====================================================
   FOJA ACADÉMICA — SCROLL INTERNO V2
   El scroll se concentra en la línea brillante izquierda.
   Se oculta la barra nativa derecha para que no compita visualmente.
===================================================== */
#foja .timeline-scroll-shell {
    position: relative;
    max-width: var(--max-width);
    margin-right: auto;
    margin-left: auto;
}

#foja .timeline-scroll-rail {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    z-index: 3;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(
        to bottom,
        rgba(168, 85, 247, 0.18),
        rgba(168, 85, 247, 0.85),
        rgba(255, 255, 255, 0.78),
        rgba(124, 58, 237, 0.82),
        rgba(168, 85, 247, 0.18)
    );
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.72);
    pointer-events: none;
}

#foja .timeline-scroll-rail span {
    position: absolute;
    top: 0;
    left: -3px;
    width: 10px;
    min-height: 68px;
    border-radius: 999px;
    background: linear-gradient(to bottom, #fff, var(--violeta-claro), var(--violeta));
    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.7),
        0 0 28px rgba(168, 85, 247, 0.95);
    opacity: 0.9;
    transform: translateY(0);
    transition: height 0.18s ease;
}

#foja .timeline {
    --timeline-collapsed-height: clamp(330px, 42vh, 420px);
    max-height: var(--timeline-collapsed-height);
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 42px;
    padding-right: 4px;
    overscroll-behavior-y: auto;
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
    scrollbar-gutter: auto;
    mask-image: linear-gradient(to bottom, black 0%, black 84%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 84%, transparent 100%);
    transition: max-height 0.34s ease, mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
}

/* Cuando un año está desplegado, el bloque crece para que las materias no queden tapadas por el recorte/fundido inferior. */
#foja .timeline.timeline-has-open {
    max-height: var(--timeline-open-height, min(78vh, 760px));
    mask-image: none;
    -webkit-mask-image: none;
}

#foja .timeline::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#foja .timeline::before {
    display: none;
}

#foja .timeline-year::before {
    left: -38px;
    z-index: 4;
}

@media (max-width: 768px) {
    #foja .timeline {
        --timeline-collapsed-height: 360px;
        padding-left: 34px;
        padding-right: 2px;
    }

    #foja .timeline.timeline-has-open {
        max-height: var(--timeline-open-height, min(72vh, 640px));
    }

    #foja .timeline-scroll-rail {
        left: 5px;
    }

    #foja .timeline-year::before {
        left: -31px;
    }
}
