/* ============================================================
   balng — Valentino Gómez
   Negro profundo, Hubot Sans ancha y pesada para display, Mona Sans
   para texto, Geist Mono para etiquetas. Un solo acento (naranja
   señal) en tres roles: palabras clave, progreso y estados activos.
   El 3D vive en un canvas fijo detrás de todo (ver src/scene.js).
   ============================================================ */

@font-face {
  font-family: "Hubot Sans";
  src: url("../fonts/hubot-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
/* El 0 de Hubot Sans lleva una barra horizontal (se lee como una theta):
   los dígitos salen de Mona Sans, su compañera, que tiene un 0 limpio.
   Se declara después, así gana para U+0030–0039. (Sin tabular-nums: el
   0 tabular de Mona Sans va tachado.) */
@font-face {
  font-family: "Hubot Sans";
  src: url("../fonts/mona-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0030-0039;
}
@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/mona-sans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #050505;
  --fg: #f3f1ec;
  --fg-2: #bebcb6;
  --fg-3: #8a8990;
  --line: rgba(243, 241, 236, 0.1);
  --line-2: rgba(243, 241, 236, 0.2);
  --accent: #ff5a1f;
  --on-accent: #0a0a0a;

  --display: "Hubot Sans", "Mona Sans", system-ui, sans-serif;
  --text: "Mona Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* la mono en mayúsculas queda solo para datos (unidades, pasos,
     coordenadas); el resto del texto chico va en Mona, en minúscula */
  --label-size: 12px;
  --label: 500 var(--label-size) / 1.4 var(--mono);
  --label-ls: 0.14em;
  --small: 450 15px / 1.45 var(--text);

  --pad: clamp(20px, 4vw, 48px);
  --gap: clamp(120px, 15vh, 170px); /* aire entre secciones, siempre el mismo */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.menu-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.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;
}

.skip {
  position: fixed;
  left: 50%;
  top: -80px;
  z-index: 120;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: var(--small);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip:focus { top: 14px; }

/* ---------- capa 3D ---------- */

.gl {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.ready .gl { opacity: 1; }
/* sin WebGL: el mismo lienzo fijo hace de fondo de respaldo */
.no-gl .gl {
  opacity: 1;
  background: radial-gradient(70% 55% at 50% 35%, rgba(255, 90, 31, 0.14), transparent 70%);
}

main,
.foot {
  position: relative;
  z-index: 1;
}

/* etiqueta que sigue a la señal de Buenos Aires (el JS la ubica sobre
   la proyección del punto); solo en el hero */
.geotag { display: none; }
.booted .geotag {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
}
/* atmósfera: un resplandor muy suave alrededor de la señal (escritorio,
   que es donde está la etiqueta); el halo del shader es el núcleo */
.booted .geotag::before {
  content: "";
  position: absolute;
  left: -80px;
  top: -80px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 90, 31, 0.11), rgba(255, 90, 31, 0.04) 55%, rgba(255, 90, 31, 0));
  mix-blend-mode: screen;
  pointer-events: none;
}
.geotag-lead {
  position: absolute;
  left: -2px;
  top: -2px;
  width: 92px;
  height: 28px;
  overflow: visible;
}
.geotag-lead path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.geotag-text {
  position: absolute;
  left: 98px;
  top: 24px;
  transform: translateY(-50%);
  white-space: nowrap;
  font: var(--label);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--fg);
  text-shadow: 0 0 10px var(--bg), 0 0 4px var(--bg);
}
.geotag-coord { margin-left: 12px; color: var(--fg-2); }
.geotag-lead .lead-m { display: none; }
/* si a la derecha choca con el título o no entra, va espejada */
.geotag.flip .geotag-lead { transform: scaleX(-1); transform-origin: 2px 2px; }
.geotag.flip .geotag-text { left: auto; right: 98px; text-align: right; }
main { overflow-x: clip; }

/* scrim: un velo oscuro y difuso detrás del texto chico que cae sobre
   las partículas, para que se lea sin apagar la escena entera */
.scrim {
  position: relative;
  isolation: isolate;
}
.scrim::before {
  content: "";
  position: absolute;
  inset: -60% -22%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(5, 5, 5, 0.9) 55%, rgba(5, 5, 5, 0));
}
.hero-kicker.scrim::before { inset: -60% -24%; }
/* El velo se extiende fuera de su caja y, como .scrim está posicionado,
   se pinta después de los hermanos: lo protagonista va por encima. */
