/* =========================================================
   LevelUP — capa de movimiento (v3)
   Técnicas: marquesinas acopladas a la velocidad,
   reveals por máscara y parallax.
   ========================================================= */

/* ---------- Marquesina de texto gigante ----------
   Dos filas en direcciones opuestas; la velocidad base la
   fija el CSS y el JS la modula con la velocidad del scroll. */
.marquee-band {
    position: relative;
    overflow: hidden;
    padding: clamp(2.2rem, 5vw, 3.6rem) 0;
    background: var(--accent);
    /* Esquinas cortadas: la firma geométrica de la referencia */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.2rem), calc(100% - 6vw) 100%, 0 100%);
}
.marquee-band + .marquee-band { margin-top: -1px; }
.marquee {
    display: flex;
    width: max-content;
    will-change: transform;
}
.marquee-row + .marquee-row { margin-top: 0.4rem; }
.marquee span {
    display: block;
    white-space: nowrap;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: clamp(2.4rem, 7vw, 5.2rem);
    line-height: 1;
    letter-spacing: 0.01em;
    color: #0b0b0d;
    padding-right: 0.6em;
}
.marquee span em {
    font-style: normal;
    -webkit-text-stroke: 2px #0b0b0d;
    color: transparent;
}

/* ---------- Declaración editorial con reveal por palabra ---------- */
.statement {
    font-family: var(--font-display);
    font-weight: 500;
    text-transform: uppercase;
    font-size: clamp(2rem, 6.4vw, 4.6rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
    text-align: center;
    max-width: 20ch;
    margin-inline: auto;
    text-wrap: balance;
}
.statement .accent { color: var(--accent); }
/* Cada palabra vive dentro de una máscara y sube al entrar */
.word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}
.word > i {
    display: inline-block;
    font-style: inherit;
    transform: translateY(105%);
    transition: transform 780ms var(--ease-out);
    transition-delay: var(--word-delay, 0ms);
}
.is-in .word > i { transform: none; }

/* ---------- Reveal por máscara (clip-path) ---------- */
.clip-reveal {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1000ms var(--ease-out);
}
.clip-reveal.is-in { clip-path: inset(0 0 0% 0); }

/* ---------- Parallax en imágenes ---------- */
.parallax-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}
/* Sin will-change permanente: mantener 8 imágenes grandes promovidas
   a capa de GPU consume memoria y termina generando tirones. */
.parallax-frame img,
.parallax-frame .parallax-inner {
    transform: translate3d(0, var(--py, 0px), 0) scale(1.18);
}

/* ---------- Bloque con esquina cortada ---------- */
.cut-corner {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), calc(100% - 2rem) 100%, 0 100%);
}

/* ---------- Indicador de progreso de scroll ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    transform: scaleX(var(--progress, 0));
    transform-origin: 0 50%;
    background: var(--accent);
    z-index: 200;
    pointer-events: none;
}

/* ---------- Respeto por reduced-motion ----------
   Sin transformaciones, sin marquesina en movimiento: todo
   queda en su estado final y legible. */
@media (prefers-reduced-motion: reduce) {
    html, body, .nav, .section, .footer { transition: none; }
    .word > i { transform: none; transition: none; }
    .clip-reveal, .clip-reveal.is-in { clip-path: none; transition: none; }
    .parallax-frame img, .parallax-frame .parallax-inner, .coach-photo img {
        transform: none;
    }
    .marquee { transform: none !important; }
    .marquee span { font-size: clamp(1.6rem, 4vw, 2.6rem); }
    .scroll-progress { display: none; }
}
