/**
 * Signature Stories — historias del aniversario (page-story.php).
 *
 * Todo cuelga de .sty para no tocar main.min.css. Ojo: en este tema
 * 1rem = 10px, por eso aquí se trabaja en px y clamp().
 *
 * Movimiento: stories.js añade .sty-motion al <article> solo si GSAP cargó
 * y el usuario no pidió movimiento reducido. Cualquier estado "oculto"
 * (opacidad 0, recortes) vive bajo .sty-motion; sin JS se lee todo.
 *
 * Fuentes alojadas en el tema (OFL, subconjunto latino, variables): la CSP
 * de la plataforma bloquea las hojas de fonts.googleapis.com.
 */

@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 500 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url("../fonts/stories/archivo-var-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/stories/newsreader-var-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Newsreader";
    font-style: italic;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/stories/newsreader-italic-var-latin.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/stories/jetbrains-mono-var-latin.woff2") format("woff2");
}

.sty {
    --paper: #f7f1e8;
    --paper-2: #efe5d6;
    --ink: #17393b;
    --ink-soft: #4b6264;
    --night: #0f2729;
    --night-2: #173b3d;
    --line: rgb(23 57 59 / .16);
    --mint: #52caa4;
    --sun: #f2b544;
    --grid: #7d9696;
    --accent: #e9a93a;

    --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
    --f-serif: "Newsreader", Georgia, "Times New Roman", serif;
    --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --measure: 690px;
    --wide: 1180px;
    --gutter: clamp(20px, 5vw, 48px);
    --ease: cubic-bezier(.2, .7, .1, 1);

    position: relative;
    overflow-x: clip;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--f-serif);
    font-size: 20px;
    line-height: 1.65;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
}

.sty *,
.sty *::before,
.sty *::after {
    box-sizing: border-box;
}

/* Resets con especificidad cero (:where): si no, `.sty figure` le ganaba a
   `.sty-wrap` (margin-inline: auto) y `.sty img` al object-fit de las fotos. */
:where(.sty) :where(p, h1, h2, h3, figure, blockquote, dl, dd, ol, ul) {
    margin: 0;
    padding: 0;
}

:where(.sty) :where(ol, ul) {
    list-style: none;
}

:where(.sty) img {
    display: block;
    max-width: 100%;
    height: auto;
}

:where(.sty) a {
    color: inherit;
}

/* SIN scroll-behavior: smooth en <html>: ScrollTrigger mide la página
   haciendo scroll a 0 y volviendo; con scroll suave esa vuelta es animada y
   todas las posiciones quedaban desplazadas lo que llevaba bajado el lector
   (fotos ya «crecidas», franja vacía, «ayer y hoy» quieto). El desplazamiento
   suave de los enlaces internos lo hace stories.js. */

.sty [id] {
    scroll-margin-top: 24px;
}

/* Grano de papel muy sutil sobre todo el artículo */
.sty::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .35;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sty > * {
    position: relative;
    z-index: 1;
}

/* ---------- Piezas comunes ---------- */

.sty-wrap {
    width: 100%;
    max-width: calc(var(--measure) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sty-wrap--wide {
    max-width: calc(var(--wide) + var(--gutter) * 2);
}

.sty-label,
.sty-kicker {
    font-family: var(--f-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .14em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sty-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.sty-label::before {
    content: "";
    width: 28px;
    height: 3px;
    background: var(--accent);
    flex: none;
}

.sty-label--light {
    color: rgb(247 241 232 / .75);
}

.sty-caption {
    margin-top: 12px;
    font-family: var(--f-display);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.sty-note {
    margin-top: 18px;
    font-family: var(--f-display);
    font-size: 13px;
    line-height: 1.5;
    opacity: .75;
}

/* ---------- Barra de progreso ---------- */

.sty-progress {
    position: fixed;
    top: var(--sticky-head, 0px);
    left: 0;
    right: 0;
    z-index: 60;
    height: 3px;
    pointer-events: none;
}

.sty-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* ---------- Índice de capítulos ---------- */

.sty-rail {
    position: fixed;
    z-index: 50;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .06em;
    transition: opacity .4s var(--ease), transform .4s var(--ease);
}

.sty-rail a {
    text-decoration: none;
}

/* Escritorio: columna fija a la izquierda, fuera de la medida del texto */
@media (min-width: 1600px) {
    .sty-rail {
        top: 50%;
        left: 28px;
        transform: translateY(-50%);
    }

    .sty-rail__now {
        display: none;
    }

    .sty-rail__list {
        display: grid;
        gap: 4px;
        border-left: 1px solid var(--line);
    }

    .sty-rail__list a {
        position: relative;
        display: flex;
        gap: 10px;
        padding: 6px 0 6px 14px;
        color: var(--ink-soft);
        opacity: .6;
        transition: opacity .3s, color .3s;
    }

    .sty-rail__list a::before {
        content: "";
        position: absolute;
        left: -1px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--accent);
        transform: scaleY(0);
        transition: transform .4s var(--ease);
    }

    .sty-rail__list a:hover,
    .sty-rail__list a.is-current {
        opacity: 1;
        color: var(--ink);
    }

    .sty-rail__list a.is-current::before {
        transform: scaleY(1);
    }

    .sty-rail.is-dark .sty-rail__list a {
        color: rgb(247 241 232 / .8);
    }

    .sty-rail.is-dark .sty-rail__list a.is-current {
        color: #fff;
    }
}

/* Móvil y tablet: píldora flotante que dice dónde estás; al tocarla abre el índice */
@media (max-width: 1599px) {
    .sty-rail {
        display: none;
        left: 50%;
        bottom: 16px;
        transform: translateX(-50%);
        max-width: calc(100vw - 32px);
    }

    .sty-js .sty-rail {
        display: block;
    }

    .sty-rail__now {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 18px;
        border-radius: 999px;
        background: rgb(15 39 41 / .88);
        color: var(--paper);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 10px 30px -10px rgb(0 0 0 / .45);
        white-space: nowrap;
        cursor: pointer;
    }

    .sty-rail__now::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
    }

    .sty-rail__list {
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        min-width: 220px;
        padding: 8px;
        border-radius: 16px;
        background: rgb(15 39 41 / .94);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        opacity: 0;
        visibility: hidden;
        transform: translate(-50%, 8px);
        transition: opacity .25s, transform .25s var(--ease), visibility .25s;
    }

    .sty-rail.is-open .sty-rail__list {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
    }

    .sty-rail__list a {
        display: flex;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 10px;
        color: var(--paper);
    }

    .sty-rail__list a.is-current {
        background: rgb(255 255 255 / .1);
    }
}

.sty-rail__n {
    color: var(--accent);
}

.sty-rail.is-hidden {
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 1600px) {
    .sty-rail.is-over-media {
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 1599px) {
    .sty-rail.is-hidden {
        transform: translate(-50%, 20px);
    }
}

/* ---------- Portada ---------- */

.sty-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: max(600px, calc(100svh - var(--head, 0px)));
    padding: 120px var(--gutter) clamp(64px, 9vh, 110px);
    color: #fff;
    background: var(--night);
    overflow: hidden;
    isolation: isolate;
}

.sty-hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.sty-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgb(15 39 41 / .15) 0%, rgb(15 39 41 / 0) 35%, rgb(15 39 41 / .55) 68%, rgb(15 39 41 / .92) 100%),
        linear-gradient(90deg, rgb(15 39 41 / .45) 0%, rgb(15 39 41 / 0) 60%);
}

.sty-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: 50% 40%;
}