.row-num,
.idx-row h3,
.tray-item h3,
.tray-year {
  position: relative;
  z-index: 1;
}

/* ---------- intro ---------- */

.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.15s var(--ease-io);
}
.ready .loader { clip-path: inset(0 0 100% 0); pointer-events: none; }
.no-boot .loader { display: none; }

.loader-word {
  position: relative;
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(44px, 9vw, 120px);
  line-height: 1;
  letter-spacing: -0.05em;
  /* trazo + relleno del color del fondo: tapa los contornos internos
     que una fuente variable deja ver cuando solo se pinta el trazo */
  color: var(--bg);
  -webkit-text-stroke: 2px var(--line-2);
  paint-order: stroke fill;
}
.loader-word::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--fg);
  -webkit-text-stroke: 2px var(--fg);
  paint-order: stroke fill;
  clip-path: inset(calc((1 - var(--lp, 0)) * 100%) 0 -0.3em 0);
}

/* ---------- navegación: pastilla flotante ---------- */

.nav {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none; /* el hueco alrededor de la pastilla no bloquea clicks */
}
.js .nav { opacity: 0; transform: translateY(-14px); }
.js:not(.ready) .nav { visibility: hidden; }
.ready .nav {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s ease 0.8s, transform 1.1s var(--ease-out) 0.8s;
}
.no-intro .nav { transition-delay: 0.1s; }
/* si el foco llega mientras aparece, se ve de inmediato */
.nav:focus-within { opacity: 1; transform: none; transition: none; }

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  padding: 4px 4px 4px 20px;
  border: 1px solid rgba(243, 241, 236, 0.12);
  border-radius: 999px;
  background: rgba(14, 14, 15, 0.8);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav-mark {
  margin-right: 14px;
  padding: 14px 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--fg);
}
/* escritorio: con el wordmark gigante en pantalla, la marca de la pastilla
   sobra; aparece cuando el título se fue (.docked, desde el JS) */
@media (min-width: 861px) {
  .booted .nav-pill { padding-left: 4px; transition: padding 0.5s var(--ease-out); }
  .booted .nav-mark {
    max-width: 0;
    margin-right: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-width 0.5s var(--ease-out), margin 0.5s var(--ease-out), opacity 0.3s ease,
      visibility 0s linear 0.5s;
  }
  .booted .nav.docked .nav-pill { padding-left: 20px; }
  .booted .nav.docked .nav-mark {
    max-width: 90px;
    margin-right: 14px;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
}
.nav-links { display: flex; }
.nav-links a,
.nav-cta,
.nav-menu {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font: 500 14px/1 var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.nav-links a { color: var(--fg-2); }
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current="true"] {
  color: var(--fg);
  background: rgba(243, 241, 236, 0.1);
}
.nav-cta {
  margin-left: 4px;
  background: var(--fg);
  color: var(--bg);
}
.nav-cta:hover,
.nav-cta[aria-current="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* pausa de las animaciones (WCAG 2.2.2) */
.nav-pause {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: 12px;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-2);
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.nav-pause::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line-2);
}
.nav-pause:hover { color: var(--fg); background: rgba(243, 241, 236, 0.1); }
.nav-pause svg { width: 14px; height: 14px; }
.nav-pause .i-play,
.nav-pause[aria-pressed="true"] .i-pause { display: none; }
.nav-pause[aria-pressed="true"] .i-play { display: block; }

.nav-menu {
  display: none;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
}
.nav-menu[aria-expanded="true"] {
  color: var(--fg);
  background: rgba(243, 241, 236, 0.1);
}

