/* ==========================================================================
   Antlook · Hero holográfico en claro (laboratorio) — ronda 2
   Colores: tema claro del navegador, acento azul
   (src/styles/themes.css · [data-theme="light"][data-accent="blue"]).
   Escena: 800 × 560 u (1 u = 1/800 del ancho del escenario).
   Profundidad: suelo -60 u · ventana 0 · escudo 40 u · hologramas 100–220 u.
   Reloj: hero.js pone data-ch="0..3" en .ah cada 7 s (T = 28 s); el CSS hace
   el resto: transiciones de entrada/salida y animaciones de capítulo que
   arrancan al activarse el capítulo (nacen sincronizadas por construcción).
   Solo se animan transform / opacity (y un stroke-dashoffset puntual).
   Sin JS / movimiento reducido: composición estática completa (sin data-ch).
   ========================================================================== */

@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/outfit-latin-800-normal.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: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.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: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.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 {
  /* Tokens del navegador (tema claro, acento azul) */
  --accent: #0f6cbd;
  --accent-h: #005a9e;
  --accent-dim: rgba(15, 108, 189, .10);
  --accent-glow: rgba(15, 108, 189, .18);
  --bg: #f5f5f7;          /* tertiary */
  --bg-1: #ececee;        /* primary */
  --chrome: #e2e2e5;      /* secondary / chrome */
  --surface: #ffffff;
  --ink: #1a1a1e;
  --ink-2: #3a3a42;
  --ink-3: #5b6474;       /* 4,61:1 sobre #e2e2e5 · 5,48:1 sobre #f5f5f7 · 5,97:1 sobre #fff */
  --line: rgba(0, 0, 0, .12);
  --glass: rgba(255, 255, 255, .82);
  --ok: #1a7f37;
  --warn: #9e6a03;
  --danger: #cf222e;
  --info: #0969da;
  /* Iridiscencia derivada del azul (con un toque cian leve) */
  --iri-1: #5fd3f3;
  --iri-2: #4ea8f8;
  --iri: linear-gradient(135deg, rgba(95, 211, 243, .9), rgba(78, 168, 248, .95) 38%, rgba(15, 108, 189, .95) 72%, rgba(9, 105, 218, .65));
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --font-h: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); overflow-x: hidden; }
img, svg { display: block; }

/* ---------- Hero ---------- */
.ah { position: relative; isolation: isolate; overflow: hidden; overflow: clip; padding: clamp(28px, 5vw, 64px) var(--gutter) 20px; }
.ah__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 72% 40%, rgba(78, 168, 248, .16), transparent 70%),
    radial-gradient(40% 40% at 90% 75%, rgba(95, 211, 243, .12), transparent 70%),
    radial-gradient(40% 50% at 6% 8%, rgba(15, 108, 189, .07), transparent 70%),
    linear-gradient(180deg, #fafafb 0%, var(--bg) 70%); }
.ah__bg::after { content: ''; position: absolute; inset: 0; opacity: .55;
  background-image: radial-gradient(rgba(15, 108, 189, .16) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 65% 45%, #000 0%, transparent 75%); mask-image: radial-gradient(70% 60% at 65% 45%, #000 0%, transparent 75%); }

.ah__inner { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; grid-template-areas: 'copy' 'media' 'chap'; }
.ah__copy { grid-area: copy; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; max-width: 640px; margin: 0 auto; }
.ah__media { grid-area: media; position: relative; container-type: inline-size; width: 100%; max-width: 980px; margin: 0 auto; }
.ah__chap { grid-area: chap; display: flex; align-items: center; justify-content: center; gap: 10px; }
html:not(.js) .ah__chap { display: none; }

.ah__kicker { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--accent-h); background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px rgba(15, 108, 189, .22), 0 6px 18px -10px rgba(15, 108, 189, .4); }
.ah__kicker img { width: 24px; height: 24px; border-radius: 50%; }
.ah__title { margin: 0; font: 800 clamp(34px, 6.4vw, 64px)/1.03 var(--font-h); letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.ah__grad { background: linear-gradient(95deg, var(--accent-h) 0%, var(--accent) 45%, var(--info) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ah__sub { margin: 0; max-width: 46ch; font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-2); text-wrap: pretty; }
.ah__ctas { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 6px; }
/* Botón: #0f6cbd con texto blanco = 5,38:1 (hover #005a9e = 7,1:1) */
.ah__btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 12px; font: 600 17px/1 var(--font); color: #fff; text-decoration: none; background: var(--accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 24px -8px rgba(15, 108, 189, .55), 0 22px 44px -18px rgba(78, 168, 248, .5);
  transition: transform .25s var(--ease), background-color .25s; }
.ah__btn:hover { background: var(--accent-h); transform: translateY(-2px); }
.ah__btn:focus-visible, .ah-ch:focus-visible, .ah-toggle:focus-visible, .ah__by a:focus-visible { outline: 3px solid var(--info); outline-offset: 3px; }
.ah__note { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.ah__by { max-width: 1320px; margin: 24px auto 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.ah__by a { color: var(--accent-h); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ah-illus { margin: 4px 0 0; text-align: right; font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }

/* Capítulos */
.ah-chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: min(100%, 620px); }
.ah-ch { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 6px; row-gap: 7px; width: 100%; padding: 8px 8px 9px; border-radius: 10px; color: var(--ink-2); transition: background .3s, color .3s; }
.ah-ch:hover { background: var(--accent-dim); }
.ah-ch__n { font: 600 11px/1 var(--font); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ah-ch__t { font: 600 13.5px/1.1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-ch__bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(0, 0, 0, .1); overflow: hidden; }
.ah-ch__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--iri-2), var(--accent)); transform: scaleX(0); transform-origin: 0 50%; }
.ah-ch.is-on { color: var(--ink); }
.ah-ch.is-on .ah-ch__n { color: var(--accent-h); }
.ah-toggle { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; color: var(--accent-h); background: #fff; box-shadow: inset 0 0 0 1px rgba(15, 108, 189, .3), 0 4px 12px -6px rgba(15, 108, 189, .45); }
.ah-toggle svg { fill: currentColor; }
.ah-toggle .i-play, .ah.is-user-paused .ah-toggle .i-pause { display: none; }
.ah.is-user-paused .ah-toggle .i-play { display: block; }
.ah-toggle[hidden] { display: none; }

.ah-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 1100px) {
  .ah { padding: clamp(40px, 6vh, 80px) clamp(16px, 3.5vw, 56px) 20px; }
  .ah__inner { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); grid-template-areas: 'copy media' 'chap media'; grid-template-rows: auto auto; column-gap: clamp(24px, 3vw, 48px); row-gap: 28px; align-items: center; }
  .ah__copy { align-items: flex-start; text-align: left; margin: 0; align-self: end; }
  .ah__ctas { align-items: flex-start; }
  .ah__chap { justify-content: flex-start; align-self: start; }
  .ah-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 360px; }
  .ah__title { font-size: clamp(44px, 4.4vw, 62px); }
  /* El reproductor nunca supera la altura útil de la ventana */
  .ah__media { max-width: min(100%, calc((100svh - 90px) * 800 / 560)); margin-right: 0; }
}

/* ==========================================================================
   Escenario 3D
   ========================================================================== */
.ah-stage { --u: calc(100cqw / 800); position: relative; aspect-ratio: 800 / 560; perspective: 230cqw; perspective-origin: 50% 40%; font-family: var(--font);
  /* Suelo tipográfico: 11 px mínimo en escena */
  --fs-xs: max(11px, calc(9.5 * var(--u))); --fs-s: max(11px, calc(11 * var(--u))); --fs-m: max(12px, calc(13 * var(--u))); }
.ah-plane { --rx: 8deg; --ry: -14deg; position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); will-change: transform; }

