/* Modo historia: la página de lanzamiento del juego. El fondo es el motor del
   juego en vivo (canvas fijo) y el scroll mueve su cámara. Técnicas de
   Scrolltide portadas a mano: encendido con progreso real (Intro Loader /
   Camera), tecla que se hunde (Scroll Key), cámara por tramos (Apogee /
   Umbral), vidrio que se arma palabra por palabra (Aerflora), etiquetas
   ancladas (Nopal, aquí sobre el 3D) y tacómetro (Valmora). */
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/web/herramientas/fonts/Inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/web/herramientas/fonts/Inter-700.woff2') format('woff2'); }

:root {
  --fondo: #0b0714;
  --texto: #fdfbff;
  --suave: rgba(253, 251, 255, 0.76);
  --magenta: #ff2d9b;
  --amarillo: #f2b705;
  --verde: #6fd36b;
  --sombra-texto: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.75);
  --gutter: clamp(16px, 4vw, 56px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fondo); color: var(--texto); font-family: 'Inter', system-ui, sans-serif; line-height: 1.45; overflow-x: clip; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: #fff; color: #000; border-radius: 6px; }
.saltar:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; }
.magenta { color: var(--magenta); }

/* ---------- el motor de fondo ---------- */
.motor { position: fixed; inset: 0; z-index: 0; }
.motor canvas { width: 100%; height: 100%; display: block; }
.motor__respaldo { position: absolute; inset: 0; background: center / cover no-repeat url('/web/juego/assets/img/fondo-menu.webp'); opacity: 0; transition: opacity 0.6s ease; }
.motor__respaldo.on { opacity: 1; }
.motor__negro { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.motor__vineta { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55)), linear-gradient(transparent 70%, rgba(11, 7, 20, 0.6)); }
.etiquetas3d { position: absolute; inset: 0; pointer-events: none; }
.etiqueta3d { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 20px; background: rgba(8, 6, 16, 0.78); border: 1px solid rgba(255, 255, 255, 0.18); font-size: 14px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity 0.3s ease; will-change: transform; }
.etiqueta3d::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 0 4px rgba(255, 45, 155, 0.3); }
.etiqueta3d.ver { opacity: 1; }

