/* ============================================================
   PREVIA v6 — IMMERSIVE OVERRIDE LAYER
   Full-viewport 3D canvas + pinned DOM overlays + virtual scroller.
   Loads AFTER styles.css to override layout.
   ============================================================ */

html, body{
  margin: 0;
  padding: 0;
  background: #0d1413 url('assets/posters/hero-bosque.webp') center/cover no-repeat fixed;
  color: #fff;
  overflow-x: hidden;
}

html, body{ min-height: 100%; }

body{
  position: relative;
}

/* Three.js canvas — full viewport, behind everything DOM. Now HIDDEN since
   videos are rendered via DOM (CSS .card-video-stash) directly, not via
   WebGL texture sampling. Kept for VFX compatibility. */
#world-canvas{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 0;
  pointer-events: none;
}

/* Invisible virtual scroller — provides scrollable height to drive scrollY */
#imv-scroller{
  position: relative;
  width: 1px;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
}

/* App root container — sits on top of canvas */
#app{
  position: relative;
  z-index: 2;
}

/* ── Stage with pinned overlays ───────────────────────────── */
.imv-stage{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
}
.imv-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px clamp(20px, 6vw, 100px) 60px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(36px) scale(0.985);
  filter: blur(8px);
  transition:
    opacity 700ms cubic-bezier(.2,.7,.2,1),
    transform 900ms cubic-bezier(.2,.7,.2,1),
    filter 800ms cubic-bezier(.2,.7,.2,1),
    visibility 0s linear 800ms;
  pointer-events: none;
}
.imv-overlay.active{
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  transition-delay: 0s;
}
.imv-overlay[data-world="dark"]{ color: #fff; }
.imv-overlay[data-world="light"]{ color: #111513; }

.imv-inner{
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Stacks ───────────────────────────────────────────────── */
.imv-stack-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}
.imv-stack{
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.imv-split{
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
@media (min-width: 900px){
  .imv-split{ grid-template-columns: 1.05fr .95fr; gap: 80px; align-items: end; }
}

/* ── Typography ───────────────────────────────────────────── */
.imv-h1{
  font-family: 'Inria Serif', 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 1.02;
  font-size: clamp(44px, 7.4vw, 112px);
  margin: 0;
  max-width: 18ch;
  text-align: center;
  color: inherit;
}
.imv-h2{
  font-family: 'Inria Serif', serif;
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 1.02;
  font-size: clamp(34px, 5.4vw, 84px);
  margin: 0;
  max-width: 14ch;
  color: inherit;
}
.imv-h2--light{ color: #111513; }
.imv-em{
  font-style: italic;
  font-weight: 300;
  color: var(--c-accent, #C4D6C5);
}
.imv-em--deep{ color: var(--c-deep, #2B3534); }
.imv-sub{
  font-size: clamp(16px, 1.4vw, 21px);
  font-weight: 300;
  max-width: 60ch;
  line-height: 1.55;
  color: rgba(255,255,255,0.86);
  margin: 0;
  text-align: center;
}
.imv-lead{
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.55;
  max-width: 40ch;
  color: rgba(255,255,255,0.82);
  margin: 0;
}
.imv-overlay[data-world="light"] .imv-lead{ color: #5b6663; }
.imv-overlay[data-world="light"] .imv-sub{ color: rgba(17,21,19,0.78); }

.imv-lead--light{ color: #5b6663 !important; }

.imv-eyebrow{
  display: block;
  margin-bottom: 8px;
}
.imv-overlay[data-world="light"] .imv-eyebrow{ color: rgba(17,21,19,0.55); }

.imv-cta-row{
  display: flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Buttons — inherit base styles from styles.css if compatible */
.imv-cta-row .btn-primary,
.imv-overlay .btn-primary{
  background: #fff;
  color: #111513;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s, background .2s;
}
.imv-cta-row .btn-primary:hover,
.imv-overlay .btn-primary:hover{
  transform: translateY(-2px);
  background: var(--c-accent, #C4D6C5);
}
.imv-cta-row .btn-ghost,
.imv-overlay .btn-ghost{
  background: transparent;
  color: inherit;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid currentColor;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.85;
  transition: opacity .2s, background .2s;
}
.imv-cta-row .btn-ghost:hover,
.imv-overlay .btn-ghost:hover{
  opacity: 1;
  background: rgba(255,255,255,0.08);
}

/* ── Shield meta ──────────────────────────────────────────── */
.imv-right{ text-align: right; }
@media (max-width: 900px){ .imv-right{ text-align: left; } }
.imv-meta-row{
  display: flex;
  gap: 28px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 24px;
}
@media (max-width: 900px){ .imv-meta-row{ justify-content: flex-start; } }
.imv-meta-item strong{
  display: block;
  font-family: 'Inria Serif', serif;
  font-weight: 400;
  font-size: 28px;
  color: #fff;
}
.imv-meta-item span{
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* ── Steps grid ───────────────────────────────────────────── */
.imv-steps-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 16px;
}
@media (min-width: 720px){ .imv-steps-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px){ .imv-steps-grid{ grid-template-columns: repeat(4, 1fr); } }
.imv-step{
  background: rgba(246,241,231,0.92);
  backdrop-filter: blur(14px);
  padding: 28px 22px 24px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  color: #111513;
  border: 1px solid rgba(17,21,19,0.06);
}
.imv-step-num{
  font-family: 'Inria Serif', serif;
  font-weight: 300;
  font-size: 48px;
  color: var(--c-deep, #2B3534);
  letter-spacing: -0.07em;
  line-height: 1;
}
.imv-step h3{
  font-family: 'Inria Serif', serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 0;
  color: #111513;
}
.imv-step p{
  font-size: 13px;
  line-height: 1.6;
  color: #5b6663;
  margin: 0;
}
.imv-step-time{
  margin-top: auto;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(17,21,19,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}
.imv-step-time::before{
  content: '';
  width: 20px;
  height: 1px;
  background: var(--c-deep, #2B3534);
}

/* ── Vitals grid (Scanner) ────────────────────────────────── */
.imv-vitals-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  background: rgba(246,241,231,0.85);
  backdrop-filter: blur(12px);
  padding: 28px;
  border-radius: 16px;
  color: #111513;
}
.imv-vital{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid rgba(17,21,19,0.1);
}
.imv-vital:nth-child(-n+2){ border-top: 0; }
.imv-vital .name{ font-size: 14px; font-weight: 500; }
.imv-vital .meta{ font-size: 12px; color: #5b6663; }

/* ── Doctors list ─────────────────────────────────────────── */
.imv-doctors-list{
  display: flex;
  flex-direction: column;
  background: rgba(31,40,39,0.45);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 8px 24px;
}
.imv-doctor{
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.imv-doctor:first-child{ border-top: 0; }
.imv-doctor-avatar{
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
}
.imv-doctor-avatar img{ width: 100%; height: 100%; object-fit: cover; }
.imv-doctor-name{
  font-family: 'Inria Serif', serif;
  letter-spacing: -0.04em;
  font-size: 22px;
  color: #fff;
  line-height: 1.1;
}
.imv-doctor-spec{
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
}
.imv-doctor-cedula{
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

/* ── Testimoniales ────────────────────────────────────────── */
.imv-testi-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 8px;
}
@media (min-width: 900px){ .imv-testi-grid{ grid-template-columns: repeat(3, 1fr); } }
.imv-testi-card{
  background: rgba(246,241,231,0.92);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #111513;
}
.imv-testi-card blockquote{
  margin: 0;
  font-family: 'Inria Serif', serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #111513;
}
.imv-testi-foot{ display: flex; gap: 14px; align-items: center; }
.imv-testi-foot img{
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
}
.imv-testi-foot .who{ font-weight: 500; font-size: 14px; }
.imv-testi-foot .meta{ font-size: 12px; color: #5b6663; }

/* ── Pricing ──────────────────────────────────────────────── */
.imv-price-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (min-width: 900px){ .imv-price-grid{ grid-template-columns: repeat(3, 1fr); } }
.imv-price-card{
  background: rgba(246,241,231,0.92);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 28px;
  color: #111513;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(17,21,19,0.06);
}
.imv-price-card.featured{
  background: var(--c-deep, #2B3534);
  color: #fff;
  border-color: var(--c-deep, #2B3534);
  transform: translateY(-6px);
}
.imv-price-card.featured *{ color: #fff !important; }
.imv-price-name{
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(17,21,19,0.55);
}
.imv-price-amt{
  font-family: 'Inria Serif', serif;
  font-weight: 400;
  font-size: 56px;
  letter-spacing: -0.05em;
  line-height: 1;
}
.imv-price-amt sup{ font-size: 22px; margin-right: 4px; vertical-align: top; }
.imv-price-amt small{ font-size: 14px; color: rgba(17,21,19,0.55); margin-left: 6px; font-weight: 400; letter-spacing: 0; }
.imv-price-foot{ font-size: 12px; color: rgba(17,21,19,0.55); margin-top: -8px; }
.imv-price-card ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.imv-price-card ul li::before{ content: '— '; opacity: 0.4; }
.imv-price-cta{
  margin-top: auto;
  background: #111513;
  color: #fff;
  border: 0;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.imv-price-card.featured .imv-price-cta{
  background: #fff;
  color: var(--c-deep, #2B3534);
}

/* ── Nav adapts to active world ───────────────────────────── */
.imv-nav{
  /* z-index 220 sits above .imv-intro-video-gate (z-200) so the user sees
     the landing header from the first frame of the intro video — the video
     becomes the cinematic backdrop of the landing rather than a separate
     pre-landing screen. When the gate fades out, the Nav doesn't move or
     re-render: visual continuity, no perceived "transition" between intro
     and landing. 2026-05-23. */
  z-index: 220;
  background: rgba(14,18,17,0.42) !important;
  backdrop-filter: blur(24px) saturate(1.2);
  border-bottom-color: rgba(255,255,255,0.05) !important;
  transition: background 600ms ease, color 600ms ease;
}
.imv-nav .nav-logo,
.imv-nav .nav-link,
.imv-nav .nav-login{
  color: rgba(255,255,255,0.85);
}
.imv-nav .nav-link:hover{ color: #fff; }
.imv-nav .nav-cta{
  background: #fff;
  color: #111513;
}
.imv-nav .nav-lang{
  background: rgba(255,255,255,0.08);
}
.imv-nav .nav-lang button{
  color: rgba(255,255,255,0.55);
}
.imv-nav .nav-lang button.active{
  background: rgba(255,255,255,0.95);
  color: #111513;
}
.imv-nav .nav-logo .dot{ background: var(--c-accent, #C4D6C5); }

/* ── Nav logo image swap (PREVIA CARE MX wordmark v6) ─────────────────────
   Two stacked variants: color (forest+terracota) for light scenes, white
   silhouette for dark scenes. Driven by body[data-active-world] which the
   scroll handler updates as user crosses scene boundaries. Cross-fade 500ms
   matches nav background transition for synchronous visual handoff. */
/* The logo is taken OUT of normal flex flow so a 110px-tall lockup doesn't
   force the nav bar to grow to ~132px. The nav keeps its compact natural
   height (defined by nav-actions) and the logo "floats" anchored to the
   left, vertically centered on the bar, with its bottom edge overflowing
   onto the scene below. The .vfx-hud chip moved further down to clear it. */
.imv-nav .nav-inner{ position: relative; justify-content: flex-end; }
.nav-logo--swap{
  position: absolute;
  left: clamp(20px, 5vw, 64px);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  /* New lockup intrinsic aspect ≈ 1.475:1 (W:H). Width below = height × 1.48. */
  height: 110px;
  width: 162px;
  flex-shrink: 0;
  z-index: 2; /* float above .vfx-hud if margins ever shrink */
}
.nav-logo-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  transition: opacity 500ms cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
  user-select: none;
}
/* Default (dark scenes — Bosque/Manifiesto/Manos/Hojas): white variant visible */
.nav-logo-img--color{ opacity: 0 !important; }
.nav-logo-img--white{ opacity: 1 !important; }
/* Light scenes (Manuscrito/Prisma/Vela/Moneda): color variant visible */
body[data-active-world="light"] .nav-logo-img--color{ opacity: 1 !important; }
body[data-active-world="light"] .nav-logo-img--white{ opacity: 0 !important; }

/* Mobile: smaller, also keeps the absolute positioning so the nav stays compact. */
@media (max-width: 768px){
  .nav-logo--swap{
    height: 82px; width: 121px;
    left: clamp(12px, 4vw, 24px);
  }
}

body[data-active-world="light"] .imv-nav{
  background: rgba(255,255,255,0.72) !important;
  border-bottom-color: rgba(17,21,19,0.06) !important;
}
body[data-active-world="light"] .imv-nav .nav-logo,
body[data-active-world="light"] .imv-nav .nav-link,
body[data-active-world="light"] .imv-nav .nav-login{
  color: rgba(17,21,19,0.85);
}
body[data-active-world="light"] .imv-nav .nav-cta{
  background: #111513;
  color: #fff;
}
body[data-active-world="light"] .imv-nav .nav-lang{
  background: rgba(17,21,19,0.06);
}
body[data-active-world="light"] .imv-nav .nav-lang button{ color: rgba(17,21,19,0.55); }
body[data-active-world="light"] .imv-nav .nav-lang button.active{ background: #fff; color: #111513; }
body[data-active-world="light"] .imv-nav .nav-logo .dot{ background: var(--c-deep, #2B3534); }

/* ── Progress dots — ocultos globalmente (editorial minimal nav) ── */
.imv-progress{
  display: none !important;
}
.imv-progress--legacy{
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 6px 12px;
}
.imv-progress-dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background .3s, transform .3s, width .3s;
}
.imv-progress-dot.active{
  background: var(--c-accent, #C4D6C5);
  width: 22px;
  border-radius: 999px;
}
body[data-active-world="light"] .imv-progress-dot{
  background: rgba(17,21,19,0.2);
}
body[data-active-world="light"] .imv-progress-dot.active{
  background: var(--c-deep, #2B3534);
}

/* ── Scroll hint ──────────────────────────────────────────── */
.imv-scroll-hint{
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  pointer-events: none;
  animation: imvHintPulse 2.4s ease-in-out infinite;
}
.imv-scroll-arrow{
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), transparent);
}
@keyframes imvHintPulse{
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 1;   transform: translateX(-50%) translateY(6px); }
}

/* ── Live dot row (hero) ──────────────────────────────────── */
.imv-overlay .hero-eyebrow-row{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
.imv-overlay .live-dot{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: imvDot 2.2s ease-in-out infinite;
}
@keyframes imvDot{
  0%,100%{ opacity: 0.35; transform: scale(.95); }
  50%    { opacity: 1;    transform: scale(1.1); }
}

/* ── Reduce motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce){
  #world-canvas{ display: none; }
  body{ background: var(--c-deep, #2B3534); }
  .imv-overlay{ transition: none !important; }
}

/* ============================================================
   CINEMATIC VFX LAYER — scroll-vfx.jsx companion
   Film grain · letterbox · flash · vignette pulse · HUD · velocity
   ============================================================ */

/* Canvas filter transition for chromatic aberration push */
#world-canvas{
  transition: filter 0.08s linear;
  will-change: filter;
}

/* 35mm grain — fullscreen, fixed, animated noise via SVG fractalNoise */
.vfx-grain{
  position: fixed;
  inset: -10%;            /* over-scan so animation can shift */
  pointer-events: none;
  z-index: 50;
  opacity: 0.10;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch' seed='5'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.95  0 0 0 0 0.95  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 320px 320px;
  animation: vfxGrainShift 0.45s steps(6) infinite;
}
@keyframes vfxGrainShift{
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -2%); }
  80%  { transform: translate(3%, 1%); }
  100% { transform: translate(0,0); }
}

/* Vignette — radial dim that pulses on section cuts */
.vfx-vignette{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 49;
  opacity: 0.18;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0)   42%,
    rgba(0,0,0,0.35) 78%,
    rgba(0,0,0,0.82) 100%
  );
  transition: opacity 0.18s ease-out;
}

/* Letterbox bars — cinematic 2.39:1 feel on section cut */
.vfx-letterbox{
  position: fixed;
  left: 0;
  width: 100vw;
  height: 6vh;
  background: #000;
  z-index: 55;
  pointer-events: none;
  transform: translateY(-100%);
  transition: transform 0.34s cubic-bezier(.83,.01,.18,1);
  will-change: transform;
}
.vfx-letterbox--top{    top: 0; }
.vfx-letterbox--bottom{ bottom: 0; transform: translateY(100%); }
.vfx-letterbox--active.vfx-letterbox--top    { transform: translateY(0); }
.vfx-letterbox--active.vfx-letterbox--bottom { transform: translateY(0); }

/* White flash bloom — 80ms peak */
.vfx-flash{
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}
.vfx-flash--active{
  animation: vfxFlash 240ms ease-out;
}
@keyframes vfxFlash{
  0%   { opacity: 0;    }
  18%  { opacity: 0.55; }
  100% { opacity: 0;    }
}

/* HUD — top-left Igloo-style monospace tag. `top` sits below the floating
   nav logo (which extends ~55px below the nav center, ending around y=96).
   120px gives 24px of breathing room above the chip. */
.vfx-hud{
  position: fixed;
  top: 120px;
  left: 22px;
  z-index: 58;
  pointer-events: none;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(246,241,231,0.78);
  text-transform: uppercase;
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(13,20,19,0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 7px 12px;
  border: 1px solid rgba(196,214,197,0.18);
  border-radius: 2px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.vfx-hud-prefix{ opacity: 0.45; }
.vfx-hud-counter{ color: rgba(232,185,138,0.95); font-weight: 600; }
.vfx-hud-dot{    opacity: 0.4; }
.vfx-hud-label{  color: #f6f1e7; min-width: 90px; }
.vfx-hud--cut{
  animation: vfxHudCut 320ms ease-out;
}
@keyframes vfxHudCut{
  0%   { transform: translateX(-12px); opacity: 0.0; filter: blur(4px); }
  35%  { transform: translateX(2px);   opacity: 1.0; filter: blur(0);   }
  100% { transform: translateX(0);     opacity: 1.0; filter: blur(0);   }
}

/* Bottom-left scroll velocity meter — Igloo HUD vibe */
.vfx-velocity{
  position: fixed;
  bottom: 26px;
  left: 22px;
  z-index: 58;
  pointer-events: none;
  font-family: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(246,241,231,0.55);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(13,20,19,0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 12px;
  border: 1px solid rgba(196,214,197,0.14);
  border-radius: 2px;
  min-width: 168px;
}
.vfx-velocity-label{ opacity: 0.7; }
.vfx-velocity-track{
  width: 100%;
  height: 2px;
  background: rgba(246,241,231,0.10);
  position: relative;
  overflow: hidden;
}
.vfx-velocity-fill{
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #C4D6C5, #E8B98A);
  transition: width 0.08s linear;
}

/* ── Scanner overlap fix — backdrop blur on text panels in scene 4 ── */
.imv-overlay[data-world="light"] .imv-split > div:first-child,
.imv-overlay[data-world="light"] .imv-stack{
  position: relative;
}
.imv-overlay[data-world="light"] .imv-vitals-grid,
.imv-overlay[data-world="dark"]  .imv-doctors-list,
.imv-overlay .imv-meta-row,
.imv-overlay .imv-price-card,
.imv-overlay .imv-step{
  background: rgba(13,20,19,0.62);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  border: 1px solid rgba(246,241,231,0.10);
}

/* Testimonios — scrim oscuro + texto cream para legibilidad sobre video vela */
.imv-overlay .imv-testi-card{
  background: rgba(13,20,19,0.72) !important;
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  border: 1px solid rgba(246,241,231,0.14) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  color: #F6F1E7 !important;
}
.imv-overlay .imv-testi-card blockquote{
  color: #F6F1E7 !important;
  text-shadow: 0 1px 12px rgba(0,0,0,0.45);
}
.imv-overlay .imv-testi-foot .who{ color: #F6F1E7 !important; }
.imv-overlay .imv-testi-foot .meta{ color: rgba(246,241,231,0.72) !important; }
.imv-overlay[data-world="light"] .imv-vital,
.imv-overlay[data-world="light"] .imv-step{
  background: rgba(246,241,231,0.78);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  color: var(--c-deep, #2B3534);
}

/* Text-bg scrim for hero copy when text overlays a busy video */
.imv-stack-center,
.imv-split > div:first-child{
  text-shadow: 0 2px 22px rgba(0,0,0,0.65);
}

/* VIDEOS via DOM — fullscreen stacked, one .active at a time.
   Poster lives on the stash pseudo-element BEHIND the videos, so when
   autoplay is blocked (IG webview, low-end mobile) the user still sees
   the active scene's static frame with subtle ken-burns motion — gives
   feel of looping motion without requiring video playback. */
.card-video-stash{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
/* ::before poster ken-burns fallback is MOBILE-ONLY (see @media block below).
   On desktop the body bg poster + the videos handle visuals natively. */
@keyframes imvKenBurns {
  0%   { transform: scale(1.0)  translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, 0.8%); }
}
.card-video-stash video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.65s cubic-bezier(.77,0,.18,1),
              transform 1.4s cubic-bezier(.16,.84,.44,1);
  filter: brightness(0.78) saturate(1.05);
}
.card-video-stash video.active{
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   ENTRY GATE — click-to-enter overlay required to satisfy
   Chrome autoplay policy. Single click unlocks all videos.
   ============================================================ */
/* (Legacy .imv-entry-gate styles removed — replaced by .imv-intro-video-gate) */

/* While intro gate is active, hide background scene videos to save GPU decode slots. */
body:has(.imv-intro-video-gate) .card-video-stash{ display: none !important; }

/* Reduce motion — kill VFX too */
@media (prefers-reduced-motion: reduce){
  .vfx-grain,
  .vfx-vignette,
  .vfx-letterbox,
  .vfx-flash,
  .vfx-velocity{ display: none !important; }
  #world-canvas{ filter: none !important; }
}

/* ============================================================
   MOBILE — ≤768px viewport
   Preserves PREVIA v6 brand (forest/sage/cream/Inria Serif)
   while collapsing layout, reducing scale, hiding decorative
   HUD elements that crowd small screens.
   ============================================================ */
@media (max-width: 768px){

  /* Typography — clamps con leading aireado para evitar densidad vertical.
     Subimos tamaños base un punto (legibilidad sobre el video bg), line-height
     un pelín más generoso y H1 cap menor para evitar wraps incómodos. */
  .imv-h1{ font-size: clamp(32px, 8.5vw, 48px); max-width: 100%; letter-spacing: -0.025em; line-height: 1.15; }
  .imv-h2{ font-size: clamp(26px, 7vw, 44px); max-width: 100%; letter-spacing: -0.025em; line-height: 1.18; }
  .imv-sub{ font-size: 16px; max-width: 100%; line-height: 1.7; }
  .imv-lead{ font-size: 16px; max-width: 100%; line-height: 1.7; }
  .imv-entry-title{ font-size: clamp(28px, 8vw, 42px); }
  .imv-entry-sub{ font-size: 14px; line-height: 1.55; }
  .imv-entry-cta{ font-size: 16px; padding: 14px 30px; }
  .imv-entry-tag{ font-size: 9.5px; padding: 5px 11px; }

  /* Video positioning — videos are 16:9 landscape but mobile is portrait.
     Use object-position to keep visual focus visible after crop. Brightness
     lifted vs desktop so videos actually read on small screens. */
  .card-video-stash video{
    object-position: 50% 50%;
    filter: brightness(0.92) saturate(1.08) contrast(1.05);
  }
  /* Text scrim — gradient overlay legible sobre video sin sentirse oprimido */
  .imv-stack-center,
  .imv-stack,
  .imv-split > div{
    text-shadow: 0 2px 14px rgba(0,0,0,0.65);
  }
  /* Scrim gradient on overlay text area (mobile only) — más liviano que antes
     para que la sección respire visualmente sin perder legibilidad. */
  .imv-overlay::before{
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg,
      rgba(13,20,19,0.12) 0%,
      rgba(13,20,19,0.50) 45%,
      rgba(13,20,19,0.82) 100%
    );
    z-index: -1;
  }
  .imv-overlay[data-world="light"]::before{
    background: linear-gradient(180deg,
      rgba(246,241,231,0.05) 0%,
      rgba(246,241,231,0.50) 45%,
      rgba(246,241,231,0.82) 100%
    );
  }

  /* Overlay spacing — más aire lateral + más aire abajo, kill desktop padding */
  .imv-overlay{ padding: 0; }
  /* Tall-content scenes: anclar al top (no vertical center) para evitar que
     el H2 quede pushed detrás del nav/HUD por overflow. Selector :has()
     restringe a overlays con grids de contenido (Steps/Scanner/Doctors/Testi/Pricing).
     NO overflow-y/overscroll-behavior — eso atrapaba el scroll y bloqueaba el
     scroll-driven scene change. El shrink + 6 vitals + H2 cap 26px hace que
     content quepa en viewport sin scroll interno. */
  .imv-overlay:has(.imv-steps-grid),
  .imv-overlay:has(.imv-vitals-grid),
  .imv-overlay:has(.imv-doctors-list),
  .imv-overlay:has(.imv-testi-grid),
  .imv-overlay:has(.imv-price-grid){
    align-items: flex-start !important;
  }
  .imv-inner{
    /* 112px top clears the floating nav logo (82px tall + ~20px buffer);
       72px bottom matches scroll-hint clearance without crowding. */
    padding: 112px 24px 72px;
    width: 100%;
    box-sizing: border-box;
  }
  .imv-stack-center{ gap: 28px; }
  .imv-stack{ gap: 34px; }
  .imv-eyebrow{ margin-bottom: 18px; }

  /* H2 mobile: cap font-size + line-height aireado + más caracteres por línea
     para evitar que stretchee verticalmente en escenas tall (Scanner/Doctors). */
  .imv-h2{
    font-size: 28px !important;
    line-height: 1.22 !important;
    max-width: 18ch !important;
  }
  .imv-lead{ font-size: 16px !important; line-height: 1.7 !important; }
  /* Light scenes mobile: lead más oscuro para contraste sobre reflejos brillantes
     (coin/manuscrito/prisma/vela) — compensa el scrim aireado sin engrosarlo. */
  .imv-overlay[data-world="light"] .imv-lead{ color: #3a4341 !important; }
  .imv-overlay[data-world="light"] .imv-sub{ color: rgba(17,21,19,0.88) !important; }

  /* Split layouts → stack vertical on mobile con más respiro entre columnas */
  .imv-split{
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    align-items: start !important;
  }

  /* Section grids → single column con breathing room generoso */
  .imv-doctors-list,
  .imv-testi-grid,
  .imv-price-grid{
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }
  /* Steps mobile: layout HORIZONTAL por card (número izq + content der).
     Compresión agresiva — toda la escena entra en ~700px de altura.
     Trade-off de legibilidad mínimo: descripciones a 12.5px/1.45 siguen siendo
     legibles, h3 a 16px lo suficientemente grande para el título corto. */
  .imv-steps-grid{
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .imv-step{
    display: grid !important;
    grid-template-columns: 44px 1fr !important;
    column-gap: 12px !important;
    row-gap: 4px !important;
    padding: 12px 14px !important;
    min-height: auto !important;
  }
  .imv-step-num{
    grid-row: 1 / 4 !important;
    align-self: start !important;
    font-size: 28px !important;
    line-height: 1 !important;
  }
  .imv-step h3{
    grid-column: 2 !important;
    font-size: 16px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }
  .imv-step p{
    grid-column: 2 !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    margin: 0 !important;
  }
  .imv-step-time{
    grid-column: 2 !important;
    margin-top: 2px !important;
    font-size: 9px !important;
  }

  /* Steps scene ONLY — tighten header so all 4 cards fit in 750-780px viewport.
     - Hide the lead paragraph (cards already explain each step in their description)
     - H2 cap @ 22px / 2 lines
     - Minimum top padding that still clears the floating logo (82px tall + 4px buffer) */
  .imv-overlay:has(.imv-steps-grid) .imv-inner{
    padding: 88px 20px 36px !important;
  }
  .imv-overlay:has(.imv-steps-grid) .imv-stack{ gap: 16px !important; }
  .imv-overlay:has(.imv-steps-grid) .imv-eyebrow{ margin-bottom: 8px !important; }
  .imv-overlay:has(.imv-steps-grid) .imv-h2{
    font-size: 22px !important;
    line-height: 1.2 !important;
    max-width: 22ch !important;
    margin-bottom: 0 !important;
  }
  /* Lead is hidden on mobile in the Steps scene only — desktop unaffected,
     other scenes (Hero/Scanner/CTA) still show their leads normally. */
  .imv-overlay:has(.imv-steps-grid) .imv-lead{
    display: none !important;
  }

  /* Vitals: contenedor único con dividers, padding interno generoso.
     Mostramos 5 (no 6) en mobile para que el H2 + lead + grid encajen
     en viewport sin sentirse amontonados. */
  .imv-vitals-grid{
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 26px 22px !important;
  }
  .imv-doctor,
  .imv-testi-card,
  .imv-price-card{
    padding: 28px 24px !important;
    min-height: auto !important;
  }
  .imv-vital{
    padding: 16px 0 !important;
    border-top: 1px solid rgba(17,21,19,0.12) !important;
  }
  .imv-vital:first-child{ border-top: 0 !important; padding-top: 6px !important; }
  .imv-vital:last-child{ padding-bottom: 6px !important; }
  .imv-vital:nth-child(n+6){ display: none !important; }
  .imv-vital .name{ font-size: 14.5px !important; }
  .imv-vital .meta{ font-size: 12.5px !important; margin-top: 4px !important; }
  .imv-meta-row{
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
  }
  .imv-meta-item strong{ font-size: 20px !important; }
  .imv-meta-item span{ font-size: 9.5px !important; letter-spacing: 0.12em; }

  /* NAV — hide desktop links, keep only logo + lang + CTAs */
  .nav-links{ display: none !important; }
  .nav-inner{
    padding: 10px 14px !important;
    gap: 8px !important;
  }
  .nav-logo{ font-size: 14px !important; }
  .nav-actions{ gap: 6px !important; }
  .nav-lang button{ font-size: 10px !important; padding: 4px 7px !important; }
  .nav-login{ font-size: 12px !important; padding: 6px 8px !important; }
  .nav-cta{ font-size: 12px !important; padding: 7px 12px !important; }

  /* Progress dots — ocultos en mobile para declutter el top
     (decorativos en desktop; usuario reconoce escena por contenido) */
  .imv-progress{ display: none !important; }

  /* HUD top-left — oculto en mobile (cinematographer marker decorativo,
     compite con nav en viewport pequeño y aporta sensación amontonada) */
  .vfx-hud{ display: none !important; }

  /* Velocity meter — hide, decorative only */
  .vfx-velocity{ display: none !important; }

  /* Letterbox bars — barras más delgadas en mobile para no enmarcar tanto */
  .vfx-letterbox{ height: 2vh; }

  /* Buttons larger touch targets */
  .btn-primary,
  .btn-ghost,
  .imv-cta-row a,
  .imv-cta-row button{
    min-height: 44px;
    padding: 12px 22px !important;
    font-size: 15px !important;
  }

  /* Pricing tile — número monetario menos pesado en mobile */
  .imv-price-amt{ font-size: 48px !important; }
  .imv-price-card ul{ gap: 10px !important; font-size: 13.5px !important; }

  /* Scroll hint — smaller, lower */
  .imv-scroll-hint{
    bottom: 22px !important;
    font-size: 10px !important;
  }

  /* Tweaks dev panel — hide on mobile (was only useful in desktop dev) */
  .tweaks-panel,
  [class*="tweaks"]{ display: none !important; }

  /* Reduce video tone-down filter on mobile so posters/videos read clearly */
  .card-video-stash video{
    filter: brightness(0.85) saturate(1.05) contrast(1.02);
  }
  /* Mobile-only: poster ken-burns BEHIND videos so if autoplay blocked
     (IG webview etc.), user still sees animated background. On desktop
     this layer is NOT present (videos work reliably on desktop). */
  .card-video-stash::before{
    content: "";
    position: absolute;
    inset: -4%;
    background-image: var(--scene-poster, url('assets/posters/hero-bosque.webp'));
    background-size: cover;
    background-position: center;
    transition: background-image 0.65s ease-in-out;
    filter: brightness(0.82) saturate(1.05);
    animation: imvKenBurns 14s ease-in-out infinite alternate;
    z-index: -1;
  }

  /* Grain less intense on mobile (less GPU) */
  .vfx-grain{ opacity: 0.06 !important; }
}

/* ============================================================
   SMALL MOBILE — ≤380px (iPhone SE / older Android)
   ============================================================ */
@media (max-width: 380px){
  .imv-h1{ font-size: 30px; line-height: 1.16; }
  .imv-h2{ font-size: 24px !important; line-height: 1.24 !important; max-width: 17ch !important; }
  .imv-lead{ font-size: 15px !important; line-height: 1.65 !important; }
  .imv-entry-title{ font-size: 26px; }
  .imv-inner{ padding: 100px 18px 48px; }
  /* Show only 4 vitals on small phones — sixth row creates overflow. */
  .imv-vital:nth-child(n+5){ display: none !important; }
  .imv-vitals-grid{ padding: 22px 18px !important; }
  .imv-step{ padding: 14px 16px !important; }
  /* Keep "Iniciar sesión" visible on narrow Androids (≤380px CSS width, e.g. OnePlus ~360px).
     It used to be display:none here, which hid login on sub-380 phones while iPhones (≥390px)
     still showed it. Shrink instead of hiding so both buttons fit. */
  .nav-login{ font-size: 11px !important; padding: 5px 7px !important; }
  .nav-actions{ gap: 5px !important; }

  /* Steps scene on tiny phones (≤380px / iPhone SE / mini) — squeeze even
     further so 4 cards still fit in ~600-650px usable. Lead remains hidden. */
  .imv-overlay:has(.imv-steps-grid) .imv-inner{
    padding: 80px 16px 28px !important;
  }
  .imv-overlay:has(.imv-steps-grid) .imv-stack{ gap: 12px !important; }
  .imv-overlay:has(.imv-steps-grid) .imv-h2{
    font-size: 20px !important;
    max-width: 22ch !important;
  }
  .imv-overlay:has(.imv-steps-grid) .imv-steps-grid{ gap: 8px !important; }
  .imv-step{ padding: 10px 12px !important; column-gap: 10px !important; grid-template-columns: 38px 1fr !important; }
  .imv-step h3{ font-size: 15px !important; }
  .imv-step p{ font-size: 12px !important; line-height: 1.42 !important; }
  .imv-step-num{ font-size: 26px !important; }
  .imv-step-time{ font-size: 8.5px !important; margin-top: 2px !important; }
}


/* ============================================================
   LÁMINA 03 — Scanner face portrait (added 2026-05-19)
   ============================================================
   The face-scan image is decorative + editorial. Positioned absolute so it
   doesn't disrupt the text flex; left edge mask-faded into the scene bg so
   there's no hard photo boundary. Desktop has the photo right + text left;
   mobile collapses to centered text with the photo as low-opacity backdrop.
*/
/* Scanner scene only: align text column to the left so the photo on the
   right has visual room. :has() scopes this without touching other scenes. */
.imv-overlay:has(.imv-scanner-face){
  justify-content: flex-start;
}
.imv-scanner-face{
  position: absolute;
  right: -3%;
  top: 50%;
  transform: translateY(-50%);
  height: min(86vh, 880px);
  width: auto;
  z-index: 0;
  pointer-events: none;
  opacity: 0.94;
  /* Fade the left edge of the image into the page bg so there's no hard
     rectangular boundary visible against the text column. */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.30) 18%, #000 48%);
          mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.30) 18%, #000 48%);
  filter: saturate(1.06) contrast(1.04);
}
.imv-scanner-stack{
  align-items: flex-start !important;
  text-align: left !important;
  max-width: 560px;
  position: relative;
  z-index: 1;
}
@media (max-width: 1024px){
  .imv-scanner-face{
    height: min(70vh, 720px);
    right: -8%;
    opacity: 0.78;
  }
  .imv-scanner-stack{ max-width: 460px; }
}
@media (max-width: 768px){
  /* Mobile: stack-center alignment + photo behind text as low-opacity backdrop */
  .imv-overlay:has(.imv-scanner-face){ justify-content: center; }
  .imv-scanner-face{
    height: 58vh;
    height: 58dvh;
    right: -14%;
    bottom: 4%;
    top: auto;
    transform: none;
    opacity: 0.38;
    /* Radial mask: photo center visible, edges fade to transparent.
       Lets the face anchor the scene without overpowering the text. */
    -webkit-mask-image: radial-gradient(ellipse at 70% 50%, #000 22%, transparent 72%);
            mask-image: radial-gradient(ellipse at 70% 50%, #000 22%, transparent 72%);
  }
  .imv-scanner-stack{
    align-items: center !important;
    text-align: center !important;
    margin: 0 auto;
    max-width: 100%;
  }
}

/* ============================================================
   SCROLL SNAP REMOVED (2026-05-25)
   The old scroll-snap-type:y mandatory block conflicted with
   GSAP ScrollTrigger pin-spacing. ScrollTrigger now owns all
   scroll-based scene transitions on both desktop and mobile.
   ============================================================ */

/* ============================================================
   END-OF-SCROLL LOOP — scene 04 → scene 01 fade transition
   When the user keeps pushing scroll-down at the bottom of the
   page, html.imv-looping is added briefly; the overlay fades in
   to cover the snap-to-top, then fades out revealing scene 01.
   JS must toggle on document.documentElement (not document.body).
   ============================================================ */
.imv-loop-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-deep, #2B3534);
  opacity: 0;
  pointer-events: none;
  z-index: 9000;
  transition: opacity 0.35s cubic-bezier(.6, 0, .4, 1);
}
html.imv-looping .imv-loop-overlay {
  opacity: 1;
}
/* Reduced-motion users: still loop, but with a near-instant cut
   instead of the fade. Snap on / snap off. */
@media (prefers-reduced-motion: reduce) {
  .imv-loop-overlay { transition: opacity 0.08s linear; }
}

/* ─────────────────────────────────────────────────────────────────────────
   INTRO VIDEO GATE (added 2026-05-22)
   ─────────────────────────────────────────────────────────────────────────
   Replaces the legacy click-to-enter EntryGate. A full-viewport intro video
   plays once; an overlay fades to black during the final second; on natural
   end (or Skip-button click) the gate fades out and the cinema-scroll
   landing is revealed underneath.

   Z-index 200 matches the legacy gate so the existing
     body:has(.imv-entry-gate) .card-video-stash { display:none }
   trick still works to keep background videos quiet — we mirror that here
   for the new class too.
   ───────────────────────────────────────────────────────────────────────── */

/* Hide background cinema-scroll videos while the intro gate is up — same
   reasoning as the legacy gate: don't divide GPU decode slots between the
   intro and the off-screen scene videos. */
body:has(.imv-intro-video-gate) .card-video-stash { display: none !important; }

.imv-intro-video-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: block;
  overflow: hidden;
  /* Disable user-select so accidental tap-and-drag doesn't trigger text
     selection on mobile (drag-select on a video element is ugly). */
  user-select: none;
  -webkit-user-select: none;
}

.imv-intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* cover anchored at center 40% — keeps the focal point (typically face/
     subject in upper third) on screen when aspect ratios mismatch. */
  object-position: center 40%;
  display: block;
  background: #000;
  /* Prevent the video element from receiving accidental focus rings — the
     wrapper is the dialog-role container. */
  outline: none;
}

/* Soft vignette to lift contrast against the eventual fade-out overlay.
   Subtle — gives the video a cinematic frame without obscuring content. */
.imv-intro-video-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.32) 100%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* Fade-to-black overlay — invisible by default, transitions to opaque over
   1s when .is-fading-out is added on the gate (set from JS ~1s before the
   video's natural end via onTimeUpdate). Result: video frame -1 to -0 cross-
   fades into solid black, then the whole gate dismisses to the landing. */
.imv-intro-fadeout {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 1s cubic-bezier(.4, 0, .6, 1);
}
.imv-intro-video-gate.is-fading-out .imv-intro-fadeout {
  opacity: 1;
}

/* Skip pill — bottom-right, only visible after 2s. Glass effect + brand
   typography. Tucks into the safe-area inset on iPhones with home indicator.
   Moved from top-right to bottom-right 2026-05-23: the Nav header now sits
   above the gate at top, so the skip pill yields that real estate to the
   primary CTAs (Iniciar sesión / Crear cuenta) and lives diagonally opposite
   the sound pill at bottom-left. */
.imv-intro-skip {
  position: absolute;
  top: auto;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  z-index: 3;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.92);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  font-family: var(--font-text, 'Inter'), sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  opacity: 0;
  animation: imv-intro-skip-in 0.5s ease forwards;
  /* Slight letter-spacing makes the small text feel intentional rather than
     accidental, in line with the editorial type system. */
}
@keyframes imv-intro-skip-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.imv-intro-skip:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.40);
}
.imv-intro-skip:active {
  transform: scale(0.97);
}
.imv-intro-skip:focus-visible {
  outline: 2px solid #E8B98A;
  outline-offset: 3px;
}

/* Sound toggle pill — mirrors .imv-intro-skip but anchored bottom-left.
   Same glass aesthetic, slightly higher contrast since this is the only
   audio affordance the user gets. Icon + label so the action is unambiguous
   even at first glance. Tap counts as a user-gesture, which is what lets
   us unmute (audible playback) without violating autoplay policy. */
.imv-intro-sound {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: calc(20px + env(safe-area-inset-left, 0px));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.95);
  padding: 9px 14px 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  font-family: var(--font-text, 'Inter'), sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  opacity: 0;
  animation: imv-intro-sound-in 0.5s ease 0.4s forwards;
}
@keyframes imv-intro-sound-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.imv-intro-sound:hover {
  background: rgba(0, 0, 0, 0.68);
  border-color: rgba(255, 255, 255, 0.42);
}
.imv-intro-sound:active { transform: scale(0.97); }
.imv-intro-sound:focus-visible {
  outline: 2px solid #E8B98A;
  outline-offset: 3px;
}
/* When muted, a subtle warm-tinted ring + sage glow on the icon hints
   "tap me — audio is waiting". When unmuted, neutral. Avoids the loud
   blinking-icon anti-pattern. */
.imv-intro-sound.is-muted {
  border-color: rgba(232, 185, 138, 0.42);
  box-shadow: 0 0 0 0 rgba(232, 185, 138, 0.0);
  animation:
    imv-intro-sound-in 0.5s ease 0.4s forwards,
    imv-intro-sound-pulse 2.4s ease-in-out 1.2s infinite;
}
@keyframes imv-intro-sound-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 185, 138, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(232, 185, 138, 0.18); }
}
.imv-intro-sound-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #E8B98A;
  flex-shrink: 0;
}
.imv-intro-sound:not(.is-muted) .imv-intro-sound-icon {
  color: #C4D6C5;
}
.imv-intro-sound-label {
  font-variant-numeric: tabular-nums;
}

/* Mobile tweaks — shrink both pills so they don't dominate the viewport,
   and adjust the video object-position for portrait phones (where the
   intro video is 16:9 letterboxed in cover). */
@media (max-width: 768px) {
  .imv-intro-video {
    object-position: center 35%;
  }
  .imv-intro-skip {
    top: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
    padding: 7px 13px;
    font-size: 11px;
    letter-spacing: 0.05em;
  }
  .imv-intro-sound {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: calc(14px + env(safe-area-inset-left, 0px));
    padding: 7px 12px 7px 10px;
    font-size: 11px;
    letter-spacing: 0.04em;
    gap: 6px;
  }
  .imv-intro-sound-icon { width: 14px; height: 14px; }
}

/* Reduced-motion users: skip the fadeout animation entirely — the video
   ends with a hard cut and the gate dismisses without the 1s ramp. */
@media (prefers-reduced-motion: reduce) {
  .imv-intro-fadeout {
    transition: opacity 0.12s linear;
  }
  .imv-intro-skip,
  .imv-intro-sound {
    animation: none;
    opacity: 1;
  }
  .imv-intro-sound.is-muted {
    box-shadow: none;
  }
}

