﻿/* Llama · Gases de Occidente
   Paleta tomada de la escena: la llama azul ilumina todo; el ámbar solo
   aparece para lo que exige atención (aprobaciones humanas y emergencias). */

/* Tipografía de títulos: MADE Mirage (MadeType), alojada localmente.
   Licencia de USO PERSONAL: ver web/assets/fonts/LICENSE.txt */
@font-face {
  font-family: "Made Mirage";
  src: url("../assets/fonts/made-mirage-thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Made Mirage";
  src: url("../assets/fonts/made-mirage-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Made Mirage";
  src: url("../assets/fonts/made-mirage-medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Made Mirage";
  src: url("../assets/fonts/made-mirage-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Made Mirage";
  src: url("../assets/fonts/made-mirage-black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #04060d;
  --ink: #edf2fb;          /* esmalte */
  --ink-2: #b4c3dc;
  --ink-3: #8193b3;
  --flame: #5a95ff;        /* cuerpo de la llama */
  --core: #a9e7ff;         /* cono interior */
  --violet: #9b8cff;       /* punta de la llama */
  --amber: #ffb547;        /* atención */
  --ember: #ff6a3d;        /* emergencia */
  --brand: #a8b400;        /* verde GdO, solo el punto de la marca */
  --glass: rgba(16, 24, 48, .42);
  --glass-strong: rgba(12, 18, 38, .66);
  --edge: rgba(176, 204, 255, .16);
  --edge-hi: rgba(214, 230, 255, .32);
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  --display: "Made Mirage", Georgia, "Times New Roman", serif;
  --text: "Raleway", "Segoe UI", system-ui, sans-serif;
  --r-panel: 28px;
  --r-card: 18px;
  --r-input: 14px;
  --nav-h: 64px;
  --fi: .3;                /* intensidad de la llama, la escribe JS */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0; min-height: 100vh; background: var(--night); color: var(--ink);
  font: 400 17px/1.6 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--core); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--core); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- escena */
#flame { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -3; display: block; }
#flame.flame-fallback {
  background: radial-gradient(60% 30% at 40% 62%, rgba(90, 149, 255, calc(var(--fi) * .55)), transparent 70%),
              radial-gradient(30% 12% at 40% 60%, rgba(169, 231, 255, calc(var(--fi) * .5)), transparent 70%), var(--night);
}
/* Plasma de la segunda mitad: se abre como un círculo desde el quemador (--mix 0..1, lo mueve app.js).
   Va encima de la llama (mismo z-index, después en el DOM) y debajo de la viñeta y el grano. */
#plasma { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -3; display: block; visibility: hidden;
  --r: calc(var(--mix, 0) * 150% - 30%);
  opacity: calc(.35 + var(--mix, 0) * .65);
  -webkit-mask-image: radial-gradient(circle at 50% 55%, #000 var(--r), transparent calc(var(--r) + 30%));
  mask-image: radial-gradient(circle at 50% 55%, #000 var(--r), transparent calc(var(--r) + 30%)); }
.vignette { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 90% at 40% 55%, transparent 55%, rgba(2, 3, 8, .75) 100%); }
.grain { position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)} }

/* ------------------------------------------------------------- vidrio */
.glass {
  position: relative; background: var(--glass);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--edge); box-shadow: var(--shadow), inset 0 1px 0 var(--edge-hi);
}
.glass::after { /* la llama se refleja en el borde superior del vidrio */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(120, 170, 255, calc(.06 + var(--fi) * .08)), transparent 38%);
}
.card { border-radius: var(--r-card); padding: 22px 24px; }

/* ------------------------------------------------------------- navegación */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20;
  width: min(1240px, calc(100% - 28px)); height: var(--nav-h); border-radius: 999px;
  display: flex; align-items: center; gap: 18px; padding: 0 10px 0 18px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { align-self: center; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, rgba(90, 149, 255, .5), transparent 70%); position: relative; }
