/* =====================================================================
   Viperlabs · micrositio de piezas · versión liviana (R0_Q4)
   Paleta y tipografía de marca: CLAUDE.md §4 / DESIGN.md.
   Escenario oscuro: la escalera de profundos baja monótona desde --brand.

   Scroll nativo: nada se fija ni se ata al scroll. Las entradas son
   transiciones de CSS que site.js dispara al entrar cada sección en
   pantalla (.rv-pend -> .rv-in). El estado por defecto es el final:
   sin JS, o con movimiento reducido, todo se ve desde el principio.

   Compatibilidad: navegadores de los últimos ~5 años (Chrome/Edge 90+,
   Firefox 90+, Safari/iOS 15+, Samsung Internet 15+). Las unidades svh,
   overflow: clip y <dialog> llevan su reemplazo para los más viejos.
   ===================================================================== */

@font-face { font-family: "TWK Everett"; src: url("../assets/fonts/everett-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TWK Everett"; src: url("../assets/fonts/everett-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "TWK Everett"; src: url("../assets/fonts/everett-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* marca */
  --brand: #00367D;
  --b2: #3796F2;
  --cyan: #40B4CF;
  --mint: #5EDF95;
  --mint-2: #7CEBC2;
  --ice: #D0E6FD;
  --line-c: #CADBEA;
  --navy: #292B3A;
  /* escalera de profundos (monótona: brand > deep-3 > deep-2 > deep > abyss) */
  --deep-3: #002C68;
  --deep-2: #00224F;
  --deep: #00193C;
  --abyss: #00112B;
  --abyss-2: #000A1E;
  /* texto sobre oscuro */
  --ink: #F2F7FF;
  --ink-2: #A9C0DE;   /* 9,6:1 sobre --abyss */
  --ink-3: #7F97B8;   /* 5,7:1 sobre --abyss, sólo meta y rótulos */
  --hair: rgba(202, 219, 234, .14);
  --hair-2: rgba(202, 219, 234, .26);
  /* sombras de objetos flotantes: azul claro y abiertas */
  --glow: 55, 150, 242;
  /* tipografía */
  --f-disp: "TWK Everett", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* movimiento */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --ease-entra: cubic-bezier(.16, 1, .3, 1);
  /* capas */
  --z-escena: 0;
  --z-contenido: 1;
  --z-frente: 30;
  --z-grano: 40;
  --z-nav: 50;
  --z-menu: 60;
  --z-visor: 80;
  --z-intro: 90;
  --nav-h: 68px;
  --gut: clamp(20px, 4.2vw, 64px);
  /* alto de pantalla: svh donde existe (la barra del navegador móvil no lo cambia), vh donde no */
  --vh100: 100vh;
}
@supports (height: 100svh) { :root { --vh100: 100svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--abyss); color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--abyss);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--mint); color: var(--abyss); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 0; }

/* íconos: sprite inline (Phosphor), heredan el color y el tamaño del texto */
.ic { display: inline-block; flex: none; width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; }
.simbolos { position: absolute; width: 0; height: 0; overflow: hidden; }

.saltar {
  position: fixed; left: 16px; top: -60px; z-index: calc(var(--z-intro) + 1);
  background: var(--ink); color: var(--abyss); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; text-decoration: none; transition: top .2s var(--ease-out);
}
.saltar:focus { top: 12px; }

/* ------------------------------------------------------------ cortina */
/* sólo CSS y con tiempo fijo: sube sola a los 0,9 s de la primera pintura. No espera al JS, ni a
   las tipografías ni a las imágenes, así con una conexión lenta no tapa lo que ya llegó.
   site.js sólo sincroniza la entrada del hero con la subida (INTRO_SUBE) */
.intro {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: var(--z-intro);
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(60% 50% at 50% 45%, var(--deep-2), var(--abyss) 70%);
  animation: intro-sube .95s var(--ease-io) .9s forwards;
}
html:not(.js) .intro { display: none; }
@keyframes intro-sube { to { clip-path: inset(0 0 100% 0); -webkit-clip-path: inset(0 0 100% 0); visibility: hidden; } }
.intro__in { display: flex; flex-direction: column; align-items: center; gap: 28px; animation: intro-in .35s ease .7s forwards; }
@keyframes intro-in { to { opacity: 0; transform: translateY(-14px); } }
.intro__ast {
  width: 78px; height: 67px; fill: var(--ink); filter: drop-shadow(0 10px 36px rgba(var(--glow), .5));
  animation: intro-ast .7s var(--ease-out) both, gira 3.2s linear infinite;
}
@keyframes intro-ast { from { opacity: 0; transform: scale(.85); } }
.intro__bar { width: min(200px, 50vw); height: 2px; border-radius: 2px; background: rgba(242, 247, 255, .16); overflow: hidden; }
.intro__bar i { display: block; height: 100%; background: var(--mint); transform: scaleX(0); transform-origin: left; animation: intro-bar .8s var(--ease-out) .05s forwards; }
@keyframes intro-bar { to { transform: scaleX(1); } }
@keyframes gira { to { transform: rotate(360deg); } }

/* ------------------------------------------------------ luces y grano */
.ambiente { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: var(--z-escena); pointer-events: none; overflow: hidden; }
/* el color va en `color` (currentColor en el degradé): así cambia con una transición común */
.luz {
  position: absolute; width: 80vmax; height: 80vmax; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0%, rgba(0, 17, 43, 0) 62%);
  opacity: .5; transition: color 1.8s ease, transform 1.8s var(--ease-io);
}
.luz--a { color: rgba(55, 150, 242, .55); left: 38vw; top: -38vmax; }
.luz--b { color: rgba(64, 180, 207, .32); left: -34vmax; top: 30vh; }
.luz--c { color: rgba(0, 54, 125, .7); left: 20vw; top: 40vh; }
.liquido { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.liquido--frente { position: fixed; z-index: var(--z-frente); }
.grano {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: var(--z-grano); pointer-events: none;
  background: url("../assets/img/ruido.png"); opacity: .045; mix-blend-mode: overlay;
}

/* recorta a lo ancho lo que se sale (los teléfonos girados antes de entrar, los reflejos): en móvil,
   el overflow del body no alcanza y el navegador achicaba la página para mostrarlo */
.contenido { position: relative; z-index: var(--z-contenido); overflow-x: hidden; }
@supports (overflow: clip) { .contenido { overflow-x: clip; } }

/* ---------------------------------------------------------------- nav */
.nav {
  position: fixed; left: 0; right: 0; top: 0; z-index: var(--z-nav);
  height: var(--nav-h); padding: 0 var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(to bottom, rgba(0, 17, 43, .82), rgba(0, 17, 43, 0));
  transition: transform .45s var(--ease-out);
}
.nav.oculta { transform: translateY(-100%); }
.nav__logo { display: block; line-height: 0; }
.nav__logo svg { width: 118px; height: 21px; fill: var(--ink); }
.nav__links { position: relative; display: flex; }
.nav__links a {
  position: relative; z-index: 1; margin-left: 4px; padding: 8px 14px; border-radius: 999px;
  font: 500 .875rem/1 var(--f-text); color: var(--ink-2); text-decoration: none;
  transition: color .2s ease;
}
.nav__links a:first-of-type { margin-left: 0; }
.nav__links a:hover, .nav__links a.activo { color: var(--ink); }
.nav__pill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 999px;
  background: rgba(208, 230, 253, .1); box-shadow: inset 0 0 0 1px var(--hair); opacity: 0;
  transition: transform .55s var(--ease-out), width .55s var(--ease-out), opacity .3s ease;
}
.nav__menu {
  display: none; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px;
  background: rgba(208, 230, 253, .1); font: 500 .9rem/1 var(--f-text); cursor: pointer;
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.nav__menu .ic { font-size: 1.1rem; }
.nav__menu:active { transform: scale(.97); }
.nav__progreso { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--hair); }
.nav__progreso i { display: block; height: 100%; background: var(--mint); transform: scaleX(0); transform-origin: left; }