/* Suelo con rejilla (foco por máscara radial: sin líneas de corte) */
.ah-floor { position: absolute; left: 0; top: 0; width: calc(800 * var(--u)); height: calc(560 * var(--u)); overflow: visible; transform: translateZ(calc(-60 * var(--u)));
  -webkit-mask-image: radial-gradient(48% 34% at 50% 84%, #000 30%, transparent 100%); mask-image: radial-gradient(48% 34% at 50% 84%, #000 30%, transparent 100%); }
.ah-floor path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }

/* Base de luz */
.ah-base { position: absolute; left: calc(140 * var(--u)); top: calc(420 * var(--u)); width: calc(520 * var(--u)); height: calc(80 * var(--u)); transform: translateZ(calc(-20 * var(--u))); }
.ah-base::before { content: ''; position: absolute; inset: -40% -12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(78, 168, 248, .32), rgba(15, 108, 189, .12) 55%, transparent); }
.ah-base__core { position: absolute; left: 22%; right: 22%; top: 30%; bottom: 30%; border-radius: 50%; background: radial-gradient(closest-side, #fff 0%, rgba(214, 236, 255, .95) 40%, rgba(78, 168, 248, 0) 100%); box-shadow: 0 0 0 1px rgba(78, 168, 248, .4); }
.ah-base__ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1.5px dashed rgba(15, 108, 189, .5); transform: translate(-50%, -50%) scaleY(.16) rotate(0deg); }
.ah-base__ring.r1 { width: calc(470 * var(--u)); height: calc(470 * var(--u)); }
.ah-base__ring.r2 { width: calc(380 * var(--u)); height: calc(380 * var(--u)); border-style: solid; border-color: rgba(9, 105, 218, .35); border-width: 1px; border-top-color: transparent; border-bottom-color: transparent; }
.ah-beam { position: absolute; left: calc(110 * var(--u)); top: calc(40 * var(--u)); width: calc(580 * var(--u)); height: calc(420 * var(--u)); transform: translateZ(calc(-30 * var(--u)));
  clip-path: polygon(0 0, 100% 0, 72% 100%, 28% 100%);
  background: linear-gradient(0deg, rgba(78, 168, 248, .32) 0%, rgba(15, 108, 189, .10) 55%, rgba(15, 108, 189, 0) 100%); opacity: .8;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
/* Motas que suben del haz (solo con el reloj en marcha) */
.ah-rise { position: absolute; inset: 0; transform: translateZ(calc(-10 * var(--u))); pointer-events: none; }
.ah-rise i { position: absolute; left: calc(var(--x) * var(--u)); top: calc(452 * var(--u)); width: max(2px, calc(3 * var(--u))); height: max(2px, calc(3 * var(--u))); border-radius: 50%; background: var(--iri-2); box-shadow: 0 0 0 1px rgba(255, 255, 255, .8); opacity: 0; }

/* ---------- Material «holograma» en claro ---------- */
.holo { position: relative; border: 1.5px solid transparent; border-radius: calc(12 * var(--u));
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), var(--glass)) padding-box, var(--iri) border-box;
  box-shadow: 0 1px 2px rgba(15, 108, 189, .08), 0 calc(10 * var(--u)) calc(24 * var(--u)) calc(-10 * var(--u)) rgba(15, 108, 189, .30), 0 calc(28 * var(--u)) calc(56 * var(--u)) calc(-24 * var(--u)) rgba(78, 168, 248, .38); }
/* líneas de escaneo (estáticas) */
.holo::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(15, 108, 189, .05) 0 1px, transparent 1px 3px); }
/* barrido de luz en tarjetas (solo transform) */
.holo__scan { position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent, rgba(95, 211, 243, .16) 60%, rgba(255, 255, 255, .75) 92%, transparent); transform: translateY(-110%); }

.card { position: relative; overflow: hidden; padding: calc(12 * var(--u)) calc(14 * var(--u)); color: var(--ink); font-size: var(--fs-s); line-height: 1.3; }
.card b { display: block; font: 600 var(--fs-m)/1.2 var(--font); letter-spacing: -.005em; }
.card span { display: block; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); padding: calc(6 * var(--u)) calc(12 * var(--u)); border-radius: 999px; font: 600 var(--fs-xs)/1.2 var(--font); color: var(--accent-h); white-space: nowrap; }

/* ---------- Ventana de navegador (UI clara real) ---------- */
.ah-win { position: absolute; left: calc(170 * var(--u)); top: calc(78 * var(--u)); width: calc(460 * var(--u)); height: calc(312 * var(--u)); overflow: hidden; border-radius: calc(12 * var(--u)); transform: translateZ(0);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--iri) border-box;
  box-shadow: 0 2px 4px rgba(15, 108, 189, .08), 0 calc(24 * var(--u)) calc(50 * var(--u)) calc(-18 * var(--u)) rgba(15, 108, 189, .38), 0 calc(60 * var(--u)) calc(90 * var(--u)) calc(-40 * var(--u)) rgba(78, 168, 248, .5); }