/* ---------- encendido ---------- */
.encendido { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at center, #1a1030, #05030a 70%); transition: opacity 0.7s ease, clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1); clip-path: inset(0 0 0 0); }
.encendido.fuera { clip-path: inset(50% 0 50% 0); opacity: 0; pointer-events: none; }
.encendido__marco { width: min(640px, 100%); text-align: center; display: grid; gap: 14px; justify-items: center; }
.encendido__sello { font-size: 12px; letter-spacing: 0.32em; color: var(--suave); font-weight: 700; }
.encendido__titulo { width: min(560px, 90vw); }
.encendido__barra { width: min(360px, 80vw); height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.encendido__barra span { display: block; height: 100%; width: 0; background: var(--magenta); transition: width 0.25s ease; }
.encendido__txt { font-size: 13px; color: var(--suave); font-variant-numeric: tabular-nums; }
.encendido__nota { font-size: 13px; color: var(--suave); max-width: 340px; }

/* La tecla: un keycap 3D que se hunde (técnica de Scroll Key, en CSS) */
.tecla { appearance: none; border: 0; padding: 0; background: none; cursor: pointer; display: inline-block; text-decoration: none; perspective: 600px; }
.tecla__cara { display: inline-block; padding: 16px 34px; border-radius: 14px; font: 700 clamp(17px, 2.6vw, 22px)/1 'Inter', sans-serif; letter-spacing: 0.14em; color: #fff; background: linear-gradient(180deg, #ff58b0, #e01d82); box-shadow: 0 8px 0 #7a0c45, 0 14px 28px rgba(255, 45, 155, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.45); transform: rotateX(18deg); transition: transform 0.12s ease, box-shadow 0.12s ease; animation: latido 1.6s ease-in-out infinite; }
.tecla:hover .tecla__cara { transform: rotateX(10deg) translateY(-2px); }
.tecla:active .tecla__cara { transform: rotateX(18deg) translateY(7px); box-shadow: 0 1px 0 #7a0c45, 0 4px 12px rgba(255, 45, 155, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3); }
.tecla:disabled { cursor: progress; }
.tecla:disabled .tecla__cara { filter: grayscale(0.8) brightness(0.7); animation: none; }
.tecla--grande .tecla__cara { padding: 22px 48px; font-size: clamp(20px, 3.4vw, 30px); }
@keyframes latido { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav__jugar { padding: 10px 18px; border-radius: 30px; border: 1.5px solid #fff; background: rgba(8, 6, 16, 0.5); font-weight: 700; text-decoration: none; font-size: 14px; }
.nav__jugar:hover { background: var(--magenta); border-color: var(--magenta); }

/* ---------- tramos que se fijan mientras el scroll mueve la cámara ---------- */
main { position: relative; z-index: 2; }
.tramo { position: relative; height: var(--alto, 200vh); }
.tramo__fijo { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 90px var(--gutter) 40px; text-align: center; }
.tramo__fijo--izq { justify-items: start; text-align: left; max-width: 720px; }
.tramo__fijo--der { justify-items: end; text-align: left; }
.tramo__fijo--abajo { align-content: end; padding-bottom: 12vh; }
.tramo__fijo--centro { justify-items: center; }

.heroe__gancho { font-size: clamp(18px, 3vw, 26px); font-weight: 700; text-shadow: var(--sombra-texto); }
.heroe__titulo { width: min(760px, 92vw); filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)); }
.heroe__bajada { max-width: 520px; font-size: clamp(16px, 2.2vw, 19px); text-shadow: var(--sombra-texto); }
.heroe__bajada b { color: var(--amarillo); }
.indicador { margin-top: 18px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--suave); animation: baja 1.8s ease-in-out infinite; }
@keyframes baja { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(6px); opacity: 1; } }

.rotulo { font-size: 13px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--amarillo); text-shadow: var(--sombra-texto); }
.grande { font-size: clamp(32px, 5.6vw, 68px); line-height: 1.02; text-shadow: var(--sombra-texto); }
.enorme { font-size: clamp(48px, 10vw, 140px); line-height: 0.95; text-shadow: var(--sombra-texto); }
.parrafo { max-width: 520px; font-size: clamp(16px, 2vw, 20px); color: var(--texto); text-shadow: var(--sombra-texto); }
.parrafo b { font-weight: 700; }
.parrafo--centro { text-align: center; margin: 0 auto; }
[data-desde] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-desde].ver { opacity: 1; transform: none; }

/* glitch del «todos los días» (técnica tipo Grid Warp, en CSS) */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-texto); position: absolute; inset: 0; pointer-events: none; }
.glitch::before { color: #2de2ff; transform: translate(-2px, 0); clip-path: inset(0 0 55% 0); animation: corte 2.4s steps(1) infinite; mix-blend-mode: screen; }
.glitch::after { color: var(--magenta); transform: translate(2px, 0); clip-path: inset(55% 0 0 0); animation: corte 2.4s steps(1) infinite reverse; mix-blend-mode: screen; }
@keyframes corte { 0%, 86% { transform: translate(0); opacity: 0; } 88% { transform: translate(-4px, 1px); opacity: 1; } 92% { transform: translate(3px, -1px); opacity: 1; } 96% { transform: translate(-1px, 0); opacity: 1; } 100% { opacity: 0; } }

/* tarjetas de vidrio que se arman palabra por palabra (Aerflora) */
.vidrio { position: absolute; right: var(--gutter); top: 50%; width: min(440px, calc(100vw - 32px)); padding: 22px 24px; border-radius: 20px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)); border: 1px solid rgba(255, 255, 255, 0.22); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45); opacity: 0; transform: translateY(calc(-50% + 60px)); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.vidrio.ver { opacity: 1; transform: translateY(-50%); }
.vidrio__num { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--amarillo); margin-bottom: 6px; }
.vidrio__tit { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.05; margin-bottom: 10px; }
.vidrio__txt { color: var(--suave); }
.palabra { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(6px); transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s ease; transition-delay: calc(var(--i) * 35ms); }
.vidrio.ver .palabra { opacity: 1; filter: none; transform: none; }

