/* --- FUENTES PROPIAS (assets/fonts/) ---------------------------------------
   Antes venían de Google Fonts: dos conexiones externas y una hoja de estilos
   que bloqueaba el primer texto. Ahora salen del mismo sitio, con
   `font-display: swap` (se pinta al instante con la fuente de respaldo y se
   cambia sin saltos). Solo el subconjunto latino: cubre el español entero.
   Jost y JetBrains Mono son fuentes variables: un archivo cubre todos los
   pesos que usa la hoja. */
@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/chakra-petch-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/chakra-petch-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/chakra-petch-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jost"; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url("../assets/fonts/jost-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --magenta: #F501F9;
  --purple: #CC00FD;
  --violet: #8626FC;
  --blue: #494FFF;
  --teal-navy: #0B4B63;
  --navy: #090A4F;
  --near-black: #060A1E;
  /* Tono claro derivado del teal del manual, para el tercer acento del HUD. */
  --teal-bright: #35D6F5;

  --text: #F5F6FF;
  --text-dim: rgba(245, 246, 255, 0.72);
  --text-faint: rgba(245, 246, 255, 0.42);

  --brand-gradient: linear-gradient(90deg, var(--blue), var(--violet), var(--magenta));
  --brand-gradient-soft: linear-gradient(135deg, rgba(73, 79, 255, 0.35), rgba(245, 1, 249, 0.28));

  /* Manual de Identidad Visual: primaria Varino Normal, secundaria Century
     Gothic. Ninguna está en Google Fonts; hasta tener los .woff2 reales se
     usan las más cercanas con rango de pesos completo. Al llegar los
     archivos: añadir su @font-face aquí arriba y cambiar solo estas dos
     líneas — nada más en toda la hoja. */
  --font-display: "Varino Normal", "Chakra Petch", "Century Gothic", sans-serif;
  --font-body: "Century Gothic", "Jost", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --header-h: 64px;
  --gutter: 6vw;
  --rail-w: 46px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* Nunca scroll horizontal. `hidden` en html no basta en móvil (el navegador deja
   arrastrar el lienzo y, si algo lo ensancha, alejar la página: los elementos
   `fixed` se descolocan). `clip` recorta sin volver a body un contenedor de
   scroll (no rompe `sticky`) y `touch-action` quita el gesto horizontal. */
html { overflow-x: hidden; overscroll-behavior-x: none; max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
html, body { touch-action: pan-y pinch-zoom; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--near-black);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* SIN `overflow-x: hidden` aquí a propósito: `html` ya lo tiene. Declararlo
     también en `body` obliga (por la spec de CSS) a que su otro eje pase a
     `auto`, y `body` se vuelve un contenedor de scroll de facto; entonces
     `position: sticky` se ancla al scrollTop de `body` (que nunca cambia) y
     el pineado de las escenas deja de funcionar. */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.005em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--magenta); }
img, video { max-width: 100%; display: block; }
/* El atributo `hidden` tiene que ganarle a los resets de display de arriba:
   si no, un <img hidden> sin archivo sigue ocupando sitio y pinta el icono
   de imagen rota con su texto alternativo. */
[hidden] { display: none !important; }
button { font: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}



/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--header-h);
  padding: 0 4vw;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(6, 10, 30, 0.8), transparent);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  opacity: 1; transition: opacity 0.3s var(--ease);
}
/* Mientras la portada está en pantalla, el logo del header se retira: ya
   está el logo central del hero y los dos a la vez se ven duplicados. */
.brand.is-hero-visible { opacity: 0; pointer-events: none; }
/* Isotipo del manual. */
.brand__logo { height: 20px; width: auto; display: block; }
@media (min-width: 900px) { .brand__logo { height: 24px; } }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  border: 1px solid rgba(245, 246, 255, 0.25);
  background: rgba(6, 10, 30, 0.5);
  backdrop-filter: blur(8px);
  color: var(--text);
  border-radius: 999px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--purple); }
.icon-btn .icon-btn__off { display: none; }
.icon-btn[aria-pressed="true"] .icon-btn__on { display: none; }
.icon-btn[aria-pressed="true"] .icon-btn__off { display: block; }
.icon-btn svg { display: block; }

.icon-btn--text {
  width: auto; padding: 0 0.85rem; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.04em; white-space: nowrap; text-transform: uppercase;
}
.icon-btn--text[aria-pressed="true"] { background: var(--magenta); color: #1a0a1a; border-color: var(--magenta); }

@media (max-width: 560px) {
  .icon-btn--text { font-size: 0.58rem; padding: 0 0.55rem; }
  .brand { font-size: 0.85rem; }
}

/* ==========================================================================
   HUD — MAPA DEL RÍO
   Dos formas del mismo componente:
     · escritorio: un riel fijo a la izquierda, solo la línea y los 12 nodos.
     · móvil: una lámina que sube desde el botón ⌖, con la lista de paradas.
       Los nodos SVG miden 7px: en un teléfono son un blanco imposible, así
       que el que recibe el toque es el botón de la lista, con 44px de alto.
   ========================================================================== */
.river-map {
  position: fixed; left: 10px; top: 50%; transform: translateY(-50%);
  z-index: 58; width: var(--rail-w); height: min(58vh, 500px);
  pointer-events: none;
}
.river-map__head { display: none; }
.river-map__canvas { width: 100%; height: 100%; }
.river-list { display: none; }
.river-map svg { width: 100%; height: 100%; overflow: visible; }

.river-track { fill: none; stroke: rgba(245, 246, 255, 0.16); stroke-width: 2; stroke-linecap: round; }
.river-progress {
  fill: none; stroke: url(#riverGrad); stroke-width: 2.4; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(245, 1, 249, 0.75));
}

.river-node { fill: var(--near-black); stroke: rgba(245, 246, 255, 0.4); stroke-width: 1.6; }
.river-node.is-passed { fill: var(--violet); stroke: var(--violet); }
.river-node.is-active {
  fill: var(--magenta); stroke: var(--magenta);
  filter: drop-shadow(0 0 7px rgba(245, 1, 249, 0.95));
}
.river-halo { fill: none; stroke: var(--magenta); stroke-width: 1.2; opacity: 0; }
.river-node.is-active + .river-halo { opacity: 0.8; }

/* --- LÁMINA MÓVIL ------------------------------------------------------- */
.icon-btn--map { display: flex; font-size: 1.05rem; }

@media (max-width: 899px) {
  .river-map {
    left: 0; right: 0; top: auto; bottom: 0; transform: translateY(100%);
    width: 100%; height: auto; max-height: 82dvh;
    padding: 0.4rem 0 calc(1rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(9, 10, 79, 0.96), rgba(6, 10, 30, 0.99));
    border-top: 1px solid rgba(245, 246, 255, 0.16);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -20px 60px rgba(3, 4, 14, 0.7);
    backdrop-filter: blur(14px);
    display: flex; flex-direction: column;
    transition: transform 0.34s var(--ease);
  }
  body.map-open .river-map { transform: translateY(0); pointer-events: auto; }

  .river-map__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.55rem 1.1rem 0.5rem; flex: none;
  }
  .river-map__title {
    font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
    letter-spacing: 0.1em; text-transform: uppercase;
  }
  .river-map__close {
    width: 44px; height: 44px; margin-right: -0.6rem;
    border: 0; background: none; color: var(--text-dim); font-size: 1rem; cursor: pointer;
  }

  .river-map__canvas {
    display: flex; gap: 0.5rem; min-height: 0; height: auto;
    padding: 0 1.1rem;
  }
  .river-map__canvas svg { width: 34px; flex: none; height: auto; align-self: stretch; }

  .river-list {
    display: flex; flex-direction: column; flex: 1 1 auto;
    min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .river-item { border-bottom: 1px solid rgba(245, 246, 255, 0.08); }
  .river-item:last-child { border-bottom: 0; }
  .river-btn {
    display: grid; grid-template-columns: 2.1rem 1fr; grid-auto-rows: auto;
    align-items: baseline; gap: 0 0.7rem;
    width: 100%; min-height: 52px; padding: 0.6rem 0.2rem;
    border: 0; background: none; color: var(--text); text-align: left; cursor: pointer;
  }
  .river-btn__num {
    grid-row: 1 / span 2;
    font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint);
    align-self: center;
  }
  .river-btn__name { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
  .river-btn__tag { font-size: 0.72rem; color: var(--text-faint); }
  .river-item.is-passed .river-btn__num { color: var(--violet); }
  .river-item.is-active .river-btn__num,
  .river-item.is-active .river-btn__name { color: var(--magenta); }
}

@media (min-width: 900px) {
  :root { --rail-w: 74px; }
  .river-map { left: 26px; }
  .icon-btn--map { display: none; }   }

/* ==========================================================================
   HUD — INSTRUMENTOS DE VUELO
   ========================================================================== */
.hud-readout {
  position: fixed; right: 4vw; bottom: 1.4rem; z-index: 58;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.04em;
  color: var(--text-faint); text-align: right; pointer-events: none;
  display: flex; flex-direction: column; gap: 0.18rem; min-width: 148px;
}
.hud-row { display: flex; justify-content: flex-end; gap: 0.6rem; }
.hud-key { color: rgba(245, 246, 255, 0.3); }
.hud-val { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.hud-bar { margin-top: 0.3rem; height: 2px; width: 100%; background: rgba(245, 246, 255, 0.12); overflow: hidden; }
.hud-bar__fill {
  display: block; height: 100%; width: 0%;
  background: var(--brand-gradient);
  box-shadow: 0 0 8px rgba(245, 1, 249, 0.6);
}

.stop-label {
  position: fixed; left: calc(var(--rail-w) + 22px); top: calc(var(--header-h) + 10px); z-index: 58;
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
  background: rgba(6, 10, 30, 0.55); padding: 0.3rem 0.65rem; border-radius: 999px;
  border: 1px solid rgba(245, 246, 255, 0.12); backdrop-filter: blur(6px);
  pointer-events: none; white-space: nowrap;
  /* Ni truncado ni elipsis: la píldora dice el nombre de la parada y ese
     nombre no se abrevia. El letter-spacing del último glifo desbordaba el
     content box por una fracción de píxel y disparaba la elipsis. */
  width: max-content; padding-right: 0.8rem;
}

@media (max-width: 560px) {
  .hud-readout { font-size: 0.54rem; min-width: 120px; bottom: 1rem; }
  .stop-label { font-size: 0.52rem; }
}

/* ==========================================================================
   CAPA 3 — PRIMER PLANO ATMOSFÉRICO
   ========================================================================== */
.fg-layer { position: fixed; inset: 0; z-index: 3; pointer-events: none; }

.fg-grain {
  position: absolute; inset: -10%; opacity: 0.055; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 170px 170px;
}

.fg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(125% 95% at 50% 45%, rgba(6, 8, 20, 0) 42%, rgba(6, 8, 20, 0.62) 100%);
}

.fg-particles { position: absolute; inset: 0; overflow: hidden; }
.pt {
  position: absolute; border-radius: 50%;
  background: var(--magenta); opacity: 0.5;
  box-shadow: 0 0 6px currentColor;
  animation: drift linear infinite;
}
@keyframes drift {
  0%   { transform: translate3d(0, 12vh, 0) scale(0.6); opacity: 0; }
  15%  { opacity: 0.55; }
  85%  { opacity: 0.4; }
  100% { transform: translate3d(2vw, -14vh, 0) scale(1.1); opacity: 0; }
}

/* ==========================================================================
   EL VUELO — fondo continuo del recorrido
   Un único video que el scroll recorre hacia adelante y hacia atrás. La capa
   `.flight-media` lleva SIEMPRE una respiración lenta: aunque el scroll esté
   detenido y el recorrido se quede en su punto, la imagen nunca se congela.
   ========================================================================== */
.flight-stage {
  position: fixed; inset: 0; width: 100%; height: 100dvh;
  z-index: 0; overflow: hidden; background: var(--near-black);
  will-change: opacity;
  filter: blur(var(--vblur, 0px));
}

.flight-media {
  position: absolute; inset: 0;
  will-change: transform;
  animation: flightBreath 21s ease-in-out infinite;
  transform-origin: 50% 48%;
}
@keyframes flightBreath {
  0%   { transform: scale(1.045) translate3d(0, 0, 0); }
  50%  { transform: scale(1.075) translate3d(-0.9%, -0.7%, 0); }
  100% { transform: scale(1.045) translate3d(0, 0, 0); }
}

.flight-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  backface-visibility: hidden;
  /* El clip ya viene gradado a la paleta de marca; aquí solo se le da el
     último punto de contraste, sin volver a teñirlo. */
  filter: saturate(1.06) contrast(1.05) brightness(0.94);
}

/* Degradado de composición: oscurece abajo para que el texto se lea. */
.flight-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(to top, rgba(6, 8, 20, 0.86) 0%, rgba(6, 8, 20, 0.08) 46%, rgba(6, 8, 20, 0.4) 100%),
    linear-gradient(to right, rgba(6, 8, 20, 0.5) 0%, rgba(6, 8, 20, 0) 62%);
}