/* menú a pantalla completa (móvil) */
.menu {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: grid;
  align-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 96px var(--pad) 48px;
  background: rgba(5, 5, 5, 0.96);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.menu.open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.menu nav { display: grid; gap: 4px; }
.menu a {
  padding: 6px 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(40px, 12vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  transform: translateY(18px);
  opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.4s ease;
}
.menu.open a { transform: none; opacity: 1; }
.menu.open a:nth-child(2) { transition-delay: 40ms; }
.menu.open a:nth-child(3) { transition-delay: 80ms; }
.menu.open a:nth-child(4) { transition-delay: 120ms; }
.menu.open a:nth-child(5) { transition-delay: 160ms; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  text-align: center;
  perspective: 1100px;
  touch-action: pan-y; /* el arrastre horizontal gira el globo; el vertical sigue siendo scroll */
}
/* el globo se arrastra con el mouse (y con el dedo) */
@media (hover: hover) and (pointer: fine) {
  .booted .hero { cursor: grab; }
  .dragging .hero { cursor: grabbing; }
}
.dragging { user-select: none; }

/* ---------- wordmark en 3D ---------- */
/* capas de la misma letra hacia atrás (la extrusión), cada una más oscura,
   y en la cara un brillo que sigue al puntero; con la inclinación del título
   se ve el canto. Se arma desde el JS (.wm3d); sin movimiento reducido o
   con colores forzados no existe. */
.wm3d .ch-in {
  position: relative;
  transform-style: preserve-3d;
}
.wm3d .ch-x {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  color: #4a4844;
  color: color-mix(in srgb, #a09d96, #0a0a0a calc(var(--k) * 10%));
  /* en em: el canto escala con la letra (en móvil es un tercio) */
  transform: translateZ(calc(var(--k) * -0.017em));
}
.wm3d .ch-x:last-child { text-shadow: 0 0.06em 0.1em rgba(0, 0, 0, 0.65); }
@media (hover: hover) and (pointer: fine) {
  .wm3d .ch-in {
    background-image: radial-gradient(
      55% 75% at var(--lx, 50%) var(--ly, 15%),
      #ffffff 0%,
      var(--fg) 32%,
      #d9d6ce 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .wm3d .ch-x { display: none; }
  .wm3d .ch-in { background: none; color: CanvasText; }
}
/* el texto arriba del nombre: Sudamérica queda libre debajo */
.hero-center {
  align-self: center;
  padding: 96px var(--pad) 24px;
}

.in-fade { display: inline-block; }
/* visible desde el primer pintado (cuenta para el LCP); solo se desliza */
.js .in-fade { transform: translateY(14px); }
.ready .in-fade {
  transform: none;
  transition: transform 1.2s var(--ease-out) 0.5s;
}
.no-intro .in-fade { transition-delay: 0.1s; }

.hero-kicker {
  display: flex;
  justify-content: center;
  align-items: center;
  /* del ancho del texto: el velo (.scrim) no cruza toda la pantalla */
  width: fit-content;
  margin-inline: auto;
  gap: 14px;
  font: var(--small);
  color: var(--fg-2);
  opacity: calc(1 - var(--hp, 0) * 3);
}
.hero-kicker > :first-child { color: var(--fg); font-weight: 600; }
.hero-kicker .sep {
  width: 22px;
  height: 1px;
  background: var(--line-2);
}

.hero-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(24px, 4.5vh, 48px);
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: min(25vw, 44vh);
  line-height: 0.8;
  letter-spacing: -0.05em;
  transform-style: preserve-3d;
}
/* Cada letra va en su span (para el 3D), así que el kerning de la fuente
   no actúa: se compensa a mano por par. La última letra sin tracking
   negativo, para que la tinta quede centrada. */
.hero-title .ch:nth-child(2) { margin-left: 0.04em; }
.hero-title .ch:nth-child(5) { margin-left: 0.02em; }
.hero-title .ch:last-child .ch-in { letter-spacing: 0; }

.ch {
  display: inline-block;
  text-align: center; /* el ancho de cada letra se fija en JS */
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
}
.ch-in {
  display: inline-block;
  transform:
    translate3d(
      calc((var(--i) - 2) * var(--hp, 0) * 90px),
      calc(var(--hp, 0) * -40px),
      calc(var(--hp, 0) * (170px + var(--i) * 70px))
    )
    rotateX(calc(var(--hp, 0) * -18deg));
  opacity: calc(1 - var(--hp, 0) * 2.2);
}
/* Entrada solo con transform (sin opacidad): el h1 cuenta como pintado
   desde el primer cuadro (LCP). El giro arranca cuando el telón ya destapó
   el título (~0,45 s después de .ready), así se ve entero; termina junto
   con la llegada de los puntos al globo. */
.js .ch { transform: translateY(42%) rotateX(-72deg); }
.ready .ch {
  transform: none;
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i) * 60ms + 440ms);
}
.no-intro.ready .ch { transition-delay: calc(var(--i) * 60ms + 80ms); }

.hero-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--pad) calc(26px + env(safe-area-inset-bottom, 0px));
  font: var(--small);
  font-size: 14px;
  color: var(--fg-3);
  opacity: calc(1 - var(--hp, 0) * 3);
}
.handle { color: var(--fg-2); }

