/* TEDxPaso del Norte Bridge · Landing de cuenta regresiva
   Una sola pantalla, sin scroll del documento. Si el contenido no cabe
   (zoom alto, pantallas muy pequeñas) app.js agrega .allow-scroll para no ocultar información (WCAG 1.4.10). */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --black: #000;
  --red: #EB0028;              /* TED red oficial (pantalla) */
  --ink: #fff;
  --mute: rgba(255,255,255,.66);
  --line: rgba(255,255,255,.14);
  --panel: #0c0c0d;
  --pad: clamp(16px, 3.6vmin, 52px);
  --hdr: 80px;                 /* lo actualiza app.js */
  --mx: 70%; --my: 75%;        /* posición del puntero para el brillo */
  --ease: cubic-bezier(.2,.7,.15,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--black); color: var(--ink); }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
html.allow-scroll body { overflow: auto; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -60px; z-index: 50; background: var(--ink); color: #000; padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* ---------- Capa inmersiva ---------- */
#bridge {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block;
  /* nada se dibuja detrás de la franja del logo */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent calc(var(--hdr) + 8px), #000 calc(var(--hdr) + 38%));
          mask-image: linear-gradient(to bottom, transparent 0, transparent calc(var(--hdr) + 8px), #000 calc(var(--hdr) + 38%));
}
.glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(42vmax 42vmax at var(--mx) var(--my), rgba(235,0,40,.10), transparent 62%);
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--hdr) + 8px), #000 70%);
          mask-image: linear-gradient(to bottom, transparent calc(var(--hdr) + 8px), #000 70%);
  transition: background-position .3s;
}

/* ---------- Estructura ---------- */
.stage {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: max(var(--pad), env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) max(calc(var(--pad) * .7), env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
}
html.allow-scroll .stage { height: auto; min-height: 100dvh; }

.top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  background: var(--black);              /* logo siempre sobre negro sólido */
}
.brand { display: block; line-height: 0; padding: 4px; margin: -4px; }   /* zona de respeto */
.brand img { height: clamp(30px, min(7.2vh, 8.4vw), 74px); width: auto; display: block; }