/* Si el video no está disponible, el fondo sigue siendo de marca. */
.flight-stage.is-fallback .flight-video { display: none; }
.flight-stage.is-fallback {
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(134, 38, 252, 0.35), transparent 65%),
    linear-gradient(160deg, var(--teal-navy), var(--navy) 55%, var(--near-black));
}

/* ==========================================================================
   CAPA 1 — VIDEO DE FONDO (cierre y escenas de planchón)
   ========================================================================== */
.video-stack {
  position: fixed; inset: 0; width: 100%; height: 100dvh;
  overflow: hidden; z-index: 0; background: transparent;
}
.video-stack, .stage-media { position: absolute; }

.bg-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; will-change: opacity, transform;
}
.bg-video.is-active { opacity: 1; }

/* Modelo 3D real: no se recorta como una toma de fondo, se encuadra completo
   sobre un plano oscuro de marca para que la embarcación se lea entera. */
.bg-video--model {
  object-fit: cover;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(134, 38, 252, 0.16), rgba(6, 10, 30, 0) 62%),
    var(--near-black);
}

.video-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(to top, rgba(6, 8, 20, 0.88) 0%, rgba(6, 8, 20, 0.1) 48%, rgba(6, 8, 20, 0.35) 100%),
    linear-gradient(to right, rgba(6, 8, 20, 0.55) 0%, rgba(6, 8, 20, 0) 60%);
}

/* ==========================================================================
   CAPA 2 — CONTENIDO
   ========================================================================== */
.scroll-track { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 500; color: var(--magenta);
}

/* ==========================================================================
   EL RECORRIDO — los beats de texto sobre el vuelo
   Todos los beats ocupan la misma caja y se cruzan por opacidad: no hay
   bloques que suban tapando al anterior, así que no aparecen líneas de corte.
   ========================================================================== */
.journey { position: relative; }          /* la altura la fija data.js */

.journey-pin {
  /* Pineado nativo: `sticky` en vez de que GSAP inserte un pin-spacer y
     alterne `position: fixed` por JS en cada scroll. El navegador lo
     compone solo, sin trabajo por fotograma. */
  position: sticky; top: 0; height: 100dvh; width: 100%;
  overflow: hidden;
}

/* La colocación de cada beat se resuelve con flexbox en el contenedor, NO con
   `transform` sobre `.beat-inner`: el motor escribe ahí su propio transform
   (parallax) en cada fotograma y borraría cualquier centrado que dependiera
   de esa propiedad. */
.journey-beat {
  position: absolute; inset: 0; z-index: 2;
  display: flex;
  pointer-events: none;
  opacity: 0; visibility: hidden;
}
.journey-beat a { pointer-events: auto; }

.beat-inner {
  position: relative;
  display: flex; flex-direction: column; gap: 0.85rem;
  will-change: transform, opacity, filter;
}

.beat-title { font-size: clamp(1.7rem, 5.5vw, 2.6rem); line-height: 1.08; }
.beat-text { color: var(--text-dim); font-size: 0.95rem; }

/* --- beat de portada: centrado, título grande --------------------------- */
.beat--hero {
  align-items: center; justify-content: center;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 5rem;
}
.beat--hero .beat-inner {
  width: min(88vw, 760px);
  align-items: center; text-align: center;
}