/* ---------- secciones ---------- */

.sec {
  position: relative;
  padding: var(--gap) var(--pad);
}
.sec-head {
  max-width: 1280px;
  margin: 0 auto clamp(48px, 8vh, 88px);
  text-align: center;
}
.sec-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(42px, 7vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  word-spacing: 0.07em;
  text-wrap: balance;
}
/* los títulos de sección quedan chicos: las protagonistas son las cifras,
   las áreas y los años (el único display grande es "¿Hablamos?") */
#numeros .sec-title,
#areas .sec-title,
#trayectoria .sec-title {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

/* titulares: se desclasifican como el manifiesto, palabra por palabra
   (la barra se retrae y la palabra aparece debajo). Sin @property, la
   barra se va de una vez al final: el estado final es el mismo. */
@property --rh {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
.sw { display: inline-block; }
.sw-in {
  position: relative;
  display: inline-block;
}
.booted [data-split] .sw-in {
  /* background-clip: text solo pinta dentro de la caja: con este relleno
     (compensado con margen) entran la "¿" y los descendentes */
  padding: 0.1em 0.08em 0.3em;
  margin: -0.1em -0.08em -0.3em;
  color: transparent;
  /* el 0 de respaldo: sin @property (Safari < 16.4, Firefox < 128) --rh no
     tiene valor inicial y el degradé entero quedaba inválido (texto invisible) */
  background-image: linear-gradient(90deg, var(--fg) calc((1 - var(--rh, 0)) * 100%), transparent 0);
  -webkit-background-clip: text;
  background-clip: text;
  transition: --rh 0.7s var(--ease-out) calc(var(--i) * 90ms);
}
.booted [data-split] .sw-in::after {
  content: "";
  position: absolute;
  left: 0.05em;
  right: 0.05em;
  top: 0.4em;
  bottom: 0.46em;
  background: #1e1e21;
  transform-origin: 100% 50%;
  transform: scaleX(var(--rh, 0));
  pointer-events: none;
}
.booted [data-split]:not(.in) .sw-in { --rh: 1; }

.reveal { transition: opacity 1s ease, transform 1.2s var(--ease-out); }
.booted .reveal:not(.in) { opacity: 0; transform: translateY(28px); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: underline 1px var(--line-2);
  text-underline-offset: 6px;
  font: var(--small);
  color: var(--fg-2);
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.arrow-link:hover { color: var(--fg); text-decoration-color: var(--fg); }
.ico { width: 13px; height: 13px; flex: none; }

/* ---------- perfil: un texto censurado que se desclasifica ---------- */

.manifesto {
  position: relative;
  height: 230vh;
}
.manifesto-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-content: center;
  /* 1.4.12: si con el espaciado del usuario no entra, se alinea arriba en
     vez de salirse por los dos lados (y el principio quedaba fuera) */
  place-content: safe center;
  justify-items: center;
  padding: 64px var(--pad) 0;
  text-align: center;
  perspective: 1200px;
  isolation: isolate;
}
/* velo amplio detrás del bloque: la retícula queda visible en los bordes */
.manifesto-pin::before {
  content: "";
  position: absolute;
  inset: 12% 6%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(5, 5, 5, 0.5), rgba(5, 5, 5, 0));
}
.statement {
  max-width: 1120px;
  margin-top: 30px;
  font-family: var(--display);
  font-weight: 650;
  font-stretch: 100%;
  font-size: clamp(30px, 5.1vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.038em;
  word-spacing: 0.08em;
  text-wrap: balance;
}
.statement em {
  font-style: normal;
  color: var(--accent);
}
/* Cada palabra lleva una barra de censura a la altura x (::after) que se
   retrae hacia la derecha (--r: 1 tapada → 0 leída). El texto solo se pinta
   en la parte ya destapada (background-clip: text), así no se adivina
   la palabra por los ascendentes. */
.statement .wg {
  display: inline-block;
  white-space: nowrap; /* la palabra y su puntuación viajan juntas */
}
/* la frase de acento ("se rompen", "responsable") no se parte entre líneas */
.statement .wem { white-space: nowrap; }
.statement .w {
  position: relative;
  display: inline-block;
  color: transparent;
  background-image: linear-gradient(90deg, var(--fg) calc((1 - var(--r, 1)) * 100%), transparent 0);
  -webkit-background-clip: text;
  background-clip: text;
}
.statement em.w {
  background-image: linear-gradient(90deg, var(--accent) calc((1 - var(--r, 1)) * 100%), transparent 0);
}
.statement .w::after {
  content: "";
  position: absolute;
  left: -0.03em;
  right: -0.03em;
  top: 0.3em;
  bottom: 0.16em;
  background: #1e1e21;
  transform-origin: 100% 50%;
  transform: scaleX(var(--r, 1));
  pointer-events: none;
}
.statement em.w::after { background: #45200f; }
.statement .wg > .w + .w::after { content: none; }
/* "rompen" se parte al leerse y queda partida: la palabra se pinta en dos
   mitades cortadas en diagonal (::before arriba, ::after abajo); la de
   arriba se corre --rk con el resorte y se queda apenas desplazada y
   girada. El texto propio queda oculto. */
.statement .w.rk::before {
  content: attr(data-t);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 42%, 0 62%);
  transform: translate(calc(var(--rk, 0em) + 0.03em), -0.015em) rotate(-0.6deg);
  visibility: hidden;
  pointer-events: none;
}
.statement .w.rk.snap { background-image: none; }
.statement .w.rk.snap::before { visibility: inherit; }
.statement .w.rk.snap::after {
  content: attr(data-t);
  left: 0;
  right: auto;
  top: 0;
  bottom: auto;
  background: none;
  color: var(--accent);
  clip-path: polygon(0 62%, 100% 42%, 100% 100%, 0 100%);
  transform: none;
}
/* llegar por el link, el skip o con Tab no deja el texto censurado */
#perfil:target .statement .w,
.manifesto:focus-within .statement .w,
.no-boot .statement .w { --r: 0 !important; }

.manifesto-note {
  margin-top: 34px;
  font: var(--small);
  color: var(--fg-2);
}
.manifesto-note a {
  display: inline-block;
  padding: 12px 2px;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 5px;
  transition: text-decoration-color 0.25s ease;
}
.manifesto-note a:hover { text-decoration-color: var(--fg); }

/* ---------- números (registro) y áreas (índice) ---------- */

#areas { padding-bottom: calc(var(--gap) * 0.5); }

.ledger,
.index {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--line-2);
  perspective: 1400px;
}
[data-depth] { transform-style: preserve-3d; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: clamp(18px, 3vh, 30px) 0;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
}
.row-unit {
  display: block;
  margin-bottom: 6px;
  font: var(--label);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--fg-2); /* sobre el halo del bloom, fg-3 no alcanzaba */
}
.row-meta p {
  max-width: 30ch;
  color: var(--fg-2);
  font-size: 17px;
  line-height: 1.45;
  text-wrap: pretty;
}
.row-num {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(64px, 9.4vw, 148px);
  line-height: 0.85;
  letter-spacing: -0.02em;
  text-align: right;
  white-space: nowrap;
}
.row-num .pre { color: var(--fg-2); }