.sty-hero__body {
    width: 100%;
    max-width: var(--wide);
    margin-inline: auto;
}

.sty-hero__kicker {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    color: rgb(255 255 255 / .85);
}

.sty-kicker__bar {
    width: 36px;
    height: 3px;
    background: var(--accent);
}

.sty-hero__title {
    font-family: var(--f-display);
    font-size: clamp(54px, 10.5vw, 168px);
    font-weight: 800;
    font-stretch: 112%;
    line-height: .88;
    letter-spacing: -.035em;
    color: #fff;
}

.sty-hero__line {
    display: block;
    overflow: hidden;
    padding-bottom: .06em;
}

.sty-hero__line > span {
    display: inline-block;
}

.sty-hero__line--accent {
    color: var(--accent);
}

.sty-hero__dek {
    max-width: 30ch;
    margin-top: 26px;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.3;
    color: rgb(255 255 255 / .92);
}

/* Itinerario: los lugares de la historia como una ruta */
.sty-route {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 0;
    margin-top: 40px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sty-route li {
    display: flex;
    align-items: center;
}

.sty-route li + li::before {
    content: "";
    width: clamp(18px, 4vw, 56px);
    height: 1px;
    margin-inline: 12px;
    background-image: linear-gradient(90deg, rgb(255 255 255 / .6) 50%, transparent 0);
    background-size: 6px 1px;
}

.sty-route a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    opacity: .85;
    transition: opacity .2s;
}

.sty-route a::before {
    content: "";
    width: 7px;
    height: 7px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    transition: background .2s;
}

.sty-route a:hover {
    opacity: 1;
}

.sty-route a:hover::before {
    background: var(--accent);
}

.sty-hero__credit {
    position: absolute;
    right: var(--gutter);
    bottom: 22px;
    max-width: 40ch;
    font-family: var(--f-display);
    font-size: 11px;
    text-align: right;
    color: rgb(255 255 255 / .55);
}

.sty-hero__cue {
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 1px;
    height: 46px;
    background: rgb(255 255 255 / .25);
    overflow: hidden;
}

.sty-hero__cue span {
    position: absolute;
    inset: 0;
    background: #fff;
    animation: sty-cue 2.2s var(--ease) infinite;
}

@keyframes sty-cue {
    0% { transform: translateY(-100%); }
    60%, 100% { transform: translateY(100%); }
}

@media (max-width: 700px) {
    .sty-hero__credit {
        display: none;
    }

    .sty-hero__cue {
        display: none;
    }
}

/* ---------- Texto ---------- */

.sty-intro {
    padding-top: clamp(80px, 12vw, 150px);
}

.sty-prose p {
    margin-bottom: 1.15em;
    text-wrap: pretty;
    hanging-punctuation: first;
}

.sty-prose + .sty-prose,
.sty-prose {
    margin-top: 0;
}

.sty-prose--lede p:first-child {
    font-size: 1.18em;
    line-height: 1.55;
}

/* Capitular */
.sty-prose--lede p:first-child::first-letter {
    float: left;
    margin: .06em .1em 0 0;
    font-family: var(--f-display);
    font-size: 4.4em;
    font-weight: 800;
    font-stretch: 112%;
    line-height: .82;
    color: var(--accent);
}

.sty-prose--light {
    color: rgb(247 241 232 / .92);
}

/* Giro: frase corta que cambia de tema dentro de un capítulo */
.sty-turn {
    margin-top: clamp(56px, 8vw, 96px);
    margin-bottom: 32px;
    font-family: var(--f-display);
    font-size: clamp(28px, 3.6vw, 46px);
    font-weight: 700;
    font-stretch: 104%;
    line-height: 1.08;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.sty-turn::before {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-bottom: 22px;
    background: var(--accent);
}

/* ---------- Capítulos ---------- */

.sty-chapter {
    position: relative;
    margin-top: clamp(80px, 12vw, 160px);
    margin-bottom: clamp(48px, 7vw, 90px);
}

.sty-chapter__media {
    position: relative;
    height: min(92svh, 980px);
    min-height: 520px;
    overflow: hidden;
    background: var(--night);
}

.sty-chapter__media img {
    width: 100%;
    height: 112%;
    object-fit: cover;
}

.sty-chapter__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(15 39 41 / 0) 40%, rgb(15 39 41 / .85) 100%);
}

/* Con foto: el título va sobre la imagen, abajo */
.sty-chapter:not(.sty-chapter--type) .sty-chapter__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(36px, 6vw, 72px);
    max-width: calc(var(--wide) + var(--gutter) * 2);
    color: #fff;
}

.sty-chapter__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    margin-bottom: 18px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sty-chapter__n {
    font-family: var(--f-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--accent);
}

.sty-chapter__place {
    font-weight: 500;
}

.sty-chapter__coords {
    opacity: .7;
}

.sty-chapter__title {
    max-width: 22ch;
    font-family: var(--f-display);
    font-size: clamp(34px, 5.4vw, 78px);
    font-weight: 800;
    font-stretch: 108%;
    line-height: .98;
    letter-spacing: -.03em;
    text-wrap: balance;
}

.sty-chapter__credit {
    max-width: calc(var(--wide) + var(--gutter) * 2);
    margin-top: 10px;
    font-family: var(--f-display);
    font-size: 12px;
    color: var(--ink-soft);
}

/* Sin foto: capítulo tipográfico sobre fondo oscuro, con el número gigante */
.sty-chapter--type {
    padding: clamp(110px, 16vw, 220px) 0 clamp(80px, 12vw, 150px);
    background: var(--night);
    color: var(--paper);
    overflow: hidden;
}

.sty-chapter--type .sty-chapter__body {
    max-width: calc(var(--wide) + var(--gutter) * 2);
}

.sty-chapter--type .sty-chapter__title {
    max-width: 26ch;
    font-family: var(--f-serif);
    font-size: clamp(32px, 4.6vw, 64px);
    font-weight: 400;
    font-stretch: normal;
    line-height: 1.12;
    letter-spacing: -.015em;
}