/* tacómetro (Valmora) */
.taco { position: relative; width: min(460px, 90vw); }
.taco__svg { width: 100%; overflow: visible; }
.taco__fondo { fill: none; stroke: rgba(255, 255, 255, 0.15); stroke-width: 18; stroke-linecap: round; }
.taco__lleno { fill: none; stroke: url(#degradado-taco); stroke: var(--magenta); stroke-width: 18; stroke-linecap: round; stroke-dasharray: 503; stroke-dashoffset: 503; filter: drop-shadow(0 0 10px rgba(255, 45, 155, 0.7)); }
.taco__aguja { stroke: #fff; stroke-width: 5; stroke-linecap: round; transform-origin: 200px 210px; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6)); }
.taco__eje { fill: #fff; }
.taco__marca { stroke: rgba(255, 255, 255, 0.55); stroke-width: 2; }
.taco__marcaTxt { fill: rgba(255, 255, 255, 0.7); font: 700 13px 'Inter', sans-serif; text-anchor: middle; }
.taco__num { position: absolute; left: 0; right: 0; bottom: -6px; text-align: center; font-size: clamp(44px, 9vw, 76px); font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: var(--sombra-texto); }
.taco__num small { font-size: 0.32em; margin-left: 6px; color: var(--suave); }
.taco__estrellas { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.taco__estrellas i { width: 26px; height: 26px; background: rgba(255, 255, 255, 0.22); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transition: background 0.3s ease, transform 0.3s ease; }
.taco__estrellas i.on { background: var(--amarillo); transform: scale(1.18); }
.passed { width: min(720px, 92vw); opacity: 0; transform: scale(1.12); transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)); }
.passed.ver { opacity: 1; transform: none; }

.cierre .tramo__fijo { background: radial-gradient(ellipse at center, rgba(11, 7, 20, 0.15), rgba(11, 7, 20, 0.6)); }

/* formulario y pie, por encima del motor */
#cotiza { position: relative; z-index: 3; }
.pie { position: relative; z-index: 3; padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom)); background: #05030a; display: grid; gap: 14px; }
.pie__t { font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amarillo); margin-bottom: 8px; }
.pie ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pie a { color: var(--suave); }
.pie__nota { font-size: 13px; color: var(--suave); }

@media (max-width: 640px) {
  .tramo__fijo--der { justify-items: center; }
  .vidrio { right: 16px; top: auto; bottom: 8vh; transform: translateY(60px); }
  .vidrio.ver { transform: none; }
  .tramo__fijo--izq { align-content: end; padding-bottom: 14vh; }
}
/* celular en «sitio de escritorio» (~980×2100): diseño de celular, más grande */
@media (max-aspect-ratio: 3/5) and (min-width: 600px) {
  .tramo__fijo--der { justify-items: center; }
  .vidrio { right: 50%; transform: translate(50%, 60px); top: auto; bottom: 10vh; width: 80vw; padding: 40px; }
  .vidrio.ver { transform: translate(50%, 0); }
  .vidrio__tit { font-size: 5.4vw; }
  .vidrio__txt, .parrafo { font-size: 3.2vw; max-width: 80vw; }
  .grande { font-size: 7.4vw; }
  .tramo__fijo--izq { align-content: end; padding-bottom: 14vh; max-width: none; }
  .heroe__bajada { font-size: 3.2vw; max-width: 80vw; }
  .tecla__cara { font-size: 3.6vw; padding: 3vw 6vw; }
}
@media (prefers-reduced-motion: reduce) {
  .tecla__cara, .indicador, .glitch::before, .glitch::after { animation: none; }
  [data-desde], .vidrio, .palabra, .passed { transition: none; }
}

/* muro de fotos del modo foto: polaroids que se enderezan al pasar */
.fotos { position: relative; z-index: 3; padding: 90px var(--gutter); background: linear-gradient(180deg, rgba(11, 7, 20, 0.2), #0b0714 18%, #0b0714 82%, rgba(11, 7, 20, 0.2)); display: grid; justify-items: center; gap: 14px; text-align: center; }
.fotos__muro { display: grid; grid-template-columns: repeat(4, minmax(0, 220px)); gap: clamp(10px, 2vw, 26px); margin-top: 20px; }
.fotos__muro figure { margin: 0; padding: 10px 10px 34px; background: #fdfbf6; border-radius: 4px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); transform: rotate(var(--g)); transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.fotos__muro figure:hover { transform: rotate(0) scale(1.06); z-index: 1; }
.fotos__muro img { border-radius: 2px; }
.fotos__nota { font-size: 12px; color: var(--suave); }
@media (max-width: 760px) { .fotos__muro { grid-template-columns: repeat(2, minmax(0, 200px)); } }

/* el comercial: vertical, al centro, con marco de celular */
.comercial { position: relative; z-index: 3; padding: 80px var(--gutter); background: linear-gradient(180deg, rgba(11, 7, 20, 0.15), #0b0714 14%, #0b0714 86%, rgba(11, 7, 20, 0.15)); display: grid; justify-items: center; gap: 16px; text-align: center; }
.comercial__marco { width: min(360px, 82vw); aspect-ratio: 9 / 16; border-radius: 28px; padding: 8px; background: #15121c; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12); }
.comercial__video { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; background: #000; display: block; }
.comercial__nota { font-size: 12px; color: var(--suave); }

/* «Así es por dentro»: el juego al lado de la app real. Todo visible sin JS; la entrada animada es solo CSS de scroll y solo donde existe. */
.porDentro { position: relative; z-index: 3; padding: 80px var(--gutter) 90px; background: #0b0714; display: grid; justify-items: center; gap: 16px; text-align: center; }
.porDentro__pares { list-style: none; margin: 28px 0 0; padding: 0; width: min(920px, 100%); display: grid; gap: 44px; }
.par { display: grid; gap: 14px; min-width: 0; }
.par__tit { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(20px, 2.6vw, 28px); }
.par__num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--amarillo); color: #0b0714; font-size: 15px; font-weight: 700; }
.par__lados { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(12px, 3vw, 40px); align-items: start; }
.par__lado { margin: 0; display: grid; gap: 10px; text-align: left; min-width: 0; }
.par__lado img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; background: #15121c; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12); }
.par__lado--real img { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(111, 211, 107, 0.55); }
.par__etq { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; background: rgba(255, 45, 155, 0.16); color: #ff8cc8; border: 1px solid rgba(255, 45, 155, 0.45); }
.par__etq--real { background: rgba(111, 211, 107, 0.14); color: var(--verde); border-color: rgba(111, 211, 107, 0.5); }
.par__lado figcaption { font-size: clamp(14px, 1.6vw, 17px); line-height: 1.4; color: var(--suave); }
.par__flecha { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--magenta); color: #fff; box-shadow: 0 6px 18px rgba(255, 45, 155, 0.5), 0 0 0 4px #0b0714; }
.porDentro__rotulo, .porDentro__pieReel { font-size: 13px; color: var(--suave); }
.porDentro__reel { margin-top: 48px; width: min(920px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 5vw, 64px); align-items: center; text-align: left; }
.porDentro__reelTxt { display: grid; gap: 16px; justify-items: start; }
.porDentro__reelTit { font-size: clamp(24px, 3.4vw, 40px); line-height: 1.1; }
.porDentro__reelFig { margin: 0; display: grid; gap: 10px; justify-items: center; }
.porDentro__reelFig .comercial__marco { width: min(320px, 78vw); }
.porDentro__pieReel { display: grid; gap: 4px; text-align: center; max-width: 340px; }
.porDentro__credito { font-size: 12px; }
.porDentro__credito a { color: inherit; }
@media (max-width: 700px) {
  .porDentro__reel { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .porDentro__reelTxt { justify-items: center; }
  .porDentro__reelFig { order: -1; }
  .par__flecha { width: 32px; height: 32px; top: 38%; }
  .par__flecha svg { width: 16px; height: 16px; }
  .par__lado img { border-radius: 12px; }
  .porDentro .tecla__cara { padding: 15px 22px; letter-spacing: 0.08em; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .par__lado { animation: porDentroEntra linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    .par__lado--real { animation-name: porDentroEntraReal; }
  }
}
@keyframes porDentroEntra { from { opacity: 0.2; transform: translateX(-24px) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes porDentroEntraReal { from { opacity: 0.2; transform: translateX(24px) rotate(2deg); } to { opacity: 1; transform: none; } }

/* accesos directos a «Así es por dentro» */
.nav__acciones { display: flex; align-items: center; gap: 10px; }
.nav__dentro { padding: 10px 14px; border-radius: 30px; font-weight: 700; font-size: 14px; text-decoration: none; color: #fff; background: rgba(8, 6, 16, 0.5); border: 1.5px solid rgba(255, 255, 255, 0.35); }
.nav__dentro:hover { border-color: var(--magenta); color: var(--magenta); }
@media (max-width: 420px) { .nav__dentro-largo { display: none; } .nav__dentro, .nav__jugar { padding: 9px 12px; font-size: 13px; } }
.heroe__dentro { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 600; color: #fff; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--magenta); }
.heroe__dentro:hover { color: var(--magenta); }