.idx-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 34ch);
  align-items: baseline;
  gap: clamp(20px, 4vw, 64px);
  padding: clamp(28px, 4.5vh, 48px) 0;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
}
.idx-row h3 {
  font-family: var(--display);
  font-weight: 750;
  font-stretch: 112%;
  font-size: clamp(40px, 4.7vw, 68px);
  line-height: 1;
  letter-spacing: -0.035em;
  word-spacing: 0.05em;
  /* con espaciado de texto aumentado (1.4.12) en 320 px, "Investigación"
     no entra: se corta con guion antes que salirse */
  hyphens: auto;
  overflow-wrap: anywhere;
  transition: transform 0.5s var(--ease-out), color 0.3s ease;
}
.idx-row p {
  color: var(--fg-2);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}
@media (hover: hover) and (pointer: fine) {
  .idx-row:hover h3 { transform: translateX(10px); }
}

.sec-foot {
  margin-top: clamp(36px, 6vh, 60px);
  text-align: center;
}
.sec-note {
  display: block;
  max-width: 56ch;
  margin: 0 auto clamp(16px, 2.6vh, 26px);
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ---------- trayectoria: un año fijo que cambia con el scroll ---------- */

.trajectory {
  position: relative;
  height: 220vh; /* ~40vh de scroll por paso */
}
.tray-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 72px var(--pad) 24px;
  text-align: center;
}
.tray-pin .sec-head { margin-bottom: clamp(24px, 4vh, 44px); }

