/* ============================================================
   VICAPITALS — Motion system público (Fase 12C)
   Capa de motion/scrollytelling sobre public.css.
   Progressive enhancement: sin JS / con reduced-motion, todo el
   contenido crítico permanece visible en estado final correcto.
   ============================================================ */

:root {
    /* Tokens motion (superficie y microinteracción) */
    --dur-fast: 0.28s;
    --dur-base: 0.6s;
    --dur-slow: 1.1s;
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --header-h: 72px;
    --header-h-scrolled: 60px;

    /* Superficies de capítulo */
    --ink-soft: rgba(255, 255, 255, 0.7);
    --line-on-ink: rgba(255, 255, 255, 0.22);
}

/* ---------- Utilidades ---------- */

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reveal por defecto: NADA oculto sin JS (GSAP aplica from() al boot). */

/* Superficie invertida (capítulos sobre tinta) */
.section--ink {
    background: var(--ink);
    color: var(--paper);
}

.section--ink .eyebrow { color: rgba(255, 255, 255, 0.62); }

.section--ink .muted { color: rgba(255, 255, 255, 0.66); }

/* ---------- Header (scroll state) ---------- */

.site-header {
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out);
}

.site-header__inner {
    min-height: var(--header-h);
    transition: min-height var(--dur-fast) var(--ease-out);
}

.site-header.is-scrolled {
    background: var(--paper);
    border-bottom-color: var(--line);
}

.site-header.is-scrolled .site-header__inner { min-height: var(--header-h-scrolled); }

/* Microinteracción de navegación: rule inferior que se extiende */
.site-nav a { position: relative; }

.site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform var(--dur-fast) var(--ease-out);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav a[aria-current='page']::after {
    transform: scaleX(1);
    transform-origin: left center;
}

/* El CTA es un botón con borde propio: no aplica el subrayado deslizante de
   los enlaces de texto del navbar. */
.site-nav .nav-cta-link::after { display: none; }

@media (max-width: 859px) {
    .site-nav a::after { display: none; }
}

/* ---------- Hero homepage (escena) ---------- */

.hero--full {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100svh - var(--header-h));
    padding-top: clamp(48px, 9vw, 120px);
    padding-bottom: 40px;
    position: relative;
    overflow: hidden;
    /* Fondo estático (fallback progresivo + reduced-motion): si el video no
       carga, autoplay falla o el navegador no lo reproduce, el hero sigue
       siendo legible sobre fondo oscuro institucional. */
    background: #000;
    color: var(--paper);
}

.hero__media,
.hero__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero__media {
    object-fit: cover;
    z-index: 0;
}

/* Capa de contraste mínima y funcional: solo si el video no ofrece
   contraste suficiente para el texto. */
.hero__overlay {
    z-index: 1;
    background: rgba(0, 0, 0, 0.32);
}

.hero--full .container {
    position: relative;
    z-index: 2;
}

.hero--full .hero__kicker,
.hero--full .hero__lede,
.hero--full .hero__cue {
    color: rgba(255, 255, 255, 0.82);
}

.hero--full .hero__rule,
.hero--full .hero__cue::before {
    background: rgba(255, 255, 255, 0.85);
}

.hero--full .hero__cue-line {
    background: #fff;
}

.hero--full .hero__cue-line::after {
    background: rgba(0, 0, 0, 0.9);
}

.hero--full .btn {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}

.hero--full .btn:hover {
    background: transparent;
    color: var(--paper);
    border-color: var(--paper);
}

.hero--full .btn--ghost {
    background: transparent;
    color: var(--paper);
}

.hero--full .btn--ghost:hover {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
    /* Sin movimiento: frame/fondo estático apropiado (nada de autoplay
       visual); el contenido permanece legible. */
    .hero__media {
        display: none;
    }

    .hero__overlay {
        background: rgba(0, 0, 0, 0.5);
    }
}

.hero--full .container {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
}

.hero__content { max-width: 1200px; }

.hero__kicker {
    margin: 0 0 clamp(18px, 3vw, 34px);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero__title {
    margin-bottom: clamp(20px, 3.4vw, 38px);
    will-change: transform;
}

.hero__title-mask {
    overflow: hidden;
    padding-bottom: 0.1em;
    margin-bottom: -0.1em;
}

.hero__lede {
    font-size: clamp(1.1rem, 1.9vw, 1.45rem);
    margin-bottom: clamp(26px, 4vw, 46px);
}

.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__rule {
    display: block;
    width: 1px;
    height: clamp(34px, 6vh, 60px);
    background: var(--ink);
    margin-top: clamp(30px, 5vw, 64px);
    transform-origin: top center;
}

.hero__cue {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero__cue::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--muted);
}

.hero__cue-line {
    display: block;
    width: 1px;
    height: 34px;
    background: var(--ink);
    overflow: hidden;
    position: relative;
}

.hero__cue-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: -100%;
    width: 100%;
    height: 100%;
    background: var(--paper);
    animation: hero-cue-drift 2.6s var(--ease-out) infinite;
}

@keyframes hero-cue-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(300%); }
}