.tools { display: flex; align-items: center; gap: clamp(8px, 1.6vw, 20px); }
.link-btn {
  background: none; border: 0; color: var(--mute); font: inherit; font-size: 14px; font-weight: 500;
  padding: 10px 4px; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
}
.link-btn:hover { color: var(--ink); text-decoration-color: var(--red); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  background: none; border: 0; color: var(--mute); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  min-width: 40px; min-height: 32px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: #000; }

/* ---------- Hero ---------- */
.hero {
  align-self: center;
  display: grid; align-content: center; gap: clamp(12px, 2.6vh, 34px);
  max-width: 1180px; padding-block: clamp(8px, 2vh, 24px);
}
.eyebrow {
  margin: 0; display: inline-flex; align-items: center; gap: 10px;
  font-size: clamp(12px, 1.7vh, 15px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(235,0,40,.6); animation: pulse 2.4s infinite; }

.headline {
  margin: 0; font-weight: 640; letter-spacing: -.035em; line-height: .98;
  font-size: clamp(30px, min(7vw, 8.6vh), 112px);
  text-wrap: balance;
}
.headline span { display: block; }
.hero, .bottom { text-shadow: 0 0 2px #000, 0 0 18px #000, 0 0 36px #000; }
.btn { text-shadow: none; }
.headline .accent { color: var(--mute); font-weight: 300; }

/* Cuenta regresiva */
.units { display: flex; gap: clamp(10px, 2.4vw, 40px); align-items: flex-start; }
.unit { display: grid; gap: 6px; min-width: 0; }
.unit + .unit { padding-left: clamp(10px, 2.4vw, 40px); border-left: 1px solid var(--line); }
.num {
  display: block; font-weight: 250; letter-spacing: -.04em; line-height: .9;
  font-size: clamp(34px, min(8.6vw, 11.5vh), 140px);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11";
}
.num.tick { animation: tick .55s var(--ease); }
.unit:first-child .num { color: var(--ink); }
.lbl { font-size: clamp(10px, 1.45vh, 13px); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.count-note { margin: clamp(10px, 1.8vh, 18px) 0 0; font-size: clamp(13px, 1.8vh, 16px); color: var(--mute); }

/* Botones */
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  --h: clamp(44px, 6.2vh, 56px);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 clamp(18px, 2.4vw, 28px);
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: clamp(15px, 1.9vh, 17px); font-weight: 600; letter-spacing: -.005em;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s, box-shadow .25s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 40px -12px rgba(235,0,40,.7); }
.btn-primary:hover { background: #ff1a3f; }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary svg { transition: transform .25s var(--ease); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--ink); border-color: rgba(255,255,255,.28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(255,255,255,.08); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Pie */
.bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 24px;
  font-size: clamp(11px, 1.45vh, 13px); color: var(--mute); padding-top: 10px;
}
.bottom p { margin: 0; }
.legal span { display: block; }
html[lang="en"] .es-only { display: none; }

/* ---------- Entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); filter: blur(6px); animation: rise 1s var(--ease) forwards; animation-delay: 150ms; }
.reveal[data-d="1"] { animation-delay: 280ms; } .reveal[data-d="2"] { animation-delay: 410ms; }
.reveal[data-d="3"] { animation-delay: 540ms; } .reveal[data-d="4"] { animation-delay: 670ms; }
html.no-js .reveal { opacity: 1; transform: none; filter: none; }

@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
@keyframes tick { from { opacity: .15; transform: translateY(-.18em); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(235,0,40,.55); } 70% { box-shadow: 0 0 0 10px rgba(235,0,40,0); } 100% { box-shadow: 0 0 0 0 rgba(235,0,40,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Diálogos ---------- */
dialog.sheet {
  width: min(540px, calc(100vw - 32px)); max-height: min(88dvh, 760px);
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 22px;
  background: var(--panel); color: var(--ink); overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.9);
}
dialog.sheet[open] { animation: sheet-in .45s var(--ease); }
dialog.sheet::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sheet-inner { position: relative; padding: clamp(22px, 4vw, 36px); display: grid; gap: 16px; }
.sheet h2 { margin: 0; padding-right: 44px; font-size: clamp(22px, 3vh, 28px); font-weight: 650; letter-spacing: -.02em; }
.sheet p { margin: 0; line-height: 1.55; color: rgba(255,255,255,.82); }
.close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.close:hover { border-color: var(--ink); }
.ext { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 4px; font-weight: 600; }

.state { display: none; gap: 16px; }
dialog[data-view="soon"] [data-state="soon"],
dialog[data-view="form"] [data-state="form"],
dialog[data-view="done"] [data-state="done"] { display: grid; }

.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; font-weight: 600; }
.opt { color: var(--mute); font-weight: 400; }
input[type="email"], input[type="text"] {
  width: 100%; min-height: 50px; padding: 0 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22); background: #000; color: var(--ink);
  font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
input[type="email"]:focus, input[type="text"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
input[aria-invalid="true"] { border-color: #ff6b81; }
.err { color: #ff8095 !important; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { margin-bottom: 8px; width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); font-size: 14px; font-weight: 500; transition: all .2s;
}
.chip input:checked + span { background: var(--ink); color: #000; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.chips .err { width: 100%; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.82); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); flex: none; }
.consent a { color: var(--ink); text-underline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; display: none; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
.form-msg { font-size: 14px; color: #ffb3c0 !important; }

.ok-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.done-title { font-size: 20px; font-weight: 650; color: var(--ink) !important; }

/* ---------- Adaptación ---------- */
@media (max-width: 640px) {
  .tools .link-btn { font-size: 13px; }
  .units { gap: 0; justify-content: space-between; }
  .unit + .unit { padding-left: 0; border-left: 0; }
  .unit { flex: 1; }
  .ctas { display: grid; grid-template-columns: 1fr; }
  .btn { width: 100%; }
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .sheet-inner { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .tools .link-btn { display: none; }               /* se mantiene accesible en el pie */
  .bottom .about-mini { display: inline; }
}
.about-mini { display: none; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* Pantallas bajas y anchas (teléfono horizontal, laptops pequeñas) */
@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  .hero { grid-template-columns: 1.05fr 1fr; column-gap: 5vw; align-items: end; }
  .eyebrow, .headline { grid-column: 1; }
  .count, .ctas { grid-column: 2; }
  .count { grid-row: 1 / span 2; align-self: end; }
  .ctas { grid-row: 3; }
  .headline { font-size: clamp(26px, min(5.2vw, 10vh), 64px); }
  .num { font-size: clamp(30px, min(6vw, 12vh), 80px); }
  .btn { --h: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .dot { animation: none; }
}
@media (forced-colors: active) {
  .btn-primary { border: 2px solid ButtonText; }
  #bridge, .glow { display: none; }
}