/* indicador de pasos: el acento es el progreso, sin puntos */
.steps {
  display: flex;
  align-items: center;
  gap: 8px; /* + el padding de cada etiqueta: el mismo aire de antes */
  padding: 0;
  list-style: none;
  font: var(--label);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--fg-3);
}
/* cada etiqueta tapa los puntos de atrás (el escaneo de la hélice pasa
   por esta línea): alrededor se ven, sobre el texto no */
.step {
  position: relative;
  isolation: isolate;
  padding: 3px 6px;
  /* halo en el texto y no una caja: el escaneo pasa alrededor sin cortes */
  text-shadow: 0 0 3px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg);
  transition: color 0.4s ease;
}
/* velo difuso bajo cada etiqueta (sin bordes): la hebra de la hélice pasa
   por detrás y el texto mantiene su contraste */
.step::before {
  content: "";
  position: absolute;
  inset: -60% -24%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--bg) 72%, rgba(5, 5, 5, 0));
}
.step.is-past { color: var(--fg-2); }
.step.is-current { color: var(--fg); }
.step-line {
  position: relative;
  width: clamp(36px, 6vw, 72px);
  height: 1px;
  background: var(--line-2);
}
.step-line i {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--fill, 0));
}

.tray-stage {
  display: grid;
  margin-top: clamp(20px, 4vh, 40px);
  perspective: 900px;
}
.tray-item {
  grid-area: 1 / 1; /* los tres pasos se apilan en la misma celda */
  display: grid;
  justify-items: center;
}
.tray-year {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(88px, 15vw, 240px);
  line-height: 1; /* la "y" de "Hoy" necesita su descendente entero */
  letter-spacing: -0.04em;
}
.tray-item h3 {
  margin-top: clamp(16px, 2.5vh, 26px);
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  word-spacing: 0.05em;
  text-wrap: balance;
}
.tray-text {
  margin-top: 10px;
  max-width: 40ch;
  color: var(--fg-2);
  font-size: 16px;
  text-wrap: pretty;
}

/* con JS: solo se ve el paso actual; los dígitos giran escalonados */
.yd {
  display: inline-block;
  text-align: center; /* el ancho de caja lo iguala el JS entre años */
  transform-origin: 50% 50%;
  transition: transform 0.8s var(--ease-out), opacity 0.45s ease;
  transition-delay: calc(var(--i) * 60ms);
}
.tray-item h3,
.tray-text {
  transition: opacity 0.5s ease 0.15s, transform 0.6s var(--ease-out) 0.15s;
}
.booted .tray-item:not(.is-current) .yd {
  opacity: 0;
  transform: translateY(45%) rotateX(-90deg);
}
.booted .tray-item.is-past .yd { transform: translateY(-45%) rotateX(90deg); }
/* odómetro: el dígito que no cambia entre pasos vecinos se queda quieto
   (se intercambia con su gemelo sin animación) */
.booted .tray-item .yd.hold { transition: none; }
.booted .tray-item:not(.is-current) .yd.hold { transform: none; }
/* en el odómetro, el dígito que cambia sale y entra a la vez (sin hueco) */
.booted .tray-item.odo .yd:not(.hold) {
  transition: transform 0.55s cubic-bezier(0.6, 0, 0.3, 1), opacity 0.3s linear;
  transition-delay: 0s;
}
.booted .tray-item.odo.is-current .yd:not(.hold) { transition-delay: 0.06s, 0.1s; }
.booted .tray-item:not(.is-current) h3,
.booted .tray-item:not(.is-current) .tray-text {
  opacity: 0;
  transform: translateY(14px);
}
.booted .tray-item:not(.is-current) { pointer-events: none; }
/* al cambiar de paso, lo que sale se va rápido y lo que entra espera:
   los dos textos nunca se leen encimados */