/* --- lockup de portada: el logo real, o el logotipo tipográfico -------- */
.hero-lockup { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.hero-logo {
  width: min(82vw, 660px); height: auto;
  /* Halo de marca detr\u00e1s del trazo: sin esto el logo se funde con el fondo
     cuando cae sobre agua clara o un cuadro luminoso del video. El halo va
     en un pseudo-elemento (no en el propio <img>, que es PNG con alfa y un
     drop-shadow encima de p\u00edxeles transparentes no ilumina nada) y el
     drop-shadow del trazo se queda para dar profundidad sobre ese halo. */
  position: relative;
  filter: drop-shadow(0 2px 10px rgba(3, 4, 14, 0.55)) drop-shadow(0 0 28px rgba(255, 255, 255, 0.22));
}
.hero-lockup { position: relative; }
.hero-lockup::before {
  content: "";
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(90vw, 720px); height: 62%;
  background: radial-gradient(50% 60% at 50% 50%, rgba(255, 255, 255, 0.16), transparent 72%);
  filter: blur(18px);
  pointer-events: none; z-index: -1;
}
.beat-title--hero.is-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

.beat-title--hero {
  font-size: clamp(2.2rem, 10.5vw, 5rem); font-weight: 700; line-height: 1;
  letter-spacing: 0.01em;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.3em;
}
/* Cada palabra en su riel: la interior sube desde el recorte. */
.pw { display: inline-block; overflow: hidden; padding: 0.04em 0; }
.pw-i {
  display: inline-block; will-change: transform, opacity;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.beat-subtitle {
  font-family: var(--font-display); font-size: clamp(0.92rem, 3vw, 1.3rem);
  font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
}
.beat--hero .beat-text { max-width: 46ch; }

/* --- beats laterales: tarjeta abajo, dejando libre la esquina del HUD ---- */
.beat--side {
  align-items: flex-end; justify-content: flex-start;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 5.8rem calc(var(--rail-w) + 22px);
}
.beat--side .beat-inner { max-width: 470px; width: 100%; }

/* --- beat de llegada: centrado abajo ------------------------------------ */
.beat--arrival {
  align-items: flex-end; justify-content: center;
  padding: 0 var(--gutter) 6.5rem;
}
.beat--arrival .beat-inner {
  width: min(86vw, 560px);
  align-items: center; text-align: center;
}
.beat--arrival .beat-title { font-size: clamp(2rem, 7vw, 3.2rem); }

.beat-indicator {
  /* Centrado con left/right en vez de translateX(-50%): la animación de
     entrada escribe `transform`, y una animación gana a la regla estática
     mientras corre — con translateX el indicador se quedaba descentrado. */
  position: absolute; bottom: 2.2rem; left: 0; right: 0;
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  will-change: opacity;
}

.scroll-indicator {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.scroll-indicator__mouse {
  width: 22px; height: 36px; border: 2px solid rgba(245,246,255,0.6); border-radius: 14px;
  display: flex; justify-content: center; padding-top: 6px;
}
.scroll-indicator__dot { width: 3px; height: 8px; border-radius: 2px; background: var(--magenta); }
.scroll-indicator__label { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }

@media (min-width: 900px) {
  .beat--hero .beat-text { font-size: 1.05rem; }
  .beat--side .beat-inner { max-width: 440px; }
  /* En pantalla ancha el beat de historia se va al lado contrario, para que
     el recorrido no repita siempre la misma esquina. */
  .beat--side.beat--right { justify-content: flex-end; }
  .beat--side.beat--right .beat-inner { text-align: right; align-items: flex-end; }
}

/* ==========================================================================
   PARADAS SIMPLES (cierre)
   ========================================================================== */
.stop {
  position: relative; min-height: 100dvh; width: 100%;
  display: flex; align-items: flex-end;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 4.5rem calc(var(--rail-w) + 22px);
}

.scene-card { max-width: 470px; width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }
.scene-card .title { font-size: clamp(1.7rem, 5.5vw, 2.5rem); line-height: 1.08; }
.scene-card .text { color: var(--text-dim); font-size: 0.94rem; }

/* Cierre: envoltorio alto + pin sticky, como las escenas (ver script.js).
   Su fondo vive en #globalStack, detrás; aquí solo la tarjeta. */
.closing-wrap { position: relative; width: 100%; }
.closing-pin {
  position: sticky; top: 0; height: 100dvh; width: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  overflow: hidden;
}
.closing-pin .scene-card { align-items: center; max-width: 620px; will-change: opacity, transform; }
.closing-logos {
  list-style: none; margin: 1.6rem 0 0; padding: 1.2rem 0 0;
  border-top: 1px solid rgba(245, 246, 255, 0.16);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1.1rem 2rem;
}
.closing-logos__item img { display: block; height: 60px; width: auto; max-width: 100%; }
.closing-logos__item.is-xenda img { height: 64px; }
.closing-logos__item.is-wide img { height: 56px; }
@media (max-width: 640px) {
  .closing-logos { gap: 1rem 1.4rem; }
  .closing-logos__item.is-xenda img { height: 46px; }
  .closing-logos__item.is-wide img { height: 40px; }
}

@media (min-width: 900px) { .stop { align-items: center; } }

/* ==========================================================================
   ESCENAS DE PLANCHÓN — 4 fases, 4 composiciones
   ========================================================================== */
.planchon { position: relative; height: 400vh; }

.planchon-pin {
  /* Pineado nativo (ver .journey-pin). Las escenas se solapan por su
     `margin-top` negativo (lo pone script.js) y se disuelven una en otra:
     mientras dura el fundido las dos están pineadas a la vez, una sobre otra. */
  position: sticky; top: 0; height: 100dvh; width: 100%;
  overflow: hidden; background: transparent;
}

/* Ninguna escena tiene fondo propio opaco: el suelo lo pone su .stage-media,
   que es lo que entra por fundido. Un pin opaco dejaba una línea de corte
   horizontal en cada cambio de escena — el borde recto entre el final de una
   y el principio de la siguiente. */
.stage-media { background: var(--near-black); }

.stage-media {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.stage-media .bg-video { transition: none; }

/* --- vectorización progresiva -------------------------------------------
   La rejilla y el barrido acompañan el dibujado del esquema: leen como un
   levantamiento técnico hecho sobre la vista aérea. */
.vec-grid {
  position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(73, 79, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73, 79, 255, 0.5) 1px, transparent 1px);
  background-size: 58px 58px, 58px 58px;
  mask-image: radial-gradient(80% 70% at 50% 50%, #000 35%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 50%, #000 35%, transparent 78%);
}

.vec-scan {
  position: absolute; top: -5%; bottom: -5%; width: 2px; z-index: 2;
  left: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--magenta) 18%, #fff 50%, var(--magenta) 82%, transparent);
  box-shadow: 0 0 18px 3px rgba(245, 1, 249, 0.75), 0 0 60px 12px rgba(134, 38, 252, 0.35);
}

/* --- el esquema vectorial ------------------------------------------------
   Es el protagonista visual de las fases 2 y 3: se dibuja trazo a trazo
   sobre la vista aérea y luego queda completo, en neón, girando apenas lo
   justo para leerse como volumen. */
.wire-wrap {
  position: absolute; z-index: 2; left: 50%; top: 44%;
  width: min(78vw, 760px); aspect-ratio: 400 / 220;
  translate: -50% -50%;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform-style: preserve-3d;
}
/* `will-change` reserva una capa de GPU entera: con 12 escenas × decenas de
   nodos, dejarlo siempre puesto era memoria de video gastada en escenas que
   ni se ven. script.js marca `.is-live` solo en las escenas cercanas. */
.planchon.is-live .wire-wrap { will-change: transform, opacity; }
.wire-wrap.is-neon {
  filter: drop-shadow(0 0 18px rgba(245, 1, 249, 0.45));
}
.wire {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
}
.wire-path {
  fill: none; stroke: var(--magenta); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(245, 1, 249, 0.85));
  vector-effect: non-scaling-stroke;
}
.wire-ring { stroke: var(--blue); }
.wire-water { stroke: var(--violet); stroke-dasharray: 6 8; opacity: 0.7; }

/* --- contenido de la sección -------------------------------------------- */
.stage-content { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.stage-content a, .stage-content button { pointer-events: auto; }

.stage-numeral {
  position: absolute; font-family: var(--font-display); font-weight: 900;
  line-height: 0.8; letter-spacing: -0.03em;
  color: transparent; -webkit-text-stroke: 1px rgba(245, 246, 255, 0.28);
  font-size: clamp(5rem, 22vw, 15rem);
  top: calc(var(--header-h) + 0.5rem); right: 4vw;
  opacity: 0.55; user-select: none;
}

.planchon-phase {
  position: absolute; left: calc(var(--rail-w) + 22px); right: var(--gutter);
  bottom: 5.8rem; max-width: 470px;
  /* El fundido lo escribe el bucle de render sobre este nodo. Arranca
     invisible: así nunca se ve una fase antes de que le toque su ventana. */
  opacity: 0; visibility: hidden;
}
.planchon.is-live .planchon-phase { will-change: opacity; }
.phase-inner { display: flex; flex-direction: column; gap: 0.7rem; }
.planchon-phase .tag {
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
}
.phase-aerial .tag { color: var(--blue); }

.phase-neon .tag { color: var(--magenta); }
.phase-interior .tag { color: var(--violet); }

.phase-v360 .tag { color: var(--teal-bright, #35D6F5); }

/* --- FASE 6: VISTA 360° ---------------------------------------------------
   Última sección de cada planchón, con su propio tramo de scroll. Hoy, sin
   videos, un dial que gira con el scroll (0–360°) deja ver y probar el
   control; el video 360° irá en este mismo escenario y lo gobernará el mismo
   número. El tamaño sale del propio escenario (cqmin) para que encaje igual
   en pantalla completa, en el marco y en el layout dividido. */
.stage-360 {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  container-type: size;
  opacity: 0; visibility: hidden; pointer-events: none;
  background: radial-gradient(90% 80% at 50% 44%, rgba(73, 79, 255, 0.16), rgba(6, 10, 30, 0) 64%);
}
.v360-dial {
  position: relative; aspect-ratio: 1;
  width: min(46vh, 72vw, 440px);            /* respaldo sin container queries */
  width: min(76cqmin, 440px);
  translate: 0 -5%;
}
.v360-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.v360-ring { fill: none; stroke: rgba(245, 246, 255, 0.24); stroke-width: 1.4; }
.v360-ring--inner { stroke: rgba(134, 38, 252, 0.55); stroke-dasharray: 3 7; }
.v360-ticks { transform-box: fill-box; transform-origin: center; }
.v360-tick { stroke: rgba(245, 246, 255, 0.34); stroke-width: 1.2; stroke-linecap: round; }
.v360-tick--major { stroke: var(--magenta); stroke-width: 2.2; }
.v360-marker { fill: var(--magenta); filter: drop-shadow(0 0 6px rgba(245, 1, 249, 0.85)); }
.v360-readout {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); color: var(--text);
}
.v360-readout b {
  font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  font-size: clamp(2.2rem, 9vh, 4.4rem);
}
.v360-readout i { font-style: normal; color: var(--magenta); margin-left: 0.06em; font-size: clamp(1.4rem, 5vh, 2.4rem); align-self: flex-start; margin-top: 0.35em; }

/* En el layout centrado el texto de las demás fases va en el medio de la
   pantalla. Aquí, para que no tape el dial, el texto de la vista 360° baja al
   pie y el dial sube arriba. */
.lay-center .stage-360 { place-items: start center; padding-top: calc(var(--header-h) + 2vh); }
.lay-center .v360-dial { width: min(38vh, 60vw, 300px); width: min(64cqmin, 300px); translate: none; }
.lay-center .v360-readout b { font-size: clamp(1.8rem, 6vh, 3rem); }
.lay-center .planchon-phase.phase-v360 { top: auto; bottom: 4.4rem; transform: translateX(-50%); }
/* En escritorio, en el layout completo el texto va abajo a un lado: el dial se
   corre al lado contrario y ya no le pasa por debajo. */
@media (min-width: 900px) {
  .lay-full .v360-dial { translate: 32% -5%; }
  .lay-full.side-right .v360-dial { translate: -32% -5%; }
}

.planchon-phase .subtitle {
  font-family: var(--font-display); font-weight: 500;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--magenta);
}

/* `!important`: los layouts lay-center / lay-split / lay-frame / side-right
   reposicionan `.planchon-phase` con selectores de más peso (dos o tres
   clases) que este único `.phase-ficha`. Sin forzarlo, la ficha heredaba esa
   caja angosta y centrada pensada para un titular corto y se desbordaba por
   arriba y por abajo de la pantalla en cualquier planchón que no fuera
   "lay-full" sin `side-right`. */

.planchon-phase .title { font-size: clamp(1.6rem, 5vw, 2.3rem); line-height: 1.08; }
.planchon-phase .text { color: var(--text-dim); font-size: 0.92rem; }

/* --- "Saber más": abre la ficha ampliada ------------------------------- */
.know-more-btn {
  align-self: flex-start; margin-top: 0.5rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px; padding: 0 1.05rem; border-radius: 999px;
  border: 1px solid rgba(245, 246, 255, 0.35); background: rgba(245, 246, 255, 0.06);
  color: var(--text); font-family: var(--font-body); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.know-more-btn:hover { background: var(--magenta); border-color: var(--magenta); transform: translateY(-1px); }
.lay-center .know-more-btn { align-self: center; }

/* ==========================================================================
   FICHA AMPLIADA — "Saber más": resumen, planimetría, fotos y datos
   Un solo panel reutilizado para los 12 planchones, fuera de #main para no
   heredar ningún pineado. Entra con fundido + un leve acercamiento; el
   fondo, un scrim que cierra al hacer clic fuera.
   ========================================================================== */
.plan-detail {
  position: fixed; inset: 0; z-index: 90;
  display: flex; justify-content: center;
  /* El botón "Cerrar" (fijo, 44 px) queda ENCIMA del contenido, no sobre él. */
  padding: calc(var(--header-h) + 0.6rem + 44px + 1rem) var(--gutter) 2rem;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: rgba(3, 4, 14, 0.78); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.plan-detail.is-open { opacity: 1; }
.plan-detail[hidden] { display: none; }

.plan-detail__close {
  position: fixed; top: calc(var(--header-h) + 0.6rem); right: var(--gutter); z-index: 91;
  min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid rgba(245, 246, 255, 0.3); background: rgba(9, 10, 79, 0.7);
  color: var(--text); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.plan-detail__close:hover { background: var(--magenta); border-color: var(--magenta); }

.plan-detail__body {
  width: min(100%, 780px); height: fit-content; margin-top: 0;
  display: flex; flex-direction: column; gap: 1.8rem;
  padding: 1.8rem clamp(1.2rem, 4vw, 2.2rem) 2.4rem;
  border-radius: 18px; background: linear-gradient(165deg, rgba(9, 10, 79, 0.92), rgba(6, 10, 30, 0.97));
  border: 1px solid rgba(245, 246, 255, 0.14); box-shadow: 0 30px 80px rgba(3, 4, 14, 0.6);
  transform: translateY(14px) scale(0.985); transition: transform 0.28s var(--ease);
}
.plan-detail.is-open .plan-detail__body { transform: translateY(0) scale(1); }

.plan-detail__head { display: flex; align-items: flex-start; gap: 1rem; }
.plan-detail__num {
  font-family: var(--font-mono); font-size: 1.1rem; color: var(--magenta);
  border: 1px solid rgba(245, 1, 249, 0.4); border-radius: 8px; padding: 0.2rem 0.55rem;
}
.plan-detail__head h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); }
.plan-detail__tagline { font-size: 0.85rem; color: var(--text-faint); margin-top: 0.2rem; }

.plan-detail__section h3 {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.4rem;
}

/* Sin `body { overflow: hidden }` al abrir la ficha: con el pineado nativo
   (`position: sticky`) convertiría a `body` en contenedor de scroll y las
   escenas de detrás saltarían. El panel ya tiene scroll propio; con
   `overscroll-behavior: contain` no arrastra la página al llegar a su borde. */
.plan-detail { overscroll-behavior: contain; }

@media (prefers-reduced-motion: reduce) {
  .plan-detail, .plan-detail__body, .know-more-btn { transition: none; }
}

/* --- VARIANTE "split" ---------------------------------------------------- */
.lay-split .stage-panel {
  position: absolute; inset: auto 0 0 0; height: 46%; z-index: 1;
  background: linear-gradient(to top, var(--navy) 55%, rgba(9, 10, 79, 0));
}
.lay-split .stage-media { bottom: 30%; }

/* --- VARIANTE "frame" ----------------------------------------------------
   La escena no es a sangre: se enmarca. El suelo lo pone el propio pin, y por
   eso aquí el fundido de entrada se aplica al pin entero. */
.lay-frame .planchon-pin { background: var(--near-black); }
.lay-frame .stage-media {
  inset: calc(var(--header-h) + 3vh) 6vw 46vh calc(var(--rail-w) + 26px);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(134, 38, 252, 0.4), 0 30px 80px rgba(3, 4, 14, 0.7);
}
.lay-frame .stage-numeral {
  top: calc(var(--header-h) + 0.2rem); right: 5vw;
  font-size: clamp(3.2rem, 11vw, 7rem); opacity: 0.4;
}

/* --- VARIANTE "center" --------------------------------------------------- */
.lay-center .planchon-phase {
  left: calc(50% + var(--rail-w) / 2); right: auto; bottom: auto; top: 48%;
  transform: translate(-50%, -50%);
  max-width: 560px; width: min(78vw, 560px);
}
.lay-center .phase-inner { align-items: center; text-align: center; }

.lay-center .stage-numeral {
  top: 48%; right: auto; left: calc(50% + var(--rail-w) / 2);
  transform: translate(-50%, -50%);
  font-size: clamp(11rem, 46vw, 30rem); opacity: 0.14;
  -webkit-text-stroke: 1px rgba(245, 246, 255, 0.5);
}

@media (min-width: 900px) {
  .planchon-phase { max-width: 440px; }

  .lay-split .stage-media { inset: 0 0 0 42%; }
  .lay-split .stage-panel {
    inset: 0 58% 0 0; height: auto;
    background: linear-gradient(120deg, var(--near-black) 40%, rgba(9, 10, 79, 0.9));
    border-right: 1px solid rgba(134, 38, 252, 0.35);
  }
  .lay-split .planchon-phase { left: calc(var(--rail-w) + 40px); right: auto; width: 34vw; bottom: auto; top: 50%; transform: translateY(-50%); }
  .lay-split .stage-numeral { right: 4vw; }

  .lay-frame .stage-media { inset: calc(var(--header-h) + 6vh) 34vw 8vh calc(var(--rail-w) + 40px); }
  .lay-frame .planchon-phase { left: auto; right: 5vw; width: 26vw; bottom: auto; top: 50%; transform: translateY(-50%); }
  .lay-frame .stage-numeral { top: calc(var(--header-h) + 2vh); bottom: auto; right: 5vw; }

  .lay-full.side-right .planchon-phase { left: auto; right: var(--gutter); }
  .lay-full.side-right .phase-inner { text-align: right; align-items: flex-end; }
  
  
}

/* ==========================================================================
   MODO ACCESIBLE — segunda interfaz, no la misma reordenada
   El recorrido visual desaparece por completo (display: none) y se muestra
   #a11yView: un documento simple, en una columna, con control de lectura en
   voz alta. Es deliberadamente otra interfaz, no la misma con parches de
   CSS: así no hereda ninguna de las alturas o posiciones pensadas para el
   scrollytelling, y no hay nada que se pueda romper por un cambio ahí.
   ========================================================================== */
body.a11y-mode #main,
body.a11y-mode .flight-stage,
body.a11y-mode .video-stack,
body.a11y-mode .fg-layer,
body.a11y-mode .river-map,
body.a11y-mode .hud-readout,
body.a11y-mode .stop-label { display: none !important; }

.a11y-view {
  position: relative; min-height: 100dvh;
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 4rem;
  background: var(--near-black); color: var(--text);
  display: flex; flex-direction: column; gap: 1.6rem;
}
body.a11y-mode .a11y-view { display: flex; }

.a11y-bar {
  display: flex; flex-direction: column; gap: 0.8rem;
  max-width: 640px; margin: 0 auto; width: 100%;
  padding: 1.1rem 1.2rem; border-radius: 14px;
  background: rgba(9, 10, 79, 0.55); border: 1px solid rgba(245, 246, 255, 0.14);
}
.a11y-bar__lead { font-size: 0.9rem; color: var(--text-dim); }
.a11y-bar__controls { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.a11y-bar__controls button {
  min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid rgba(245, 246, 255, 0.3); background: rgba(245, 246, 255, 0.06);
  color: var(--text); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.a11y-bar__controls button:hover { background: rgba(245, 246, 255, 0.14); }
#a11yPlay[aria-pressed="true"] {
  background: var(--magenta); border-color: var(--magenta); color: #fff;
}
.a11y-bar__controls button:disabled { opacity: 0.4; cursor: not-allowed; }
.a11y-bar__status {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em;
  color: var(--text-faint); min-height: 1em;
}

.a11y-toc {
  max-width: 640px; margin: 0 auto; width: 100%;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.a11y-toc button {
  min-height: 40px; padding: 0 0.85rem; border-radius: 999px;
  border: 1px solid rgba(245, 246, 255, 0.16); background: transparent;
  color: var(--text-dim); font-size: 0.78rem; cursor: pointer;
}
.a11y-toc button:hover { border-color: rgba(245, 246, 255, 0.4); color: var(--text); }
.a11y-toc button.is-current { border-color: var(--magenta); color: var(--magenta); }

.a11y-content {
  max-width: 640px; margin: 0 auto; width: 100%;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.a11y-content h1 {
  font-size: clamp(1.7rem, 5vw, 2.2rem); margin-top: 0.4rem;
}
.a11y-content h2 {
  font-size: clamp(1.2rem, 3.4vw, 1.5rem); margin-top: 1.2rem;
  color: var(--magenta);
}
.a11y-content h3 {
  font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-dim); margin-top: 0.6rem;
}
.a11y-content p { font-size: 1rem; line-height: 1.65; color: var(--text); max-width: 34em; }
/* Párrafo que se está leyendo en voz alta en este momento. */
.a11y-content .is-reading {
  outline: 2px solid var(--magenta); outline-offset: 6px; border-radius: 4px;
  background: rgba(245, 1, 249, 0.08);
}

/* La entrada de la portada la hace CSS, no el bucle de render: así la primera
   pantalla se ve aunque el navegador estrangule el requestAnimationFrame.
   Las animaciones ganan a los estilos en línea mientras corren, y `both` deja
   el estado final — que es exactamente el que escribe el render. */
@keyframes pw-rise {
  from { transform: translate3d(0, 116%, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes beat-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.beat--hero .pw-i {
  animation: pw-rise 1.05s cubic-bezier(0.16, 0.84, 0.24, 1) both;
  animation-delay: calc(0.2s + var(--i, 0) * 0.085s);
}
@keyframes fade-in-only {
  from { opacity: 0; }
  to { opacity: 1; }
}
.beat--hero .beat-eyebrow { animation: beat-in 0.8s var(--ease) both; }
.beat--hero .hero-lockup { animation: beat-in 1s var(--ease) 0.15s both; }
.beat--hero .beat-subtitle { animation: beat-in 0.9s var(--ease) 0.55s both; }
.beat--hero .beat-text { animation: beat-in 0.9s var(--ease) 0.7s both; }
/* Sin desplazamiento: aquí `transform` es lo que sostiene el centrado. */
.beat--hero .beat-indicator { animation: fade-in-only 0.9s var(--ease) 1.1s both; }

@media (prefers-reduced-motion: reduce) {
  .beat--hero .pw-i, .beat--hero .beat-eyebrow, .beat--hero .hero-lockup,
  .beat--hero .beat-subtitle, .beat--hero .beat-text, .beat--hero .beat-indicator {
    animation: none;
  }
}

/* ==========================================================================
   FONDOS GRÁFICOS — el recorrido sin un solo archivo de media
   Cada escena tiene su propio tono, derivado de su posición en la ruta (--h,
   de 0 a 1): azul en las primeras paradas, magenta en las últimas. Así las
   doce escenas no se confunden entre sí y el degradado de marca recorre la
   pieza entera de principio a fin.
   ========================================================================== */
.bg-gfx {
  position: absolute; inset: 0; opacity: 0;
  transform-origin: center 60%;
  /* Mezcla de los dos extremos del degradado de marca según --h. */
  --tint: color-mix(in oklab, var(--blue) calc((1 - var(--h)) * 100%), var(--magenta));
}

/* Vista aérea: el río cruzando el encuadre en diagonal. */
.bg-gfx--aerial {
  background:
    radial-gradient(58% 42% at 22% 18%, color-mix(in oklab, var(--tint) 34%, transparent), transparent 70%),
    radial-gradient(66% 50% at 84% 76%, rgba(11, 75, 99, 0.5), transparent 72%),
    linear-gradient(118deg,
      #050818 0%, #0a1030 26%,
      color-mix(in oklab, var(--tint) 26%, #0a1030) 48%,
      #0a1030 70%, #050818 100%),
    var(--near-black);
}
/* La banda del agua, que es lo que da la lectura de "esto es un río".
   Sin filter: blur — doce escenas con un desenfoque a pantalla completa
   ahogan al compositor. El difuminado lo dan las propias paradas del
   degradado, que no cuesta nada. */
.bg-gfx--aerial::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(104deg,
    transparent 30%,
    color-mix(in oklab, var(--tint) 18%, transparent) 40%,
    color-mix(in oklab, var(--tint) 40%, transparent) 46%,
    rgba(73, 79, 255, 0.2) 50%,
    color-mix(in oklab, var(--tint) 34%, transparent) 55%,
    color-mix(in oklab, var(--tint) 14%, transparent) 62%,
    transparent 70%);
}

/* A bordo: plano cerrado, más cálido y más bajo — se ha descendido. */
.bg-gfx--interior {
  background:
    radial-gradient(70% 58% at 50% 108%, color-mix(in oklab, var(--tint) 30%, transparent), transparent 68%),
    radial-gradient(40% 34% at 16% 12%, rgba(134, 38, 252, 0.26), transparent 70%),
    linear-gradient(180deg, #04060f 0%, #0b1026 52%, #0e0a22 100%),
    var(--near-black);
}
.bg-gfx--interior::after {
  content: ""; position: absolute; inset: 0;
  /* Las tablas de la cubierta, insinuadas. */
  background: repeating-linear-gradient(92deg,
    rgba(245, 246, 255, 0.045) 0 2px, transparent 2px 54px);
  mask-image: linear-gradient(180deg, transparent 44%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 44%, #000 100%);
}

.bg-gfx--closing {
  /* La imagen se asigna desde script.js. El velo oscuro sube el contraste del
     texto y de los logos sin perder el trazo del río. */
  background-color: #060a1e;
  background-size: cover; background-position: 50% 50%; background-repeat: no-repeat;
}
.bg-gfx--closing::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(80% 70% at 50% 50%, rgba(6, 10, 30, 0.72), rgba(6, 10, 30, 0.45) 70%),
    linear-gradient(180deg, rgba(6, 10, 30, 0.55), rgba(9, 10, 79, 0.35) 55%, rgba(6, 10, 30, 0.7));
}

/* ==========================================================================
   EL VUELO SIN VIDEO
   Cielo, río y calima en tres capas. El bucle de render desplaza y acerca el
   río según el progreso (--descend), de modo que el descenso se sigue leyendo
   como un vuelo continuo y no como un fondo quieto.
   ========================================================================== */
.flight-stage--gfx .flight-media { --descend: 0; }

.gfx-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, #1b1147 0%, #0a0c26 46%, #050815 100%),
    var(--near-black);
}
.gfx-sky::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(50% 34% at 50% 6%, rgba(134, 38, 252, 0.3), transparent 70%);
}

.gfx-river {
  position: absolute; left: 50%; top: 34%;
  width: 190%; height: 150%;
  transform: translate3d(-50%, 0, 0);
  transform-origin: 50% 20%;
  will-change: transform;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(73, 79, 255, 0.4), transparent 72%),
    linear-gradient(180deg, rgba(11, 75, 99, 0.55) 0%, rgba(9, 10, 79, 0.9) 60%, #060a1e 100%);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
}
.gfx-bank {
  position: absolute; top: 0; bottom: 0; width: 34%;
  background: linear-gradient(180deg, rgba(6, 10, 30, 0.2), rgba(6, 10, 30, 0.92));
}
.gfx-bank--l { left: -6%; border-radius: 0 46% 0 0; }
.gfx-bank--r { right: -6%; border-radius: 46% 0 0 0; }
/* El brillo del agua: lo único que se mueve por su cuenta, muy despacio. */
.gfx-shimmer {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(96deg,
    rgba(245, 246, 255, 0.05) 0 3px, transparent 3px 46px);
  mask-image: radial-gradient(60% 46% at 50% 46%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(60% 46% at 50% 46%, #000 10%, transparent 72%);
  animation: shimmer 26s linear infinite;
}
@keyframes shimmer {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-46px, 0, 0); }
}

/* Calima: se abre conforme se desciende, de modo que al final del vuelo el
   aire está más limpio que al principio. */
.gfx-haze {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(6, 10, 30, calc(0.55 - var(--descend) * 0.3)) 0%,
    transparent 42%,
    rgba(6, 10, 30, 0.6) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .gfx-shimmer { animation: none; }
}

/* ==========================================================================
   MOVIMIENTO REDUCIDO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .pt,
.flight-media { animation: none !important; }
  .flight-stage, .flight-video { filter: none; }
}

/* ==========================================================================
   TELÉFONO — lo que se apaga y por qué
   La ruta se abre desde un QR en el muelle: el dispositivo típico es un
   teléfono de gama media con datos móviles y sol de frente. Todo lo que
   compone capas de más se retira, y lo que queda gana contraste y tamaño.
   ========================================================================== */
@media (max-width: 899px) {
  /* El riel del mapa ya no ocupa columna: el mapa es una lámina. Ese espacio
     se devuelve al texto, que es lo que se viene a leer. */
  :root { --rail-w: 0px; --gutter: 5.5vw; }
  .stop-label { left: 5.5vw; }

  /* El grano es una textura a pantalla completa en mix-blend-mode: overlay.
     Fuerza al compositor a rehacer la capa entera en cada fotograma de
     scroll. En un teléfono no vale lo que cuesta. */
  .fg-grain { display: none; }
  .fg-vignette { background: radial-gradient(130% 100% at 50% 45%, rgba(6, 8, 20, 0) 48%, rgba(6, 8, 20, 0.55) 100%); }

  /* Sin desenfoque por velocidad: un filter: blur sobre video a pantalla
     completa es el efecto más caro de toda la página. */
  .flight-stage, .video-stack, .stage-media { filter: none !important; }

  /* Menos capas con will-change = menos memoria de GPU reservada. */
  .stage-media, .bg-video { will-change: opacity; }

  .planchon-phase { bottom: 4.4rem; right: 5.5vw; }
  .planchon-phase .title { font-size: clamp(1.5rem, 7vw, 2.1rem); }
  .planchon-phase .text { font-size: 0.9rem; }
  /* En teléfono la ficha sí puede necesitar scroll propio: tres textos no
     caben en 390px de ancho. Se limita a la altura útil y se toca. */
  

  .lay-frame .stage-media { inset: calc(var(--header-h) + 2vh) 5.5vw 50vh 5.5vw; }
  .lay-center .planchon-phase,
  .lay-center .stage-numeral { left: 50%; }
  .lay-center .planchon-phase { width: min(88vw, 560px); }

  /* La ficha es lo único con scroll propio: hay que poder tocarla. */
  .stage-content { pointer-events: none; }
  
}

@media (max-width: 560px) {
  .icon-btn__lbl-long { display: none; }
  .hero-logo { width: min(84vw, 420px); }
}

/* ==========================================================================
   NIVELES DE CALIDAD — `html[data-tier]` lo escribe script.js
     full      escritorio con recursos: todo encendido.
     standard  teléfono / tableta / equipo justo: sin grano ni partículas.
     lite      ahorro de datos, red 2G, poca memoria, o un equipo que se
               arrastra (script.js baja de nivel solo si mide fotogramas
               lentos mientras se hace scroll): además sin desenfoques,
               sombras de brillo ni animaciones de fondo. Es el diseño sin
               efectos, no una versión rota: se lee y se navega igual.
   ========================================================================== */
html[data-tier="standard"] .fg-grain,
html[data-tier="lite"] .fg-grain,
html[data-tier="standard"] .fg-particles,
html[data-tier="lite"] .fg-particles { display: none; }

html[data-tier="lite"] * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-tier="lite"] .wire-path,
html[data-tier="lite"] .wire-wrap.is-neon,
html[data-tier="lite"] .river-progress,
html[data-tier="lite"] .river-node.is-active,
html[data-tier="lite"] .v360-marker,
html[data-tier="lite"] .beat-title--hero,
html[data-tier="lite"] .hero-logo { filter: none !important; }
html[data-tier="lite"] .vec-scan { box-shadow: none !important; }
html[data-tier="lite"] .flight-media,
html[data-tier="lite"] .gfx-shimmer,
html[data-tier="lite"] .pt { animation: none !important; }
/* Sin desenfoque, un fondo translúcido se lee peor: se hace algo más opaco. */
html[data-tier="lite"] .icon-btn,
html[data-tier="lite"] .stop-label,
html[data-tier="lite"] .know-more-btn { background: rgba(6, 10, 30, 0.86); }
html[data-tier="lite"] .plan-detail { background: rgba(3, 4, 14, 0.94); }

/* ==========================================================================
   VIDEO 360° — toma cuadrada (1:1) que se recorta según la pantalla.
   `cover` llena el escenario: en escritorio (apaisado) se ve la franja
   central; en móvil (vertical) la columna central. El punto focal se puede
   mover con --v360-focus (0–100 %, horizontal). Mientras gira con el scroll,
   la cámara barre los 360° y el recorte siempre queda centrado en ella.
   ========================================================================== */
.stage-360 .v360-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--v360-focus, 50%) 50%;
  background: var(--near-black);
}
.stage-360.has-video .v360-dial { display: none; }
.stage-360.has-video::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(6, 10, 30, 0.82), rgba(6, 10, 30, 0) 46%),
              linear-gradient(to bottom, rgba(6, 10, 30, 0.5), rgba(6, 10, 30, 0) 22%);
}
.planchon-pin > .bg-video--model { z-index: 1; pointer-events: none; }

/* Panel "Saber más": texto corrido, sin imágenes. */
.plan-detail__prose { display: flex; flex-direction: column; gap: 1rem; max-width: 62ch; }
.plan-detail__prose p { color: var(--text); font-size: 1.02rem; line-height: 1.7; margin: 0; }

/* Cierre con los tres párrafos completos: en pantallas bajas se compacta. */
.closing-pin .scene-card .text { line-height: 1.55; }
@media (max-height: 760px) {
  .closing-pin { padding-top: 3.4rem; padding-bottom: 0.8rem; }
  .closing-pin .scene-card { gap: 0.45rem; }
  .closing-pin .scene-card .title { font-size: clamp(1.25rem, 5.4vw, 1.9rem); }
  .closing-pin .scene-card .text { font-size: 0.76rem; line-height: 1.4; }
  .closing-logos { margin-top: 0.6rem; padding-top: 0.7rem; gap: 0.6rem 1.1rem; }
  .closing-logos__item.is-xenda img { height: 38px; }
  .closing-logos__item.is-wide img { height: 32px; }
}

/* Aviso pequeño: el modelo 3D y el 360° giran con el scroll. */
.scroll-hint {
  margin: 0.15rem 0 0; font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim);
}
.scroll-hint::before { content: "↕"; color: var(--magenta); margin-right: 0.55em; }
.lay-center .scroll-hint { text-align: center; }

.closing-pin > .bg-gfx--closing { position: absolute; inset: 0; z-index: 0; }
.closing-pin > .scene-card { position: relative; z-index: 1; }

/* ==========================================================================
   PANTALLA DE CARGA
   ========================================================================== */
html.is-loading, html.is-loading body { overflow: hidden; }
.loader {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(90% 70% at 50% 30%, #12144f 0%, #060a1e 70%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 2rem var(--gutter); }
.loader__mark { width: 104px; height: auto; animation: loader-float 2.4s ease-in-out infinite; filter: drop-shadow(0 12px 28px rgba(245, 1, 249, 0.35)); }
.loader__bar { width: min(260px, 66vw); height: 3px; border-radius: 3px; background: rgba(245, 246, 255, 0.14); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--brand-gradient); transition: width 0.25s linear; }
.loader__pct { margin: 0; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; color: var(--text-dim); font-variant-numeric: tabular-nums; }
/* Al terminar: el isotipo sube y se desvanece con el fondo. */
.loader.is-done .loader__inner { transform: translateY(-14px) scale(1.04); transition: transform 0.7s var(--ease); }
@keyframes loader-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
/* La entrada de la portada espera a que el usuario pulse "Entrar". */
html.is-loading .beat--hero *, html.is-loading .beat--hero { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .loader__mark { animation: none; } }

/* El desenfoque de fondo sobre video en movimiento es de lo más caro para una
   GPU integrada: solo en el nivel "full". */
html[data-tier="standard"] .know-more-btn, html[data-tier="lite"] .know-more-btn,
html[data-tier="standard"] .icon-btn, html[data-tier="lite"] .icon-btn {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.debug-hud {
  position: fixed; left: 8px; bottom: 8px; z-index: 2000; padding: 6px 9px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.78); color: #9fffb0; font: 11px/1.45 ui-monospace, Consolas, monospace;
  pointer-events: none; white-space: pre;
}

/* ==========================================================================
   ¿SABÍAS QUE...? — texto grande que se ilumina con el scroll
   ========================================================================== */
.phase-interior .phase-inner { max-width: min(560px, 100%); }
.dato { position: relative; isolation: isolate; padding-left: 1.3rem; }
.dato::before {                               /* filo vertical de marca */
  content: ""; position: absolute; left: 0; top: 0.2rem; bottom: 0.2rem; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--magenta), var(--violet) 60%, var(--blue));
  box-shadow: 0 0 18px rgba(245, 1, 249, 0.6);
}
.dato::after {                                /* signo gigante de contorno */
  content: "?"; position: absolute; z-index: -1; right: 0; top: -0.5em;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(6rem, 24vw, 13rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(245, 1, 249, 0.38);
}
.dato__scrim {                                /* velo suave para leer sobre el video */
  position: absolute; z-index: -2; inset: -2.2rem -2rem -2rem -2.4rem; pointer-events: none;
  background: radial-gradient(closest-side, rgba(6, 10, 30, 0.78), rgba(6, 10, 30, 0.5) 65%, rgba(6, 10, 30, 0));
}
.dato__kicker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem 0.7rem; margin-bottom: 0.85rem;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--magenta);
}
.dato__kicker em { font-style: normal; color: var(--text-dim); }
.dato__kicker em::before { content: "·"; margin-right: 0.7rem; color: var(--text-faint); }
.dato__ring {
  position: relative; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--brand-gradient); color: #0a0714; font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  animation: dato-pulse 2.2s ease-out infinite;
}
.dato__ring i { font-style: normal; }
@keyframes dato-pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 1, 249, 0.55); } 70%, 100% { box-shadow: 0 0 0 0.9rem rgba(245, 1, 249, 0); } }
.dato__text {
  margin: 0; font-family: var(--font-display); font-weight: 600; color: #fff;
  font-size: clamp(1.02rem, 1.9vw, 1.4rem); line-height: 1.4; text-shadow: 0 2px 20px rgba(6, 10, 30, 0.7);
}
.dw { display: inline; opacity: 0.22; }
.dw--q { color: var(--magenta); }
.dato__rule { height: 2px; margin-top: 1.1rem; background: rgba(245, 246, 255, 0.16); border-radius: 2px; overflow: hidden; }
.dato__rule span { display: block; height: 100%; background: var(--brand-gradient); transform: scaleX(0); transform-origin: left; }
@media (max-width: 560px) { .dato { padding-left: 1rem; } .dato__text { font-size: 0.98rem; } }
html[data-tier="lite"] .dato__ring { animation: none; }
body.a11y-mode .dw { opacity: 1; }