.ah-win__tabs { position: relative; display: flex; align-items: flex-end; gap: calc(4 * var(--u)); height: calc(34 * var(--u)); padding: 0 calc(10 * var(--u)); background: var(--chrome); }
.tab { position: relative; display: flex; align-items: center; gap: calc(6 * var(--u)); width: calc(92 * var(--u)); height: calc(26 * var(--u)); padding: 0 calc(8 * var(--u)); border-radius: calc(8 * var(--u)) calc(8 * var(--u)) 0 0; font-size: var(--fs-xs); color: var(--ink-2); white-space: nowrap; transition: opacity .5s var(--ease); }
.tab em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.tab.is-act { background: var(--surface); color: var(--ink); }
.fav { flex: none; width: calc(10 * var(--u)); height: calc(10 * var(--u)); min-width: 7px; min-height: 7px; border-radius: 3px; background: var(--accent); }
.fav.f2 { background: #d4a72c; } .fav.f3 { background: var(--info); } .fav.f4 { background: var(--ok); }
.moon { position: relative; flex: none; margin-left: auto; width: calc(9 * var(--u)); height: calc(9 * var(--u)); min-width: 7px; min-height: 7px; border-radius: 50%; box-shadow: calc(-2.5 * var(--u)) calc(1.5 * var(--u)) 0 0 var(--accent); opacity: 0; transform: scale(.4); transition: opacity .4s var(--ease), transform .5s var(--ease); }
.tab-plus { align-self: center; padding: 0 calc(6 * var(--u)); color: var(--ink-3); font-size: var(--fs-m); }
.win-ctl { margin-left: auto; align-self: center; display: flex; gap: calc(10 * var(--u)); }
.win-ctl i { width: calc(9 * var(--u)); height: calc(1.5 * var(--u)); background: var(--ink-3); }
.win-ctl i:nth-child(2) { height: calc(9 * var(--u)); background: none; border: 1.2px solid var(--ink-3); }
.win-ctl i:nth-child(3) { height: calc(9 * var(--u)); background: none; border: 0; position: relative; }
.win-ctl i:nth-child(3)::before, .win-ctl i:nth-child(3)::after { content: ''; position: absolute; left: 50%; top: 0; width: 1.2px; height: 125%; background: var(--ink-3); transform: rotate(45deg); transform-origin: top; }
.win-ctl i:nth-child(3)::after { transform: rotate(-45deg); left: 0; }

.ah-win__bar { display: flex; align-items: center; gap: calc(10 * var(--u)); height: calc(36 * var(--u)); padding: 0 calc(10 * var(--u)); background: var(--surface); border-bottom: 1px solid var(--line); }
.nav { display: flex; gap: calc(8 * var(--u)); }
.nav i { width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-left: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); }
.nav i + i { transform: rotate(-135deg); opacity: .45; }
.omni { position: relative; flex: 1; display: flex; align-items: center; gap: calc(6 * var(--u)); height: calc(24 * var(--u)); min-height: 18px; padding: 0 calc(6 * var(--u)) 0 calc(9 * var(--u)); border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); font-size: var(--fs-xs); color: var(--ink-2); }
.omni__shield { flex: none; width: calc(12 * var(--u)); height: calc(12 * var(--u)); fill: rgba(26, 127, 55, .16); stroke: var(--ok); stroke-width: 1.4; }
.omni__url { position: absolute; left: calc(26 * var(--u)); right: calc(104 * var(--u)); top: 50%; transform: translateY(-50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .35s; }
.omni__id { position: relative; margin-left: auto; display: flex; align-items: center; gap: calc(5 * var(--u)); width: calc(90 * var(--u)); min-width: 74px; height: calc(18 * var(--u)); min-height: 16px; padding: 0 calc(8 * var(--u)) 0 calc(5 * var(--u)); border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(15, 108, 189, .3); color: var(--accent-h); font-weight: 600; overflow: hidden; }
.omni__id > i { flex: none; width: calc(10 * var(--u)); height: calc(10 * var(--u)); min-width: 7px; min-height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--iri-1), var(--accent)); }
.omni__idn { position: absolute; left: max(16px, calc(20 * var(--u))); top: 50%; margin-top: -0.65em; line-height: 1.3; white-space: nowrap; }
.omni__idn.n1 { opacity: 0; }

.ah-win__body { position: absolute; left: 0; right: 0; top: calc(70 * var(--u)); bottom: 0; }
.pg { position: absolute; inset: 0; padding: calc(18 * var(--u)) calc(22 * var(--u)); opacity: 0; transition: opacity .45s var(--ease); }
.ln { display: block; height: calc(7 * var(--u)); margin: calc(8 * var(--u)) 0; border-radius: 4px; background: rgba(0, 0, 0, .08); }
.ln.h { height: calc(12 * var(--u)); background: rgba(0, 0, 0, .15); }
.w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; }

/* Barrido de escaneo que cruza la ventana al cambiar de capítulo */
.ah-sweep { position: absolute; left: 0; right: 0; top: 0; height: 34%; pointer-events: none; opacity: 0; transform: translateY(-100%);
  background: linear-gradient(180deg, rgba(95, 211, 243, 0), rgba(78, 168, 248, .14) 70%, rgba(255, 255, 255, .9) 96%, rgba(15, 108, 189, .5) 100%); }