/* ---------- Capítulos: números editoriales ---------- */

.eyebrow .chapter-no {
    font-variant-numeric: tabular-nums;
    color: inherit;
}

.eyebrow--chapter { display: flex; align-items: baseline; gap: 10px; }

/* ---------- Philosophy (statement sobre tinta) ---------- */

.section.scene-philosophy { padding-top: clamp(72px, 10vw, 150px); }

.scene-philosophy { padding-bottom: clamp(80px, 12vw, 170px); }

.scene-philosophy__statement { margin-top: clamp(24px, 5vw, 60px); }

.scene-philosophy__title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 8vw, 6.5rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    max-width: 18ch;
    margin: 0 0 clamp(24px, 4vw, 44px);
}

.scene-philosophy__rule {
    display: block;
    width: clamp(60px, 12vw, 160px);
    height: 1px;
    background: var(--paper);
    margin: 0 0 clamp(28px, 4vw, 44px);
    transform-origin: left center;
}

.scene-philosophy__body { max-width: 60ch; }

.scene-philosophy__body .lede {
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
}

/* ---------- Execution scene ---------- */

.execution-scene { position: relative; }

.section.execution-scene { padding-top: clamp(24px, 3vw, 48px); }

.execution-scene__head {
    padding-top: clamp(72px, 12vw, 150px);
    padding-bottom: clamp(40px, 6vw, 80px);
}

.execution-scene__heading {
    font-size: clamp(1.9rem, 4.4vw, 3.2rem);
    max-width: 22ch;
}

.execution-scene__lede { margin-bottom: 0; }

/* Capa decorativa: slides grandes (solo en modo escena vía JS) */
.execution-scene__slides { display: none; list-style: none; margin: 0; padding: 0; }

/* Lista semántica accesible (default: mobile, no-JS, reduced-motion) */
.execution-scene__acts { padding: clamp(8px, 2vw, 28px) 0 clamp(72px, 10vw, 130px); }

.execution-scene__act-list { list-style: none; margin: 0; padding: 0; }

.execution-scene__act {
    padding: clamp(22px, 3.4vw, 34px) 0;
    border-top: 1px solid var(--line);
}

.execution-scene__act:last-child { border-bottom: 1px solid var(--line); }

.execution-scene__act-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    line-height: 1.15;
    margin: 0 0 6px;
}

.execution-scene__act-note {
    color: var(--muted);
    max-width: 52ch;
    margin: 0;
}

/* Estado de escena (añadido solo por JS cuando motion está disponible) */
.execution-scene.is-scene .execution-scene__acts {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.execution-scene.is-scene .execution-scene__stage {
    position: relative;
    height: 100vh;
    height: 100svh;
}

.execution-scene.is-scene .execution-scene__slides {
    display: block;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.execution-scene.is-scene .execution-scene__slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 clamp(20px, 6vw, 80px);
    overflow: hidden;
    will-change: transform, opacity;
}

.execution-scene.is-scene .execution-scene__word {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 8.5vw, 7rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    max-width: 16ch;
}

.execution-scene.is-scene .execution-scene__note {
    color: var(--muted);
    max-width: 46ch;
    margin: clamp(18px, 3vw, 30px) 0 0;
    font-size: clamp(0.98rem, 1.4vw, 1.1rem);
}

.execution-scene.is-scene .execution-scene__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    margin: 0 auto;
    width: min(60vw, 240px);
    height: 1px;
    background: var(--line);
}

.execution-scene.is-scene .execution-scene__progress i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left center;
}

/* ---------- Process scene ---------- */

/* El número pasa a ser un span visible (no ::before de la fase 12A). */
.process-step::before { display: none; }

.process-step__no {
    display: block;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    margin: 0 0 18px;
}

.section.process-scene { padding-top: clamp(20px, 2vw, 40px); }

.process-scene__head {
    padding-bottom: clamp(36px, 6vw, 70px);
}

.process-rail {
    position: relative;
    padding-bottom: clamp(72px, 10vw, 130px);
}

.process-rail__line {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
    height: 96px;
    pointer-events: none;
    overflow: visible;
}

.process-rail__line .pr-base {
    stroke: var(--line-soft);
    stroke-width: 1;
    fill: none;
}

.process-rail__line .pr-progress {
    stroke: var(--ink);
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: square;
    transform-box: fill-box;
    transform-origin: left center;
}

.process-rail__line .pr-node {
    fill: var(--paper);
    stroke: var(--ink);
    stroke-width: 1;
}

.process-rail__line .pr-node.is-done {
    fill: var(--ink);
}

.process-steps { position: relative; }

.process-step { transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }

@media (min-width: 900px) {
    .process-rail { padding-left: 0; padding-right: 0; }

    .process-steps .process-step {
        border-top: 0;
        padding-top: clamp(52px, 7vh, 76px);
    }
}

/* En modo escena (solo JS desktop): banda superior para el rail conector. */
@media (min-width: 900px) {
    .process-scene.is-scene .process-step { padding-top: 128px; }

    .process-scene.is-scene .process-step__no {
        position: absolute;
        top: 30px;
        left: 0;
        margin: 0;
        font-size: 0.72rem;
        letter-spacing: 0.12em;
    }

    .process-scene.is-scene .step-title {
        font-size: clamp(1.3rem, 1.9vw, 1.6rem);
    }
}

