/* Una sola escena: un letrero de cartelera a medio encender en una sala a
   oscuras. Todo lo demás es la luz que bota. Mismos colores que la campaña
   de historias (instagram-historias). Sólo tema oscuro, a propósito. */
@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --ink: #fafafa;
  --ink-2: #cfcfcf;
  --ink-3: #8f9198;
  --glow: 214 228 255;
  --blue: 59 130 246;
  --indigo: 99 102 241;
  --cyan: 34 211 238;
  --amber: #f59e0b;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Cuánta luz hay en la sala: 0 en reposo, 1 con el letrero encendido. */
  --power: 0;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Recorta también en html: si no, el halo del letrero ensancha la página en el teléfono. */
html { background: var(--bg); overflow-x: clip; }

body {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ── Luz ambiente ─────────────────────────────────────── */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  opacity: calc(0.3 + 0.7 * var(--power));
  transition: opacity 1.1s var(--ease);
}
.aurora i { position: absolute; border-radius: 50%; }
.aurora i:nth-child(1) {
  width: max(90vw, 700px); height: 70svh; left: -35vw; top: -34svh;
  background: radial-gradient(closest-side, rgb(var(--blue) / 0.55), transparent);
  transform: rotate(16deg);
}
.aurora i:nth-child(2) {
  width: max(80vw, 640px); height: 64svh; left: 12vw; top: -38svh;
  background: radial-gradient(closest-side, rgb(var(--indigo) / 0.5), transparent);
  transform: rotate(-12deg);
}
.aurora i:nth-child(3) {
  width: max(80vw, 640px); height: 62svh; right: -36vw; top: -26svh;
  background: radial-gradient(closest-side, rgb(var(--cyan) / 0.35), transparent);
  transform: rotate(10deg);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.2 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Estructura ───────────────────────────────────────── */
.top {
  display: flex;
  justify-content: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(1.5rem, 4svh, 2.5rem));
}
.wordmark { width: 8.25rem; height: auto; fill: #fff; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(2rem, 5svh, 3.5rem);
  text-align: center;
}

/* ── El letrero ───────────────────────────────────────── */
.stage {
  position: relative;
  /* El letrero mide 11,9 em de ancho: así siempre cabe entre los márgenes. */
  font-size: min((100vw - 32px) / 11.95, max(var(--sign-h, 9svh), 1.75rem), 5.25rem);
}
.sign {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  margin: 0;
  padding: 0.46em 0.8em;
  border: 0;
  border-radius: 0.54em;
  background: linear-gradient(180deg, #171717, #0d0d0d);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.07),
    0 0 0 1px rgb(255 255 255 / 0.06),
    0 0.8em 1.6em -0.4em rgb(0 0 0 / 0.9);
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: strike 1.2s linear 0.3s both;
}
.sign:focus-visible { outline: 2px solid rgb(var(--glow)); outline-offset: 6px; }
/* La luz que bota sobre la sala: va en el marco, detrás del tablero. */
.stage::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -3.2em -2.4em;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgb(var(--glow) / 0.16), transparent 75%),
    radial-gradient(closest-side, rgb(var(--indigo) / 0.34), transparent);
  opacity: calc(0.72 + 0.28 * var(--power));
  transition: opacity 0.9s var(--ease);
  pointer-events: none;
}
@keyframes strike {
  0% { opacity: 0.12; }
  8% { opacity: 0.9; }
  12% { opacity: 0.2; }
  20% { opacity: 1; }
  26% { opacity: 0.45; }
  34%, 100% { opacity: 1; }
}

.bulbs { display: flex; gap: 0.176em; height: 0.162em; }
.bulb {
  position: relative;
  width: 0.162em;
  height: 0.162em;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
}
.bulb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0.08em 0.027em rgb(var(--glow) / 0.9), 0 0 0.3em 0.054em rgb(var(--glow) / 0.45);
  opacity: max(var(--lit, 0), var(--near, 0));
  transition: opacity 0.14s linear;
}

