/* ============================================================================
 * Academy Hall — La U en Casa · Banco de Occidente
 * ----------------------------------------------------------------------------
 * Las posiciones de los puntos de contacto se midieron sobre el arte final
 * (LANDING FINAL ACADEMY HALL BDEO.jpeg) comparándolo contra el fondo limpio,
 * y van en % del escenario para que todo escale sin recalcular nada.
 *
 * Los tamaños internos (tipografía, iconos, radios) van en `cqw`, unidades
 * relativas al contenedor .stage: así la escena y sus burbujas escalan juntas
 * en cualquier resolución, exactamente como en el arte.
 * ========================================================================== */

:root {
  --navy: #062855;
  --ink: #10214A;
  --blue: #1C5598;
  --blue-bright: #0186FC;
  --card: #FFFFFF;
  --muted: #6B7A93;
  --live: #E8283C;
  --soon: #F2B33D;

  --stage-w: 1672;
  --stage-h: 941;
}

* { box-sizing: border-box; }

/* `hidden` solo trae `display: none` de la hoja del navegador y cualquier
 * `display` propio lo anula. Se refuerza para que el atributo sea confiable
 * (lo usa la cuenta regresiva del chip de estado). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: #04101F;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: #fff;
  color: var(--navy);
  padding: .75rem 1.25rem;
  border-radius: 0 0 .5rem 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ── Escenario ─────────────────────────────────────────────────────────────
 * width se calcula para que la escena quepa entera en pantalla sin recortes
 * ni scroll horizontal, manteniendo la relación de aspecto del arte.
 */
.stage-wrap {
  position: relative;
  display: grid;
  place-items: center;
  background: #04101F;
  width: 100%;
  overflow: hidden;
}

.stage {
  position: relative;
  /* 100% y no 100vw: 100vw incluye la barra de scroll y provocaría
   * desplazamiento horizontal en escritorio. */
  width: min(100%, calc(100svh * var(--stage-w) / var(--stage-h)));
  aspect-ratio: var(--stage-w) / var(--stage-h);
  container-type: size;
  container-name: stage;
  overflow: hidden;

  /* Posición del puntero normalizada (-1..1) y avance del scroll (0..1).
   * Las escribe parallax.js; si el archivo no carga, todo queda en 0 y la
   * escena se ve exactamente igual, quieta. */
  --mx: 0;
  --my: 0;

  /* Recorrido de cada plano, en unidades del propio escenario.
   * Valores deliberadamente bajos: el objetivo es insinuar profundidad, no
   * que la escena se mueva. Un recorrido grande marea, sobre todo si va
   * ligado al scroll. */
  --depth-fondo: .16cqw;
  --depth-puntos: .18cqw;
}

/* ── Profundidad ───────────────────────────────────────────────────────────
 * Plano de fondo: la sala y lo que está pintado sobre ella. Se mueve EN
 * CONTRA del puntero. El scale evita que el desplazamiento descubra los
 * bordes de la imagen.
 */
.stage__scene {
  position: absolute;
  inset: 0;
  /* Sin término de scroll a propósito: mover la escena mientras la página se
   * desplaza es lo que más marea, porque desmiente lo que el ojo espera. */
  translate:
    calc(var(--mx) * var(--depth-fondo) * -1)
    calc(var(--my) * var(--depth-fondo) * -1);
  will-change: translate;
}

/* El sobredimensionado solo se aplica cuando el parallax está activo: si
 * parallax.js no corre (o el visitante pidió menos movimiento), la escena se
 * muestra completa, sin recortar los bordes. */
.stage.has-parallax .stage__scene { scale: 1.045; }

.stage__bg { width: 100%; height: 100%; object-fit: cover; }

/* Plano de los puntos de contacto: flotan por delante y se mueven A FAVOR
 * del puntero. La diferencia de recorrido entre los dos planos es lo que se
 * percibe como profundidad. */
.hs {
  translate:
    calc(var(--mx) * var(--depth-puntos))
    calc(var(--my) * var(--depth-puntos));
  will-change: translate;
}