/* ==========================================================================
   MÓVIL ESTRECHO — el texto se sube para no pisar el HUD (coordenadas, altura,
   ruta), que ocupa la esquina inferior derecha.
   ========================================================================== */
@media (max-width: 899px) {
  .planchon-phase, .lay-center .planchon-phase.phase-v360 { bottom: 6rem; }
}

/* Pantallas bajas (teléfonos pequeños): textos y espacios más compactos. */
@media (max-width: 899px) and (max-height: 640px) {
  .planchon-phase .text { font-size: 0.8rem; line-height: 1.4; }
  .planchon-phase .title { font-size: 1.3rem; }
  .planchon-phase .subtitle { font-size: 0.82rem; }
  .planchon-phase { gap: 0.4rem; }
  .know-more-btn { min-height: 40px; margin-top: 0.3rem; }
  .dato__text { font-size: 0.9rem; }
  .journey-beat .beat-text { font-size: 0.84rem; line-height: 1.42; }
}

/* Teléfono en horizontal (~360 px de alto): el texto se ensancha en vez de
   crecer hacia arriba, y se retira lo accesorio. */
@media (max-height: 480px) and (orientation: landscape) {
  .hud-readout { display: none; }
  .planchon-phase, .lay-center .planchon-phase.phase-v360 { bottom: 0.9rem; max-width: min(78vw, 640px); }
  .planchon-phase .tag { font-size: 0.55rem; }
  .planchon-phase .title { font-size: 1.1rem; }
  .planchon-phase .subtitle { display: none; }
  .planchon-phase .text { font-size: 0.74rem; line-height: 1.38; }
  .know-more-btn { min-height: 34px; padding: 0 0.9rem; font-size: 0.74rem; }
  .dato__text { font-size: 0.82rem; }
  .dato__kicker { margin-bottom: 0.4rem; }
  .journey-beat .beat-text { font-size: 0.78rem; line-height: 1.38; }
  .closing-pin .scene-card { max-width: min(86vw, 700px); }
}