/* Nueva pestaña (estado base) */
.pg-home { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(14 * var(--u)); padding-bottom: calc(30 * var(--u)); }
.pg-home img { width: calc(54 * var(--u)); height: calc(54 * var(--u)); border-radius: 50%; box-shadow: 0 calc(10 * var(--u)) calc(24 * var(--u)) calc(-8 * var(--u)) rgba(15, 108, 189, .5); }
.pg-home__search { display: flex; align-items: center; gap: calc(8 * var(--u)); width: 64%; height: calc(30 * var(--u)); min-height: 22px; padding: 0 calc(12 * var(--u)); border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 6px 16px -10px rgba(15, 108, 189, .4); font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.pg-home__search i { flex: none; width: calc(9 * var(--u)); height: calc(9 * var(--u)); border: 1.5px solid var(--ink-3); border-radius: 50%; }
.pg-home__dials { display: flex; gap: calc(12 * var(--u)); }
.pg-home__dials i { width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: calc(9 * var(--u)); background: var(--bg-1); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }

/* C1 · lo que ve la web */
.pg-id { display: grid; grid-template-columns: calc(96 * var(--u)) 1fr; align-items: center; gap: calc(20 * var(--u)); padding: calc(34 * var(--u)) calc(26 * var(--u)) calc(14 * var(--u)); }
.pg-id__h { position: absolute; left: calc(26 * var(--u)); top: calc(12 * var(--u)); font-size: var(--fs-xs); font-weight: 600; color: var(--accent-h); letter-spacing: .04em; text-transform: uppercase; }
.pg-id__fp { width: calc(92 * var(--u)); height: calc(92 * var(--u)); padding: calc(14 * var(--u)); border-radius: 50%; stroke: var(--accent); background: radial-gradient(closest-side, rgba(95, 211, 243, .14), rgba(15, 108, 189, .07) 70%, transparent); box-shadow: inset 0 0 0 1px rgba(15, 108, 189, .22); }
.pg-id__rows { margin: 0; display: grid; gap: calc(7 * var(--u)); }
.pg-id__rows .rw { display: grid; grid-template-columns: calc(96 * var(--u)) 1fr; align-items: center; padding-bottom: calc(6 * var(--u)); border-bottom: 1px dashed rgba(15, 108, 189, .25); }
.pg-id__rows dt { font-size: var(--fs-xs); color: var(--ink-3); }
.pg-id__rows dd { position: relative; margin: 0; height: 1.35em; font: 600 var(--fs-m)/1.35 var(--font); color: var(--ink); overflow: hidden; }
.pg-id .v { position: absolute; left: 0; top: 0; white-space: nowrap; }
.pg-id .v1 { opacity: 0; }

/* C2 · anuncios */
.pg-ads { padding-right: calc(150 * var(--u)); }
.ad, .ad-side { display: grid; place-items: center; border-radius: calc(8 * var(--u)); background: repeating-linear-gradient(135deg, rgba(212, 167, 44, .2) 0 6px, rgba(212, 167, 44, .08) 6px 12px); box-shadow: inset 0 0 0 1px rgba(158, 106, 3, .4); }
.ad { position: relative; height: calc(44 * var(--u)); margin: calc(10 * var(--u)) 0; }
.ad em, .ad-side em { font-style: normal; font-size: var(--fs-xs); font-weight: 600; color: #6f4a00; }
.ad-side { position: absolute; right: calc(22 * var(--u)); top: calc(18 * var(--u)); width: calc(110 * var(--u)); height: calc(190 * var(--u)); }

/* C3 · vista dividida */
.pg-split { display: flex; gap: 0; padding: calc(12 * var(--u)); background: var(--bg); }
.sp { flex: 1; padding: calc(8 * var(--u)) calc(12 * var(--u)); border-radius: calc(8 * var(--u)); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07); }
.sp-l .img { display: block; height: calc(64 * var(--u)); margin: calc(8 * var(--u)) 0; border-radius: calc(6 * var(--u)); background: linear-gradient(135deg, rgba(15, 108, 189, .18), rgba(95, 211, 243, .22)); }
.sp-div { flex: none; width: calc(14 * var(--u)); display: grid; place-items: center; }
.sp-div i { width: calc(3 * var(--u)); min-width: 2px; height: 30%; border-radius: 3px; background: linear-gradient(var(--iri-2), var(--accent)); }
.pdf-h { display: inline-block; padding: calc(2 * var(--u)) calc(7 * var(--u)); border-radius: 4px; background: #ffebe9; color: #a40e26; font: 600 var(--fs-xs)/1.3 var(--font); }
.hl { display: block; height: calc(9 * var(--u)); width: 75%; margin: calc(8 * var(--u)) 0; border-radius: 3px; background: rgba(212, 167, 44, .5); transform-origin: 0 50%; }

/* C4 · pestañas suspendidas */
.pg-light { display: flex; flex-direction: column; gap: calc(9 * var(--u)); padding: calc(18 * var(--u)) calc(130 * var(--u)) calc(18 * var(--u)) calc(30 * var(--u)); background: var(--bg); }
.lt-row { display: flex; align-items: center; gap: calc(10 * var(--u)); height: calc(36 * var(--u)); min-height: 26px; padding: 0 calc(12 * var(--u)); border-radius: calc(9 * var(--u)); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); font-size: var(--fs-s); color: var(--ink); }
.lt-row em { font-style: normal; }
.lt-row .z { margin-left: auto; font-style: normal; font-size: var(--fs-xs); font-weight: 600; padding: calc(2 * var(--u)) calc(8 * var(--u)); border-radius: 999px; background: var(--accent-dim); color: var(--accent-h); }
.lt-row .z.on { background: rgba(26, 127, 55, .12); color: var(--ok); }

/* ---------- Escudo y partículas (C2) ---------- */
.ah-shield { position: absolute; left: 0; top: 0; width: calc(800 * var(--u)); height: calc(560 * var(--u)); overflow: visible; pointer-events: none; opacity: 0; transform: translateZ(calc(40 * var(--u))) scale(.94); transform-origin: 50% 75%; transition: opacity .5s var(--ease), transform .8s var(--ease); }
.sh-dome { stroke-opacity: .4; }
.sh-edge { stroke-dasharray: 1; stroke-dashoffset: 0; stroke-width: 3; stroke-linecap: round; }
.ah-pz { position: absolute; inset: 0; transform: translateZ(calc(50 * var(--u))); pointer-events: none; }
.pz { position: absolute; left: 0; top: 0; padding: calc(4 * var(--u)) calc(10 * var(--u)) calc(4 * var(--u)) calc(19 * var(--u)); border-radius: 999px; font: 600 max(10px, calc(10.5 * var(--u)))/1.2 var(--font); font-style: normal; color: #a40e26; white-space: nowrap; background: rgba(255, 235, 233, .95); box-shadow: inset 0 0 0 1px rgba(207, 34, 46, .35), 0 4px 10px -4px rgba(207, 34, 46, .35); opacity: 0; transform: translate(calc(var(--x0) * var(--u)), calc(var(--y0) * var(--u))); }
.pz::before { content: ''; position: absolute; left: calc(7 * var(--u)); top: 50%; width: calc(7 * var(--u)); height: calc(7 * var(--u)); min-width: 5px; min-height: 5px; transform: translateY(-50%); border-radius: 50%; background: var(--danger); }

/* ---------- Hologramas laterales ---------- */
.hg { position: absolute; --z: 120; --d: 0ms; opacity: 0; transform-origin: 50% 100%;
  transform: translate3d(0, calc(26 * var(--u)), calc(var(--z) * var(--u))) scaleY(.08);
  transition: opacity .3s ease, transform .35s var(--ease-in); }
/* sombra de contacto (color, no negro) */
.hg::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: calc(-26 * var(--u)); height: calc(16 * var(--u)); border-radius: 50%; background: radial-gradient(closest-side, rgba(15, 108, 189, .22), rgba(78, 168, 248, .08) 60%, transparent); z-index: -1; }
/* haz de proyección: del holograma hacia la base */
.hg::before { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: calc(80 * var(--u)); background: linear-gradient(180deg, rgba(15, 108, 189, .45), rgba(95, 211, 243, 0)); }
.hg-ids::before { left: 40%; }
.reg-lt { left: calc(20 * var(--u)); top: calc(60 * var(--u)); width: calc(206 * var(--u)); --z: 130; }
.reg-lb { left: calc(40 * var(--u)); top: calc(300 * var(--u)); width: calc(206 * var(--u)); --z: 170; }
.reg-rt { left: calc(572 * var(--u)); top: calc(12 * var(--u)); width: calc(196 * var(--u)); --z: 100; }
.reg-rb { left: calc(548 * var(--u)); top: calc(290 * var(--u)); width: calc(200 * var(--u)); --z: 200; }

/* C1 · dos identidades apiladas */
.hg-ids { height: calc(124 * var(--u)); }
.idc { position: absolute; left: 0; width: calc(196 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u));
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(250, 251, 253, .95)) padding-box, var(--iri) border-box;
  transform: translate3d(calc(var(--ox) * var(--u)), calc(var(--oy) * var(--u)), calc(var(--oz) * var(--u))); }