/* ── Barra superior con el logo ──────────────────────────────────────────── */
.topbar {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 10.95%;
  background: var(--navy);
  /* borde derecho en diagonal, como en el arte */
  clip-path: polygon(0 0, 22.73% 0, 18.24% 100%, 0 100%);
  display: flex;
  align-items: center;
  z-index: 6;
  pointer-events: none;
}
.topbar__logo {
  width: 15.5%;
  height: auto;
  margin-left: 2.2%;
}

/* ── Chip de estado ─────────────────────────────────────────────────────── */
.status-chip {
  position: absolute;
  top: 4%;
  right: 2.4%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: .55cqw;
  padding: .75cqw 1.35cqw;
  border-radius: 999px;
  background: rgba(6, 40, 85, .88);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.02cqw;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 .4cqw 1.4cqw rgba(0, 0, 0, .3);
  white-space: nowrap;
}
.status-chip__dot {
  width: .78cqw;
  height: .78cqw;
  border-radius: 50%;
  background: var(--soon);
  flex: none;
}
.status-chip__count {
  font-variant-numeric: tabular-nums;
  opacity: .85;
  padding-left: .5cqw;
  border-left: 1px solid rgba(255, 255, 255, .28);
}

:root[data-state="live"] .status-chip__dot {
  background: var(--live);
  animation: livePulse 1.4s ease-in-out infinite;
}
:root[data-state="live"] .status-chip { background: rgba(232, 40, 60, .92); }
:root[data-state="ended"] .status-chip__dot { background: var(--muted); }

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 40, 60, .8); }
  70% { box-shadow: 0 0 0 .8cqw rgba(232, 40, 60, 0); }
}

/* ── Puntos de contacto ─────────────────────────────────────────────────── */
.hs {
  position: absolute;
  z-index: 5;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}

/* Coordenadas medidas sobre el arte final */
.hs--evento { left: 19.08%; top: 11.58%; width: 16.99%; }
.hs--kids   { left: 68.06%; top: 18.28%; width: 16.93%; }
.hs--lau    { left: 43.12%; top: 39.53%; width: 15.91%; }

.hs__card {
  display: flex;
  align-items: center;
  gap: .9cqw;
  padding: .95cqw 1.15cqw;
  background: var(--card);
  border-radius: 1.15cqw;
  box-shadow: 0 .45cqw 1.5cqw rgba(6, 40, 85, .22);
  transition: transform .22s ease, box-shadow .22s ease;
}

.hs__icon {
  flex: none;
  width: 2.35cqw;
  height: 2.35cqw;
  color: var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* Iluminación: halo pulsante que señala "esto es un punto de contacto" */
  animation: haloPulse 2.4s ease-out infinite;
}
.hs__icon svg { width: 100%; height: 100%; }

@keyframes haloPulse {
  0% { box-shadow: 0 0 0 0 rgba(1, 134, 252, .45); }
  70% { box-shadow: 0 0 0 1.1cqw rgba(1, 134, 252, 0); }
  100% { box-shadow: 0 0 0 0 rgba(1, 134, 252, 0); }
}

.hs__text { display: flex; flex-direction: column; line-height: 1.18; min-width: 0; }
.hs__title { font-size: 1.32cqw; font-weight: 700; color: var(--ink); }
.hs__sub { font-size: 1.05cqw; font-weight: 400; color: #2C3A5A; }

/* Línea conectora hacia el dispositivo + punto luminoso en la punta */
.hs__line {
  position: absolute;
  top: 100%;
  width: max(2px, .17cqw);
  background: var(--blue);
  pointer-events: none;
}
.hs--evento .hs__line { left: 50.9%; height: 3.4cqh; }
.hs--kids   .hs__line { left: 50.7%; height: 3.9cqh; }
/* En este punto la línea no sale del centro de la burbuja, sino del lado
 * izquierdo, para caer sobre la pantalla del portátil. */
.hs--lau    .hs__line { left: 36.8%; height: 5.0cqh; }

.hs__pulse {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: .62cqw;
  height: .62cqw;
  margin-left: -.31cqw;
  margin-bottom: -.31cqw;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 .8cqw .18cqw rgba(1, 134, 252, .9);
  animation: dotPulse 2.4s ease-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.55); opacity: .65; }
}

