/* Waitlist VHS (2a y 3a): toda la página es una pantalla VHS reproduciendo una cinta.
   Medidas de referencia: la mesa del diseño de 1280 x 800. Todo escala con clamp() a partir de ahí. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--dua-burgundy); }
body { color: #fff; font-family: var(--dua-font-mono); -webkit-text-size-adjust: 100%; }

/* la pantalla: ocupa la ventana; si la ventana es muy baja (móvil acostado) deja hacer scroll en vez de encimar */
.tv {
  position: relative; overflow: hidden; isolation: isolate;
  width: 100%; height: 100dvh; min-height: 560px;
  --gx: clamp(18px, 5vw, 64px);                 /* margen lateral: 64px a 1280 */
  --gy: clamp(18px, 6vh, 48px);                 /* margen superior del OSD: 48px a 800 */
}
@media (max-height: 560px) and (orientation: landscape) { .tv { min-height: 360px; } }
.tv--2a { background: #1a0710; }
.tv--3a { background: var(--dua-burgundy); }
.layer { position: absolute; inset: 0; }

/* 1. imagen de cinta: canvas chico estirado con escalado suave */
.tape { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tape--video { filter: saturate(1.35) contrast(.95) brightness(.97) sepia(.06); }
.tape--pause {
  inset: -6px 0; height: calc(100% + 12px);
  filter: saturate(1.2) contrast(.96) blur(1px);   /* quieta, como el freeze frame de 2a */
}
/* 2. scanlines */
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.14) 2px 3px); }
.tv--3a .scan { background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.12) 2px 3px); }
.tv .scan.is-canvas { background: none; overflow: hidden; }   /* el JS las pinta en píxeles reales (startScanlines) */
/* 3. grano */
.grain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .1; mix-blend-mode: overlay; }
.tv--3a .grain { opacity: .12; }
/* 4. banda de refresco */
.roll {
  position: absolute; left: 0; right: 0; top: 0; height: 12%; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.08) 40%, rgba(255,255,255,.16) 50%, rgba(255,255,255,.08) 60%, transparent);
  animation: vhsRoll 9s linear infinite;
}
/* 6. estática: tapa todo, incluidos el formulario y el OSD. Aparece sin fundido. */
.static { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; opacity: 0; }
.static.is-on { opacity: 1; animation: staticFailsafe 0s linear 4s forwards; }  /* si el JS no arranca, la estática se retira sola (el JS cancela esto) */
@keyframes staticFailsafe { to { opacity: 0; } }
.tv--2a .static:not(.is-on) { transition: opacity .12s linear; }

@keyframes vhsRoll { from { transform: translateY(-100%); } to { transform: translateY(820%); } }
@keyframes vhsBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* el <video> es solo la fuente del canvas: se reproduce pero no se ve */
.source { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* ===================== OSD ===================== */
.osd {
  position: absolute; top: var(--gy); display: flex; align-items: center; gap: .5em;
  font-weight: 600; font-size: clamp(16px, min(2.5vw, 4vh), 32px); line-height: 1.25; letter-spacing: .08em; text-transform: uppercase; color: #fff;
  pointer-events: none;
}
.osd--left { left: var(--gx); }
.osd--right { right: var(--gx); gap: .75em; }
.osd--play { text-shadow: -2px 0 rgba(232,39,104,.8), 2px 0 rgba(255,128,58,.7), 3px 3px 0 rgba(48,49,79,.9); }
.osd--pause { text-shadow: -2px 0 rgba(232,39,104,.8), 2px 0 rgba(228,228,0,.55), 3px 3px 0 rgba(88,1,41,.8); }
.blink { animation: vhsBlink 1.6s steps(1) infinite; }

/* ===================== textos y formulario ===================== */
.title {
  font-family: var(--dua-font-sans); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #fff;
  padding-left: .14em;   /* compensa el tracking de la última letra para que quede centrado */
}
.sub { letter-spacing: .03em; max-width: 60ch; text-wrap: balance; }

.lead { display: flex; gap: 10px; width: min(780px, 100%); }
.lead input {
  min-width: 0; color: #fff; font: inherit; font-size: 15px; letter-spacing: .03em;
  padding: 16px 22px; border-radius: var(--dua-r-pill); outline: none;
}
.lead input::placeholder { color: inherit; opacity: .6; }
.lead input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.lead input[aria-invalid="true"] { border-color: var(--dua-amarillo-limon); box-shadow: 0 0 0 3px rgba(228,228,0,.22); }
.lead .f-name { flex: 1 1 0; }
.lead .f-email { flex: 1.15 1 0; }
.lead button {
  flex: none; background: var(--dua-amarillo-limon); color: var(--dua-burgundy); border: 0; cursor: pointer;
  font-family: var(--dua-font-sans); font-weight: 500; font-size: 15px; letter-spacing: .06em;
  padding: 16px 26px; border-radius: var(--dua-r-pill); transition: filter .2s;
}
.lead button:hover { filter: brightness(1.12); }
.lead button:disabled { cursor: progress; filter: saturate(.6); }
.lead button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.done { letter-spacing: .08em; text-transform: uppercase; color: var(--dua-amarillo-limon); }
.form-error { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #fff; max-width: 780px; }
.is-done .lead, .is-done .form-error { display: none; }
.done { display: none; }
.is-done .done { display: block; }

/* campos ocultos de Zoho y el campo trampa: nunca visibles */
.zoho-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* pastillas de control */
.pill {
  background: rgba(0,0,0,.28); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.3);
  font: inherit; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--dua-r-pill); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
}
.pill:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.pill:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ico-sound { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ico-sound path:first-child { fill: currentColor; stroke: none; }
.pill[aria-pressed="false"] .wave, .pill[aria-pressed="true"] .mute { display: none; }

/* móvil: el formulario en columna, campos de 52px y letra de 16px (iOS no hace zoom al enfocar) */
@media (max-width: 760px) {
  .lead { flex-direction: column; }
  .lead input, .lead button { width: 100%; min-height: 52px; font-size: 16px; }
  .lead input { padding: 14px 20px; }
}
@media (min-width: 521px) and (max-width: 760px) {
  .lead { flex-direction: row; flex-wrap: wrap; }
  .lead .f-name, .lead .f-email { flex: 1 1 0; width: auto; }
  .lead button { flex: 1 1 100%; }
}
@media (pointer: coarse) { .pill { min-height: 40px; padding: 9px 16px; } }
/* móvil: los controles quedan en solo ícono y discretos; el foco es el formulario (el nombre va en aria-label) */
@media (max-width: 760px) {
  .pill { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; font-size: 11px; letter-spacing: -.12em;
    background: rgba(0,0,0,.12); border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.6); }
  .pill .lbl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .roll { display: none; }
  .blink { animation: none; }
  .static { display: none; }
}