/* ==========================================================================
   MÓVIL — ajustes tras revisar capturas
   ========================================================================== */
.icon-btn .icon-btn__ear { display: none; }
@media (max-width: 560px) {
  
  .icon-btn--text { width: 38px; padding: 0; }
  .icon-btn .icon-btn__ear { display: block; }
}
@media (max-width: 899px) {
  /* Datos del HUD: una franja fina en el borde inferior, en vez de una
     esquina que se monta sobre el texto. */
  .hud-readout {
    left: 0; right: 0; bottom: 0; min-width: 0; z-index: 58;
    flex-direction: row; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.6rem var(--gutter) calc(0.5rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(6, 10, 30, 0.88), rgba(6, 10, 30, 0));
    font-size: 0.56rem; text-align: left;
  }
  .hud-row { gap: 0.35rem; justify-content: flex-start; }
  .hud-row:first-child .hud-key { display: none; }
  .hud-bar { position: absolute; left: 0; right: 0; top: 0; margin: 0; width: auto; }
  .beat-indicator { bottom: 3.6rem; }
  .site-header { height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  /* Hoja del mapa: el título y el botón de cerrar respiran respecto a la lista. */
  .river-map__head { padding: 0.7rem 1.1rem 0.8rem; border-bottom: 1px solid rgba(245, 246, 255, 0.1); margin-bottom: 0.3rem; }
}

/* Mapa de puntos en escritorio: clicable, con el nombre al pasar. */
.river-hit { fill: transparent; pointer-events: all; cursor: pointer; outline: none; }
.river-hit:focus-visible { stroke: var(--magenta); stroke-width: 1.5; }
.river-map svg { pointer-events: none; }
.river-tip {
  position: fixed; z-index: 70; transform: translateY(-50%); padding: 0.32rem 0.7rem; border-radius: 999px;
  background: rgba(6, 10, 30, 0.88); border: 1px solid rgba(245, 246, 255, 0.2); color: var(--text);
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.river-tip.is-on { opacity: 1; }
@media (max-width: 899px) { .river-tip { display: none; } }

/* ==========================================================================
   FOTOS DE LA INTRODUCCIÓN, INDICADOR DE SCROLL, PLANOS Y AMPLIACIÓN
   ========================================================================== */

/* Fotos de archivo del recorrido: SIN recortar (proporción original); se limita
   el alto, no el encuadre. */
.beat-photo {
  display: block; width: fit-content; max-width: 100%; margin: 0.2rem 0 0.1rem;
  border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(245, 246, 255, 0.22); box-shadow: 0 14px 40px rgba(3, 4, 14, 0.55);
}
.beat-photo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 27vh; object-fit: contain; filter: saturate(0.9) contrast(1.04); }
@media (min-width: 900px) {
  .beat-photo img { max-height: 250px; }
  .beat--side.beat--right .beat-photo { align-self: flex-end; }
}
@media (max-width: 899px) and (max-height: 700px) { .beat-photo img { max-height: 25vh; } }
@media (max-width: 899px) and (max-height: 600px) { .beat-photo img { max-height: 19vh; } }
@media (max-height: 480px) and (orientation: landscape) { .beat-photo { display: none; } }

/* Indicador de scroll: ratón en escritorio, dedo en móvil/táctil. Lo decide el
   CSS con el ancho y el puntero de cada momento (no el JS al cargar). */
.scroll-indicator__finger, .si-touch { display: none; }
.scroll-indicator__finger {
  color: rgba(245, 246, 255, 0.85); filter: drop-shadow(0 2px 8px rgba(3, 4, 14, 0.7));
  animation: finger-swipe 1.8s var(--ease) infinite;
}
.scroll-indicator__finger svg { display: block; }
.scroll-indicator__dot { animation: mouse-wheel 1.8s var(--ease) infinite; }
@media (max-width: 899px), (hover: none) and (pointer: coarse) {
  .scroll-indicator__mouse, .si-desktop { display: none; }
  .scroll-indicator__finger { display: block; }
  .si-touch { display: inline; }
}
@keyframes finger-swipe {
  0% { transform: translateY(12px); opacity: 0.2; }
  20% { opacity: 1; }
  75% { transform: translateY(-14px); opacity: 1; }
  100% { transform: translateY(-18px); opacity: 0.2; }
}
@keyframes mouse-wheel {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  70% { transform: translateY(11px); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-indicator__finger, .scroll-indicator__dot { animation: none; }
}

/* Planos en "Saber más": hojas claras (dibujo de línea sobre blanco) */
.planos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.plano { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.plano--perspectiva { grid-column: 1 / -1; }
.plano__btn {
  padding: 0.5rem; border: 0; border-radius: 10px; background: #fff; cursor: zoom-in;
  display: grid; place-items: center; box-shadow: 0 8px 26px rgba(3, 4, 14, 0.4);
}
.plano__btn img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.plano--planta .plano__btn img { max-height: 420px; }
.plano figcaption { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
@media (max-width: 560px) { .planos { grid-template-columns: 1fr; } }

/* Plano ampliado */
.lightbox {
  position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.7rem; padding: 3.6rem 1rem 1.2rem;
  background: rgba(3, 4, 14, 0.92); opacity: 0; transition: opacity 0.2s var(--ease); cursor: zoom-out;
}
.lightbox.is-open { opacity: 1; }
.lightbox__sheet { background: #fff; border-radius: 10px; padding: 0.6rem; max-width: 100%; max-height: calc(100dvh - 8rem); display: grid; place-items: center; }
.lightbox__sheet img { display: block; max-width: 100%; max-height: calc(100dvh - 9.5rem); width: auto; height: auto; object-fit: contain; }
.lightbox__cap { margin: 0; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.lightbox__close {
  position: absolute; top: 0.8rem; right: 0.8rem; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(245, 246, 255, 0.3); background: rgba(9, 10, 79, 0.7); color: var(--text); cursor: pointer; font-size: 1rem;
}

/* ==========================================================================
   CALIDAD, RECORRIDO AUTOMÁTICO, AVISO Y PÓSTER DE FONDO
   ========================================================================== */
.bg-gfx--poster { background-size: cover; background-position: center; background-repeat: no-repeat; }

/* Recorrido automático: play / pausa */
.icon-btn .auto-pause { display: none; }
.icon-btn[aria-pressed="true"] .auto-pause { display: block; }
.icon-btn[aria-pressed="true"] .auto-play { display: none; }
#autoToggle[aria-pressed="true"] { border-color: var(--magenta); color: var(--magenta); }
.auto-chip {
  height: 30px; min-width: 38px; padding: 0 0.6rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--magenta); background: rgba(6, 10, 30, 0.7); color: var(--text);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
}
body.a11y-mode #autoToggle, body.a11y-mode #autoSpeed { display: none; }
#qualityToggle[aria-pressed="true"] { border-color: var(--magenta); }

/* Menú de calidad */
.q-menu {
  position: fixed; z-index: 62; top: calc(var(--header-h) - 4px); right: 4vw; width: min(360px, 92vw);
  padding: 0.3rem 0 0.5rem; border-radius: 16px; border: 1px solid rgba(245, 246, 255, 0.18);
  background: linear-gradient(180deg, rgba(9, 10, 79, 0.97), rgba(6, 10, 30, 0.98));
  box-shadow: 0 24px 70px rgba(3, 4, 14, 0.65);
  opacity: 0; transform: translateY(-8px); transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.q-menu.is-open { opacity: 1; transform: none; }
.q-menu__head { padding: 0.8rem 1.1rem 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.q-opt { display: flex; gap: 0.8rem; width: 100%; padding: 0.7rem 1.1rem; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.q-opt:hover, .q-opt:focus-visible { background: rgba(134, 38, 252, 0.26); outline: none; }
.q-opt__dot { flex: none; width: 16px; height: 16px; margin-top: 0.2rem; border-radius: 50%; border: 2px solid rgba(245, 246, 255, 0.4); }
.q-opt[aria-checked="true"] .q-opt__dot { border-color: var(--magenta); background: radial-gradient(circle, var(--magenta) 0 45%, transparent 50%); }
.q-opt__body { display: flex; flex-direction: column; gap: 0.15rem; }
.q-opt__name { font-weight: 700; font-size: 0.95rem; }
.q-opt__name em { margin-left: 0.5rem; font-style: normal; font-weight: 600; font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: #0a0714; background: var(--brand-gradient); padding: 0.12rem 0.5rem; border-radius: 999px; }
.q-opt__desc { font-size: 0.78rem; color: var(--text-dim); line-height: 1.4; }
.q-opt__mb { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-faint); }
.q-menu__note { margin: 0.4rem 1.1rem 0.2rem; font-size: 0.7rem; color: var(--text-faint); }

/* Aviso de rendimiento */
.toast {
  position: fixed; z-index: 70; left: 50%; bottom: 3.4rem; width: min(440px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; border-radius: 14px;
  background: rgba(9, 10, 79, 0.96); border: 1px solid rgba(245, 246, 255, 0.22); box-shadow: 0 16px 50px rgba(3, 4, 14, 0.6);
  font-size: 0.82rem; opacity: 0; transform: translate(-50%, 10px); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast span { flex: 1; }
.toast__act { flex: none; min-height: 36px; padding: 0 0.9rem; border: 0; border-radius: 999px; cursor: pointer; background: var(--brand-gradient); color: #0a0714; font-weight: 700; }
.toast__x { flex: none; width: 32px; height: 32px; border: 0; background: none; color: var(--text-dim); cursor: pointer; }
@media (max-width: 899px) { .q-menu { right: 3vw; } }

/* Foco visible para quien navega con teclado (Tab): un aro de marca en todo lo
   interactivo. Solo aparece con teclado, no al hacer clic. */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 6px;
}
.icon-btn:focus-visible, .know-more-btn:focus-visible, .auto-chip:focus-visible, .toast__act:focus-visible { border-radius: 999px; }
.river-hit:focus-visible { outline: none; }
.q-opt:focus-visible { outline-offset: -2px; }