.brand-mark svg { width: 20px; height: 20px; fill: var(--core); stroke: none; filter: drop-shadow(0 0 6px var(--flame)); }
.brand-mark::after { content: ""; position: absolute; right: 1px; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.brand-name { font: 800 26px/1 var(--display); letter-spacing: .5px; }
.brand-sub { font-size: 13px; color: var(--ink-3); }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: rgba(160, 196, 255, .1); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.icon-btn:hover { background: rgba(160, 196, 255, .12); color: var(--ink); }
.icon-btn[aria-pressed="false"] .wave { opacity: .25; }
.sos { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #1b0e00; background: var(--amber);
  padding: 9px 16px 9px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 0 24px rgba(255, 181, 71, .35); }
.sos svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------- hero */
.hero { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 32px;
  padding: calc(var(--nav-h) + 40px) max(24px, calc((100vw - 1240px) / 2)) 32px; }
.hero-copy { display: flex; flex-direction: column; justify-content: space-between; min-height: calc(100vh - var(--nav-h) - 72px); }
.display { font: 400 clamp(64px, 10.5vw, 168px)/.84 var(--display); letter-spacing: -1px; margin: 0;
  text-shadow: 0 0 calc(18px + var(--fi) * 40px) rgba(90, 149, 255, calc(.25 + var(--fi) * .3)); }
.display b { font-weight: 900; }
.lede { max-width: 31em; color: var(--ink-2); font-size: 19px; margin: 18px 0 0; text-shadow: 0 1px 14px rgba(2, 4, 10, .9), 0 0 2px rgba(2, 4, 10, .6); }
.controls { display: flex; align-items: center; gap: 34px; margin-top: auto; }
.knob-wrap { position: relative; flex: none; width: 250px; height: 250px; display: grid; place-items: center; }
.dial { position: absolute; inset: 0; pointer-events: none; }
.tick { position: absolute; left: 50%; top: 50%; font-size: 13px; color: var(--ink-3); white-space: nowrap; transition: color .3s;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-112px) rotate(calc(-1 * var(--a))); text-shadow: 0 1px 8px #000; }
.tick.on { color: var(--core); font-weight: 600; }
.voice-panel { display: grid; gap: 10px; max-width: 30em; }
.hint { margin: 0; font-size: 14px; color: var(--ink-3); }
.knob { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; touch-action: none;
  background: transparent; transform: rotate(var(--knob-rot, -130deg)); transition: transform .9s cubic-bezier(.2, .9, .2, 1.1); }
.knob-ridge { position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #2b3448 0 4deg, #11161f 4deg 8deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06), 0 0 calc(var(--fi) * 60px) rgba(90, 149, 255, calc(var(--fi) * .55)); }
.knob-face { position: absolute; inset: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #3a455c 0%, #161c29 55%, #0b0f17 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .12), inset 0 -6px 14px rgba(0, 0, 0, .7); }
.knob-pointer { position: absolute; left: 50%; top: 10px; width: 6px; height: 46px; margin-left: -3px; border-radius: 3px;
  background: linear-gradient(var(--core), var(--flame)); box-shadow: 0 0 12px var(--flame); }
.knob[aria-pressed="true"] .knob-face { box-shadow: inset 0 2px 1px rgba(255, 255, 255, .12), inset 0 -6px 14px rgba(0, 0, 0, .7), 0 0 0 3px rgba(169, 231, 255, .55); }
.knob-state { font: 700 30px/1.05 var(--display); color: var(--ink); min-height: 1.1em; letter-spacing: .3px; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
/* Lo que la persona va diciendo: blanco brillante con halo oscuro para que no se pierda en la llama */
.transcript { min-height: 1.6em; color: #fff; font-size: 19px; font-weight: 600; line-height: 1.45;
  text-shadow: 0 0 2px #000, 0 1px 4px rgba(0, 0, 0, .95), 0 2px 18px rgba(0, 0, 0, .9), 0 0 28px rgba(255, 255, 255, .28); }
.voice-opts { display: flex; gap: 22px; flex-wrap: wrap; color: var(--ink-2); font-size: 15px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 38px; height: 22px; border-radius: 99px; background: rgba(160, 190, 240, .2); position: relative; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.switch input:checked + span { background: var(--flame); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--core); outline-offset: 2px; }

/* encendido (el único momento orquestado de la página) */
.reveal-ignite { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
body.lit .reveal-ignite { opacity: 1; transform: none; }
body.lit .reveal-ignite:nth-child(2) { transition-delay: .15s; }
body.lit .reveal-ignite:nth-child(3) { transition-delay: .3s; }
body.lit .reveal-ignite:nth-child(4) { transition-delay: .45s; }

/* ------------------------------------------------------------- chat */
.chat { position: sticky; top: calc(var(--nav-h) + 28px); height: calc(100vh - var(--nav-h) - 56px); border-radius: var(--r-panel);
  display: flex; flex-direction: column; overflow: hidden; background: var(--glass-strong); transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--edge); }
.who { display: flex; gap: 12px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 800 18px var(--display);
  background: linear-gradient(140deg, rgba(90, 149, 255, .5), rgba(155, 140, 255, .35)); border: 1px solid var(--edge-hi); }
.who-name { font-weight: 700; line-height: 1.2; }
.who-meta { font-size: 13px; color: var(--ink-3); }
.chat-actions { display: flex; gap: 2px; }
.only-docked { display: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: rgba(160, 190, 240, .25) transparent; }
.msg { max-width: 92%; animation: msgIn .35s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg.user { align-self: flex-end; background: rgba(90, 149, 255, .22); border: 1px solid rgba(120, 170, 255, .3); padding: 10px 14px; border-radius: 18px 18px 6px 18px; }
.msg.bot { align-self: flex-start; padding: 2px 2px; line-height: 1.6; }
.msg.bot p { margin: 0 0 .6em; } .msg.bot p:last-child { margin-bottom: 0; }
/* Gráficas e imágenes que el agente comparte por enlace. */
.msg-img { display: block; max-width: 100%; height: auto; margin: 8px 0 2px; border-radius: 12px;
  border: 1px solid var(--edge); background: rgba(0, 0, 0, .18); }
.msg-fig { margin: 10px 0 2px; }
.msg-fig .msg-img { margin: 0; }
.msg.bot.streaming > .body::after { content: ""; display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; vertical-align: -3px;
  border-radius: 2px; background: var(--core); box-shadow: 0 0 10px var(--flame); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.cite { display: inline-block; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 3px 6px; margin: 0 2px; border-radius: 6px;
  vertical-align: 2px; color: var(--core); background: rgba(169, 231, 255, .12); border: 1px solid rgba(169, 231, 255, .25); cursor: pointer; text-decoration: none; }
.steps { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-3); }
.step { display: flex; align-items: center; gap: 8px; }
.step .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--flame); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
.step.done .dot { animation: none; border-color: var(--flame); background: var(--flame); box-shadow: 0 0 8px var(--flame); transform: scale(.6); }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking { display: flex; align-items: center; align-self: flex-start; gap: 12px; padding: 6px 4px; color: var(--core); font-weight: 600; font-size: 14px; animation: msgIn .3s ease both; }
.thinking .f { position: relative; width: 30px; height: 30px; flex: none; }
.thinking .f span { position: absolute; bottom: 0; left: 50%; width: 12px; height: 26px; margin-left: -6px; border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%; background: radial-gradient(ellipse at 50% 80%, #eaf6ff 0%, #5a95ff 45%, rgba(40, 80, 255, 0) 72%); filter: blur(.3px); transform-origin: 50% 100%; animation: lick .9s ease-in-out infinite; }
.thinking .f span:nth-child(2) { margin-left: -14px; height: 18px; animation-delay: .2s; }
.thinking .f span:nth-child(3) { margin-left: 2px; height: 20px; animation-delay: .4s; }
.thinking .t { animation: breathe 1.6s ease-in-out infinite; }
@keyframes lick { 0%, 100% { transform: scaleY(1) skewX(0); } 50% { transform: scaleY(1.25) skewX(-6deg); } }
@keyframes breathe { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.jev-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.pill { padding: 3px 9px; border-radius: 999px; background: rgba(160, 196, 255, .1); border: 1px solid var(--edge); color: var(--ink-2); }
.pill.warn { color: #241300; background: var(--amber); border-color: var(--amber); }
.sources { display: grid; gap: 6px; margin-top: 10px; }
.source { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; font-size: 13.5px; padding: 8px 10px;
  border-radius: 12px; background: rgba(10, 16, 34, .5); border: 1px solid var(--edge); color: var(--ink-2); text-decoration: none; }
.source b { color: var(--ink); font-weight: 600; }
.source small { grid-column: 2; color: var(--ink-3); }
.source.flash { border-color: var(--core); box-shadow: 0 0 0 2px rgba(169, 231, 255, .25); }
.source[href] { cursor: pointer; transition: border-color .2s, background .2s; }
.source[href]:hover, .source[href]:focus-visible { border-color: var(--edge-hi); background: rgba(16, 24, 48, .75); outline: none; }
.source[data-faq] small::after { content: " · ver en preguntas frecuentes"; color: var(--core); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--edge); background: rgba(6, 10, 22, .35); }
.composer input { flex: 1; min-width: 0; border-radius: var(--r-input); border: 1px solid var(--edge); background: rgba(6, 10, 22, .55); padding: 12px 14px; outline: none; }
.composer input:focus { border-color: rgba(169, 231, 255, .6); }
.composer input::placeholder { color: var(--ink-3); }
.mic, .send { width: 46px; flex: none; border-radius: var(--r-input); border: 1px solid var(--edge); background: rgba(160, 196, 255, .1); cursor: pointer; display: grid; place-items: center; }
.send { background: var(--flame); border-color: var(--flame); color: #fff; }
.send.armed { animation: sendPulse 1.1s ease-out infinite; }
.msg.user.pending { background: rgba(90, 149, 255, .1); border-style: dashed; border-color: rgba(169, 231, 255, .45); }
.msg.user .pending-hint { display: block; margin-top: 6px; font-size: 11.5px; font-style: italic; color: var(--ink-3); }
@keyframes sendPulse {
  0% { box-shadow: 0 0 0 0 rgba(90, 149, 255, .7); }
  100% { box-shadow: 0 0 0 12px rgba(90, 149, 255, 0); }
}
.mic.live { background: var(--core); color: #06122a; }

/* tarjetas que el agente pone en la conversación */
.card-in { border-radius: var(--r-card); padding: 16px; background: rgba(10, 16, 34, .72); border: 1px solid var(--edge-hi); animation: msgIn .35s ease both; }
.card-in h4 { margin: 0 0 6px; font: 700 22px/1.1 var(--display); letter-spacing: .3px; }
.card-in p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.options { display: grid; gap: 8px; }
.option { text-align: left; border-radius: 14px; padding: 12px 14px; border: 1px solid var(--edge); background: rgba(160, 196, 255, .07); cursor: pointer; transition: border-color .2s, background .2s; }
.option:hover, .option[aria-pressed="true"] { border-color: var(--core); background: rgba(169, 231, 255, .1); }
.option b { display: block; } .option span { color: var(--ink-3); font-size: 14px; }
.field { display: grid; gap: 4px; margin: 10px 0; font-size: 14px; color: var(--ink-2); }
.field input, .field textarea { border-radius: 12px; border: 1px solid var(--edge); background: rgba(6, 10, 22, .6); padding: 9px 12px; color: var(--ink); font: inherit; resize: vertical; }
.contract-codes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.contract-codes button { font-size: 12.5px; border-radius: 999px; padding: 4px 10px; border: 1px dashed var(--edge-hi); background: transparent; cursor: pointer; color: var(--ink-2); }
.err { color: var(--amber); font-size: 14px; margin: 6px 0; }
.approval { border-color: rgba(255, 181, 71, .7); box-shadow: 0 0 0 1px rgba(255, 181, 71, .25), 0 0 40px -10px rgba(255, 181, 71, .5); }
.approval h4 { color: var(--amber); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn { border-radius: 999px; padding: 9px 18px; border: 1px solid var(--flame); background: var(--flame); color: #fff; font-weight: 700; cursor: pointer; transition: transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--edge-hi); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #241300; }
.btn.danger { background: transparent; border-color: var(--ember); color: #ffb39c; }
.emergency { border-color: var(--ember); background: linear-gradient(160deg, rgba(255, 106, 61, .3), rgba(30, 10, 6, .8)); }
.emergency .num { font: 900 76px/.9 var(--display); color: #fff; text-shadow: 0 0 30px var(--ember); text-decoration: none; display: inline-block; }
.emergency ol { margin: 8px 0 0; padding-left: 20px; color: #ffe2d7; }
.resolved { opacity: .6; pointer-events: none; }

/* botón flotante cuando el chat se esconde al hacer scroll */
.chat-fab { position: fixed; right: 26px; bottom: 26px; z-index: 1001; width: 68px; height: 68px; border-radius: 50%; border: 1px solid var(--edge-hi); cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #364160, #0d121c); box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 calc(10px + var(--fi) * 40px) rgba(90, 149, 255, .6);
  transform: scale(0); transition: transform .4s cubic-bezier(.2, .9, .3, 1.3); display: grid; place-items: center; }
.fab-flame { width: 22px; height: 30px; border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%; background: radial-gradient(circle at 50% 75%, var(--core), var(--flame) 55%, var(--violet));
  box-shadow: 0 0 18px var(--flame); transform: scale(calc(.8 + var(--fi) * .35)); }
body.docked .chat-fab { transform: scale(1); }
body.docked .chat { position: fixed; right: 26px; bottom: 108px; top: auto; width: min(440px, calc(100vw - 52px)); height: min(640px, calc(100vh - 140px));
  transform: translateY(24px) scale(.96); opacity: 0; pointer-events: none; z-index: 1000; } /* el chat flotante va encima de todo */
body.docked.chat-open .chat { transform: none; opacity: 1; pointer-events: auto; }
body.docked .only-docked { display: grid; }

/* ------------------------------------------------------------- secciones */
.section { padding: 120px 0 40px; }
.wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.display-2 { font: 800 clamp(44px, 6vw, 92px)/.9 var(--display); margin: 0 0 18px; letter-spacing: -.5px; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34em); gap: 32px; align-items: end; margin-bottom: 32px; }
.section-sub { color: var(--ink-2); margin: 0 0 22px; }
.big-sentence { font: 700 clamp(30px, 3.6vw, 54px)/1.08 var(--display); max-width: 22ch; margin: 0 0 36px; color: var(--ink-2); }
.big-sentence b { color: var(--ink); font-weight: 900; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.viz { margin: 0; }
.viz figcaption { font-weight: 700; margin-bottom: 14px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 11em minmax(0, 1fr) 3em; gap: 12px; align-items: center; font-size: 14.5px; }
.bar .lbl { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .val { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar .track { height: 12px; border-radius: 0 4px 4px 0; background: rgba(160, 196, 255, .07); position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: #3987e5; width: 0; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.bar:hover .fill { background: #5a9cf0; }
.fine { color: var(--ink-3); font-size: 14px; margin-top: 18px; }
.muted { color: var(--ink-3); }

.faq-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 999px; min-width: min(380px, 100%); height: 50px; }
.search input { border: 0; background: transparent; outline: none; flex: 1; height: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; padding: 7px 14px; border: 1px solid var(--edge); background: rgba(16, 24, 48, .5); color: var(--ink-2); cursor: pointer; font-size: 14.5px; backdrop-filter: blur(10px); }
.chip[aria-pressed="true"] { background: var(--ink); color: #0a1226; border-color: var(--ink); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--c); box-shadow: 0 0 8px var(--c); }

/* Carrusel de preguntas: tarjetas escalonadas con esquina cortada; el borde lleva el color de la categoría. */
.faq-deck { --cw: 380px; --ch: 520px; --cut: 44px; position: relative; height: 600px; overflow: hidden; touch-action: pan-y;
  isolation: isolate; /* el z-index de las tarjetas no se sale del carrusel */ }
.faq-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 0 16px; }
.fcard { position: absolute; left: 50%; top: 50%; width: var(--cw); height: var(--ch); cursor: pointer;
  transition: transform .5s ease-in-out, filter .5s; }
.faq-deck.no-anim .fcard { transition: none; }
/* En las tarjetas laterales se atenúa el contenido, no el borde de color */
.fcard:not(.is-center) .fcard-in > :not(.fcard-cut) { opacity: .4; transition: opacity .5s; }
.fcard:not(.is-center):hover .fcard-in > :not(.fcard-cut) { opacity: .7; }
.fcard.is-center { cursor: default; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c) 35%, transparent)) drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
/* Resaltado al llegar desde una fuente del chat */
.fcard.flash { animation: faqFlash 2.2s ease-out; }
@keyframes faqFlash {
  0%, 35% { filter: drop-shadow(0 0 30px var(--c)) drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
  100% { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c) 35%, transparent)) drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
}
.fcard-in { position: relative; height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 26px 26px 22px;
  /* Vidrio como el resto de la página; borde fino teñido con el color de la categoría */
  background: var(--glass); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  --line: color-mix(in srgb, var(--c) 55%, transparent);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--edge-hi); color: var(--ink-2); transition: background .5s;
  clip-path: polygon(var(--cut) 0%, calc(100% - var(--cut)) 0%, 100% var(--cut), 100% 100%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 100%, 0 0); }
/* Línea diagonal que cierra el borde en la esquina cortada */
.fcard-cut { position: absolute; right: -1px; top: calc(var(--cut) - 1px); width: calc(var(--cut) * 1.4142 + 1px); height: 1px; background: var(--line); transform: rotate(45deg); transform-origin: top right; }
.fcard-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); box-shadow: 3px 3px 0 var(--night); }
.fcard-icon svg { width: 28px; height: 28px; stroke-width: 1.7; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 70%, transparent)); }
.fcard-cat { font-size: 12.5px; color: var(--c); letter-spacing: .02em; }
.fcard-q { margin: 0; font: 700 17px/1.35 var(--text); color: var(--ink); }
.fcard-a { margin: 0; font-size: 14.5px; line-height: 1.5; font-weight: 400; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; }
.fcard.is-center .fcard-in { --line: color-mix(in srgb, var(--c) 85%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 55%), var(--glass-strong); }
.fcard.is-center .fcard-a { display: block; overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }
.fcard-foot { display: none; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 6px; }
.fcard.is-center .fcard-foot { display: flex; }
.fcard-foot a { font-size: 13.5px; }
.fcard-foot .btn { padding: 7px 14px; font-size: 14px; }
.faq-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 8px; }
.faq-nav[hidden] { display: none; }
.faq-arrow { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--edge-hi); background: var(--glass-strong); color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.faq-arrow:hover { background: var(--ink); color: #0a1226; }
.faq-arrow:focus-visible { outline: 2px solid var(--core); outline-offset: 3px; }
.faq-arrow svg { width: 22px; height: 22px; }
.faq-pos { min-width: 6em; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 14.5px; }

.wiki { display: grid; grid-template-columns: 300px 1fr; border-radius: var(--r-panel); min-height: 620px; overflow: hidden; }
.wiki-nav { border-right: 1px solid var(--edge); padding: 18px 10px; overflow-y: auto; max-height: 760px; }
/* Títulos de grupo del índice: cápsula como la de "Borrador", en amarillo brillante */
.wiki-nav h4 { display: table; margin: 16px 6px 6px; padding: 3px 12px; border-radius: 999px; font: 700 14.5px var(--text); color: #ffe27a;
  border: 1px solid #ffd43b; background: rgba(255, 212, 59, .07); box-shadow: 0 0 10px rgba(255, 212, 59, .28), inset 0 0 6px rgba(255, 212, 59, .12);
  text-shadow: 0 0 8px rgba(255, 212, 59, .35); }
.wiki-nav button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 10px; border-radius: 10px; color: var(--ink-2); cursor: pointer; font-size: 14.5px; }
.wiki-nav button:hover, .wiki-nav button[aria-current="page"] { background: rgba(160, 196, 255, .12); color: var(--ink); }
.wiki-nav .topic-btn { font-weight: 700; color: var(--ink); }
.wiki-page { padding: 30px 40px; overflow-y: auto; max-height: 760px; outline: none; }
.wiki-page h1 { font: 800 52px/.95 var(--display); margin: 0 0 14px; }
.wiki-page .wiki-title { font: 800 52px/.95 var(--display); margin: 0 0 14px; }
.wiki-page h2 { font: 700 26px/1.1 var(--display); margin: 28px 0 8px; letter-spacing: .3px; }
.wiki-page h3 { font: 700 21px/1.15 var(--display); margin: 22px 0 6px; letter-spacing: .2px; }
.wiki-page p, .wiki-page li { max-width: 70ch; color: var(--ink-2); }
.wiki-page ul { padding-left: 20px; }
.wiki-page .wlink { color: var(--core); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(169, 231, 255, .35); }
.wiki-page sup { font-size: 11px; color: var(--ink-3); cursor: help; }
.okf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; font-size: 13.5px; color: var(--ink-3); }
.badge { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--edge-hi); color: var(--ink-2); }
.badge.stable { border-color: #3fae8a; color: #8ff0cc; }
.badge.draft { border-color: rgba(255, 181, 71, .6); color: var(--amber); }

.graph-card { margin: 0; border-radius: var(--r-panel); height: 640px; overflow: hidden; }
#graph { width: 100%; height: 100%; display: block; cursor: grab; }
.graph-tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 10px; background: rgba(6, 10, 22, .9); border: 1px solid var(--edge-hi); font-size: 13.5px; max-width: 280px; }
.legend { position: absolute; left: 20px; bottom: 16px; display: flex; gap: 16px; font-size: 14px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* tarifas: simulador + proyección (estética de vidrio) */
.tarifas-grid { align-items: start; }
.tarifa-form, .tarifa-forecast { padding: 22px; }
.tarifa-form h3, .tarifa-forecast h3 { font: 700 22px/1.1 var(--display); margin: 0 0 14px; letter-spacing: .3px; }
.tarifa-form .field { display: grid; gap: 6px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.tarifa-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tarifa-form select, .tarifa-form input { width: 100%; border-radius: var(--r-input); border: 1px solid var(--edge); background: rgba(6, 10, 22, .55); padding: 10px 12px; color: var(--ink); font: inherit; }
.tarifa-form select:focus, .tarifa-form input:focus { border-color: rgba(169, 231, 255, .6); outline: none; }
.tarifa-form .btn { width: 100%; margin-top: 4px; }
.tarifa-total { display: grid; gap: 2px; padding: 16px 18px; margin: 18px 0; border-radius: 16px; background: radial-gradient(120% 140% at 10% 0%, rgba(90, 149, 255, .22), rgba(10, 16, 34, .4)); border: 1px solid var(--edge-hi); }
.tarifa-total span { font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.tarifa-total b { font: 800 clamp(30px, 4vw, 46px)/1 var(--display); color: var(--ink); }
.tarifa-total small { color: var(--ink-2); }
.tarifa-break { display: grid; gap: 1px; margin: 0 0 14px; border-radius: 12px; overflow: hidden; }
.tarifa-break > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: rgba(10, 16, 34, .45); font-size: 14px; }
.tarifa-break dt { color: var(--ink-3); }
.tarifa-break dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.tarifa-break .ok dd { color: #8ff0cc; }
.tarifa-break .warn dd { color: var(--amber); }
.tarifa-formula { margin: 0 0 10px; }
.tarifa-formula code { display: block; padding: 10px 12px; border-radius: 10px; background: rgba(6, 10, 22, .6); border: 1px solid var(--edge); color: var(--ink-2); font-size: 12.5px; overflow-x: auto; }
.forecast-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.forecast-table th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--edge); }
.forecast-table td { padding: 9px 8px; border-bottom: 1px solid rgba(176, 204, 255, .08); color: var(--ink-2); }
.forecast-table .monto { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.forecast-table .up { color: var(--amber); }
.forecast-table .down { color: #8ff0cc; }
.forecast-table .rango { color: var(--ink-3); font-size: 12.5px; }
@media (max-width: 720px) { .tarifa-form .field-row { grid-template-columns: 1fr; } }

.rail { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: s; }
.rail li { counter-increment: s; }
.rail li::before { content: counter(s); display: block; font: 900 46px/1 var(--display); color: var(--flame); }
.rail h3 { font: 700 24px/1.05 var(--display); margin: 8px 0 8px; letter-spacing: .3px; }
.rail p { margin: 0; font-size: 15px; color: var(--ink-2); }
.lab h3, .status h3 { font: 700 30px/1 var(--display); margin: 0 0 8px; }
.lab-form { display: flex; gap: 8px; margin: 12px 0; }
.lab-form input { flex: 1; min-width: 0; border-radius: var(--r-input); border: 1px solid var(--edge); background: rgba(6, 10, 22, .55); padding: 11px 14px; }
.jev-out { display: grid; gap: 12px; }
.jev-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14.5px; }
.jev-row .k { color: var(--ink-2); }
.jev-row > :last-child { overflow-wrap: anywhere; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 3.2em; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; }
.meter { display: block; height: 10px; border-radius: 0 4px 4px 0; background: rgba(160, 196, 255, .08); position: relative; }
.meter span { position: absolute; inset: 0 auto 0 0; background: #3987e5; border-radius: 0 4px 4px 0; transition: width .6s; }
.meter.hot span { background: var(--amber); }
.estado { display: grid; grid-template-columns: minmax(7em, auto) minmax(0, 1fr); gap: 6px 16px; margin: 0 0 18px; font-size: 15px; }
.estado dt { color: var(--ink-3); overflow-wrap: anywhere; } .estado dd { margin: 0; overflow-wrap: anywhere; }
.status h4 { margin: 0 0 6px; }
.protocols { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; display: grid; gap: 6px; }
code { font-size: .9em; background: rgba(160, 196, 255, .1); padding: 1px 6px; border-radius: 6px; }

.footer { padding: 60px 0 80px; color: var(--ink-2); }
.footer b { color: var(--ink); }
.footer a { color: var(--amber); font-weight: 700; }

.dialog { border-radius: var(--r-panel); color: var(--ink); padding: 26px; width: min(560px, calc(100vw - 32px)); background: var(--glass-strong); }
.dialog::backdrop { background: rgba(2, 4, 10, .6); backdrop-filter: blur(6px); }
.dialog h3 { font: 800 34px/1 var(--display); margin: 0 0 14px; }
.mem-body { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.mem { padding: 10px 12px; border-radius: 12px; background: rgba(10, 16, 34, .6); border: 1px solid var(--edge); font-size: 15px; }
.mem small { display: block; color: var(--ink-3); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .rail { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: auto; gap: 18px; }
  .chat { position: relative; top: 0; height: 72vh; }
  body.docked .chat { position: fixed; }
  .section-head, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 > * { min-width: 0; }
  .faq-deck { --cw: 290px; --ch: 540px; --cut: 36px; height: 610px; }
  .fcard-in { padding: 22px 20px 18px; }
  .fcard-q { font-size: 16px; }
  .fcard-a { font-size: 14px; }
  .wiki { grid-template-columns: 1fr; }
  .wiki-nav { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--edge); }
  .wiki-page { padding: 22px; }
  .brand-sub { display: none; }
}
@media (max-width: 560px) {
  .controls { flex-direction: column; align-items: flex-start; gap: 6px; }
  .knob-state { font-size: 24px; }
  .knob-wrap { align-self: center; }
  .sos span { display: none; }
  .sos { padding: 9px 12px; }
  .rail { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 8em 1fr 2.5em; }
  .knob { width: 150px; height: 150px; }
  /* Los pares etiqueta/valor del laboratorio se apilan: con dos columnas el contenido largo
     empujaba la tarjeta 18 px fuera del ancho del móvil. */
  .jev-row, .estado { grid-template-columns: 1fr; gap: 2px 0; }
  .estado dt { margin-top: 10px; }
  .estado dt:first-child { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal-ignite { opacity: 1; transform: none; }
}
@media (forced-colors: active) {
  .bar .fill, .meter span { background: CanvasText; }
}

/* ============================================================ 20 herramientas */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 18px; }
.tool-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.tool-card:hover { border-color: var(--edge-hi); transform: translateY(-2px); }
.tool-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-n { font: 700 13px/1 var(--display); color: var(--amber); letter-spacing: .08em; }
.tool-card h3 { margin: 2px 0 0; font-size: 15px; line-height: 1.25; }
.tool-card h3 code { font-size: 14px; color: var(--ink); background: rgba(160, 196, 255, .08); padding: 2px 6px; border-radius: 6px; }
.tool-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.tool-args { margin-top: auto; display: flex; flex-wrap: wrap; gap: 5px; }
.tool-args span { font-size: 11px; color: var(--ink-3); border: 1px solid var(--edge); border-radius: 999px; padding: 2px 7px; }

/* ============================================================ WhatsApp / OpenClaw */
.wa-grid { align-items: stretch; }
.wa-card h3 { margin: 0 0 12px; font: 700 22px/1.15 var(--display); }
.wa-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.wa-steps b { color: var(--ink); }
.wa-flow { margin-top: 22px; padding: 20px 24px; overflow-x: auto; }
.wa-flow figcaption { font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin-bottom: 12px; }
.ascii-flow { margin: 0; font: 12.5px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink-2); white-space: pre; }
.wa-card .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ============================================================ INTRO CINEMATOGRÁFICA */
.cine {
  position: fixed; inset: 0; z-index: 2000; overflow: hidden;
  background: #05070d url("../assets/portada-poster.jpg") center/cover no-repeat;
  touch-action: none; color: #f2f4f8; transition: opacity .65s ease, visibility .65s ease;
}
.cine.is-out { opacity: 0; visibility: hidden; }
.cine video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform-origin: center center; pointer-events: none;
  opacity: 0; transition: opacity 1.15s ease;
}
.cine video.is-front { opacity: 1; }
.cine-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,7,13,.72) 0%, rgba(5,7,13,.08) 28%, rgba(5,7,13,.18) 62%, rgba(5,7,13,.82) 100%),
    radial-gradient(ellipse at 50% 48%, rgba(5,7,13,0) 0%, rgba(5,7,13,.55) 82%);
}
.cine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.cine-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(18px, 4vw, 34px) clamp(20px, 5vw, 54px);
}
.cine-brand { font: 500 clamp(12px, 1.3vw, 14px)/1 var(--sans, Raleway, sans-serif); letter-spacing: .18em; text-transform: uppercase; color: rgba(242,244,248,.66); }
.cine-brand b { font: 700 clamp(15px, 1.7vw, 19px)/1 var(--display); letter-spacing: .04em; color: #fff; text-transform: none; }
.cine-top-right { display: flex; align-items: center; gap: 18px; }
.cine-counter { font: 600 11px/1 var(--sans, Raleway, sans-serif); letter-spacing: .26em; color: rgba(242,244,248,.45); }
.cine-skip {
  border: 1px solid rgba(214,230,255,.28); background: rgba(10,16,34,.38); color: rgba(242,244,248,.8);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 600 11px/1 var(--sans, Raleway, sans-serif);
  letter-spacing: .14em; text-transform: uppercase; backdrop-filter: blur(8px); transition: .25s ease;
}
.cine-skip:hover { color: #fff; border-color: rgba(255,181,71,.7); background: rgba(255,181,71,.12); }
.cine-stage { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; }
.cine-intro, .cine-chapter, .cine-final {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 8%; gap: clamp(12px, 1.8vw, 22px);
  will-change: transform, filter, opacity;
}
.cine-chapter, .cine-final { border: 0; background: none; color: inherit; opacity: 0; pointer-events: none; }
.cine-kicker {
  font: 600 clamp(10px, 1.1vw, 12px)/1 var(--sans, Raleway, sans-serif); letter-spacing: .34em;
  text-transform: uppercase; color: var(--amber); text-shadow: 0 2px 16px rgba(0,0,0,.6);
}
.cine-wordmark {
  font: 400 clamp(74px, 17vw, 240px)/.82 var(--display); letter-spacing: -.04em; color: #fff;
  text-shadow: 0 10px 60px rgba(0,0,0,.55);
}
.cine-intro-sub { font: 500 clamp(13px, 1.6vw, 17px)/1.5 var(--sans, Raleway, sans-serif); color: rgba(242,244,248,.7); letter-spacing: .02em; }
.cine-title {
  font: 400 clamp(52px, 10.5vw, 156px)/.86 var(--display); letter-spacing: -.035em; color: #f7f8fb;
  text-shadow: 0 12px 60px rgba(0,0,0,.55); text-transform: uppercase;
}
.cine-title b { font-weight: 400; color: var(--amber); font-style: italic; }
.cine-sub {
  max-width: 42ch; font: 500 clamp(14px, 1.5vw, 18px)/1.55 var(--sans, Raleway, sans-serif);
  color: rgba(242,244,248,.74); letter-spacing: .01em; text-shadow: 0 2px 18px rgba(0,0,0,.7);
}
.cine-go, .cine-enter {
  min-width: 210px; justify-content: center;
  display: inline-flex; align-items: center; gap: 10px; margin-top: 6px;
  border: 1px solid rgba(255,181,71,.55); background: rgba(255,181,71,.12); color: #ffd79a;
  border-radius: 999px; padding: 12px 20px; cursor: pointer;
  font: 700 12px/1 var(--sans, Raleway, sans-serif); letter-spacing: .16em; text-transform: uppercase;
  backdrop-filter: blur(10px); transition: .25s ease;
}
.cine-go:hover, .cine-enter:hover { background: var(--amber); color: #1b1000; border-color: var(--amber); transform: translateY(-2px); }
.cine-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 0 clamp(18px, 4vw, 40px) clamp(18px, 3.5vh, 32px);
}
.cine-hint {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  color: rgba(242,244,248,.62); font: 600 10px/1 var(--sans, Raleway, sans-serif);
  letter-spacing: .32em; text-transform: uppercase; transition: opacity .5s ease;
}
.cine-hint i { width: 1px; height: 28px; background: linear-gradient(180deg, var(--amber), transparent); animation: cine-drop 1.7s ease-in-out infinite; }
@keyframes cine-drop { 0%,100% { transform: scaleY(.4); opacity: .3; transform-origin: top; } 50% { transform: scaleY(1); opacity: 1; transform-origin: top; } }
.cine-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cine-tab {
  border: 1px solid transparent; background: none; color: rgba(242,244,248,.46); cursor: default;
  border-radius: 999px; padding: 8px 13px; font: 600 11px/1 var(--sans, Raleway, sans-serif);
  letter-spacing: .12em; text-transform: uppercase; transition: .25s ease;
}
.cine-tab span { color: rgba(255,181,71,.7); margin-right: 6px; }
.cine-tab.is-active { color: #fff; border-color: rgba(255,181,71,.45); background: rgba(255,181,71,.09); }
.cine-bar { width: min(520px, 72vw); height: 2px; background: rgba(255,255,255,.14); overflow: hidden; }
.cine-bar span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left center; background: linear-gradient(90deg, rgba(255,181,71,.55), #fff); }
.linkish { border: 0; background: none; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.linkish:hover { color: var(--amber); }
@media (max-width: 640px) {
  .cine-top { padding: 16px 18px; }
  .cine-counter { display: none; }
  .cine-brand { font-size: 10px; letter-spacing: .12em; }
  .cine-brand b { font-size: 15px; }
  .cine-title { font-size: clamp(44px, 14vw, 74px); }
  .cine-sub { max-width: 30ch; font-size: 13px; }
  .cine-tab { padding: 7px 9px; font-size: 10px; letter-spacing: .06em; }
  .cine-top-right { gap: 0; }
}

/* ============================================================ PÁGINA /wa (QR de WhatsApp) */
.wa-page {
  min-height: 100dvh; display: grid; place-items: center; padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,181,71,.16), transparent 48%),
    radial-gradient(ellipse at 90% 100%, rgba(44,120,255,.18), transparent 52%),
    #04060d;
  color: var(--ink);
}
.wa-shell { width: min(1060px, 100%); }
.wa-back { display: inline-block; margin-bottom: 18px; color: var(--ink-2); text-decoration: none; font-size: 13px; letter-spacing: .04em; }
.wa-back:hover { color: var(--amber); }
.wa-card {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(22px, 4vw, 48px);
  align-items: center; border-radius: 28px; padding: clamp(24px, 4vw, 48px);
}
.wa-kicker { font: 600 10px/1 var(--sans, Raleway, sans-serif); letter-spacing: .32em; text-transform: uppercase; color: var(--amber); }
.wa-title { font: 400 clamp(44px, 6.5vw, 82px)/.9 var(--display); letter-spacing: -.03em; margin: 12px 0 16px; }
.wa-title b { color: var(--amber); font-style: italic; font-weight: 400; }
.wa-lede { color: var(--ink-2); font-size: clamp(15px, 1.5vw, 18px); line-height: 1.55; max-width: 46ch; }
.wa-steps { margin: 20px 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.wa-steps b { color: var(--ink); }
.wa-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.wa-actions .btn { text-decoration: none; }
.wa-fine { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; margin: 0; }
.wa-fine b { color: var(--ink-2); }
/* Atajos: cada uno abre WhatsApp con la pregunta ya escrita. */
.waq-quick { margin-top: 22px; }
.waq-title {
  font: 600 10px/1 var(--sans, Raleway, sans-serif); letter-spacing: .28em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 12px;
}
.waq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.waq-action {
  display: grid; gap: 3px; padding: 13px 15px; border-radius: 16px; text-decoration: none;
  border: 1px solid var(--edge); background: rgba(10, 16, 34, .55); color: var(--ink);
  transition: border-color .2s, background .2s, transform .2s;
}
.waq-action b { font: 700 15px/1.2 var(--text); }
.waq-action span { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }
.waq-action:hover { border-color: rgba(255, 181, 71, .55); background: rgba(255, 181, 71, .08); transform: translateY(-2px); }
.waq-action:focus-visible { outline: 2px solid var(--core); outline-offset: 3px; }
.waq-action-emergency { border-color: rgba(255, 92, 92, .5); background: rgba(255, 92, 92, .08); }
.waq-action-emergency b { color: #ff8f8f; }
.waq-action-emergency:hover { border-color: #ff5c5c; background: rgba(255, 92, 92, .16); }
.wa-qr { margin: 0; display: grid; justify-items: center; gap: 10px; }
.wa-qr img {
  width: min(360px, 70vw); height: auto; display: block; border-radius: 20px;
  padding: 12px; background: #fff; box-shadow: 0 20px 70px rgba(0,0,0,.45);
}
.wa-qr figcaption { font: 700 14px/1 var(--display); letter-spacing: .08em; color: var(--amber); }
.wa-foot { margin: 22px 0 0; text-align: center; color: var(--ink-3); font-size: 12px; }
.wa-foot a { color: var(--amber); }
@media (max-width: 760px) {
  .wa-card { grid-template-columns: 1fr; text-align: center; }
  .wa-steps { text-align: left; }
  .wa-actions { justify-content: center; }
}