.sty-chapter--type .sty-chapter__meta {
    color: rgb(247 241 232 / .85);
}

.sty-chapter__ghost {
    position: absolute;
    right: -.04em;
    bottom: -.2em;
    font-family: var(--f-display);
    font-size: clamp(220px, 34vw, 520px);
    font-weight: 900;
    font-stretch: 125%;
    line-height: 1;
    letter-spacing: -.06em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgb(247 241 232 / .12);
    pointer-events: none;
    user-select: none;
}

/* ---------- Figuras ---------- */

.sty-figure {
    margin: clamp(48px, 7vw, 88px) auto;
    padding-inline: var(--gutter);
}

.sty-figure--wide {
    max-width: calc(var(--wide) + var(--gutter) * 2);
}

.sty-figure__frame {
    overflow: hidden;
    background: var(--paper-2);
}

.sty-figure__frame img {
    width: 100%;
}

.sty-figure--inset {
    max-width: calc(var(--wide) + var(--gutter) * 2);
}

@media (min-width: 900px) {
    .sty-figure--inset.has-aside {
        display: grid;
        grid-template-columns: 5fr 6fr;
        grid-template-rows: auto 1fr;
        column-gap: clamp(32px, 6vw, 88px);
        align-items: start;
    }

    .sty-figure--inset .sty-figure__frame {
        grid-row: 1;
    }

    .sty-figure--inset .sty-caption {
        grid-row: 2;
        grid-column: 1;
    }

    .sty-figure--inset .sty-figure__aside {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }
}

.sty-figure__aside {
    margin-top: 32px;
}

.sty-figure__aside p {
    font-size: 1.12em;
}

/* ---------- Datos ---------- */

.sty-facts {
    margin-block: clamp(48px, 7vw, 80px);
}

.sty-facts__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 4px solid var(--ink);
}

.sty-facts__item {
    padding: 22px 18px 22px 0;
    border-bottom: 1px solid var(--line);
}

.sty-facts__item:nth-child(even) {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.sty-facts__value {
    font-family: var(--f-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    font-stretch: 108%;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.sty-facts__text {
    margin-top: 10px;
    font-family: var(--f-display);
    font-size: 15px;
    line-height: 1.4;
    color: var(--ink-soft);
}

@media (max-width: 520px) {
    .sty-facts__grid {
        grid-template-columns: 1fr;
    }

    .sty-facts__item:nth-child(even) {
        padding-left: 0;
        border-left: 0;
    }
}

/* ---------- Citas ---------- */

.sty-quote {
    position: relative;
    max-width: calc(980px + var(--gutter) * 2);
    margin-block: clamp(48px, 7vw, 96px);
}

.sty-quote::before {
    content: "“";
    position: absolute;
    top: -.42em;
    left: calc(var(--gutter) - .08em);
    font-family: var(--f-serif);
    font-size: clamp(120px, 14vw, 200px);
    line-height: 1;
    color: var(--accent);
    opacity: .9;
}

.sty-quote blockquote p {
    font-family: var(--f-serif);
    font-size: clamp(30px, 4.2vw, 56px);
    font-style: italic;
    font-weight: 400;
    line-height: 1.16;
    letter-spacing: -.01em;
    text-wrap: balance;
}

.sty-quote figcaption {
    margin-top: 26px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sty-quote figcaption::before {
    content: "— ";
    color: var(--accent);
}

.sty-w {
    transition: opacity .25s linear, color .25s linear;
}

.sty-motion [data-sty-scrub] .sty-w {
    opacity: .16;
}

.sty-motion [data-sty-scrub] .sty-w.is-lit {
    opacity: 1;
}

/* ---------- Galería (carrusel nativo) ----------
   Antes era un pin horizontal de GSAP: secuestraba la rueda del ratón
   ~2.400px y parecía que la página se trababa. Ahora la página baja normal
   y las fotos se pasan con flechas, arrastrando o con el trackpad. */

.sty-gallery {
    margin-block: clamp(40px, 6vw, 80px);
    padding-block: clamp(32px, 4.5vw, 56px);
    background: var(--paper-2);
}

.sty-gallery__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: calc(var(--wide) + var(--gutter) * 2);
    margin-bottom: 22px;
}

.sty-gallery__head .sty-label {
    margin-bottom: 0;
}

.sty-gallery__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sty-gallery__controls[hidden] {
    display: none;
}

.sty-gallery__count {
    margin-right: 8px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .1em;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.sty-gallery__count [data-sty-gallery-now] {
    color: var(--ink);
}

.sty-gallery__btn {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--f-display);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s, opacity .25s;
}

.sty-gallery__btn:hover:not(:disabled) {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.sty-gallery__btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sty-gallery__btn:disabled {
    opacity: .35;
    cursor: default;
}

.sty-gallery__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    cursor: grab;
}

.sty-gallery__viewport::-webkit-scrollbar {
    display: none;
}

.sty-gallery__viewport.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
    user-select: none;
}

.sty-gallery__viewport:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* El primer y el último ítem se alinean con la columna ancha del texto */
.sty-gallery__track {
    --edge: max(var(--gutter), calc((100vw - var(--wide)) / 2));
    display: flex;
    gap: clamp(14px, 2vw, 28px);
    width: max-content;
    padding-inline: var(--edge);
}

.sty-gallery__item {
    /* Alto de la foto limitado a ~60 % de la pantalla: la galería entera
       (título, foto y pie) cabe en una vista. 3:2 → ancho = alto × 1,5. */
    width: min(78vw, 760px, 60vh * 1.5);
    scroll-snap-align: start;
    scroll-margin-inline: var(--edge);
}

.sty-gallery__item img {
    pointer-events: none; /* que arrastrar mueva el carrusel, no la imagen */
}

.sty-gallery__frame {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--paper);
}

.sty-gallery__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease), filter .5s;
}

/* La foto que no está al frente queda un poco apagada */
.sty-js .sty-gallery__item:not(.is-current) .sty-gallery__frame img {
    filter: saturate(.7) brightness(.92);
}

.sty-gallery__n {
    margin-right: 6px;
    font-family: var(--f-mono);
    color: var(--accent);
}

.sty-gallery__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 24px;
    max-width: calc(var(--wide) + var(--gutter) * 2);
    margin-top: 18px;
}

.sty-gallery__credit {
    font-family: var(--f-display);
    font-size: 12px;
    color: var(--ink-soft);
}

.sty-gallery__bar {
    position: relative;
    width: min(220px, 40%);
    height: 2px;
    background: var(--line);
    overflow: hidden;
}

.sty-gallery__bar span {
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .3s var(--ease);
}

@media (max-width: 600px) {
    .sty-gallery__item {
        width: 84vw;
    }

    .sty-gallery__btn {
        width: 40px;
        height: 40px;
    }

    .sty-gallery__count {
        display: none;
    }
}