.hs:hover .hs__card,
.hs:focus-visible .hs__card {
  transform: translateY(-.35cqw);
  box-shadow: 0 .9cqw 2.2cqw rgba(6, 40, 85, .32);
}
.hs:hover .hs__icon,
.hs:focus-visible .hs__icon { color: var(--blue-bright); }

.hs:focus-visible { outline: none; }
.hs:focus-visible .hs__card { outline: .25cqw solid var(--blue-bright); outline-offset: .25cqw; }

/* ── Botón sobre la pantalla del televisor ──────────────────────────────── */
.cta-tv {
  position: absolute;
  /* El arte original medía 20.33%–29.18% de ancho; se ancla el CENTRO de ese
   * rango (24.75%) y se deja que el botón crezca hacia los dos lados según su
   * texto. Con ancho fijo, "Entrar al evento ▶" quedaba pegado a los bordes.
   * `translate` y no `transform`: así el :hover puede usar scale sin pisar el
   * centrado. */
  left: 24.75%;
  translate: -50% 0;
  top: 41.34%;
  min-width: 8.85%;
  height: 4.57%;
  padding: 0 1.7cqw;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7cqw;
  background: var(--blue-bright);
  color: #fff;
  border-radius: 999px;
  font-size: .95cqw;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 1.6cqw rgba(1, 134, 252, .55);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.cta-tv__play { width: 1.05cqw; height: 1.05cqw; flex: none; }
.cta-tv:hover, .cta-tv:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 2.4cqw rgba(1, 134, 252, .85);
}
.cta-tv:focus-visible { outline: .2cqw solid #fff; outline-offset: .2cqw; }

/* ── Estado bloqueado (antes y después del evento) ──────────────────────── */
.hs.is-locked { cursor: not-allowed; }
.hs.is-locked .hs__card { background: rgba(255, 255, 255, .82); }
.hs.is-locked .hs__icon { color: var(--muted); animation: none; box-shadow: none; }
.hs.is-locked .hs__sub { color: var(--muted); }
.hs.is-locked .hs__line { background: var(--muted); opacity: .55; }
.hs.is-locked .hs__pulse { background: var(--muted); box-shadow: none; animation: none; }
.hs.is-locked:hover .hs__card { transform: none; box-shadow: 0 .45cqw 1.5cqw rgba(6, 40, 85, .22); }

.cta-tv.is-locked {
  background: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .82);
  box-shadow: none;
  cursor: not-allowed;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .3);
}
.cta-tv.is-locked:hover { transform: none; box-shadow: none; }
.cta-tv.is-locked .cta-tv__play { display: none; }

.btn.is-locked { opacity: .6; cursor: not-allowed; }

/* Feedback al tocar un punto que aún no está disponible */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }

/* ── Accesos ───────────────────────────────────────────────────────────── */
/* main ocupa al menos la pantalla completa para que el degradado de los
 * accesos llegue hasta abajo y no quede una franja muerta en móvil. */
main { min-height: 100svh; display: flex; flex-direction: column; }
.accesos { flex: 1; }