.menu-movil {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: var(--z-menu); padding: calc(var(--nav-h) + 24px) var(--gut) 40px;
  display: flex; flex-direction: column; background: rgba(0, 10, 30, .96);
}
.menu-movil[hidden] { display: none; }
.menu-movil a { font: 500 2.1rem/1.25 var(--f-disp); letter-spacing: -.02em; text-decoration: none; padding: 9px 0; }
.menu-movil--entra a { animation: menu-a .6s var(--ease-out) both; }
.menu-movil--entra a:nth-child(2) { animation-delay: 40ms; }
.menu-movil--entra a:nth-child(3) { animation-delay: 80ms; }
.menu-movil--entra a:nth-child(4) { animation-delay: 120ms; }
.menu-movil--entra a:nth-child(5) { animation-delay: 160ms; }
@keyframes menu-a { from { opacity: 0; transform: translateY(24px); } }

/* ------------------------------------------------------------ botones */
.btn {
  display: inline-flex; align-items: center; white-space: nowrap;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 .98rem/1 var(--f-disp); letter-spacing: .005em; text-decoration: none;
  transition: transform .16s var(--ease-out), background-color .22s ease, color .22s ease, box-shadow .22s ease;
}
.btn > * + * { margin-left: 10px; }
.btn .ic { font-size: 1.15em; }
.btn small { font: 500 .78rem/1 var(--f-text); color: var(--ink-3); transition: color .22s ease; }
.btn small:empty { display: none; }
.btn:active { transform: scale(.97); }
.btn--pri { background: var(--ink); color: var(--deep-2); }
.btn--pri small { color: #4F6788; }
.btn--sec { background: rgba(208, 230, 253, .08); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-2); }
.btn--link { padding: 0 6px; min-height: 44px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--hair-2); text-underline-offset: 6px; }
.btn--ico { width: 44px; min-height: 44px; padding: 0; justify-content: center; background: rgba(208, 230, 253, .08); box-shadow: inset 0 0 0 1px var(--hair-2); }
.btn--s { min-height: 40px; padding: 0 16px; font-size: .9rem; }
@media (hover: hover) and (pointer: fine) {
  .btn--pri:hover { background: var(--mint); color: var(--abyss); }
  .btn--pri:hover small { color: #0E4A3A; }
  .btn--sec:hover, .btn--ico:hover { background: rgba(208, 230, 253, .16); }
  .btn--sec:hover small { color: var(--ink-2); }
  .btn--link:hover { color: var(--ink); text-decoration-color: var(--mint); }
  .nav__menu:hover { background: rgba(208, 230, 253, .16); }
}
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------------------------------------------------------- tipografía */
.linea { display: block; }
/* máscara de entrada: deja lugar a los descendentes (p, y, g) con interlineado 1 */
.mk { display: block; overflow: hidden; padding-bottom: .16em; margin-bottom: -.16em; }
.mk__in { display: block; }
.linea--acento { color: var(--mint-2); }

/* ============================================================ ENTRADAS */
/* .rv-pend: la sección todavía no entró en pantalla (lo pone site.js sólo a las que arrancan fuera
   de la vista). .rv-in: ya entró; cada cosa vuelve a su lugar con su propia transición.
   .rv-sin apaga las transiciones un cuadro, para que el estado inicial no se anime. */
.mk__in { transition: transform 1.15s var(--ease-entra); transition-delay: var(--d, 0s); }
.rv-pend .mk__in { transform: translate3d(0, 108%, 0); }
.rv-it { transition: opacity .95s var(--ease-entra), transform .95s var(--ease-entra), filter .95s var(--ease-entra); transition-delay: calc(var(--i, 0) * 60ms + .15s); }
.rv-pend .rv-it { opacity: 0; transform: translate3d(0, 18px, 0); filter: blur(6px); }
.rv-sin, .rv-sin * { transition: none !important; }

/* =============================================================== HERO */
/* texto a la izquierda, caja a la derecha. Detrás de la caja, la hélice de ADN y las gotas
   del ambiente líquido (canvas, js/liquido.js); ninguna pasa por el texto. */
.hero { position: relative; }
.hero__in {
  position: relative; min-height: var(--vh100); overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: clamp(24px, 4vw, 72px);
  padding: calc(var(--nav-h) + 24px) max(var(--gut), calc((100vw - 1560px) / 2)) 48px;
}
.lyr__m { width: 100%; height: 100%; }
.deco img { width: 100%; height: auto; }

.hero__texto { grid-column: 1; grid-row: 1; position: relative; z-index: 2; max-width: 660px; }
.hero__h1 {
  font: 500 clamp(3rem, 5.6vw, 5.6rem)/.98 var(--f-disp);
  letter-spacing: -.03em;
}
.hero__h1 .linea:nth-child(2) .mk__in { --d: .1s; }
.hero__sub { margin-top: 22px; max-width: 34ch; font-size: clamp(1.06rem, 1.3vw, 1.2rem); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.hero__cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.hero__obj { grid-column: 2; grid-row: 1; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.hero__obj .hero__grados { margin-top: calc(min(calc(var(--vh100) * .58), 540px) * .2); }
.caja3d--hero { --caja-h: min(calc(var(--vh100) * .58), 540px); cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; transition: opacity 1.6s var(--ease-entra) .15s, transform 1.6s var(--ease-entra) .15s; }
.caja3d--hero.arrastrando { cursor: grabbing; }
.rv-pend .caja3d--hero { opacity: 0; transform: translate3d(0, 90px, 0); }
/* luz de fondo detrás de la caja: suave, se funde con el fondo y marca el foco. Respira sola */
.hero__foco {
  position: absolute; left: 50%; top: calc(min(calc(var(--vh100) * .58), 540px) / 2); z-index: -1; width: min(1180px, 78vw); height: min(1180px, 78vw);
  margin: calc(min(1180px, 78vw) / -2) 0 0 calc(min(1180px, 78vw) / -2); pointer-events: none;
  transition: opacity 2.2s var(--ease-entra), transform 2.2s var(--ease-entra);
}
.hero__foco::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(64, 180, 207, .34), rgba(55, 150, 242, .16) 42%, rgba(0, 54, 125, .06) 64%, rgba(0, 54, 125, 0) 80%);
  animation: foco 5s ease-in-out infinite alternate;
}
@keyframes foco { to { transform: scale(1.06); opacity: .85; } }
.rv-pend .hero__foco { opacity: 0; transform: scale(.7); }
.hero__grados {
  display: flex; align-items: center; padding: 9px 16px; border-radius: 999px;
  background: rgba(0, 17, 43, .5); box-shadow: inset 0 0 0 1px var(--hair); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 500 .85rem/1 var(--f-text); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.hero__grados .ic { font-size: 1.15rem; margin-right: 10px; }
.hero__arrastre { margin-right: 18px; }
.hero__grados-v { color: var(--ink); min-width: 4ch; text-align: right; }
.hero__grados-l { width: 110px; height: 1px; margin-left: 14px; background: var(--hair-2); }
.hero__grados-l b { display: block; height: 100%; background: var(--mint); transform: scaleX(0); transform-origin: left; }

/* ============================================================ POR QUÉ */
.porque { position: relative; padding: clamp(96px, 16vh, 180px) var(--gut) clamp(80px, 12vh, 140px); }
.porque__in {
  position: relative; width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px clamp(40px, 6vw, 96px); align-items: center;
}
.porque__t { grid-column: 1; font: 400 clamp(1.7rem, 3.2vw, 2.85rem)/1.16 var(--f-disp); letter-spacing: -.02em; text-wrap: pretty; }
/* las palabras se encienden de a una cuando la sección entra */
.porque__t .w { transition: opacity .5s ease; transition-delay: calc(var(--i, 0) * 45ms); }
.rv-pend .porque__t .w { opacity: .14; }
.cambio { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 22px; }
.cambio__fila { display: grid; gap: 8px; }
.cambio__rol { font: 500 .85rem/1 var(--f-text); color: var(--ink-3); }
.cambio__caja { position: relative; display: block; min-height: clamp(52px, 5.4vw, 76px); }
.cambio__nuevo {
  display: inline-flex; align-items: center; min-height: inherit;
  font: 500 clamp(2rem, 4.3vw, 3.7rem)/1 var(--f-disp); letter-spacing: -.025em; white-space: nowrap;
}
/* cada letra ocupa el ancho de su letra final: mientras se descifra, la palabra no se mueve */
.cc-letras { position: relative; display: inline-block; }
.cc { display: inline-block; text-align: center; }
.cc--x { color: transparent; }
.cc--mezcla { color: var(--mint-2); }
.cc-mascara { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; white-space: pre; color: var(--ink-3); pointer-events: none; }
.cambio__caja .cc-mascara { transform: translateY(.14em); }
.cambio__nuevo, .cambio__nuevo--lab, .cambio__txt { position: relative; }
.cambio__logo { position: absolute; left: 0; top: 50%; width: 4.9em; height: .85em; margin-top: -.44em; fill: var(--ink); opacity: 0; transform-origin: 0 50%; }
html:not(.js) .cambio__logo { display: none; }
.cambio__scan {
  position: absolute; left: 0; top: -4%; width: 3px; height: 108%; margin-left: -1px; border-radius: 2px; pointer-events: none;
  background: var(--mint); box-shadow: 0 0 20px 3px rgba(94, 223, 149, .65); opacity: 0;
}
.porque__cierre { grid-column: 1; max-width: 52ch; color: var(--ink-2); font-size: clamp(1.02rem, 1.2vw, 1.14rem); text-wrap: pretty; transition: opacity 1s var(--ease-entra), transform 1s var(--ease-entra), filter 1s var(--ease-entra); }
.rv-pend .porque__cierre, .porque--descifrando .porque__cierre { opacity: 0; transform: translate3d(0, 24px, 0); filter: blur(6px); }

/* ========================================================= PIEZAS: base */
.pieza { position: relative; }
.pieza__in {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(32px, 5vw, 80px);
  padding: clamp(72px, 11vh, 132px) var(--gut); max-width: 1560px; margin: 0 auto;
}
.pieza__info { position: relative; z-index: 2; max-width: 520px; }
.pieza__t { font: 500 clamp(2.6rem, 5.2vw, 4.6rem)/1 var(--f-disp); letter-spacing: -.03em; }
.pieza__lead { margin-top: 20px; color: var(--ink-2); font-size: clamp(1.02rem, 1.15vw, 1.12rem); text-wrap: pretty; }
.meta { margin-top: 26px; display: grid; gap: 10px; }
.meta div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--hair); }
.meta dt { font-size: .85rem; color: var(--ink-3); padding-top: 2px; }
.meta dd { font-size: .95rem; color: var(--ink); }
.acciones { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }

.pieza__escena { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; perspective: 1800px; }
.deco { position: absolute; pointer-events: none; z-index: 0; transition: opacity 1.6s ease .4s; }
.rv-pend .deco { opacity: 0 !important; }
.deco img { display: block; }
/* las moléculas flotan solas (CSS, fuera del hilo principal) */
.flt { animation: flota var(--dur, 4.6s) ease-in-out var(--del, 0s) infinite alternate; }
@keyframes flota { to { transform: translate3d(0, -7%, 0) rotate(var(--rot, 2.4deg)); } }
.dev { position: relative; z-index: 1; transform-style: preserve-3d; transition: transform 1.5s var(--ease-entra), opacity 1.1s ease; }
.dev__tilt { transform-style: preserve-3d; }
.dev__sombra {
  position: absolute; left: 12%; right: 12%; bottom: -9%; height: 16%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--glow), .34), rgba(var(--glow), 0)); filter: blur(18px);
}

/* pantalla genérica de dispositivo */
.pantalla-dev { position: relative; overflow: hidden; background: #fff; isolation: isolate; }
.pantalla-dev__brillo {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, .05) 100%);
  mix-blend-mode: screen;
}
/* carrusel: la ayuda visual pasa láminas con un fundido; el díptico sube de página como al scrollearlo */
/* la imagen nueva (.entra -> .act) llega por encima de la anterior (.sale), que se queda quieta abajo */
.carrusel { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.carrusel img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; }
.carrusel:not(.carrusel--vivo) img:first-child { opacity: 1; }
.carrusel img.sale { opacity: 1; z-index: 1; }
.carrusel img.act { opacity: 1; z-index: 2; }
.carrusel img.entra { z-index: 2; transition: none; }
.carrusel--fundido img.act { transition: opacity .8s ease, transform 1.4s var(--ease-out); }
.carrusel--fundido img.entra { opacity: 0; transform: scale(1.03); }
.carrusel--sube img.act { transition: transform .95s var(--ease-io); }
.carrusel--sube img.entra { opacity: 1; transform: translate3d(0, 100%, 0); }
.carrusel--sube img.sale { transform: translate3d(0, -28%, 0); transition: transform .95s var(--ease-io); }