/* ---------- Antes / después ---------- */

.sty-ba {
    margin-block: clamp(48px, 7vw, 88px);
}

.sty-ba__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 1.4vw, 18px);
}

.sty-ba__pane {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--paper-2);
}

.sty-ba__pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sty-ba__tag,
.sty-tn__tag {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgb(15 39 41 / .78);
    color: #fff;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sty-ba__pane--after .sty-ba__tag {
    background: var(--accent);
    color: var(--night);
}

@media (max-width: 600px) {
    .sty-ba__grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Mezcla de energía (barra apilada) ---------- */

.sty-mix {
    margin-block: clamp(64px, 9vw, 120px);
    padding-block: clamp(64px, 9vw, 120px);
    background: var(--night);
    color: var(--paper);
}

.sty-mix__inner {
    display: grid;
    gap: 48px;
}

@media (min-width: 960px) {
    .sty-mix__inner {
        grid-template-columns: 4fr 7fr;
        gap: clamp(48px, 7vw, 110px);
        align-items: center;
    }
}

.sty-mix__title {
    margin-bottom: 20px;
    font-family: var(--f-display);
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 800;
    font-stretch: 108%;
    line-height: 1;
    letter-spacing: -.025em;
    color: var(--accent);
}

.sty-mix__copy p {
    color: rgb(247 241 232 / .85);
}

.sty-mix .sty-label {
    color: rgb(247 241 232 / .7);
}

.sty-mix__bar {
    display: flex;
    height: clamp(56px, 7vw, 84px);
    gap: 3px;
}

.sty-mix__seg {
    flex: var(--v) 1 0;
    transform-origin: 0 50%;
    transition: transform 1.1s var(--ease);
}

.sty-mix__seg:first-child {
    border-radius: 6px 0 0 6px;
}

.sty-mix__seg:last-child {
    border-radius: 0 6px 6px 0;
}

.sty-mix__seg.is-sun,
.sty-mix__legend .is-sun .sty-mix__pct { background: var(--sun); }
.sty-mix__seg.is-store,
.sty-mix__legend .is-store .sty-mix__pct { background: var(--mint); }
.sty-mix__seg.is-grid,
.sty-mix__legend .is-grid .sty-mix__pct { background: var(--grid); }

/* El sol carga la batería: patrón de rayas en la parte almacenada */
.sty-mix__seg.is-store {
    background-image: repeating-linear-gradient(135deg, rgb(255 255 255 / .18) 0 6px, transparent 6px 12px);
}

.sty-motion .sty-mix__seg {
    transform: scaleX(0);
}

.sty-motion .sty-mix.is-in .sty-mix__seg {
    transform: scaleX(1);
}

.sty-motion .sty-mix.is-in .sty-mix__seg:nth-child(2) { transition-delay: .25s; }
.sty-motion .sty-mix.is-in .sty-mix__seg:nth-child(3) { transition-delay: .5s; }

.sty-mix__legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 26px;
}

.sty-mix__legend li {
    display: grid;
    gap: 10px;
    align-content: start;
}

.sty-mix__pct {
    justify-self: start;
    padding: 2px 10px 0;
    border-radius: 4px;
    font-family: var(--f-display);
    font-size: clamp(34px, 4.4vw, 60px);
    font-weight: 800;
    font-stretch: 108%;
    line-height: 1.05;
    letter-spacing: -.03em;
    color: var(--night);
    font-variant-numeric: tabular-nums;
}

.sty-mix__lbl {
    font-family: var(--f-display);
    font-size: 14px;
    line-height: 1.4;
    color: rgb(247 241 232 / .8);
}

@media (max-width: 560px) {
    .sty-mix__legend {
        grid-template-columns: 1fr;
    }

    .sty-mix__legend li {
        grid-template-columns: auto 1fr;
        align-items: center;
    }
}

/* ---------- Ayer y hoy (fundido con el scroll) ---------- */

.sty-tn {
    margin-block: clamp(56px, 8vw, 100px);
}

.sty-tn__stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 1.4vw, 18px);
    max-width: calc(var(--wide) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sty-tn__pane {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--paper-2);
}

.sty-tn__pane--then {
    order: -1;
}

.sty-tn__pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sty-tn__pane--then img {
    filter: sepia(.25) contrast(1.05);
}

@media (max-width: 600px) {
    .sty-tn__stage {
        grid-template-columns: 1fr;
    }
}

/* Con movimiento: las dos fotos apiladas y fijas; el archivo se disuelve en el presente */
.sty-motion .sty-tn {
    height: 230vh;
    margin-block: clamp(24px, 4vw, 48px);
}

.sty-motion .sty-tn__stage {
    position: sticky;
    top: calc(var(--sticky-head, 0px) + 4vh);
    display: block;
    height: 84vh;
}

.sty-motion .sty-tn__pane {
    position: absolute;
    inset: 0 var(--gutter);
    aspect-ratio: auto;
}

.sty-motion .sty-tn__pane--then {
    clip-path: inset(0 0 0 0);
}

.sty-motion .sty-tn .sty-caption {
    position: sticky;
    top: calc(var(--sticky-head, 0px) + 4vh + 84vh + 8px);
}

/* ---------- La factura (gráfico fijo + pasos) ---------- */

.sty-bills {
    margin-block: clamp(56px, 8vw, 100px);
}

.sty-bills__panel {
    background: var(--paper);
}

.sty-bills__figures {
    display: grid;
}