.idc b::before { content: ''; display: inline-block; vertical-align: -.1em; width: .8em; height: .8em; margin-right: .45em; border-radius: 50%; background: linear-gradient(135deg, var(--iri-1), var(--accent)); }
.idc1 { --ox: 0; --oy: 40; --oz: 30; z-index: 2; }
.idc2 { --ox: 14; --oy: 0; --oz: 0; z-index: 1; }
.idc2 b::before { background: linear-gradient(135deg, #d4a72c, var(--warn)); }

.sepc { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.sepc__ico { flex: none; position: relative; display: block; width: calc(40 * var(--u)) !important; height: calc(30 * var(--u)); }
.sepc__ico i { position: absolute; top: 0; width: calc(26 * var(--u)); height: calc(30 * var(--u)); border-radius: calc(7 * var(--u)); border: 1.5px solid var(--accent); background: rgba(15, 108, 189, .08); }
.sepc__ico i + i { left: calc(14 * var(--u)); border-color: var(--warn); background: rgba(212, 167, 44, .12); }
.sepc p, .cnt p, .bnk p, .spl p { margin: 0; }

/* C2 */
.cnt { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.cnt__ico { flex: none; display: grid; place-items: center; width: calc(36 * var(--u)) !important; height: calc(36 * var(--u)); border-radius: 50%; background: rgba(26, 127, 55, .12); }
.cnt__ico svg { width: 60%; height: 60%; fill: rgba(26, 127, 55, .18); stroke: var(--ok); stroke-width: 1.5; }
.bnk { display: flex; align-items: center; justify-content: space-between; gap: calc(10 * var(--u)); }
.sw { position: relative; flex: none; width: calc(40 * var(--u)) !important; height: calc(22 * var(--u)); border-radius: 999px; background: var(--chrome); overflow: hidden; }
.sw::before { content: ''; position: absolute; inset: 0; background: var(--accent); opacity: 1; }
.sw i { position: absolute; left: calc(3 * var(--u)); top: calc(3 * var(--u)); width: calc(16 * var(--u)); height: calc(16 * var(--u)); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transform: translateX(calc(18 * var(--u))); }

/* C3 */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(7 * var(--u)); }
.tools__h { grid-column: 1 / -1; }
.tl { display: flex !important; flex-direction: column; align-items: center; gap: calc(4 * var(--u)); padding: calc(7 * var(--u)) 0 calc(5 * var(--u)); border-radius: calc(8 * var(--u)); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); font-size: var(--fs-xs); font-weight: 600; color: var(--ink) !important; }
.ti { width: calc(18 * var(--u)); height: calc(18 * var(--u)); border-radius: calc(5 * var(--u)); }
.ti.pdf { background: linear-gradient(135deg, #ff8182, var(--danger)); }
.ti.tr { background: linear-gradient(135deg, var(--iri-2), var(--info)); }
.ti.fa { background: linear-gradient(135deg, var(--accent), var(--accent-h)); }
.ti.ocr { background: linear-gradient(135deg, #4ac26b, var(--ok)); }
.ti.cap { background: linear-gradient(135deg, #eac54f, var(--warn)); }
.ti.nt { background: linear-gradient(135deg, #8fcbff, var(--iri-2)); }
.nrl__h { display: flex !important; align-items: center; gap: calc(6 * var(--u)); }
.nrl__h i { width: calc(12 * var(--u)); height: calc(12 * var(--u)); border-radius: 50%; background: conic-gradient(from 30deg, var(--iri-1), var(--iri-2), var(--accent), var(--iri-1)); }
.bub { margin-top: calc(7 * var(--u)); padding: calc(6 * var(--u)) calc(9 * var(--u)); border-radius: calc(9 * var(--u)); font-size: var(--fs-xs); }
.bub.me { margin-left: auto; width: max-content; max-width: 100%; background: var(--accent); color: #fff !important; border-bottom-right-radius: 3px; }
.bub.ai { background: var(--bg); border-bottom-left-radius: 3px; }
.bub.ai .ln { height: calc(5 * var(--u)); margin: calc(4 * var(--u)) 0; background: rgba(15, 108, 189, .25); transform-origin: 0 50%; }
.nrl__f { margin-top: calc(7 * var(--u)); font-size: var(--fs-xs); color: var(--ink-3) !important; font-weight: 600; }
.spl { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.spl__ico { flex: none; display: flex !important; gap: calc(3 * var(--u)); }
.spl__ico i { width: calc(14 * var(--u)); height: calc(22 * var(--u)); border-radius: 3px; background: linear-gradient(180deg, var(--iri-2), var(--accent)); }

/* C4 */
.ram__bar { position: relative; height: calc(10 * var(--u)); margin: calc(9 * var(--u)) 0 calc(8 * var(--u)); border-radius: 999px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.ram__bar i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--iri-2), var(--accent)); transform-origin: 0 50%; transform: scaleX(.42); }
.ram__note { font-size: var(--fs-xs); }
.imp__row { display: flex !important; align-items: center; gap: calc(8 * var(--u)); margin-top: calc(7 * var(--u)); padding: calc(5 * var(--u)) calc(8 * var(--u)); border-radius: calc(8 * var(--u)); background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07); color: var(--ink) !important; font-weight: 600; font-size: var(--fs-xs); }
.br { width: calc(14 * var(--u)); height: calc(14 * var(--u)); min-width: 10px; min-height: 10px; border-radius: 50%; }
.br.c { background: conic-gradient(#cf222e 0 120deg, #d4a72c 0 240deg, #1a7f37 0); }
.br.e { background: linear-gradient(135deg, var(--iri-1), var(--info)); }
.br.b { background: linear-gradient(135deg, #f0883e, #bc4c00); border-radius: 30%; }
.ok { margin-left: auto; width: calc(12 * var(--u)); height: calc(7 * var(--u)); min-width: 9px; min-height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg) translateY(-25%); }
.hg-moon { left: calc(232 * var(--u)); top: calc(30 * var(--u)); width: auto; --z: 90; }
.hg-moon::before, .hg-moon::after { display: none; }
.moonchip .moon { opacity: 1; transform: none; margin: 0; }

/* Cierre con el logo */
.ah-end { position: absolute; left: calc(300 * var(--u)); top: calc(130 * var(--u)); width: calc(200 * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); opacity: 0; transform: translateZ(calc(220 * var(--u))) scale(.8); pointer-events: none; }
.ah-end::before { content: ''; position: absolute; left: 50%; top: calc(48 * var(--u)); width: calc(280 * var(--u)); height: calc(220 * var(--u)); transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .97) 40%, rgba(255, 255, 255, .75) 65%, transparent); z-index: -1; }
.ah-end img { width: calc(96 * var(--u)); height: calc(96 * var(--u)); border-radius: 50%; box-shadow: 0 calc(16 * var(--u)) calc(36 * var(--u)) calc(-10 * var(--u)) rgba(15, 108, 189, .6), 0 0 0 calc(5 * var(--u)) rgba(255, 255, 255, .85); }
.ah-end b { font: 800 max(16px, calc(26 * var(--u)))/1 var(--font-h); letter-spacing: -.02em; color: var(--ink); }

/* ==========================================================================
   Estados
   ========================================================================== */
/* Estado estático (sin JS, movimiento reducido o antes del primer capítulo) */
.ah:not([data-ch]) .pg-home,
.ah:not([data-ch]) .omni__url.u0 { opacity: 1; }
.ah:not([data-ch]) .hg.pick { opacity: 1; transform: translate3d(0, 0, calc(var(--z) * var(--u))); }

/* Páginas y direcciones por capítulo */
.ah[data-ch="0"] .pg-id, .ah[data-ch="0"] .omni__url.uid,
.ah[data-ch="1"] .pg-ads, .ah[data-ch="1"] .omni__url.u1,
.ah[data-ch="2"] .pg-split, .ah[data-ch="2"] .omni__url.u2,
.ah[data-ch="3"] .pg-light, .ah[data-ch="3"] .omni__url.u3 { opacity: 1; transition-delay: .15s; }

/* Hologramas: aparición por barrido desde la base, salida rápida */
.ah[data-ch="0"] .hg.ch0, .ah[data-ch="1"] .hg.ch1, .ah[data-ch="2"] .hg.ch2, .ah[data-ch="3"] .hg.ch3 {
  opacity: 1; transform: translate3d(0, 0, calc(var(--z) * var(--u)));
  transition: opacity .5s ease, transform .9s var(--ease); transition-delay: calc(var(--d) + .25s); }
.reg-rt { --d: 120ms; } .reg-lb { --d: 240ms; } .reg-rb { --d: 380ms; }
.ah[data-ch="1"] .ah-shield { opacity: 1; transform: translateZ(calc(40 * var(--u))); }

/* Pestañas que se duermen (C4) */
.ah[data-ch="3"] .tab.t2, .ah[data-ch="3"] .tab.t3, .ah[data-ch="3"] .tab.t4 { opacity: .55; transition-delay: .6s; }
.ah[data-ch="3"] .tab .moon { opacity: 1; transform: none; transition-delay: .8s; }

/* ---------- Animaciones de capítulo (duración = un capítulo) ---------- */
.ah { --seg: 7s; }
.ah[data-ch] .hg, .ah[data-ch] .pg { will-change: opacity, transform; }

/* Encendido: barrido por la ventana + parpadeo de cada holograma (un nombre por capítulo para que se reinicie) */
.ah[data-ch="0"] .ah-sweep { animation: ah-sw0 1.1s var(--ease-in) .05s both; }
.ah[data-ch="1"] .ah-sweep { animation: ah-sw1 1.1s var(--ease-in) .05s both; }
.ah[data-ch="2"] .ah-sweep { animation: ah-sw2 1.1s var(--ease-in) .05s both; }
.ah[data-ch="3"] .ah-sweep { animation: ah-sw3 1.1s var(--ease-in) .05s both; }
@keyframes ah-sw0 { 0% { opacity: 0; transform: translateY(-100%); } 12%, 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(300%); } }
@keyframes ah-sw1 { 0% { opacity: 0; transform: translateY(-100%); } 12%, 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(300%); } }
@keyframes ah-sw2 { 0% { opacity: 0; transform: translateY(-100%); } 12%, 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(300%); } }
@keyframes ah-sw3 { 0% { opacity: 0; transform: translateY(-100%); } 12%, 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(300%); } }
.ah[data-ch="0"] .hg.ch0 { animation: ah-on0 .75s linear calc(var(--d) + .25s) both; }
.ah[data-ch="1"] .hg.ch1 { animation: ah-on1 .75s linear calc(var(--d) + .25s) both; }
.ah[data-ch="2"] .hg.ch2 { animation: ah-on2 .75s linear calc(var(--d) + .25s) both; }
@keyframes ah-on0 { 0% { opacity: 0; } 10% { opacity: .85; } 17% { opacity: .15; } 27% { opacity: 1; } 35% { opacity: .5; } 46%, 100% { opacity: 1; } }
@keyframes ah-on1 { 0% { opacity: 0; } 10% { opacity: .85; } 17% { opacity: .15; } 27% { opacity: 1; } 35% { opacity: .5; } 46%, 100% { opacity: 1; } }
@keyframes ah-on2 { 0% { opacity: 0; } 10% { opacity: .85; } 17% { opacity: .15; } 27% { opacity: 1; } 35% { opacity: .5; } 46%, 100% { opacity: 1; } }

/* C1: la web ve otra identidad a mitad de capítulo (3,5 s cada una) */
.ah[data-ch="0"] .pg-id .v0, .ah[data-ch="0"] .omni__idn.n0 { animation: ah-c0 var(--seg) linear both; }
.ah[data-ch="0"] .pg-id .v1, .ah[data-ch="0"] .omni__idn.n1 { animation: ah-c1 var(--seg) linear both; }
@keyframes ah-c0 { 0%, 47% { opacity: 1; transform: none; } 52%, 100% { opacity: 0; transform: translateY(-60%); } }
@keyframes ah-c1 { 0%, 47% { opacity: 0; transform: translateY(60%); } 52%, 100% { opacity: 1; transform: none; } }
.ah[data-ch="0"] .idc1 { animation: ah-k0 var(--seg) var(--ease) both; }
.ah[data-ch="0"] .idc2 { animation: ah-k1 var(--seg) var(--ease) both; }
@keyframes ah-k0 { 0%, 46% { z-index: 2; transform: translate3d(calc(var(--ox) * var(--u)), calc(var(--oy) * var(--u)), calc(var(--oz) * var(--u))); } 54%, 100% { z-index: 1; transform: translate3d(calc((var(--ox) - 6) * var(--u)), calc(var(--oy) * var(--u)), calc((var(--oz) - 50) * var(--u))); } }
@keyframes ah-k1 { 0%, 46% { z-index: 1; transform: translate3d(calc(var(--ox) * var(--u)), calc(var(--oy) * var(--u)), calc(var(--oz) * var(--u))); } 54%, 100% { z-index: 3; transform: translate3d(calc((var(--ox) + 16) * var(--u)), calc(var(--oy) * var(--u)), calc((var(--oz) + 90) * var(--u))); } }
.ah[data-ch="0"] .pg-id__fp { animation: ah-fp var(--seg) var(--ease) both; }
@keyframes ah-fp { 0%, 46% { transform: none; } 50% { transform: scale(.9) rotate(-8deg); } 55%, 100% { transform: rotate(6deg); } }

/* C2: anuncios que se pliegan, escudo que se dibuja, partículas que rebotan, Búnker que se activa */
.ah[data-ch="1"] .ad.a1 { animation: ah-fold var(--seg) var(--ease) both; }
.ah[data-ch="1"] .ad.a2 { animation: ah-fold2 var(--seg) var(--ease) both; }
.ah[data-ch="1"] .ad-side { animation: ah-fold3 var(--seg) var(--ease) both; }
@keyframes ah-fold { 0%, 13% { opacity: 1; transform: none; } 19%, 100% { opacity: 0; transform: scale(.92, .06); } }
@keyframes ah-fold2 { 0%, 20% { opacity: 1; transform: none; } 26%, 100% { opacity: 0; transform: scale(.92, .06); } }
@keyframes ah-fold3 { 0%, 27% { opacity: 1; transform: none; } 33%, 100% { opacity: 0; transform: scale(.06, .92); } }
.ah[data-ch="1"] .sh-edge { animation: ah-draw 1.4s var(--ease) .2s both; }
@keyframes ah-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.ah[data-ch="1"] .pz { animation: ah-pz 2.6s var(--ease-in) infinite; }
.ah[data-ch="1"] .p2 { animation-delay: .3s; } .ah[data-ch="1"] .p3 { animation-delay: .6s; } .ah[data-ch="1"] .p4 { animation-delay: .15s; }
.ah[data-ch="1"] .p5 { animation-delay: .9s; } .ah[data-ch="1"] .p6 { animation-delay: 1.2s; } .ah[data-ch="1"] .p7 { animation-delay: 1.5s; } .ah[data-ch="1"] .p8 { animation-delay: 1.8s; }
@keyframes ah-pz {
  0% { opacity: 0; transform: translate(calc(var(--x0) * var(--u)), calc(var(--y0) * var(--u))) scale(.9); animation-timing-function: cubic-bezier(.45, 0, .9, .5); }
  12% { opacity: 1; }
  52% { opacity: 1; transform: translate(calc(var(--x1) * var(--u)), calc(var(--y1) * var(--u))) scale(1); animation-timing-function: cubic-bezier(.15, .7, .3, 1); }
  58% { transform: translate(calc(var(--x1) * var(--u)), calc(var(--y1) * var(--u))) scale(.82); }
  100% { opacity: 0; transform: translate(calc((var(--x1) + (var(--x0) - var(--x1)) * .38) * var(--u)), calc((var(--y1) + (var(--y0) - var(--y1)) * .38 + 40) * var(--u))) scale(.7) rotate(-14deg); }
}
.ah[data-ch="1"] .sw::before { animation: ah-swbg var(--seg) var(--ease) both; }
.ah[data-ch="1"] .sw i { animation: ah-swk var(--seg) var(--ease) both; }
@keyframes ah-swbg { 0%, 42% { opacity: 0; } 48%, 100% { opacity: 1; } }
@keyframes ah-swk { 0%, 42% { transform: none; } 48%, 100% { transform: translateX(calc(18 * var(--u))); } }

/* C3: la segunda pestaña entra, el PDF se subraya, las herramientas se encienden, Neural responde */
.ah[data-ch="2"] .sp-r { animation: ah-in-r var(--seg) var(--ease) both; }
@keyframes ah-in-r { 0%, 5% { opacity: 0; transform: translateX(40%); } 16%, 100% { opacity: 1; transform: none; } }
.ah[data-ch="2"] .hl { animation: ah-hl var(--seg) var(--ease) both; }
@keyframes ah-hl { 0%, 30% { transform: scaleX(0); } 40%, 100% { transform: scaleX(1); } }
.ah[data-ch="2"] .tl { animation: ah-pop var(--seg) var(--ease) both; }
.ah[data-ch="2"] .tl:nth-of-type(2) { animation-name: ah-pop2; } .ah[data-ch="2"] .tl:nth-of-type(3) { animation-name: ah-pop3; }
.ah[data-ch="2"] .tl:nth-of-type(4) { animation-name: ah-pop4; } .ah[data-ch="2"] .tl:nth-of-type(5) { animation-name: ah-pop5; } .ah[data-ch="2"] .tl:nth-of-type(6) { animation-name: ah-pop6; }
@keyframes ah-pop { 0%, 9% { opacity: 0; transform: scale(.6); } 15%, 100% { opacity: 1; transform: none; } }
@keyframes ah-pop2 { 0%, 11% { opacity: 0; transform: scale(.6); } 17%, 100% { opacity: 1; transform: none; } }
@keyframes ah-pop3 { 0%, 13% { opacity: 0; transform: scale(.6); } 19%, 100% { opacity: 1; transform: none; } }
@keyframes ah-pop4 { 0%, 15% { opacity: 0; transform: scale(.6); } 21%, 100% { opacity: 1; transform: none; } }
@keyframes ah-pop5 { 0%, 17% { opacity: 0; transform: scale(.6); } 23%, 100% { opacity: 1; transform: none; } }
@keyframes ah-pop6 { 0%, 19% { opacity: 0; transform: scale(.6); } 25%, 100% { opacity: 1; transform: none; } }
.ah[data-ch="2"] .bub.me { animation: ah-msg var(--seg) var(--ease) both; }
@keyframes ah-msg { 0%, 14% { opacity: 0; transform: translateY(40%) scale(.9); } 20%, 100% { opacity: 1; transform: none; } }
.ah[data-ch="2"] .bub.ai { animation: ah-msg2 var(--seg) var(--ease) both; }
@keyframes ah-msg2 { 0%, 24% { opacity: 0; transform: translateY(30%); } 29%, 100% { opacity: 1; transform: none; } }
.ah[data-ch="2"] .bub.ai .ln { animation: ah-type var(--seg) linear both; }
.ah[data-ch="2"] .bub.ai .ln + .ln { animation-name: ah-type2; } .ah[data-ch="2"] .bub.ai .ln + .ln + .ln { animation-name: ah-type3; }
@keyframes ah-type { 0%, 29% { transform: scaleX(0); } 39%, 100% { transform: scaleX(1); } }
@keyframes ah-type2 { 0%, 39% { transform: scaleX(0); } 49%, 100% { transform: scaleX(1); } }
@keyframes ah-type3 { 0%, 49% { transform: scaleX(0); } 59%, 100% { transform: scaleX(1); } }

/* C4: la memoria baja, la importación se completa, cierre con el logo (≥1,5 s) y fundido de 0,4 s hacia el capítulo 1 */
.ah[data-ch="3"] .ram__bar i { animation: ah-ram var(--seg) var(--ease) both; }
@keyframes ah-ram { 0%, 10% { transform: scaleX(.88); } 36%, 100% { transform: scaleX(.42); } }
.ah[data-ch="3"] .lt-row .z:not(.on) { animation: ah-z var(--seg) var(--ease) both; }
.ah[data-ch="3"] .lt-row.r2 .z { animation-name: ah-z2; } .ah[data-ch="3"] .lt-row.r3 .z { animation-name: ah-z3; }
@keyframes ah-z { 0%, 10% { opacity: 0; transform: scale(.7); } 14%, 100% { opacity: 1; transform: none; } }
@keyframes ah-z2 { 0%, 15% { opacity: 0; transform: scale(.7); } 19%, 100% { opacity: 1; transform: none; } }
@keyframes ah-z3 { 0%, 20% { opacity: 0; transform: scale(.7); } 24%, 100% { opacity: 1; transform: none; } }
.ah[data-ch="3"] .imp__row .ok { animation: ah-ok var(--seg) var(--ease) both; }
.ah[data-ch="3"] .imp__row:nth-of-type(2) .ok { animation-name: ah-ok2; } .ah[data-ch="3"] .imp__row:nth-of-type(3) .ok { animation-name: ah-ok3; }
@keyframes ah-ok { 0%, 20% { opacity: 0; transform: rotate(-45deg) translateY(-25%) scale(.3); } 25%, 100% { opacity: 1; transform: rotate(-45deg) translateY(-25%); } }
@keyframes ah-ok2 { 0%, 27% { opacity: 0; transform: rotate(-45deg) translateY(-25%) scale(.3); } 32%, 100% { opacity: 1; transform: rotate(-45deg) translateY(-25%); } }
@keyframes ah-ok3 { 0%, 34% { opacity: 0; transform: rotate(-45deg) translateY(-25%) scale(.3); } 39%, 100% { opacity: 1; transform: rotate(-45deg) translateY(-25%); } }
.ah[data-ch="3"] .ah-end { animation: ah-end var(--seg) var(--ease) both; }
/* 7 s: entra 4,3–4,8 s · visible 4,8–6,6 s (1,8 s) · fundido 6,6–7 s */
@keyframes ah-end { 0%, 62% { opacity: 0; transform: translateZ(calc(220 * var(--u))) scale(.7); } 69%, 94% { opacity: 1; transform: translateZ(calc(220 * var(--u))) scale(1); } 100% { opacity: 0; transform: translateZ(calc(220 * var(--u))) scale(1.04); } }
.ah[data-ch="3"] .hg.ch3 { animation: ah-hg-out var(--seg) linear both; }
@keyframes ah-hg-out { 0%, 3% { opacity: 0; } 9%, 60% { opacity: 1; } 67%, 100% { opacity: 0; } }
/* La ventana se apaga del todo para el cierre y vuelve con un fundido al empezar el capítulo 1 */
.ah[data-ch="3"] .ah-win { animation: ah-win-out var(--seg) linear both; }
@keyframes ah-win-out { 0%, 60% { opacity: 1; } 67%, 100% { opacity: 0; } }
.ah[data-ch="0"] .ah-win { animation: ah-win-in .45s var(--ease) both; }
@keyframes ah-win-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Bucles ambientales (solo con el reloj en marcha) ---------- */
.ah.is-live .ah-base__ring.r1 { animation: ah-spin 24s linear infinite; }
.ah.is-live .ah-base__ring.r2 { animation: ah-spin 16s linear infinite reverse; }
@keyframes ah-spin { to { transform: translate(-50%, -50%) scaleY(.16) rotate(360deg); } }
.ah.is-live .ah-beam { animation: ah-beam 4s ease-in-out infinite alternate; }
@keyframes ah-beam { from { opacity: .55; } to { opacity: .9; } }
.ah.is-live .ah-rise i { animation: ah-rise 4.8s linear var(--dl) infinite; }
@keyframes ah-rise { 0% { opacity: 0; transform: translateY(0) scale(1); } 15% { opacity: .9; } 70% { opacity: .5; } 100% { opacity: 0; transform: translateY(calc(-300 * var(--u))) scale(.5); } }
.ah.is-live .holo__scan { animation: ah-scan 3.6s var(--ease-in) infinite; }
.ah.is-live .hg .holo__scan { animation-delay: .9s; }
@keyframes ah-scan { 0% { opacity: 0; transform: translateY(-110%); } 10% { opacity: 1; } 70%, 100% { opacity: 0; transform: translateY(270%); } }

/* Pausa: todo se congela a la vez (reloj y CSS) */
.ah.is-paused *, .ah.is-paused *::before, .ah.is-paused *::after { animation-play-state: paused !important; }

/* ==========================================================================
   Tablet / móvil
   ========================================================================== */
@media (max-width: 1099px) {
  .ah-plane { --rx: 7deg; --ry: -9deg; }
}
/* Tablet: los hologramas con más profundidad sobresalen; se reserva margen lateral */
@media (min-width: 641px) and (max-width: 1099px) {
  .ah__media { max-width: min(940px, calc(100% - 32px)); }
}
/* Móvil: escena encuadrada a la ventana, lo esencial dentro y un holograma por capítulo */
@media (max-width: 640px) {
  .ah__title { font-size: clamp(32px, 9.4vw, 44px); }
  .ah__btn { width: 100%; justify-content: center; }
  .ah__ctas { width: 100%; }
  .ah__chap { align-items: flex-start; }
  .ah-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .ah-ch { padding: 6px 6px 8px; }
  .ah-ch__n { display: none; }
  .ah-ch__t { font-size: 13px; grid-column: 1 / -1; }
  .ah-stage { --u: calc(100cqw / 500); aspect-ratio: 500 / 540; perspective: 280cqw; }
  .ah-plane { --rx: 6deg; --ry: 0deg; left: calc(-150 * var(--u)); right: auto; width: calc(800 * var(--u)); }
  .ah-win { left: calc(160 * var(--u)); width: calc(480 * var(--u)); top: calc(60 * var(--u)); height: calc(300 * var(--u)); }
  .ah-win__tabs { height: max(26px, calc(34 * var(--u))); }
  .tab { height: max(21px, calc(26 * var(--u))); width: calc(120 * var(--u)); }
  .tab.t3, .tab.t4 { display: none; }
  .ah-win__bar { height: max(30px, calc(36 * var(--u))); }
  .omni__url { right: calc(130 * var(--u)); left: max(20px, calc(26 * var(--u))); }
  .ah-win__body { top: max(56px, calc(70 * var(--u))); }
  .ah-floor { -webkit-mask-image: radial-gradient(40% 34% at 50% 84%, #000 30%, transparent 100%); mask-image: radial-gradient(40% 34% at 50% 84%, #000 30%, transparent 100%); }
  /* Ventana: solo lo esencial y más grande */
  .pg-id { grid-template-columns: 1fr; align-content: start; padding: 30px calc(30 * var(--u)) 0; }
  .pg-id__fp, .rw-lg, .rw-tz { display: none !important; }
  .pg-id__rows { gap: 10px; }
  .pg-id__rows .rw { grid-template-columns: 1fr; gap: 2px; }
  .pg-id__rows dd { font-size: 16px; }
  .ln.x, .ad-side { display: none; }
  .pg-ads { padding-right: calc(30 * var(--u)); }
  .lt-row.r3 { display: none; }
  .pg-light { padding: calc(18 * var(--u)) calc(30 * var(--u)); }
  .pg-light .lt-row { padding-right: 8px; }
  .sp-l .img { display: none; }
  /* Hologramas: uno por capítulo */
  .hg:not(.pick) { display: none; }
  .hg.pick { left: calc(250 * var(--u)) !important; top: calc(312 * var(--u)) !important; width: calc(300 * var(--u)) !important; --z: 90; }
  .ah:not([data-ch]) .hg.pick { opacity: 0; }
  .ah:not([data-ch]) .hg.hg-tools { opacity: 1; }
  .hg.hg-ids { top: calc(330 * var(--u)) !important; height: calc(150 * var(--u)); }
  .idc { width: calc(290 * var(--u)); }
  .idc__geo { display: none !important; }
  .idc1 { --oy: 76; } .idc2 { --oy: 0; }
  .ah-end { left: calc(300 * var(--u)); top: calc(110 * var(--u)); }
  .ah-rise i:nth-child(n+5) { display: none; }
  /* partículas: arrancan dentro del encuadre móvil (x 150–650) */
  .pz.p1, .pz.p7 { --x0: 175 !important; } .pz.p2 { --x0: 180 !important; }
  .pz.p8 { --x0: 560 !important; --x1: 590 !important; }
  .pz.p3, .pz.p4, .pz.p5 { display: none; }
}

/* ==========================================================================
   Movimiento reducido: fotograma fijo; los capítulos siguen siendo navegables
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ah *, .ah *::before, .ah *::after { animation: none !important; transition: none !important; }
  .ah-ch__bar { display: none; }
  .ah-toggle { display: none !important; }
  .ah[data-ch="1"] .ad, .ah[data-ch="1"] .ad-side { opacity: .35; }
}