/* ------------------------------------------------------------- tablet */
.dev--tablet { width: 100%; max-width: min(820px, calc((var(--vh100) - var(--nav-h) - 120px) * 1.52)); }
.tablet {
  position: relative; padding: 2.3%; border-radius: 3.6% / 5.6%;
  background: linear-gradient(150deg, #353b47 0%, #12151c 38%, #0a0c11 70%, #252a34 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, .12),
    inset 0 0 0 6px #07090d,
    0 2px 0 rgba(255, 255, 255, .06),
    0 40px 80px -30px rgba(0, 5, 18, .85),
    0 0 140px -30px rgba(var(--glow), .45);
}
.tablet__cam { position: absolute; left: 50%; top: 1.05%; width: .8%; height: 0; padding-bottom: .8%; margin-left: -.4%; border-radius: 50%; background: #1d2330; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.tablet .pantalla-dev { aspect-ratio: 16 / 10; border-radius: 1.1% / 1.7%; }
.pieza--av .rv-pend .dev { opacity: 0; transform: translate3d(0, 120px, 0) rotateX(28deg) rotateY(-24deg) rotateZ(4deg) scale(.84); }

.lamina { margin-top: 34px; display: flex; align-items: baseline; gap: 6px; font: 500 .95rem/1 var(--f-text); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lamina__n { font: 500 2.4rem/1 var(--f-disp); color: var(--ink); letter-spacing: -.02em; display: inline-block; min-width: 1.4em; }

.pieza--av .deco--m2 { width: clamp(140px, 13vw, 230px); right: 2%; top: -6%; filter: blur(1.5px); opacity: .8; }

/* -------------------------------------------------------------- laptop */
.pieza--dip .pieza__in { grid-template-columns: minmax(0, 1fr); gap: 40px; }
.pieza--dip .pieza__escena { grid-row: 1; }
.pieza--dip .pieza__info {
  grid-row: 2; max-width: none; width: 100%;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px clamp(24px, 4vw, 64px); align-items: end;
}
.pieza--dip .pieza__lead { margin-top: 0; }
.pieza--dip .meta { display: none; }
.pieza--dip .acciones { margin-top: 0; }
/* el laptop aplana su 3D en sí mismo: la cámara de la tapa es la suya (arriba y lejos), no la de la escena */
.dev--laptop { width: 92%; max-width: min(900px, calc((var(--vh100) - var(--nav-h) - 300px) * 1.5)); perspective: 3200px; perspective-origin: 50% -20%; transform-style: flat; margin-bottom: 7%; }
.laptop { position: relative; width: 84%; margin: 0 auto; transform-style: preserve-3d; }
/* la tapa se abre sola cuando la sección entra (de cerrada a 6°) */
.laptop__tapa { position: relative; transform-origin: 50% 100%; transform-style: preserve-3d; transform: rotateX(6deg); transition: transform 1.7s var(--ease-io) .45s; }
.rv-pend .laptop__tapa { transform: rotateX(-89deg); }
.laptop__frente {
  position: relative; padding: 2.4% 2.4% 3.2%; border-radius: 2.4% 2.4% 0 0 / 3.8% 3.8% 0 0;
  background: linear-gradient(180deg, #1b1f27, #0b0d12);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .1), inset 0 0 0 5px #06080b, 0 0 160px -30px rgba(var(--glow), .5);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.laptop__cam { position: absolute; left: 50%; top: .9%; width: .7%; height: 0; padding-bottom: .7%; margin-left: -.35%; border-radius: 50%; background: #222937; }
.laptop .pantalla-dev { aspect-ratio: 16 / 10; border-radius: 3px; }
.laptop__dorso {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 2.4% 2.4% 0 0 / 3.8% 3.8% 0 0;
  background: linear-gradient(180deg, #4a5261 0%, #2a2f39 55%, #1d2129 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transform: rotateX(180deg); -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
}
.laptop__ast { width: 11%; height: auto; aspect-ratio: 409 / 352; fill: #fff; opacity: .75; transform: scaleY(-1); }
/* base: un plano acostado que sale de la bisagra hacia el que mira; la tapa cerrada se apoya encima */
.laptop__teclado {
  position: absolute; left: -2%; width: 104%; top: 100%; height: 100%;
  transform-origin: 50% 0; transform: translateY(1px) rotateX(90deg); transform-style: preserve-3d;
  background: linear-gradient(180deg, #3a404c 0%, #262b34 30%, #1c2028 100%);
  border-radius: 0 0 3% 3% / 0 0 4.5% 4.5%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.laptop__teclas { position: absolute; left: 9%; right: 9%; top: 7%; height: 44%; border-radius: 1.2%; background: rgba(4, 6, 10, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.laptop__trackpad { position: absolute; left: 35%; width: 30%; top: 58%; height: 30%; border-radius: 1.8% / 3%; background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.laptop__canto {
  position: absolute; left: 0; right: 0; top: 100%; height: 12px; border-radius: 0 0 8px 8px;
  transform-origin: 50% 0; transform: rotateX(-90deg);
  background: linear-gradient(180deg, #6b7383, #2a2f39);
}
.dev--laptop .dev__sombra { bottom: -22%; left: 4%; right: 4%; height: 22%; }
.pieza--dip .rv-pend .dev { opacity: 0; transform: translate3d(0, 150px, 0) scale(.88); }
.pieza--dip .deco--est { width: clamp(140px, 15vw, 250px); left: 1%; top: 6%; }
.pieza--dip .deco--m5 { width: clamp(110px, 9vw, 160px); right: 6%; top: 4%; filter: blur(2px); opacity: .7; }

/* --------------------------------------------------------------- hojas */
.pieza--inf .pieza__in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.hojas { position: relative; z-index: 1; display: flex; justify-content: center; perspective: 1600px; width: 100%; }
.hoja {
  position: relative; width: 40%; max-width: min(300px, calc((var(--vh100) - var(--nav-h) - 110px) * .494));
  transform-style: preserve-3d; transform-origin: 50% 100%;
  transition: transform 1.6s var(--ease-entra), opacity 1.1s ease;
}
.hoja + .hoja { margin-left: clamp(16px, 2.4vw, 40px); }
.hoja--1 { transform: rotate(-3deg); }
.hoja--2 { margin-top: 8%; transform: rotate(3deg); transition-delay: .12s; }
.rv-pend .hoja--1 { opacity: 0; transform: translate3d(0, 220px, 0) rotateX(62deg) rotate(-9deg); }
.rv-pend .hoja--2 { opacity: 0; transform: translate3d(0, 320px, 0) rotateX(70deg) rotate(10deg); }
.hoja .dev__tilt { position: relative; border-radius: 3px; overflow: hidden; box-shadow: 0 2px 4px rgba(0, 5, 18, .3), 0 30px 60px -20px rgba(0, 5, 18, .75), 0 0 100px -30px rgba(var(--glow), .5); }
.hoja img { width: 100%; height: auto; }
/* un reflejo que cruza cada hoja una vez, cuando termina de apoyarse */
.hoja__luz {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .22) 48%, rgba(255, 255, 255, 0) 62%);
  background-size: 250% 100%; background-position: 50% 0;
}
.rv-in .hoja__luz { animation: reflejo 1.8s var(--ease-io) 1.2s both; }
.rv-in .hoja--2 .hoja__luz { animation-delay: 1.4s; }
@keyframes reflejo { from { background-position: 110% 0; } to { background-position: 50% 0; } }

.avatar { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.avatar--navy { background: #fff; }
.avatar__ast { width: 56%; height: 48%; fill: var(--navy); }
.avatar--s { width: 32px; height: 32px; }

/* ------------------------------------------------------------ teléfonos */
.pieza--ban .pieza__in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.pieza--ban .pieza__escena { display: block; min-height: max(660px, 76vh); }
.dev--tel { position: absolute; width: clamp(230px, 20vw, 290px); }
.dev--tel-a { left: 14%; top: 50%; margin-top: calc(clamp(230px, 20vw, 290px) * -1.05); z-index: 2; transform: rotateZ(-4deg) rotateY(8deg); }
.dev--tel-b { right: 10%; top: 50%; margin-top: calc(clamp(230px, 20vw, 290px) * -.95); z-index: 1; transform: translate3d(0, 30px, 0) rotateZ(5deg) rotateY(-10deg); transition-delay: .12s; }
.rv-pend .dev--tel-a { opacity: 0; transform: translate3d(0, 260px, 0) rotateZ(-12deg) rotateY(20deg); }
.rv-pend .dev--tel-b { opacity: 0; transform: translate3d(0, 420px, 0) rotateZ(12deg) rotateY(-20deg); }
.tel {
  position: relative; aspect-ratio: 9 / 19.2; padding: 3.6%; border-radius: 15% / 7.2%;
  background: linear-gradient(150deg, #3b414d 0%, #14171e 40%, #0a0c10 72%, #2a2f39 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .14), inset 0 0 0 6px #06080b, 0 40px 70px -25px rgba(0, 5, 18, .85), 0 0 120px -30px rgba(var(--glow), .5);
}
.tel__pant { position: relative; height: 100%; border-radius: 12% / 5.8%; overflow: hidden; display: flex; flex-direction: column; font-family: var(--f-text); font-size: 11px; line-height: 1.42; }
.tel__isla { position: absolute; left: 50%; top: 1.4%; width: 30%; height: 3.4%; margin-left: -15%; border-radius: 999px; background: #000; z-index: 3; }
.tel__estado { display: flex; justify-content: space-between; align-items: center; padding: 3.2% 8% 0; height: 7%; font-weight: 600; font-size: 11px; }
.tel__estado span:last-child { display: inline-flex; font-size: 12px; }
.tel__estado span:last-child .ic + .ic { margin-left: 3px; }
.chat__cab { display: flex; align-items: center; padding: 7px 10px 9px; font-size: 16px; }
.chat__cab > * + * { margin-left: 8px; }
.chat__quien { flex: 1; display: grid; line-height: 1.25; min-width: 0; }
.chat__quien b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__quien small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__cuerpo { flex: 1; position: relative; overflow: hidden; }
.chat__hilo { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 10px 8px; display: flex; flex-direction: column; }
.chat__hilo > * + * { margin-top: 6px; }
.chat__dia { align-self: center; padding: 3px 9px; border-radius: 6px; font-size: 9.5px; }
.chat__pie { display: flex; align-items: center; padding: 8px 10px 16px; font-size: 16px; }
.chat__pie > * + * { margin-left: 8px; }
.chat__campo { flex: 1; display: flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 11px; }
.chat__campo .ic { font-size: 16px; margin-right: 6px; }
.msj { position: relative; max-width: 86%; border-radius: 9px; padding: 6px 8px 16px; }
.msj p + p { margin-top: 5px; }
.msj__hora { position: absolute; right: 8px; bottom: 4px; font-size: 8.5px; }
.msj--img { padding: 3px 3px 3px; }
.msj--img img { width: 100%; height: auto; border-radius: 7px; }
.msj--img .msj__hora { right: 9px; bottom: 7px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.msj--escribe { display: inline-flex; padding: 10px 12px; align-self: flex-start; }
.msj--escribe i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }
.msj--escribe i + i { margin-left: 4px; }
.msj--escribe { display: none; }
.msj--escribe.ve { display: inline-flex; }
.msj--escribe.ve i { animation: escribe .6s ease-in-out infinite alternate; }
.msj--escribe.ve i:nth-child(2) { animation-delay: .15s; }
.msj--escribe.ve i:nth-child(3) { animation-delay: .3s; }
@keyframes escribe { from { opacity: .25; } to { opacity: .9; } }
/* la conversación se arma sola cuando la sección entra (site.js), con este estado de partida */
.chat--espera .msj--img, .chat--espera .msj--txt { display: none; }
.chat--espera .li-msj { opacity: 0; transform: translate3d(0, 30px, 0); }
.li-msj { transition: opacity .8s var(--ease-entra), transform .8s var(--ease-entra); }

.chat--wa { background: #0b141a; color: #e9edef; }
.chat--wa .tel__estado { color: #e9edef; }
.chat--wa .chat__cab { background: #1f2c34; color: #aebac1; }
.chat--wa .chat__quien b { color: #e9edef; }
.chat--wa .chat__quien small { color: #8696a0; }
.chat--wa .chat__dia { background: #182229; color: #8696a0; }
.chat--wa .msj { background: #202c33; align-self: flex-start; border-top-left-radius: 2px; }
.chat--wa .msj--escribe { color: #8696a0; }
.chat--wa .msj__hora { color: #8696a0; }
.chat--wa .chat__pie { background: #0b141a; color: #8696a0; }
.chat--wa .chat__campo { background: #202c33; color: #8696a0; }
.chat--wa .chat__mic { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #00a884; color: #0b141a; font-size: 15px; }

.chat--li { background: #fff; color: #1d2226; }
.chat--li .tel__estado { color: #1d2226; }
.chat--li .chat__cab { border-bottom: 1px solid #e8e8e8; color: #5b5f62; }
.chat--li .chat__quien b { color: #1d2226; }
.chat--li .chat__quien small { color: #666; }
.chat--li .chat__pie { border-top: 1px solid #e8e8e8; color: var(--b2); }
.chat--li .chat__campo { background: #eef3f8; color: #666; border-radius: 6px; }
.li-msj { display: flex; align-items: flex-start; }
.li-msj > * + * { margin-left: 8px; }
.li-msj .avatar { background: #fff; box-shadow: inset 0 0 0 1px #e0e0e0; }
.li-msj > div { min-width: 0; font-size: 10.5px; color: #333; }
.li-msj p + p { margin-top: 5px; }
.li-msj__quien { font-size: 11px; color: #1d2226; }
.li-msj__quien small { color: #666; font-size: 9.5px; }
.li-adj { margin-top: 8px; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
.li-adj img { width: 100%; height: auto; }
.li-adj span { display: flex; align-items: center; padding: 6px 8px; font-size: 9.5px; color: #555; background: #f7f7f7; }
.li-adj span .ic { margin-right: 5px; }

.pieza--ban .deco--luna { width: 150px; height: 150px; right: 30%; top: 2%; }
.luna { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset -34px -10px 0 0 #EAF3FF; filter: drop-shadow(0 0 30px rgba(124, 235, 194, .45)); transform: rotate(-18deg); }
.pieza--ban .deco--m7 { width: clamp(110px, 9vw, 170px); left: 6%; top: 0; filter: blur(3px); opacity: .8; }

/* --------------------------------------------------------- celular del reel */
/* el reel es 9:16: la pantalla del celular tiene esa proporción exacta y el video la llena entera */
.dev--reel { width: 100%; max-width: min(380px, calc((var(--vh100) - var(--nav-h) - 150px) * .5)); }
.pieza--vid .rv-pend .dev { opacity: 0; transform: translate3d(0, 220px, 0) rotateY(-28deg) rotateZ(7deg) scale(.86); }
/* el celular se inclina con el puntero: la parte que queda "detrás" del plano del .dev en 3D
   quedaba tapada por la caja invisible del .dev y los botones no recibían el clic.
   Sólo la pantalla recibe eventos. */
.dev--reel, .dev--reel .dev__tilt, .tel--reel { pointer-events: none; }
.tel--reel .tel__pant { pointer-events: auto; }
.tel--reel { aspect-ratio: auto; padding: 3.2%; border-radius: 13% / 7.4%; }
.tel--reel .tel__pant { height: auto; aspect-ratio: 9 / 16; border-radius: 10% / 5.7%; background: #000; }
.reel__video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.tel--reel .tel__isla { top: 1.6%; height: 2.9%; }
.reel { cursor: pointer; }
/* play: sólo se baja el video cuando se toca. Mientras corre, el botón se esconde y queda para pausar */
.reel__play {
  position: absolute; left: 50%; top: 50%; z-index: 4; display: flex; flex-direction: column; align-items: center;
  padding: 0; border: 0; background: none; color: #fff; cursor: pointer; transform: translate(-50%, -50%);
  transition: opacity .3s ease;
}
.reel__circ {
  display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(0, 10, 30, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 10px 40px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.reel__circ::after { content: ""; position: absolute; width: 76px; height: 76px; border-radius: 50%; animation: latido 2.2s var(--ease-out) infinite; pointer-events: none; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(124, 235, 194, .5); } 70%, 100% { box-shadow: 0 0 0 14px rgba(124, 235, 194, 0); } }
.reel__circ .ic { font-size: 30px; }
.reel__circ .ic--play { margin-left: 4px; }
.reel__play:active .reel__circ { transform: scale(.95); }
.reel__etq { margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(0, 10, 30, .6); font: 600 .8rem/1 var(--f-text); white-space: nowrap; }
.reel__etq small { margin-left: 4px; font-weight: 500; color: rgba(255, 255, 255, .7); }
.ic--pausa, .reel--juega .ic--play, .reel--pausa .ic--play { display: none; }
.reel--juega .ic--pausa { display: inline-block; }
.reel--pausa .ic--play { display: inline-block; }
.reel--juega .reel__play, .reel--visto .reel__etq { opacity: 0; }
.reel--visto .reel__etq { display: none; }
.reel--juega .reel__play:focus-visible { opacity: 1; }
.reel--juega .reel__circ::after, .reel--pausa .reel__circ::after { animation: none; }
.reel__barra { position: absolute; left: 8%; right: 8%; bottom: 1.2%; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s ease; }
.reel__barra i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.reel--visto .reel__barra { opacity: 1; }
/* parlante: aparece cuando el reel ya arrancó */
.reel__sonido {
  position: absolute; right: 5%; bottom: 3.4%; z-index: 4; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(0, 10, 30, .62); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: transform .16s var(--ease-out), background-color .2s ease, opacity .3s ease, visibility .3s;
}
.reel__sonido .ic { font-size: 18px; }
.reel__sonido .ic--sin, .reel--mudo .reel__sonido .ic--con { display: none; }
.reel--mudo .reel__sonido .ic--sin { display: inline-block; }
.reel--visto .reel__sonido { opacity: 1; visibility: visible; }
.reel__sonido:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .reel__sonido:hover, .reel__play:hover .reel__circ { background: rgba(0, 10, 30, .85); }
}
/* sin JS: quedan los controles del navegador (site.js los saca y pone los propios) */
html:not(.js) .reel__play, html:not(.js) .reel__sonido, html:not(.js) .reel__barra { display: none; }

/* ============================================================= CIERRE */
.cierre {
  position: relative; padding: clamp(96px, 16vh, 180px) var(--gut) clamp(80px, 12vh, 140px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cierre > * + * { margin-top: 26px; }
.cierre__ast { width: clamp(84px, 8vw, 120px); height: auto; aspect-ratio: 409 / 352; fill: var(--ink); filter: drop-shadow(0 14px 44px rgba(var(--glow), .55)); transition: transform 1.6s var(--ease-entra), opacity 1.2s ease; }
.rv-pend .cierre__ast { opacity: 0; transform: translate3d(0, 120px, 0) rotate(-120deg) scale(.7); }
.cierre__t { font: 500 clamp(2.5rem, 6.4vw, 5.6rem)/1 var(--f-disp); letter-spacing: -.03em; }
.cierre__t .linea:nth-child(2) .mk__in { --d: .12s; }
.cierre__txt { max-width: 46ch; color: var(--ink-2); font-size: clamp(1.02rem, 1.2vw, 1.14rem); }

.pie {
  position: relative; display: flex; align-items: center; padding: 28px var(--gut) 36px;
  border-top: 1px solid var(--hair); max-width: 1560px; margin: 0 auto;
}
.pie__vl { flex: none; width: 100px; height: 18px; margin-right: 28px; fill: var(--ink); opacity: .85; }
.pie p { font-size: .82rem; line-height: 1.55; color: var(--ink-3); max-width: 110ch; }

/* ============================================================== VISOR */
.visor {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--ink); overflow: hidden; z-index: var(--z-visor);
}
@supports (height: 100dvh) { .visor { height: 100dvh; } }
.visor:not([open]) { display: none; }
.visor::backdrop { background: rgba(0, 8, 22, .88); }
.visor__marco { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; background: var(--abyss-2); }
.visor__barra { flex: none; display: flex; align-items: center; min-height: 64px; padding: 10px clamp(14px, 2vw, 24px); border-bottom: 1px solid var(--hair); }
.visor__barra > * + * { margin-left: 18px; }
.visor__t { font: 500 1.15rem/1.2 var(--f-disp); }
.visor__ayuda { color: var(--ink-3); font-size: .85rem; }
.visor__acc { margin-left: auto !important; display: flex; }
.visor__acc > * + * { margin-left: 8px; }
.visor__fs .ic--cerrar, .visor--fs .visor__fs .ic--abrir { display: none; }
.visor--fs .visor__fs .ic--cerrar { display: inline-block; }
.visor__cuerpo { position: relative; flex: 1; min-height: 0; }
.visor__cuerpo iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.visor__cuerpo.img { display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.visor__cuerpo.img img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.visor__cuerpo video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000; }
.visor__cargando { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; background: var(--abyss-2); pointer-events: none; transition: opacity .3s ease; }
.visor__cargando i { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--hair-2); border-top: 2px solid var(--mint); animation: gira .8s linear infinite; }
.visor__cargando p { position: absolute; top: calc(50% + 40px); color: var(--ink-3); font-size: .85rem; }
html.visor-abierto { overflow: hidden; }
/* navegadores sin <dialog>: el visor va como capa fija con fondo propio */
.visor--sin-dialog { background: rgba(0, 8, 22, .88); }

/* ============================================================ CAJA 3D */
/* Caja de Venomixol hecha con seis caras en CSS 3D. 1em = alto / 48: la caja mide 30 x 48 x 12 em
   y todo lo de adentro va en em, así escala entera con --caja-h. La luz la pinta site.js por cara
   (sombra según la normal, brillo especular) mientras gira. */
.caja3d { position: relative; font-size: calc(var(--caja-h, 480px) / 48); width: 30em; height: 48em; perspective: 150em; perspective-origin: 50% 110%; }
.caja3d__flota, .caja3d__tilt, .caja__giro { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform-style: preserve-3d; }
.cara {
  position: absolute; left: 50%; top: 50%; overflow: hidden;
  background: linear-gradient(160deg, #FBFDFF 0%, #F2F6FB 100%); color: var(--navy); font-family: var(--f-text);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  /* el borde de 1px tapa la costura entre caras vecinas */
  box-shadow: 0 0 0 1px #E6EDF6;
}
.cara::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; box-shadow: inset 0 0 1.6em rgba(0, 34, 79, .07); }
.cara--frente, .cara--dorso { width: 30em; height: 48em; margin: -24em 0 0 -15em; }
.cara--der, .cara--izq { width: 12em; height: 48em; margin: -24em 0 0 -6em; }
.cara--tapa, .cara--base { width: 30em; height: 12em; margin: -6em 0 0 -15em; }
.cara--frente { transform: translateZ(6em); }
.cara--dorso { transform: rotateY(180deg) translateZ(6em); }
.cara--der { transform: rotateY(90deg) translateZ(15em); }
.cara--izq { transform: rotateY(-90deg) translateZ(15em); }
.cara--tapa { transform: rotateX(90deg) translateZ(24em); }
.cara--base { transform: rotateX(-90deg) translateZ(24em); }
.cara__semi { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-image: var(--semi, none); background-size: 84em 48em; background-repeat: no-repeat; }
.cara--izq .cara__semi { background-position: 0 0; }
.cara--frente .cara__semi { background-position: -12em 0; }
.cara--der .cara__semi { background-position: -42em 0; }
.cara--dorso .cara__semi { background-position: -54em 0; }
.cara__sombra, .cara__brillo { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; pointer-events: none; opacity: 0; }
.cara__sombra { background: #041430; }
.cara__brillo { background: linear-gradient(105deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .75) 50%, rgba(255, 255, 255, 0) 60%); background-size: 320% 100%; background-position: 50% 0; }
.caja3d__piso {
  position: absolute; left: 50%; top: 100%; width: 36em; height: 6em; margin: 4em 0 0 -18em; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 6, 20, .6), rgba(0, 6, 20, 0)), radial-gradient(closest-side, rgba(var(--glow), .35), rgba(var(--glow), 0));
  filter: blur(.8em);
}
.cx-lockup { display: block; width: 100%; height: auto; }
.cx-ink { font: 700 1em/1.25 ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; letter-spacing: .06em; color: #1E2433; opacity: .8; }

/* frente */
.cx-receta { position: absolute; top: 2.6em; right: 2.4em; padding: .42em .9em; border: .1em solid rgba(0, 54, 125, .55); border-radius: .3em; font: 600 .7em/1 var(--f-text); letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.cx-marca { position: absolute; left: 3.2em; top: 14.6em; width: 23.6em; }
.cx-dosis { margin-top: .45em; font: 500 3.3em/1 var(--f-disp); letter-spacing: -.02em; color: var(--brand); }
.cx-forma { margin-top: .7em; font: 500 1.05em/1.3 var(--f-text); color: var(--navy); }
.cx-via { margin-top: .25em; font: 400 .9em/1.3 var(--f-text); color: #5E6266; }
.cx-cant { position: absolute; left: 3.2em; bottom: 8.4em; display: flex; align-items: center; color: var(--navy); }
.cx-cant b { margin-right: .55em; font: 500 2.6em/1 var(--f-disp); letter-spacing: -.03em; color: var(--brand); }
.cx-cant span { font: 500 .76em/1.25 var(--f-text); }
.cx-vl { position: absolute; left: 3.2em; bottom: 3em; width: 8.6em; height: 1.5em; fill: var(--navy); }

/* dorso */
.cx-dorso { position: absolute; top: 2.6em; right: 2.6em; bottom: 2.2em; left: 2.6em; display: flex; flex-direction: column; }
.cx-lockup--s { width: 13.5em; }
.cx-sub { margin-top: .6em; font: 500 .8em/1.3 var(--f-text); color: var(--brand); }
.cx-leg { margin-top: 1.7em; font: 400 .72em/1.42 var(--f-text); color: #3A3E49; text-wrap: pretty; }
.cx-leg p + p { margin-top: .6em; }
.cx-picto { margin-top: 1.6em; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6em; }
.cx-picto span { display: flex; flex-direction: column; align-items: center; padding: .7em .3em .6em; border: .09em solid rgba(0, 54, 125, .22); border-radius: .35em; font: 500 .52em/1.25 var(--f-text); text-align: center; color: var(--navy); }
.cx-picto .ic { font-size: 2.6em; margin-bottom: .15em; color: var(--brand); vertical-align: 0; }
.cx-leg b { font-weight: 600; color: var(--navy); }
.cx-lote { margin-top: auto; display: flex; }
.cx-lote p { flex: 1; display: grid; gap: .35em; padding: .55em .7em; border: .09em solid rgba(41, 43, 58, .35); border-radius: .25em; background: rgba(255, 255, 255, .6); }
.cx-lote p + p { margin-left: .9em; }
.cx-lote span { font: 600 .52em/1 var(--f-text); letter-spacing: .08em; text-transform: uppercase; color: #5E6266; }
.cx-lote .cx-ink { font-size: .95em; }
.cx-firma { margin-top: 1.1em; display: flex; align-items: flex-end; justify-content: space-between; }
.cx-firma span { font: 400 .5em/1 var(--f-text); letter-spacing: .04em; color: #5E6266; }
.cx-vl--dorso { position: static; width: 7em; height: 1.22em; }

/* laterales: el contenido va girado, se lee de abajo hacia arriba como en una caja real */
.cara__rot { position: absolute; left: 50%; top: 50%; width: 48em; height: 12em; margin: -6em 0 0 -24em; transform: rotate(-90deg); }
.cx-bloque { position: absolute; }
.cx-bloque svg { display: block; width: 100%; height: 100%; }
.cx-bloque--braille { left: 3em; top: 1.2em; width: 25.6em; height: 2em; }
.cx-bloque--lat { left: 3em; top: 4.4em; width: 15em; }
.cx-lat { margin-top: .5em; font: 500 .74em/1.2 var(--f-text); color: var(--navy); white-space: nowrap; }
.cx-bloque--ean { right: 2.2em; top: 2em; width: 13.6em; height: 8em; padding: .5em .6em; background: #fff; border-radius: .2em; }
.cx-bloque--ean text { font: 500 7.5px var(--f-text); fill: #111; }
.cx-bloque--lat2 { left: 3em; top: 2.2em; width: 19em; }
.cx-lat2 { margin-top: .6em; font: 500 .82em/1.2 var(--f-text); color: var(--navy); white-space: nowrap; }
.cx-lat2 b { margin-right: .35em; font: 500 1.5em/1 var(--f-disp); color: var(--brand); letter-spacing: -.02em; }
.cx-traza { right: 2.2em; top: 1.7em; width: 17.4em; height: 8.6em; display: flex; align-items: center; padding: .7em; background: #fff; border: .06em solid #D5DDE8; border-radius: .3em; }
.cx-dm { flex: none; width: 7em; height: 7em; margin-right: .8em; }
.cx-dm svg { fill: #111; }
.cx-traza p { font: 500 .5em/1.55 ui-monospace, Consolas, monospace; color: #4a4f5b; letter-spacing: .02em; }
.cx-traza b { color: #111; font-weight: 700; }

/* tapa y base */
.cx-tapa { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 2.6em; }
.cara--tapa .cx-lockup { width: 11em; }
.cara--tapa .cx-ink { font-size: .78em; text-align: right; }
.cx-base { font: 500 .7em/1.3 var(--f-text); color: var(--navy); }
.cx-ast { width: 2em; height: 1.72em; fill: var(--navy); }

/* ========================================================= RESPONSIVE */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__menu { display: inline-flex; }
}

@media (max-width: 860px) {
  .porque__in { grid-template-columns: minmax(0, 1fr); }
  .porque__t, .cambio, .porque__cierre { grid-column: 1; grid-row: auto; }
  .cambio { margin: 10px 0; }

  .pieza__in,
  .pieza--inf .pieza__in,
  .pieza--ban .pieza__in { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; padding-top: 72px; padding-bottom: 72px; gap: 36px; }
  .pieza__info { order: -1; max-width: 620px; }
  .pieza--dip .pieza__info, .pieza--dip .pieza__escena { grid-row: auto; }
  .lamina { display: none; }

  .pieza--dip .pieza__info { display: block; }
  .pieza--dip .pieza__lead { margin-top: 20px; }
  .pieza--dip .acciones { margin-top: 26px; }
  .pieza--dip .meta { display: grid; }
  .dev--laptop, .dev--tablet { width: 100%; max-width: none; }
  .dev--reel { width: 78vw; max-width: 340px; margin: 0 auto; }

  /* hero apilado: texto arriba, caja abajo */
  .hero__in { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 64px; padding-bottom: 72px; }
  .hero__texto { grid-row: 1; }
  .hero__grados-l { display: none; }
  .hero__obj { grid-column: 1; grid-row: 2; }
  .caja3d--hero { --caja-h: min(calc(var(--vh100) * .46), 400px); }
  .hero__obj .hero__grados { margin-top: calc(min(calc(var(--vh100) * .46), 400px) * .2); }
  .hero__foco { top: calc(min(calc(var(--vh100) * .46), 400px) / 2); width: 130vw; height: 130vw; margin: -65vw 0 0 -65vw; }
  .hoja { width: 46%; }
  .pieza--ban .pieza__escena { min-height: 560px; }
  .dev--tel-a { left: 4%; }
  .dev--tel-b { right: 2%; }
  /* en el teléfono el grano cuesta más de lo que suma: una capa fija con mezcla recompone todo en cada scroll */
  .grano { display: none; }
}

@media (max-width: 600px) {
  :root { --nav-h: 60px; }
  body { font-size: 1rem; }
  .hero__sub { max-width: none; }
  .caja3d--hero { --caja-h: min(calc(var(--vh100) * .42), 340px); }
  .hero__obj .hero__grados { margin-top: calc(min(calc(var(--vh100) * .42), 340px) * .2); }
  .hero__foco { top: calc(min(calc(var(--vh100) * .42), 340px) / 2); }
  .acciones .btn { flex: 1 1 auto; justify-content: center; }
  .pieza--ban .pieza__escena { min-height: 500px; }
  .dev--tel { width: 200px; }
  .dev--tel-a { left: 0; margin-top: -210px; }
  .dev--tel-b { right: 0; margin-top: -190px; }
  .pie { flex-direction: column; align-items: flex-start; }
  .pie__vl { margin: 0 0 16px; }
  .visor__ayuda { display: none; }
}

/* ahorro de datos (Save-Data): sin las moléculas decorativas ni el grano */
.ahorro .deco, .ahorro .grano { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav { transition: none; }
  .intro { display: none; }
  .flt, .hero__foco::before, .reel__circ::after, .msj--escribe.ve i { animation: none; }
  .visor__cargando i { animation-duration: 2s; }
  .carrusel img { transform: none !important; }
  .carrusel img.act { transition: opacity .6s ease !important; }
  .carrusel--sube img.entra { opacity: 0; }
}