.booted .tray-item:not(.is-current) h3,
.booted .tray-item:not(.is-current) .tray-text {
  transition-duration: 0.18s;
  transition-delay: 0s;
}
.booted .tray-item.is-current h3,
.booted .tray-item.is-current .tray-text { transition-delay: 0.32s; }
.booted .tray-item:not(.is-current) .yd {
  transition-duration: 0.35s, 0.2s;
  transition-delay: calc(var(--i) * 30ms);
}
.booted .tray-item.is-current .yd { transition-delay: calc(0.2s + var(--i) * 60ms); }

/* sin JS, sin arranque o con movimiento reducido: lista estática */
/* también si la trayectoria fijada no entra en la pantalla (.no-pin, desde
   el JS: espaciado de texto del usuario, 1.4.12) */
html:not(.js) .trajectory,
.no-boot .trajectory,
.no-pin .trajectory { height: auto; }
html:not(.js) .tray-pin,
.no-boot .tray-pin,
.no-pin .tray-pin { position: static; height: auto; padding: var(--gap) var(--pad); }
html:not(.js) .steps,
.no-boot .steps,
.no-pin .steps { display: none; }
html:not(.js) .tray-stage,
.no-boot .tray-stage,
.no-pin .tray-stage { gap: 72px; }
html:not(.js) .tray-item,
.no-boot .tray-item,
.no-pin .tray-item { grid-area: auto; }
.no-boot .tray-item .yd,
.no-boot .tray-item h3,
.no-boot .tray-item .tray-text,
.no-pin .tray-item .yd,
.no-pin .tray-item h3,
.no-pin .tray-item .tray-text { opacity: 1 !important; transform: none !important; }

/* ---------- contacto ---------- */

.contact {
  /* menos el alto del pie: la etiqueta no queda bajo la pastilla al final */
  min-height: calc(100vh - 77px);
  min-height: calc(100svh - 77px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-content: start center;
  justify-items: center;
  text-align: center;
}
.contact-title {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(30px, min(10.5vw, 19vh), 230px);
  line-height: 0.82;
  letter-spacing: -0.055em;
}
.contact-text {
  margin: 34px auto 0;
  max-width: 38ch;
  color: var(--fg-2);
  font-size: clamp(17px, 1.4vw, 20px);
  text-wrap: balance;
}
.contact-cta { margin-top: 40px; }
/* el velo de .contact-text se extiende fuera de su caja: título y botón
   van por encima */
.contact-title,
.contact-cta {
  position: relative;
  z-index: 1;
}
.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 22px 34px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 108%;
  font-size: clamp(17px, 2vw, 27px);
  letter-spacing: -0.02em;
  transition: transform 0.55s var(--ease-out), background-color 0.3s ease, color 0.3s ease;
}
.contact-mail:hover { background: var(--accent); color: var(--on-accent); }
.contact-mail .ico { width: 0.8em; height: 0.8em; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: var(--small);
  color: var(--fg-2);
  transition: transform 0.55s var(--ease-out), border-color 0.3s ease, color 0.3s ease;
}
.pill:hover { border-color: var(--fg); color: var(--fg); }

/* ---------- pie ---------- */

.foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px var(--pad) calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg);
  font: var(--small);
  font-size: 14px;
  color: var(--fg-3);
}
.foot-mark {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 16px;
  letter-spacing: -0.035em;
  color: var(--fg);
}
.foot a {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition: color 0.25s ease;
}
.foot a:hover { color: var(--fg); }
/* RFC 9116: cómo reportarle una vulnerabilidad a este sitio */
.foot .foot-sec {
  font: var(--label);
  letter-spacing: 0.02em;
  text-decoration: underline 1px currentColor; /* se distingue como enlace */
  text-underline-offset: 4px;
}

/* ---------- si el JS no arrancó, o no hay JS: todo visible y quieto ---------- */

.no-boot [data-depth] {
  opacity: 1 !important;
  transform: none !important;
}
html:not(.js) .manifesto,
.no-boot .manifesto { height: auto; }
html:not(.js) .manifesto-pin,
.no-boot .manifesto-pin {
  position: static;
  height: auto;
  padding: var(--gap) var(--pad);
}
html:not(.js) .nav-pause,
.no-boot .nav-pause { display: none; }