.word {
  display: flex;
  padding-left: 0.18em;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: pre;
}
.letter { position: relative; color: #2e2e2e; }
.letter::after {
  content: attr(data-ch);
  position: absolute;
  inset: 0;
  color: #fff;
  text-shadow: 0 0 0.24em rgb(var(--glow) / 0.9), 0 0 0.8em rgb(var(--glow) / 0.5);
  opacity: max(var(--lit, 0), var(--near, 0));
  transition: opacity 0.14s linear;
}

/* ── Texto ────────────────────────────────────────────── */
h1 {
  /* Por delante de la sombra del letrero. */
  position: relative;
  margin: clamp(2.25rem, 6svh, 4rem) 0 0;
  font-size: clamp(2.6rem, min(13vw, var(--title-h, 11svh)), 6.5rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.048em;
}
h1 > span { display: block; }
.fade {
  /* Aire abajo para que el recorte del degradado no corte la «g». */
  padding-bottom: 0.08em;
  background-image: linear-gradient(90deg, #fafafa, #a3a3a3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  max-width: 24em;
  margin: clamp(1rem, 2.6svh, 1.5rem) 0 0;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1.2vw + 0.8rem, 1.3125rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
@media (min-width: 40rem) { .lead { max-width: none; } }
.lead strong { color: #fff; font-weight: 600; }

/* Vidrio de la campaña. */
.pill, .enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: clamp(1.5rem, 4svh, 2.25rem) 0 0;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.15), rgb(255 255 255 / 0.05));
  box-shadow:
    inset 0 1px 0.5px rgb(255 255 255 / 0.4),
    inset 0 -1px 0.5px rgb(255 255 255 / 0.16),
    inset 0 0 0 1px rgb(255 255 255 / 0.13),
    inset 0 -14px 20px -18px rgb(170 195 255 / 0.45),
    0 14px 34px -18px rgb(0 0 0 / 0.8);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
}
.pill::after, .enter::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: auto 14% -7px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgb(170 195 255 / 0.35), transparent);
}
.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgb(245 158 11 / 0.2), 0 0 12px var(--amber);
}
.dot.live { background: #34d399; box-shadow: 0 0 0 3px rgb(52 211 153 / 0.2), 0 0 12px #34d399; }
.days { display: flex; align-items: center; gap: 0.3125rem; height: 1rem; padding-right: 0.75rem; border-right: 1px solid rgb(255 255 255 / 0.2); }
.days i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgb(255 255 255 / 0.13); }
.days i.on { background: #fff; box-shadow: 0 0 3px 1px rgb(var(--glow) / 0.9), 0 0 9px 2px rgb(var(--glow) / 0.45); }

/* Con fecha: la píldora sube sobre el letrero, como en las historias, y todo
   se achica un poco para que el reloj entre sin desplazarse. */
.counting { --sign-h: 7.4svh; --title-h: 9svh; }
.counting .pill { order: -1; margin: 0 0 clamp(1.5rem, 4svh, 2.5rem); }
.counting h1 { margin-top: clamp(1.75rem, 4.5svh, 3rem); }
.counting main { padding-block: clamp(1.25rem, 3svh, 3rem); }

.clock {
  display: grid;
  grid-template-columns: repeat(4, minmax(3.75rem, auto));
  margin-top: clamp(1.25rem, 3.5svh, 2rem);
  font-variant-numeric: tabular-nums;
}
.clock div { display: grid; gap: 0.25rem; padding-inline: clamp(0.5rem, 2.4vw, 1.5rem); }
.clock div + div { border-left: 1px solid rgb(255 255 255 / 0.12); }
.clock b { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.clock span { color: var(--ink-3); font-size: 0.8125rem; }

.remind { margin: clamp(0.75rem, 2.4svh, 1.5rem) 0 0; color: var(--ink-3); font-size: 0.9375rem; line-height: 1.9; }
.remind a { margin-left: 0.5rem; white-space: nowrap; }
.remind a, .foot a { color: var(--ink); text-decoration: underline; text-decoration-color: rgb(255 255 255 / 0.3); text-underline-offset: 0.25em; }
.remind a:hover, .foot a:hover { text-decoration-color: #fff; }

.enter { text-decoration: none; }
a:focus-visible { outline: 2px solid rgb(var(--glow)); outline-offset: 4px; border-radius: 4px; }
.enter:focus-visible { border-radius: 999px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(1.25rem, 3.5svh, 2rem));
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  .sign { animation: none; }
  .aurora, .stage::before, .bulb::after, .letter::after { transition: none; }
}