.sty-bills__big {
    grid-area: 1 / 1;
    font-family: var(--f-display);
    font-size: clamp(64px, 10vw, 150px);
    font-weight: 800;
    font-stretch: 112%;
    line-height: 1;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.sty-bills__prefix {
    display: block;
    margin-bottom: 4px;
    font-family: var(--f-serif);
    font-size: clamp(18px, 1.6vw, 22px);
    font-style: italic;
    font-weight: 400;
    font-stretch: normal;
    letter-spacing: 0;
    color: var(--ink-soft);
}

.sty-bills[data-step="0"] .sty-bills__big[data-i="0"],
.sty-bills[data-step="1"] .sty-bills__big[data-i="1"],
.sty-bills[data-step="2"] .sty-bills__big[data-i="2"],
.sty-bills[data-step="3"] .sty-bills__big[data-i="3"] {
    opacity: 1;
    transform: none;
}

.sty-bills[data-step="2"] .sty-bills__big[data-i="2"] {
    color: var(--accent);
}

.sty-bills__bars {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.sty-bills__bars li {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity .4s;
}

.sty-bills__bar {
    height: 14px;
    width: var(--w);
    min-width: 6px;
    border-radius: 0 4px 4px 0;
    background: var(--ink);
    transform-origin: 0 50%;
    transition: transform .8s var(--ease), background .4s;
}

.sty-bills__barlbl {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-soft);
    white-space: nowrap;
}

/* Las barras aparecen a medida que avanza el relato; la actual va en acento */
.sty-bills[data-step="0"] li[data-i="1"],
.sty-bills[data-step="0"] li[data-i="2"],
.sty-bills[data-step="1"] li[data-i="2"] {
    opacity: .12;
}

.sty-bills[data-step="0"] li[data-i="1"] .sty-bills__bar,
.sty-bills[data-step="0"] li[data-i="2"] .sty-bills__bar,
.sty-bills[data-step="1"] li[data-i="2"] .sty-bills__bar {
    transform: scaleX(0);
}

.sty-bills[data-step="0"] li[data-i="0"] .sty-bills__bar,
.sty-bills[data-step="1"] li[data-i="1"] .sty-bills__bar,
.sty-bills[data-step="2"] li[data-i="2"] .sty-bills__bar {
    background: var(--accent);
}

.sty-bills__steps {
    display: grid;
}

.sty-bills__step {
    padding-block: 28px;
    border-top: 1px solid var(--line);
}

.sty-bills__amount {
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    filter: brightness(.8);
}

.sty-bills__title {
    margin: 6px 0 8px;
    font-family: var(--f-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
}

.sty-bills__step p:last-child {
    color: var(--ink-soft);
}

@media (min-width: 900px) {
    .sty-bills {
        display: grid;
        grid-template-columns: 6fr 5fr;
        gap: clamp(48px, 7vw, 110px);
    }

    .sty-bills__sticky {
        position: sticky;
        top: 18vh;
    }

    .sty-js .sty-bills__step {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 72vh;
        opacity: .35;
        transition: opacity .4s;
    }

    .sty-js .sty-bills__step.is-active {
        opacity: 1;
    }
}

/* Móvil: el gráfico queda fijo arriba, compacto, y los pasos pasan por debajo */
@media (max-width: 899px) {
    .sty-js .sty-bills__panel {
        position: sticky;
        top: var(--sticky-head, 0px);
        z-index: 2;
        padding-block: 18px 14px;
        border-bottom: 1px solid var(--line);
    }

    .sty-js .sty-bills__panel .sty-note {
        display: none;
    }

    .sty-js .sty-bills__big {
        font-size: 56px;
    }

    .sty-js .sty-bills__bars {
        margin-top: 14px;
        gap: 6px;
    }

    .sty-js .sty-bills__bar {
        height: 10px;
    }

    .sty-js .sty-bills__step {
        min-height: 60vh;
    }
}

/* ---------- Cierre ---------- */

.sty-closing {
    position: relative;
    margin-top: clamp(80px, 12vw, 160px);
    background: var(--night);
    color: var(--paper);
}

/* El fondo ocupa toda la sección y la foto va fija dentro. No usar el truco
   sticky + margin-bottom negativo: la caja de margen mide 0 y la foto se
   salía por debajo de la sección, tapando «Keep reading» y el pie.
   overflow: clip (no hidden) para no convertirlo en contenedor de scroll. */
.sty-closing__bg {
    position: absolute;
    inset: 0;
    overflow: clip;
}

.sty-closing__bg img {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    opacity: .5;
}

.sty-closing__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 70% at 50% 40%, rgb(15 39 41 / .35), rgb(15 39 41 / .92));
}

.sty-closing__body {
    position: relative;
    padding-block: 40vh 10vh;
}

.sty-closing__body .sty-prose p {
    padding: 2px 0;
    text-shadow: 0 1px 18px rgb(15 39 41 / .9);
}

.sty-closing__final {
    max-width: 22ch;
    margin: 30vh auto 0;
    font-family: var(--f-display);
    font-size: clamp(32px, 4.6vw, 62px);
    font-weight: 700;
    font-stretch: 104%;
    line-height: 1.08;
    letter-spacing: -.025em;
    text-align: left;
    text-wrap: balance;
}

@media (min-width: 900px) {
    .sty-closing__final {
        position: relative;
        left: 50%;
        width: min(1000px, 92vw);
        max-width: none;
        transform: translateX(-50%);
    }
}

.sty-closing__credit {
    margin-top: 14vh;
    font-family: var(--f-display);
    font-size: 12px;
    color: rgb(247 241 232 / .5);
}

/* ---------- Otras historias ---------- */

.sty-more {
    padding-block: clamp(72px, 10vw, 130px);
}

.sty-more__title {
    margin-bottom: 36px;
    font-family: var(--f-display);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800;
    font-stretch: 110%;
    line-height: 1;
    letter-spacing: -.03em;
}

.sty-more__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(14px, 2vw, 24px);
}

@media (max-width: 960px) {
    .sty-more__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sty-more__grid {
        gap: 12px;
    }

    .sty-card__media {
        aspect-ratio: 3 / 4;
    }

    .sty-card__title,
    .sty-card.is-soon .sty-card__title {
        font-size: 18px;
    }

    .sty-card.is-soon .sty-card__title {
        left: 12px;
        right: 12px;
    }

    .sty-card__dek {
        display: none;
    }
}

.sty-card__link {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.sty-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 0% 100%, var(--card-accent), transparent 70%),
        var(--night);
}

.sty-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease);
}

.sty-card__link:hover .sty-card__media img {
    transform: scale(1.04);
}

.sty-card__title {
    margin-top: 14px;
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.01em;
}

/* Historias todavía sin foto: el título va dentro de la tarjeta */
.sty-card.is-soon .sty-card__title {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 0;
    font-size: clamp(24px, 2.4vw, 32px);
    color: #fff;
}

.sty-card__dek {
    margin-top: 6px;
    font-style: italic;
    font-size: 16px;
    line-height: 1.4;
    color: var(--ink-soft);
}

.sty-card__go {
    margin-top: 10px;
    font-family: var(--f-display);
    color: var(--card-accent);
    filter: brightness(.75);
    transition: transform .3s var(--ease);
}

.sty-card__link:hover .sty-card__go {
    transform: translateX(6px);
}

.sty-more__foot {
    margin-top: 48px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font-family: var(--f-display);
    font-size: 15px;
    color: var(--ink-soft);
}

.sty-more__foot a {
    margin-left: 6px;
    font-weight: 600;
    color: var(--ink);
}

/* ---------- Estados iniciales del movimiento (solo con .sty-motion) ---------- */

.sty-motion [data-sty-reveal] {
    opacity: 0;
    transform: translateY(24px);
}

.sty-motion [data-sty-unveil] {
    clip-path: inset(14% 12% 14% 12% round 24px);
}

.sty-motion [data-sty-wipe] {
    clip-path: inset(0 100% 0 0);
}

.sty-motion .sty-hero__line > span {
    transform: translateY(105%);
}