.accesos {
  background: linear-gradient(180deg, #062855 0%, #04101F 100%);
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}
.accesos__title {
  margin: 0 0 .4rem;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.01em;
}
.accesos__lead {
  margin: 0 auto clamp(1.5rem, 3vw, 2rem);
  max-width: 52ch;
  color: #B9C6DC;
  font-size: clamp(.95rem, 2.2vw, 1.05rem);
  line-height: 1.5;
}

.accesos__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: .85rem;
  max-width: 60rem;
}
@media (min-width: 768px) {
  .accesos__list { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
}

.btn {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.1rem;
  min-height: 4.25rem;
  background: #fff;
  color: var(--ink);
  border-radius: 1rem;
  text-decoration: none;
  text-align: left;
  box-shadow: 0 .35rem 1.1rem rgba(0, 0, 0, .3);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 .6rem 1.5rem rgba(1, 134, 252, .35);
}
.btn:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 3px; }
.btn__icon {
  flex: none;
  width: 2.35rem;
  height: 2.35rem;
  color: var(--blue);
}
.btn__icon svg { width: 100%; height: 100%; }
.btn__text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.btn__text b { font-size: 1.05rem; }
.btn__text small { font-size: .875rem; color: #4A5A78; }
.btn__arrow { font-size: 1.75rem; color: var(--blue); line-height: 1; }

/* ── Móvil ─────────────────────────────────────────────────────────────────
 * Diseño entregó una pieza vertical 9:16 (landing-mobile.png), así que en
 * móvil no se reencuadra la escena horizontal: se cambia de arte y con él
 * las coordenadas de los puntos, medidas sobre esa pieza (941 × 1672).
 *
 * Los accesos grandes de abajo siguen siendo la vía principal; los puntos
 * sobre la sala son el refuerzo visual.
 */
@media (max-width: 767px) {
  :root { --stage-w: 941; --stage-h: 1672; }

  .stage {
    width: 100%;
    /* En vertical el recorrido se percibe menor, pero tampoco conviene
     * subirlo mucho: en móvil el giroscopio ya aporta movimiento propio. */
    --depth-fondo: .5cqw;
    --depth-puntos: .55cqw;
  }

  /* La barra del logo es proporcionalmente más alta y angosta en vertical */
  .topbar { height: 6.2%; clip-path: polygon(0 0, 62% 0, 50% 100%, 0 100%); }
  .topbar__logo { width: 40%; margin-left: 4.5%; }

  .status-chip {
    top: 7.6%;
    right: 3.5%;
    font-size: 2.5cqw;
    gap: 1.2cqw;
    padding: 1.5cqw 2.6cqw;
  }
  .status-chip__dot { width: 1.9cqw; height: 1.9cqw; }
  .status-chip__count { padding-left: 1.2cqw; }

  /* Coordenadas medidas sobre la pieza vertical:
   *   TV grande  -> pantalla en  7%–50% x, 27.5%–43%  y  (centro x 28%)
   *   TV Kids    -> pantalla en 70%–96% x, 32.5%–45%  y  (centro x 83%)
   *   Portátil   -> pantalla en 27%–59% x, 55.5%–68%  y  (centro x 43%)  */
  .hs--evento { left: 2%;  top: 18.5%; width: 52%; }
  .hs--kids   { left: 52%; top: 24.5%; width: 46%; }
  .hs--lau    { left: 20%; top: 46.5%; width: 46%; }

  .hs__card { gap: 2.4cqw; padding: 2.6cqw 3cqw; border-radius: 3.2cqw; }
  .hs__icon { width: 6.4cqw; height: 6.4cqw; }
  .hs__title { font-size: 3.6cqw; }
  .hs__sub { font-size: 2.9cqw; }
  .hs__pulse { width: 1.7cqw; height: 1.7cqw; margin-left: -.85cqw; margin-bottom: -.85cqw; }

  .hs--evento .hs__line { left: 50%; height: 3cqh; }
  /* La burbuja no cabe centrada sobre este televisor sin salirse del borde
   * derecho, así que la línea sale descentrada para caer sobre la pantalla. */
  .hs--kids   .hs__line { left: 67.4%; height: 2cqh; }
  .hs--lau    .hs__line { left: 50%; height: 2.5cqh; }

  /* En vertical el televisor es demasiado pequeño para reproducir el botón
   * con un texto legible: el acceso al evento queda en la burbuja y en el
   * botón grande de la sección de accesos. */
  .cta-tv { display: none; }
}

/* ── Accesibilidad: sin movimiento ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* El halo se mantiene fijo para que el punto de contacto siga siendo obvio */
  .hs__icon { box-shadow: 0 0 0 .35cqw rgba(1, 134, 252, .35); }
}