/* pausa: congela las animaciones CSS (la escena, en JS) */
.paused *,
.paused *::before,
.paused *::after {
  animation-play-state: paused !important;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-menu { display: inline-flex; }
  .nav-pill { width: 100%; max-width: 560px; }
  .nav-mark { margin-right: auto; }
  /* sin JS el menú no abre: se muestran los links, con scroll lateral */
  html:not(.js) .nav-links,
  .no-boot .nav-links {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  html:not(.js) .nav-links a,
  .no-boot .nav-links a { scroll-snap-align: start; }
  html:not(.js) .nav-menu,
  .no-boot .nav-menu { display: none; }
}

@media (max-width: 760px) {
  :root { --label-size: 13px; }
  .geotag-lead .lead-d { display: none; }
  .geotag-lead .lead-m { display: inline; }
  .geotag-text { left: 34px; top: 18px; transform: translateY(-9px); }
  .geotag.flip .geotag-text { left: auto; right: 34px; }
  .geotag-coord { display: block; margin: 2px 0 0; font-size: 12px; letter-spacing: 0.06em; }

  .hero-title { font-size: min(25vw, 40vh); }
  .hero-kicker { flex-direction: column; gap: 8px; }
  .hero-kicker .sep { display: none; }

  .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .row-num {
    order: -1;
    text-align: left;
    font-size: clamp(56px, 19vw, 96px);
  }
  .idx-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .idx-row h3 { font-size: clamp(34px, 11vw, 40px); } /* "Investigación" entera a 320 */

  .contact-mail {
    font-size: clamp(15px, 4.6vw, 27px);
    padding: 20px 24px;
  }
  /* en móvil el pie mide ~126 px */
  .contact {
    min-height: calc(100vh - 126px);
    min-height: calc(100svh - 126px);
  }

  .foot { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; }
  .foot a { justify-self: center; }
}

/* 320 px con espaciado de texto aumentado: la pastilla entra entera */
@media (max-width: 360px) {
  .geotag-coord { display: none; } /* no entran: queda la ciudad */
  .nav-pill { padding-left: 12px; }
  .nav-menu,
  .nav-cta { padding: 0 10px; }
  .nav-pause { margin-left: 6px; }
}

/* pantallas bajas (landscape en móvil, zoom 200%) */
@media (max-height: 520px) {
  .statement { font-size: clamp(22px, 9.5vh, 40px); }
  .manifesto-pin { padding-top: 84px; }
  .menu { align-content: start; padding-top: 88px; }
  .menu a { font-size: clamp(26px, 8.5vh, 40px); }
  .tray-year { font-size: clamp(56px, 18vh, 96px); }
  .tray-pin .sec-title { font-size: clamp(28px, 7vh, 44px); }
}
@media (max-height: 400px) {
  .manifesto-note { margin-top: 16px; }
  .manifesto-pin { padding-top: 76px; }
}
/* contacto en pantallas bajas (375×667, laptops de 640–700 px): al final
   de la página la etiqueta tiene que quedar por debajo de la pastilla */
@media (max-height: 700px) {
  .contact { padding-top: 96px; padding-bottom: 40px; }
  .contact-text { margin-top: 22px; }
  .contact-cta { margin-top: 26px; }
}

/* colores forzados: sin escena ni censura; el sistema manda */
@media (forced-colors: active) {
  .gl,
  .geotag { display: none !important; }
  .statement { line-height: 1.25; }
  .statement .wg,
  .statement .w { display: inline; }
  .statement .w {
    color: CanvasText;
    background: none;
  }
  .statement .w::after { display: none; }
  /* los titulares partidos en palabras recortaban descendentes */
  .sec-title,
  .contact-title { line-height: 1.15; }
  .sw,
  .sw-in { display: inline; }
  .booted [data-split] .sw-in {
    color: CanvasText;
    background: none;
  }
  .booted [data-split] .sw-in::after,
  .statement .w.rk::before { display: none; }
  /* en móvil la cifra va arriba y su placa tapaba la unidad */
  .row-meta { z-index: 2; }
}

/* ---------- movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .manifesto,
  .trajectory { height: auto; }
  .manifesto-pin,
  .tray-pin {
    position: static;
    height: auto;
    padding: var(--gap) var(--pad);
  }
  .steps { display: none; }
  .tray-stage { gap: 72px; }
  .tray-item { grid-area: auto; }
  .booted .tray-item:not(.is-current) h3,
  .booted .tray-item:not(.is-current) .tray-text,
  .booted .tray-item:not(.is-current) .yd { opacity: 1; transform: none; }
  .nav-pause { display: none; }
}