.sty-motion .sty-hero__kicker,
.sty-motion .sty-hero__dek,
.sty-motion .sty-route {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {

    .sty-hero__cue span {
        animation: none;
    }

    .sty-gallery__viewport {
        scroll-behavior: auto;
    }
}

/* Móvil: el escenario de «ayer y hoy» más bajo, para que el pie quepa debajo */
@media (max-width: 700px) {
    .sty-motion .sty-tn {
        height: 190vh;
    }

    .sty-motion .sty-tn__stage {
        height: 62vh;
    }

    .sty-motion .sty-tn .sty-caption {
        top: calc(var(--sticky-head, 0px) + 4vh + 62vh + 8px);
    }
}

/* Tras la galería el capítulo no necesita su margen completo: ya hay un cambio de fondo */
.sty-gallery + .sty-chapter {
    margin-top: clamp(40px, 5vw, 64px);
}

/* =====================================================================
   Piezas añadidas para las historias 01, 02, 03 y 05
   ===================================================================== */

/* ---------- Portada partida (fotos de poca resolución) ---------- */

.sty-hero--split {
    display: grid;
    align-items: stretch;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
}

.sty-hero--split .sty-hero__media {
    position: relative;
    inset: auto;
    z-index: 0;
    min-height: 56vh;
    overflow: hidden;
}

.sty-hero--split .sty-hero__media::after {
    display: none;
}

.sty-hero--split .sty-hero__body {
    align-self: center;
    padding: clamp(40px, 6vw, 96px) var(--gutter);
}

.sty-hero--split .sty-hero__title {
    font-size: clamp(52px, 7.4vw, 124px);
    color: var(--ink);
}

.sty-hero--split .sty-hero__kicker {
    color: var(--ink-soft);
}

.sty-hero--split .sty-hero__dek {
    color: var(--ink);
}

.sty-hero--split .sty-hero__credit {
    color: rgb(255 255 255 / .85);
    text-shadow: 0 1px 8px rgb(0 0 0 / .6);
}

.sty-hero--split .sty-hero__cue {
    display: none;
}

@media (min-width: 900px) {
    .sty-hero--split {
        grid-template-columns: 5fr 6fr;
    }

    .sty-hero--split .sty-hero__media {
        order: 2;
        min-height: 0;
    }

    .sty-hero--split .sty-hero__body {
        max-width: 680px;
        margin: 0 0 0 auto;
    }
}

.sty-hero__byline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.sty-hero__byline::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
}

/* ---------- Portada en mosaico (una foto por protagonista) ---------- */

.sty-hero--mosaic {
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    padding-top: clamp(28px, 4vw, 56px);
}

.sty-hero__tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(8px, 1.2vw, 16px);
    width: 100%;
    max-width: var(--wide);
    margin: 0 auto clamp(32px, 5vw, 56px);
}

.sty-hero__tile {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--night-2);
}

.sty-hero__tile:nth-child(even) {
    margin-top: clamp(16px, 3vw, 48px);
}

.sty-hero__tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sty-hero__tile::after {
    content: "";
    position: absolute;
    inset: 50% 0 0;
    background: linear-gradient(180deg, transparent, rgb(15 39 41 / .85));
}

.sty-hero__tile-name {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #fff;
}

.sty-hero--mosaic .sty-hero__title {
    font-size: clamp(54px, 9vw, 150px);
}

@media (max-width: 700px) {
    .sty-hero__tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .sty-hero__tile {
        aspect-ratio: 1;
    }

    .sty-hero__tile:nth-child(even) {
        margin-top: 0;
    }
}

/* ---------- Capítulo: subtítulo ---------- */

.sty-chapter__dek {
    max-width: 40ch;
    margin-top: 18px;
    font-family: var(--f-serif);
    font-style: italic;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.35;
    opacity: .9;
}

/* El número fantasma admite palabras («grow», «SOAR») */
.sty-chapter__ghost {
    white-space: nowrap;
}

/* ---------- Frase destacada ---------- */

.sty-statement {
    max-width: calc(1000px + var(--gutter) * 2);
    margin-block: clamp(56px, 8vw, 110px);
    font-family: var(--f-display);
    font-size: clamp(30px, 4.4vw, 60px);
    font-weight: 700;
    font-stretch: 104%;
    line-height: 1.08;
    letter-spacing: -.025em;
    text-wrap: balance;
}

/* Variante oscura a todo el ancho sin envoltorio extra */
.sty-statement--dark {
    padding-block: clamp(72px, 10vw, 140px);
    background: var(--night);
    color: var(--paper);
    box-shadow: 0 0 0 100vmax var(--night);
    clip-path: inset(0 -100vmax);
}

/* ---------- Par de fotos ---------- */

.sty-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 3vw, 48px);
    align-items: start;
    margin-block: clamp(48px, 7vw, 88px);
}

.sty-pair__frame {
    overflow: hidden;
    background: var(--paper-2);
}

.sty-pair__frame img {
    width: 100%;
}

/* Álbum familiar: copias con borde blanco, apenas giradas */
.sty-pair--album .sty-pair__item {
    width: 100%;
    max-width: 460px;
    justify-self: center;
    transform: rotate(var(--tilt));
}

.sty-pair--album .sty-pair__frame {
    padding: 12px 12px 0;
    background: #fff;
}

.sty-pair--album .sty-pair__item {
    background: #fff;
    box-shadow: 0 1px 2px rgb(23 57 59 / .12), 0 22px 44px -20px rgb(23 57 59 / .4);
}

.sty-pair--album .sty-caption {
    margin: 0;
    padding: 12px 12px 14px;
}

@media (max-width: 600px) {
    .sty-pair {
        grid-template-columns: 1fr;
    }
}

/* ---------- Cadena de generaciones ---------- */

.sty-lineage {
    margin-block: clamp(56px, 8vw, 100px);
    padding-block: clamp(48px, 7vw, 88px);
    background: var(--paper-2);
}

.sty-lineage__list {
    --p: 1;
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px;
}

.sty-lineage__list::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(var(--p));
    transform-origin: 0 50%;
}

.sty-lineage__gen {
    position: relative;
}

.sty-lineage__knot {
    display: block;
    width: 20px;
    height: 20px;
    margin-bottom: 18px;
    border: 3px solid var(--accent);
    border-radius: 50%;
    background: var(--paper-2);
}

.sty-lineage__gen:last-child .sty-lineage__knot {
    background: var(--accent);
}