/* ---------- Strategies scene (home) ---------- */

.strategy-scene { background: var(--ink); color: var(--paper); position: relative; }

.strategy-scene .eyebrow { color: rgba(255, 255, 255, 0.6); }

.strategy-scene__head { padding: clamp(64px, 10vw, 130px) 0 clamp(32px, 4vw, 48px); }

.strategy-scene__head .headline { margin-bottom: 10px; }

.strategy-scene__head .lede { color: rgba(255, 255, 255, 0.7); }

/* Modo escena horizontal: rail */
.strategy-scene__viewport { overflow: hidden; }

/* Apilado natural (mobile / no-js / reduced-motion) */
.strategy-scene__intro,
.strategy-scene__panel { padding: clamp(44px, 7vw, 88px) 0; }

.strategy-scene.is-scene .strategy-scene__intro,
.strategy-scene.is-scene .strategy-scene__panel { padding: 0; }

.strategy-scene__rail { list-style: none; margin: 0; padding: 0; display: block; }

.strategy-scene__intro,
.strategy-scene__panel { box-sizing: border-box; }

.strategy-scene__intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.strategy-scene__intro-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    line-height: 1.03;
    letter-spacing: -0.015em;
    margin: 0 0 22px;
}

.strategy-scene__intro p.lede { max-width: 44ch; margin-bottom: 26px; }

.strategy-scene__panel { border-top: 1px solid var(--line-on-ink); }

.strategy-scene__inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

.strategy-scene__index {
    display: block;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: clamp(18px, 3vw, 30px);
}

.strategy-scene__name {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin: 0 0 clamp(16px, 2.4vw, 26px);
}

.strategy-scene__summary {
    color: rgba(255, 255, 255, 0.72);
    max-width: 46ch;
    font-size: clamp(0.98rem, 1.3vw, 1.12rem);
    margin: 0 0 clamp(24px, 3vw, 36px);
}

.strategy-scene__link { color: var(--paper); }

.strategy-scene.is-scene .strategy-scene__rail { display: flex; }

.strategy-scene.is-scene .strategy-scene__intro,
.strategy-scene.is-scene .strategy-scene__panel { flex: 0 0 auto; }

.strategy-scene.is-scene .strategy-scene__panel { border-top: 0; border-left: 1px solid var(--line-on-ink); }

/* Progreso contextual (solo en escena horizontal) */
.strategy-scene__progress {
    display: none;
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(260px, 60vw);
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
}

.strategy-scene__progress i {
    display: block;
    height: 100%;
    background: var(--paper);
    transform: scaleX(0);
    transform-origin: left center;
}

.strategy-scene.is-scene .strategy-scene__viewport { position: relative; }

.strategy-scene.is-scene .strategy-scene__progress { display: block; }

/* ---------- Record teaser (home) ---------- */

.record-teaser__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(36px, 6vw, 90px);
    align-items: start;
}

@media (min-width: 820px) {
    .record-teaser__grid { grid-template-columns: 1.2fr 1fr; align-items: center; }
}

.record-teaser__stat {
    border-top: 1px solid var(--ink);
    padding-top: clamp(22px, 3vw, 30px);
}

.record-teaser__value {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Closing editorial ---------- */

.closing { padding-top: clamp(80px, 12vw, 150px); }

.closing__title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 6.2vw, 5.5rem);
    line-height: 1.02;
    letter-spacing: -0.025em;
    margin: 0 0 clamp(20px, 3vw, 34px);
    max-width: 18ch;
}

.closing__sub {
    font-family: var(--serif);
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    line-height: 1.35;
    color: var(--muted);
    max-width: 26ch;
    margin: 0 0 34px;
}

/* ---------- Footer (cierre editorial) ---------- */

.site-footer { background: var(--paper); }

.site-footer__close {
    border-top: 1px solid var(--line);
    padding: clamp(48px, 8vw, 96px) 0 clamp(30px, 5vw, 60px);
    overflow: hidden;
}

.footer-wordmark {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    margin: 0;
}

.footer-wordmark .footer-wordmark-logo {
    display: block;
    width: min(40vw, 540px);
    height: auto;
    object-fit: contain;
    aspect-ratio: 1051 / 177;
}

.footer-wordmark-sub {
    margin: clamp(14px, 2vw, 22px) 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- List rows (reveal sutil en listados) ---------- */

.list-row {
    transition: background-color var(--dur-fast) var(--ease-out);
}

.list-row:hover { background: var(--faint); }

.list-row:focus-visible { background: var(--faint); }

/* ---------- Track Record: draw sutil del gráfico ---------- */

.perf-chart__svg polyline {
    fill: none;
    stroke: currentColor;
}

/* ---------- Accesibilidad: reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .hero__cue-line::after,
    .hero__rule {
        animation: none;
    }

    .site-nav a::after {
        transition: none;
        transform: none;
    }
}