.sty-lineage__who {
    font-family: var(--f-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

.sty-lineage__what {
    margin-top: 8px;
    font-size: 17px;
    line-height: 1.45;
    color: var(--ink-soft);
}

.sty-lineage .sty-note {
    margin-top: 32px;
}

@media (max-width: 860px) {
    .sty-lineage__list {
        grid-template-columns: 1fr;
        gap: 26px;
        padding-left: 40px;
    }

    .sty-lineage__list::before {
        top: 10px;
        bottom: 10px;
        left: 9px;
        right: auto;
        width: 2px;
        height: auto;
        transform: scaleY(var(--p));
        transform-origin: 50% 0;
    }

    .sty-lineage__knot {
        position: absolute;
        left: -40px;
        top: 0;
    }
}

/* ---------- Escala de tiempo ---------- */

.sty-horizon {
    margin-block: clamp(64px, 9vw, 120px);
    padding-block: clamp(64px, 9vw, 120px);
    background: var(--night);
    color: var(--paper);
}

.sty-horizon__title {
    max-width: 18ch;
    font-family: var(--f-display);
    font-size: clamp(32px, 4.4vw, 58px);
    font-weight: 800;
    font-stretch: 108%;
    line-height: 1;
    letter-spacing: -.025em;
}

.sty-horizon__axis {
    position: relative;
    height: 2px;
    margin-top: 190px;
    background: rgb(247 241 232 / .15);
}

.sty-horizon__line {
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform-origin: 0 50%;
}

/* Las marcas cuelgan del eje: impares debajo, pares encima */
.sty-horizon__marks {
    position: relative;
    height: 0;
}

.sty-horizon__mark {
    position: absolute;
    left: var(--at);
    top: 0;
    width: 230px;
    padding-top: 24px;
    transition: opacity .5s;
}

.sty-horizon__mark:nth-child(even) {
    top: auto;
    bottom: 2px;
    padding-top: 0;
    padding-bottom: 24px;
}

.sty-horizon__mark::before {
    content: "";
    position: absolute;
    left: -8px;
    top: -9px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    background: var(--night);
    transition: background .4s;
}

.sty-horizon__mark:nth-child(even)::before {
    top: auto;
    bottom: -9px;
}

.sty-horizon__mark.is-lit::before,
.sty-horizon:not(.is-armed) .sty-horizon__mark::before {
    background: var(--accent);
}

.sty-horizon__mark.is-end {
    transform: translateX(-100%);
    text-align: right;
}

.sty-horizon__mark.is-end::before {
    left: auto;
    right: -8px;
}

.sty-horizon__span {
    display: block;
    font-family: var(--f-display);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--accent);
}

.sty-horizon__place {
    display: block;
    margin-top: 4px;
    font-family: var(--f-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgb(247 241 232 / .7);
}

.sty-horizon__text {
    display: block;
    margin-top: 6px;
    font-size: 16px;
    line-height: 1.4;
    color: rgb(247 241 232 / .85);
}

.sty-horizon .sty-note {
    margin-top: 190px;
}

.sty-motion .sty-horizon.is-armed .sty-horizon__mark {
    opacity: .3;
}

.sty-motion .sty-horizon.is-armed .sty-horizon__mark.is-lit {
    opacity: 1;
}

/* Móvil: lista vertical con el eje a la izquierda */
@media (max-width: 860px) {
    .sty-horizon__axis {
        display: none;
    }

    .sty-horizon__marks {
        height: auto;
        margin-top: 40px;
        padding-left: 28px;
        border-left: 2px solid var(--accent);
    }

    .sty-horizon__mark,
    .sty-horizon__mark:nth-child(even),
    .sty-horizon__mark.is-end {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        width: auto;
        padding: 0 0 28px;
        transform: none;
        text-align: left;
    }

    .sty-horizon__mark::before,
    .sty-horizon__mark:nth-child(even)::before,
    .sty-horizon__mark.is-end::before {
        left: -38px;
        right: auto;
        top: 6px;
        bottom: auto;
    }

    .sty-horizon .sty-note {
        margin-top: 8px;
    }
}

/* ---------- Supervivencia (retícula de 100) ---------- */

.sty-dots {
    display: grid;
    gap: 32px;
    align-items: center;
    margin-block: clamp(56px, 8vw, 100px);
}

@media (min-width: 860px) {
    .sty-dots {
        grid-template-columns: 5fr 6fr;
        gap: clamp(40px, 6vw, 96px);
    }

    .sty-dots .sty-note {
        grid-column: 1 / -1;
    }
}

.sty-dots__big {
    font-family: var(--f-display);
    font-size: clamp(88px, 12vw, 180px);
    font-weight: 800;
    font-stretch: 112%;
    line-height: .9;
    letter-spacing: -.05em;
    font-variant-numeric: tabular-nums;
}

.sty-dots__text {
    max-width: 30ch;
    margin-top: 14px;
    font-size: 1.1em;
    line-height: 1.45;
}

.sty-dots__grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: clamp(6px, 1vw, 12px);
    max-width: 460px;
}

.sty-dots__dot {
    aspect-ratio: 1;
    border: 2px solid rgb(23 57 59 / .22);
    border-radius: 50%;
    transition: background .35s, border-color .35s, transform .35s var(--ease);
}

.sty-dots__dot.is-alive {
    border-color: var(--accent);
    background: var(--accent);
}

.sty-motion .sty-dots .sty-dots__dot.is-alive {
    background: transparent;
    border-color: rgb(23 57 59 / .22);
    transform: scale(.6);
}

.sty-motion .sty-dots.is-in .sty-dots__dot.is-alive {
    background: var(--accent);
    border-color: var(--accent);
    transform: none;
    transition-delay: calc(var(--d) * 14ms);
}

/* ---------- Cuatro miradas (pestañas) ---------- */

.sty-lenses {
    position: relative;
    margin-block: clamp(64px, 9vw, 120px);
    padding-block: clamp(72px, 10vw, 130px);
    background: var(--night);
    color: var(--paper);
    overflow: clip;
}

.sty-lenses__bg {
    position: absolute;
    inset: 0;
}

.sty-lenses__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .25;
}

.sty-lenses__inner {
    position: relative;
}

.sty-lenses__title {
    max-width: 22ch;
    font-family: var(--f-serif);
    font-size: clamp(28px, 3.6vw, 46px);
    font-weight: 400;
    line-height: 1.15;
}

.sty-lenses__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
}

.sty-lenses__tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border: 1px solid rgb(247 241 232 / .25);
    border-radius: 999px;
    background: transparent;
    color: var(--paper);
    font-family: var(--f-mono);
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s, border-color .25s, color .25s;
}

.sty-lenses__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c);
}

.sty-lenses__tab:hover {
    border-color: var(--c);
}

.sty-lenses__tab[aria-selected="true"] {
    background: var(--c);
    border-color: var(--c);
    color: var(--night);
}

.sty-lenses__tab[aria-selected="true"] .sty-lenses__dot {
    background: var(--night);
}

.sty-lenses__tab:focus-visible {
    outline: 2px solid var(--paper);
    outline-offset: 3px;
}

.sty-lenses__panel {
    min-height: 3.6em;
    margin-top: 36px;
    font-size: clamp(34px, 5vw, 72px);
}

.sty-lenses__is {
    max-width: 20ch;
    font-family: var(--f-display);
    font-weight: 800;
    font-stretch: 106%;
    line-height: 1.02;
    letter-spacing: -.03em;
    color: var(--c);
    animation: sty-lens-in .5s var(--ease);
}

.sty-lenses__is span {
    display: block;
    margin-bottom: 10px;
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 400;
    font-stretch: normal;
    font-size: .42em;
    letter-spacing: 0;
    color: rgb(247 241 232 / .8);
}

.sty-lenses__where {
    margin-top: 18px;
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgb(247 241 232 / .7);
}

.sty-lenses__after {
    margin-top: 36px;
    color: rgb(247 241 232 / .85);
}

@keyframes sty-lens-in {
    from { opacity: 0; transform: translateY(12px); }
}

/* Sin JS: las cuatro miradas a la vista, una debajo de otra */
.sty:not(.sty-js) .sty-lenses__tabs {
    display: none;
}

.sty:not(.sty-js) .sty-lenses__panel[hidden] {
    display: block;
}

/* ---------- Panorámica ---------- */

.sty-pano {
    margin-block: clamp(48px, 7vw, 88px);
}

.sty-pano__strip {
    overflow-x: auto;
    scrollbar-width: thin;
}

.sty-pano__strip img {
    width: auto;
    max-width: none;
    height: clamp(240px, 52vh, 560px);
}

.sty-motion .sty-pano__strip {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .sty-lenses__is {
        animation: none;
    }
}

.sty-hero__title--long,
.sty-hero--mosaic .sty-hero__title.sty-hero__title--long {
    font-size: clamp(46px, 7vw, 124px);
}

/* Mosaico: fotos más bajas para que el título quepa en la primera pantalla */
@media (min-width: 701px) {
    .sty-hero__tile {
        aspect-ratio: auto;
        height: clamp(170px, 30vh, 300px);
    }

    .sty-hero__tile:nth-child(even) {
        margin-top: clamp(12px, 2.4vw, 36px);
    }

    .sty-hero--mosaic .sty-hero__title {
        font-size: clamp(54px, 8vw, 132px);
    }
}

/* Móvil: el título del capítulo va debajo de la foto (sobre ella se cortaba) */
@media (max-width: 700px) {
    .sty-chapter__media {
        height: 62svh;
        min-height: 360px;
    }

    .sty-chapter__media::after {
        display: none;
    }

    .sty-chapter:not(.sty-chapter--type) .sty-chapter__body {
        position: static;
        padding-block: 28px 32px;
        background: var(--night);
    }

    .sty-chapter__credit {
        margin-top: 10px;
    }
}

/* ---------- Movimiento reducido (.sty-calm) ----------
   Las apariciones se mantienen; solo la panorámica deja de deslizarse
   (se recorre a mano) — ver stories.js. */

.sty-calm .sty-pano__strip {
    overflow-x: auto;
}

/* ---------- Ritmo vertical entre secciones ----------
   Los márgenes de cada bloque se sumaban y, entre dos secciones con fondo
   (galería, bloque oscuro, capítulo tipográfico), quedaban bandas beige de
   hasta 160px que se leían como huecos. */

.sty-chapter {
    margin-top: clamp(56px, 7vw, 104px);
    margin-bottom: clamp(36px, 4.5vw, 64px);
}

.sty-chapter--type {
    padding: clamp(72px, 10vw, 150px) 0 clamp(56px, 7vw, 104px);
}

.sty-turn {
    margin-top: clamp(40px, 5.5vw, 72px);
}

.sty-quote,
.sty-statement {
    margin-block: clamp(44px, 6vw, 84px);
}

.sty-statement--dark {
    margin-block: clamp(44px, 6vw, 84px);
}

/* El último párrafo de un bloque de texto no añade su margen al siguiente */
.sty-prose > p:last-child {
    margin-bottom: 0;
}

/* Secciones con fondo propio, pegadas entre sí: sin banda vacía */
:is(.sty-gallery, .sty-mix, .sty-lineage, .sty-horizon, .sty-lenses, .sty-chapter--type, .sty-statement--dark, .sty-closing)
+ :is(.sty-gallery, .sty-mix, .sty-lineage, .sty-horizon, .sty-lenses, .sty-chapter--type, .sty-statement--dark, .sty-closing) {
    margin-top: 0;
}

/* Tras una foto de capítulo con su pie, el texto arranca cerca */
.sty-chapter + .sty-prose,
.sty-chapter + .sty-quote,
.sty-chapter + .sty-figure {
    margin-top: 0;
}

/* Cierre: menos aire vacío antes del primer párrafo */
.sty-closing__body {
    padding-block: 26vh 10vh;
}

.sty-closing__final {
    margin-top: 18vh;
}

/* La cifra de la factura va siempre en una línea («$70–80» se partía en dos) */
.sty-bills__big {
    white-space: nowrap;
    font-size: clamp(56px, 7vw, 128px);
}

@media (max-width: 899px) {
    .sty-js .sty-bills__big {
        font-size: clamp(44px, 13vw, 64px);
    }
}

/* La portada también es una sección con fondo: lo que la sigue con fondo
   propio (capítulo tipográfico, bloque oscuro) va pegado, sin franja beige. */
.sty-hero + :is(.sty-gallery, .sty-mix, .sty-lineage, .sty-horizon, .sty-lenses, .sty-chapter--type, .sty-statement--dark, .sty-closing) {
    margin-top: 0;
}

/* Capítulo con foto justo después de otra sección con fondo: sin franja */
:is(.sty-hero, .sty-gallery, .sty-mix, .sty-lineage, .sty-horizon, .sty-lenses, .sty-chapter--type, .sty-statement--dark) + .sty-chapter {
    margin-top: 0;
}

/* Comillas dentro del bloque de la cita: antes colgaban por encima
   (top negativo) y tapaban el pie de foto o el texto anterior. */
.sty-quote {
    --qm: clamp(96px, 11vw, 160px);
    padding-top: calc(var(--qm) * .52);
}

.sty-quote::before {
    top: 0;
    font-size: var(--qm);
    line-height: .85;
}

.sty-chapter + .sty-quote {
    margin-top: clamp(32px, 4vw, 56px);
}

/* Y el margen inferior de la sección con fondo que va delante */
:is(.sty-hero, .sty-gallery, .sty-mix, .sty-lineage, .sty-horizon, .sty-lenses, .sty-chapter--type, .sty-statement--dark):has(+ :is(.sty-gallery, .sty-mix, .sty-lineage, .sty-horizon, .sty-lenses, .sty-chapter, .sty-statement--dark, .sty-closing)) {
    margin-bottom: 0;
}
