/* GravityBeat web, estilo Synthwave (el del logo). */

:root {
  --bg: #0b0618;
  --bg-2: #140a2b;
  --panel: rgba(28, 14, 58, 0.72);
  --text: #f3eefe;
  --muted: #b9acd9;
  --accent: #ff2fb4;
  --accent-2: #22e6ff;
  --sun: linear-gradient(180deg, #ffe45c 0%, #ff8a3d 45%, #ff2fb4 100%);
  --line: rgba(255, 47, 180, 0.35);
  --glow: 0 0 18px rgba(255, 47, 180, 0.55), 0 0 42px rgba(34, 230, 255, 0.25);
  --radius: 14px;
  --font-head: "Crivon", "Orbitron", system-ui, sans-serif;
  --font-body: "Exo 2", system-ui, sans-serif;
  --head-weight: 900;
  --head-case: uppercase;
  --head-spacing: 0.02em;
  --clip: none;
  /* Escala fluida: crece con el ancho pero se frena en pantallas bajas (portátiles). */
  --fs-body: clamp(15px, 0.55vw + 0.45rem + 0.35svh, 17px);
  --fs-lead: clamp(16px, 0.6vw + 0.5rem + 0.4svh, 18px);
  --fs-title: clamp(26px, min(3.4vw, 5.6svh), 46px);
  --sec-pad: clamp(48px, min(7vw, 10svh), 110px);
  --nav-h: 60px;
  --screen-pad: clamp(16px, 4svh, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { width: min(max(1120px, 62vw), 1400px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
html { font-synthesis: none; } /* Crivon tiene un solo peso y ya es cursiva */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* Navegación */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 10px clamp(16px, 4vw, 40px); min-height: var(--nav-h);
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-color: var(--line); }
.nav__brand, .footer__brand {
  font: 400 clamp(22px, 1.4vw + 8px, 26px)/1 "Crivon", "Exo 2", system-ui, sans-serif; text-transform: uppercase;
  color: #fff; text-decoration: none; white-space: nowrap;
  /* igual que la palabra del logo: blanca, filo cian, sombra magenta desplazada y el mismo espaciado (-10 unidades) */
  letter-spacing: -0.01em;
  -webkit-text-stroke: 0.04em #22e4ff; paint-order: stroke fill;
  text-shadow: 0.07em 0.07em 0 #ff2bd6, 0 0 0.5em color-mix(in srgb, #22e4ff 45%, transparent);
}
.nav__links { display: flex; gap: clamp(18px, 2vw, 28px); margin-left: auto; font-weight: 600; font-size: 16px; letter-spacing: 0.02em; }
@media (max-width: 1000px) { .nav__links { font-size: 15px; } }
.nav__links a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta { color: var(--accent) !important; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button {
  background: none; border: 0; color: var(--muted); font: 600 14px var(--font-body);
  padding: 6px 12px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Portada */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center;
  text-align: center; overflow: hidden; isolation: isolate;
  padding: calc(var(--nav-h) + 2svh) 20px 64px;
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; }
.hero__shade {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(11, 6, 24, 0.25), rgba(11, 6, 24, 0.85) 70%),
    linear-gradient(180deg, rgba(11, 6, 24, 0.55) 0%, transparent 30%, transparent 60%, var(--bg) 100%);
}
.hero__grid {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 45%; z-index: -1;
  background-image:
    linear-gradient(var(--accent) 2px, transparent 2px),
    linear-gradient(90deg, var(--accent) 2px, transparent 2px);
  background-size: 80px 80px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: 50% 100%;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, transparent, #000 60%);
  animation: grid 2.4s linear infinite;
}
@keyframes grid { to { background-position: 0 80px; } }
.hero__content { max-width: 920px; }
.hero__logo img { width: 100%; height: auto; }
/* El logo (1940×820) se limita también por alto para que portada, texto y botones quepan. */
.hero__logo { margin: 0 auto 4px; width: min(760px, 100%, (100svh - var(--nav-h) - 290px) * 2.37); min-width: min(280px, 100%); filter: drop-shadow(0 8px 40px rgba(255, 47, 180, 0.35)); }
.hero__headline {
  font: var(--head-weight) clamp(15px, 2vw, 20px) / 1.3 var(--font-head);
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--accent-2);
  margin: 0 0 14px; display: none;
}
.hero__pitch { font-size: var(--fs-lead); color: var(--text); max-width: 620px; margin: 0 auto clamp(16px, 3svh, 28px); text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8); }
.hero__ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero__scroll { position: absolute; bottom: clamp(10px, 2.5svh, 24px); left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid var(--muted); border-radius: 14px; }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent-2); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 50% { transform: translateY(12px); opacity: 0.2; } }

/* Botones */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 200px; padding: 12px 24px; text-decoration: none;
  font: 700 15px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 999px; transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  clip-path: var(--clip);
}
.btn small { font: 600 11px var(--font-body); letter-spacing: 0.08em; opacity: 0.85; margin-top: 4px; }
.btn--primary { background: linear-gradient(90deg, var(--accent), #ff7a3d); color: #fff; box-shadow: var(--glow); }
.btn--ghost { border: 2px solid var(--accent-2); color: var(--accent-2); }
.btn:hover { transform: translateY(-2px); }
.btn.is-disabled { cursor: default; opacity: 0.8; }
.btn.is-disabled:hover { transform: none; }

/* Secciones */
section { position: relative; }
.about, .tech, .gallery, .play, .demo { padding: var(--sec-pad) 0; }
.eyebrow { margin: 0 0 8px; font: 700 12px var(--font-body); text-transform: uppercase; letter-spacing: 0.3em; color: var(--accent); }
.title {
  margin: 0 0 clamp(14px, 2.4svh, 22px); font: var(--head-weight) var(--fs-title) / 1.08 var(--font-head);
  text-transform: var(--head-case); letter-spacing: var(--head-spacing); max-width: 860px;
}
.lead { color: var(--muted); max-width: 640px; margin: 0 0 clamp(20px, 4svh, 36px); font-size: var(--fs-lead); }

.about { background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.about__text { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; color: var(--muted); max-width: 980px; }
.about__text p { margin: 0; }
.stats { list-style: none; padding: 0; margin: clamp(28px, 5svh, 48px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; clip-path: var(--clip); }
.stats b { display: block; font: 900 clamp(24px, min(3vw, 5svh), 36px)/1 var(--font-head); color: var(--accent-2); margin-bottom: 8px; text-shadow: var(--glow); }
.stats span { color: var(--muted); font-size: 14px; }

/* Bajo el capó: cuatro gráficas animadas con datos reales (js/tech.js) */
.tech { background: radial-gradient(ellipse at 50% 0%, rgba(34, 230, 255, 0.07), transparent 60%), var(--bg); }
.tech__head { display: grid; grid-template-columns: auto 1fr; column-gap: 48px; align-items: end; }
.tech__head .lead { justify-self: end; max-width: 400px; font-size: 15px; text-align: right; margin-bottom: clamp(14px, 2.4svh, 22px); }
@media (max-width: 900px) { .tech__head { grid-template-columns: 1fr; } .tech__head .lead { justify-self: start; text-align: left; } }
.tech__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.viz {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  position: relative; overflow: hidden;
}
.viz::after { /* líneas de barrido de monitor antiguo */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0, 0, 0, 0.18) 2px 3px);
}
@media (min-width: 1400px) { .viz { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.viz__plot { position: relative; height: clamp(150px, 22vw, 210px); border-radius: 10px; background: rgba(5, 2, 14, 0.55); border: 1px solid rgba(34, 230, 255, 0.18); overflow: hidden; }
.viz__plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viz__num { margin: 0; font: 400 clamp(22px, min(2.4vw, 4svh), 32px)/1 var(--font-head); color: var(--accent-2); text-shadow: var(--glow); }
.viz__num small { font: 700 12px var(--font-body); letter-spacing: 0.2em; color: var(--muted); text-shadow: none; }
.viz__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 4px; }
.viz h3 { margin: 0; font: 400 16px/1.2 var(--font-head); text-transform: var(--head-case); letter-spacing: var(--head-spacing); }
.viz__text p:not(.viz__num):not(.viz__eq) { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.viz__eq {
  margin: 8px 0 0; display: inline-block; padding: 4px 10px; border-radius: 6px;
  font: 600 13px/1.4 "Orbitron", var(--font-body); letter-spacing: 0.03em; color: #ffe45c;
  background: rgba(255, 228, 92, 0.07); border: 1px solid rgba(255, 228, 92, 0.25);
}
.viz__eq sub { font-size: 0.7em; }
.tech__chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tech__chips li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13px; color: var(--muted); background: rgba(0, 0, 0, 0.25); }
.tech__chips b { color: var(--text); font: 600 13px "Orbitron", var(--font-body); margin-right: 6px; }

.gallery { background: linear-gradient(180deg, var(--bg), var(--bg-2) 50%, var(--bg)); }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.shot { padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: #000; clip-path: var(--clip); }
.shot--wide { grid-column: span 2; grid-row: span 2; }
.shot img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.5s; }
.shot:hover img { transform: scale(1.05); }

.play__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.keys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.keys li { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; clip-path: var(--clip); }
.keys span { margin-left: 6px; color: var(--muted); font-size: 15px; }
kbd {
  min-width: 34px; height: 34px; padding: 0 7px; display: inline-grid; place-items: center;
  font: 700 14px var(--font-head); color: var(--text);
  border: 1px solid var(--accent-2); border-bottom-width: 3px; border-radius: 8px; background: rgba(0, 0, 0, 0.35);
}

.demo { text-align: center; overflow: hidden; isolation: isolate; }
.demo::before {
  content: ""; position: absolute; left: 50%; top: 18%; width: min(620px, 90vw); aspect-ratio: 1; translate: -50% 0;
  border-radius: 50%; background: var(--sun); opacity: 0.16; filter: blur(30px); z-index: -1;
}
.demo__inner { display: flex; flex-direction: column; align-items: center; }
.demo__icon { width: clamp(72px, 11svh, 104px); height: auto; aspect-ratio: 1; margin-bottom: clamp(14px, 3svh, 24px); border-radius: 24px; box-shadow: var(--glow); }
.demo .lead { margin-inline: auto; }

/* Contacto */
.contact { padding: 0 0 var(--sec-pad); }
.contact__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.contact .lead { margin-inline: auto; }
.contact__form { width: min(720px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.contact__form label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); }
.contact__form input, .contact__form textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical;
}
.contact__form input:focus, .contact__form textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(34, 230, 255, 0.2); }
.contact__wide { grid-column: 1 / -1; }
.contact__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.contact__actions .btn { border: 0; cursor: pointer; }
.contact__actions .btn:disabled { opacity: 0.6; cursor: wait; }
.contact__status { margin: 0; color: var(--accent-2); }
.contact__status.is-error { color: #ff8fb0; }
.contact__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.footer { border-top: 1px solid var(--line); padding: 26px 0 30px; color: var(--muted); font-size: 15px; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.footer .footer__brand { font-size: 22px; margin-bottom: 8px; }
.footer p { margin: 0; }
.footer__author { color: var(--accent); text-decoration: none; }
.footer__author:hover { text-decoration: underline; }
.footer__small { font-size: 13px; opacity: 0.75; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 92svh; max-width: 100%; object-fit: contain; width: auto; box-shadow: var(--glow); }
.lightbox__close { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 44px; line-height: 1; cursor: pointer; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Tráiler */
.trailer { padding: var(--sec-pad) 0 0; }
/* Reproductor ancho: el tráiler es 1080p. */
/* y nunca más alto que la ventana menos la cabecera y el título. */
.trailer__frame { width: min(1440px, 100vw - 40px, (100svh - var(--nav-h) - 2 * var(--screen-pad) - 150px) * 16 / 9); margin-left: 50%; translate: -50% 0; }
.trailer__note { text-align: center; }
.trailer__frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #000; box-shadow: var(--glow); clip-path: var(--clip);
}
.trailer__frame img, .trailer__frame iframe, .trailer__frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.trailer__frame img { filter: brightness(0.6); }
.trailer__play {
  position: absolute; inset: 0; margin: auto; width: max-content; height: max-content;
  display: flex; align-items: center; gap: 12px; padding: 13px 26px; cursor: pointer;
  font: 700 16px var(--font-head); text-transform: uppercase; letter-spacing: 0.08em; color: #fff;
  background: color-mix(in srgb, var(--accent) 85%, transparent); border: 0; border-radius: 999px;
  box-shadow: var(--glow); clip-path: var(--clip); transition: transform 0.15s;
}
.trailer__play:hover { transform: scale(1.05); }
.trailer__icon { font-size: 22px; }
.trailer__soon {
  display: none; position: absolute; left: 50%; top: 50%; translate: -50% -50%; margin: 0;
  font: 700 clamp(16px, 2vw, 22px) var(--font-head); text-transform: uppercase; letter-spacing: 0.2em; color: var(--text);
  padding: 12px 26px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.45); white-space: nowrap;
}
.trailer__frame.is-soon .trailer__play { display: none; }
.trailer__frame.is-soon .trailer__soon { display: block; }
.trailer__note { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.trailer__note a { color: var(--accent); }
.trailer__frame video { object-fit: contain; }

/* Una sección, una pantalla (pantallas apaisadas: escritorio, portátil y tableta horizontal).
   Cada sección ocupa la ventana entera, con su contenido centrado y limitado
   por el alto, para que al desplazarse se vea completa y sin cortes. */
@media (min-width: 701px) and (min-height: 540px) and (orientation: landscape) {
  html { scroll-snap-type: y proximity; }
  main > section, .footer { scroll-snap-align: start; }
  main > section:not(.hero) {
    min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
    padding: calc(var(--nav-h) + var(--screen-pad)) 0 var(--screen-pad);
  }
  .contact { min-height: calc(100svh - 150px) !important; padding-bottom: calc(var(--screen-pad) * 1.5) !important; }
  .demo { min-height: 100svh; }
  .trailer__note { margin-top: 10px; }

  .title { max-width: none; }
  /* Bajo el capó: las gráficas toman el alto que queda para que quepan las dos filas. */
  .viz { align-items: stretch; }
  .viz__plot { height: auto; min-height: clamp(120px, (100svh - 440px) / 2, 230px); }
  .tech__grid { gap: clamp(8px, 1.4svh, 14px); }
  .tech__chips { margin-top: clamp(8px, 1.4svh, 14px); }

  /* Tráiler y galería: el bloque entero (título incluido) toma el ancho que permite el alto. */
  .trailer .wrap { width: min(1440px, 100% - 40px, (100svh - var(--nav-h) - 2 * var(--screen-pad) - 150px) * 16 / 9); }
  .trailer .trailer__frame { width: 100%; margin-left: 0; translate: none; }
  .gallery .wrap {
    display: grid; grid-template-columns: auto 1fr; column-gap: 48px; align-items: end;
  }
  .gallery .eyebrow { grid-column: 1; }
  .gallery .title { grid-column: 1; margin-bottom: clamp(14px, 2.4svh, 22px); }
  .gallery .lead { grid-column: 2; grid-row: 1 / 3; justify-self: end; max-width: 400px; margin-bottom: clamp(14px, 2.4svh, 22px); font-size: 15px; text-align: right; }
  /* Las 8 capturas, iguales, en dos filas de cuatro: la galería entera de un vistazo. */
  .gallery .shots { grid-column: 1 / -1; width: min(100%, (100svh - var(--nav-h) - 2 * var(--screen-pad) - 150px) * 3.5); justify-self: center; }
  .gallery .shot--wide { grid-column: auto; grid-row: auto; }

  /* Cómo se juega: teclas algo mayores, que la sección tiene sitio. */
  .keys { gap: 14px; }
  .keys li { padding: 14px 16px; }
  .keys span { font-size: 16px; }
  kbd { min-width: 40px; height: 40px; font-size: 15px; }
}
html { scroll-padding-top: var(--nav-h); }
@media (min-width: 701px) and (min-height: 540px) and (orientation: landscape) { html { scroll-padding-top: 0; } }
/* Pantallas bajas: textos de «Bajo el capó» algo más compactos para que quepa en una pantalla. */
@media (min-width: 701px) and (max-height: 800px) and (orientation: landscape) {
  .viz { padding: 10px; gap: 12px; }
  .viz__text p:not(.viz__num):not(.viz__eq) { font-size: 12.5px; line-height: 1.38; }
  .viz h3 { font-size: 14px; }
  .viz__num { font-size: 22px; }
  .viz__eq { margin-top: 6px; padding: 2px 8px; font-size: 12px; }
  .tech__chips li { padding: 3px 12px; font-size: 12px; }
}

/* Móvil */
@media (max-width: 640px) {
  .contact__form { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .tech__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .play__inner, .about__text { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .nav__links { display: none; }
  .lang { margin-left: auto; }
  .nav__brand { font-size: 22px; }
  .hero__logo { width: 100%; }
  .keys { grid-template-columns: 1fr; }
  .viz { grid-template-columns: 1fr; }
  .viz__plot { height: 170px; }
  .shots { grid-template-columns: 1fr; }
  .shot--wide { grid-column: auto; grid-row: auto; }
  .btn { min-width: 0; width: 100%; }
  .hero__ctas { width: 100%; }
}
/* Entrada (js/gate.js): cristal translúcido sobre la portada, con el sol, la rejilla y VELTRA arrancando.
   El clic de entrar deja sonar la voz; el interruptor de al lado elige con o sin sonido. */
html.gate-open { overflow: hidden; }
.gate {
  --beat: 0.686s;
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: hidden;
  padding: 24px 16px; isolation: isolate; color: var(--text); text-align: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(255, 47, 180, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(11, 6, 24, 0.55), rgba(11, 6, 24, 0.82) 60%, rgba(11, 6, 24, 0.94));
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  animation: gate-in 1.2s ease both;
}
.gate[hidden] { display: none; }
@keyframes gate-in { from { opacity: 0; } }
.gate.is-leaving { animation: gate-out 0.9s cubic-bezier(0.6, 0, 0.8, 0.4) forwards; pointer-events: none; }
@keyframes gate-out {
  30% { filter: hue-rotate(40deg) contrast(1.4); }
  100% { opacity: 0; transform: scale(1.12); filter: blur(10px); }
}
.gate__sun {
  position: absolute; z-index: -3; left: 50%; top: 46%; width: min(78vmin, 720px); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; background: var(--sun); opacity: 0.2; filter: blur(46px);
  animation: sun-pulse var(--beat) ease-out infinite;
}
@keyframes sun-pulse { 0% { opacity: 0.3; scale: 1.04; } 100% { opacity: 0.18; scale: 1; } }
.gate__grid {
  position: absolute; z-index: -2; left: -50%; right: -50%; bottom: -12%; height: 46%;
  background-image: linear-gradient(var(--accent-2) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--accent-2) 1.5px, transparent 1.5px);
  background-size: 70px 70px; transform: perspective(420px) rotateX(64deg); transform-origin: 50% 100%;
  opacity: 0.22; mask-image: linear-gradient(180deg, transparent, #000 70%);
  animation: grid calc(var(--beat) * 2) linear infinite;
}
.gate__scan {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
}
.gate__scan::after { /* barrido de monitor que baja despacio */
  content: ""; position: absolute; left: 0; right: 0; height: 22vh; top: -22vh;
  background: linear-gradient(180deg, transparent, rgba(34, 230, 255, 0.06), transparent);
  animation: sweep 6s linear infinite;
}
@keyframes sweep { to { top: 100vh; } }
.gate__lang { position: absolute; top: 16px; right: 16px; }
.gate__inner { width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; }
.gate__sys {
  margin: 0; display: flex; align-items: center; gap: 10px;
  font: 400 clamp(14px, 1.6vw, 17px)/1 "Crivon", var(--font-head); letter-spacing: 0.18em; color: var(--accent-2);
  text-shadow: 0 0 12px rgba(34, 230, 255, 0.7);
}
.gate__ver { font: 600 11px "Orbitron", monospace; letter-spacing: 0.12em; color: var(--muted); text-shadow: none; }
.gate__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); animation: led var(--beat) steps(2) infinite; }
.gate__boot { list-style: none; margin: 10px 0 0; padding: 0; min-height: 4.6em; font: 500 clamp(11px, 1.3vw, 13px)/1.55 "Orbitron", monospace; color: #b9fbff; opacity: 0.85; }
.gate__boot li { overflow: hidden; white-space: nowrap; width: 0; margin-inline: auto; animation: type 0.9s steps(28) forwards; }
.gate__boot li:nth-child(1) { animation-delay: 0.5s; }
.gate__boot li:nth-child(2) { animation-delay: 1.4s; color: #ff8fd0; }
.gate__boot li:nth-child(3) { animation-delay: 2.3s; }
@keyframes type { to { width: 100%; } }
.gate__title { margin: clamp(6px, 2svh, 18px) 0 0; width: min(520px, 86vw, (100svh - 480px) * 2.37); min-width: min(240px, 80vw); position: relative; }
.gate__title img { width: 100%; height: auto; filter: drop-shadow(0 0 24px rgba(255, 47, 180, 0.45)); animation: float 5s ease-in-out infinite, glitch 7s steps(1) infinite 3s; }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes glitch {
  0%, 96%, 100% { clip-path: none; translate: 0; filter: drop-shadow(0 0 24px rgba(255, 47, 180, 0.45)); }
  97% { clip-path: inset(30% 0 45% 0); translate: -6px 0; filter: drop-shadow(-3px 0 #22e6ff) drop-shadow(3px 0 #ff2fb4); }
  98% { clip-path: inset(62% 0 12% 0); translate: 5px 0; }
  99% { clip-path: inset(8% 0 70% 0); translate: -3px 0; }
}
.gate__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; width: 100%; margin: clamp(14px, 3.5svh, 34px) 0 clamp(8px, 2svh, 20px); }
.gate__row .gate__enter { grid-column: 2; }
.gate__enter {
  position: relative; margin: 0; width: clamp(150px, 26svh, 210px); aspect-ratio: 1;
  display: grid; place-content: center; gap: 4px; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: radial-gradient(circle, rgba(255, 47, 180, 0.32), rgba(11, 6, 24, 0.55) 62%);
  box-shadow: 0 0 40px rgba(255, 47, 180, 0.35), inset 0 0 30px rgba(34, 230, 255, 0.2);
  animation: beat var(--beat) ease-out infinite; transition: transform 0.2s, box-shadow 0.2s;
}
@keyframes beat { 0% { box-shadow: 0 0 70px rgba(255, 47, 180, 0.65), inset 0 0 40px rgba(34, 230, 255, 0.35); } 100% { box-shadow: 0 0 30px rgba(255, 47, 180, 0.3), inset 0 0 24px rgba(34, 230, 255, 0.15); } }
.gate__enter:hover { transform: scale(1.06); }
.gate__enter:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 8px; }
.gate__ring { position: absolute; inset: -10%; width: 120%; height: 120%; pointer-events: none; overflow: visible; }
.gate__ring circle { fill: none; transform-origin: 100px 100px; }
.gate__r1 { stroke: var(--accent-2); stroke-width: 1.5; stroke-dasharray: 60 18 6 18; opacity: 0.8; animation: spin 14s linear infinite; filter: drop-shadow(0 0 4px #22e6ff); }
.gate__r2 { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 120 40 20 40; opacity: 0.9; animation: spin 9s linear infinite reverse; filter: drop-shadow(0 0 6px #ff2fb4); }
.gate__r3 { stroke: #ffe45c; stroke-width: 1; stroke-dasharray: 2 6; opacity: 0.6; animation: spin 22s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.gate__label { font: 400 clamp(22px, min(4.4svh, 8vw), 36px)/1 "Crivon", var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; text-shadow: 0 0 18px rgba(255, 47, 180, 0.9), 0 0 2px #fff; }
.gate__sound {
  grid-column: 3; justify-self: start; display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer;
  background: none; border: 0; color: var(--text); font: 600 12px "Orbitron", monospace; letter-spacing: 0.14em; text-transform: uppercase;
}
.gate__track { position: relative; width: 46px; height: 24px; border-radius: 999px; background: rgba(34, 230, 255, 0.25); border: 1px solid var(--accent-2); box-shadow: 0 0 12px rgba(34, 230, 255, 0.45); transition: background 0.25s, border-color 0.25s, box-shadow 0.25s; }
.gate__knob { position: absolute; top: 2px; left: 24px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); transition: left 0.25s, background 0.25s, box-shadow 0.25s; }
.gate__on { color: var(--accent-2); text-shadow: 0 0 10px rgba(34, 230, 255, 0.6); }
.gate__off { display: none; color: var(--muted); }
.gate.is-silent .gate__track { background: rgba(185, 172, 217, 0.12); border-color: rgba(185, 172, 217, 0.45); box-shadow: none; }
.gate.is-silent .gate__knob { left: 2px; background: var(--muted); box-shadow: none; }
.gate.is-silent .gate__on { display: none; }
.gate.is-silent .gate__off { display: inline; }
.gate__sound:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; border-radius: 8px; }
@media (max-width: 640px) {
  .gate__row { grid-template-columns: 1fr; gap: 18px; justify-items: center; }
  .gate__row .gate__enter, .gate__sound { grid-column: 1; justify-self: center; }
}
@media (max-height: 700px) { .gate__boot { display: none; } .gate__title { width: min(520px, 86vw, (100svh - 400px) * 2.37); } }
@media (prefers-reduced-motion: reduce) { .gate__boot li { width: auto; } }

/* VELTRA: la IA de la nave (js/veltra.js) */
.play__inner .veltra-cta { margin-top: 4px; min-width: 0; border-radius: 999px; cursor: pointer; background: none; font-size: 14px; }
.veltra { position: fixed; right: clamp(12px, 2vw, 24px); bottom: clamp(12px, 2vw, 24px); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.veltra > * { pointer-events: auto; }
.veltra__toggle {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 230, 255, 0.45); border-radius: 999px; color: var(--text);
  box-shadow: 0 0 18px rgba(34, 230, 255, 0.18); font: 600 13px var(--font-body);
}
.veltra__toggle:hover { border-color: var(--accent-2); }
.veltra__led { width: 8px; height: 8px; border-radius: 50%; background: #ff8a3d; box-shadow: 0 0 8px #ff8a3d; animation: led 1.4s steps(2) infinite; }
@keyframes led { 50% { opacity: 0.25; } }
.veltra__name { font: 400 15px/1 "Crivon", var(--font-head); letter-spacing: 0.08em; color: var(--accent-2); }
.veltra__hint { color: var(--muted); }
.veltra__icon { color: var(--accent); font-size: 12px; }
.veltra.is-on .veltra__led { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); animation-duration: 0.35s; }
.veltra__panel {
  width: min(380px, calc(100vw - 24px)); padding: 10px 12px 12px; border-radius: 12px;
  background: rgba(5, 2, 14, 0.88); backdrop-filter: blur(10px); border: 1px solid rgba(34, 230, 255, 0.35);
  box-shadow: 0 0 30px rgba(34, 230, 255, 0.15); position: relative; overflow: hidden;
}
.veltra__panel[hidden] { display: none; }
.veltra__panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0, 0, 0, 0.25) 2px 3px); }
.veltra__scope { display: block; width: 100%; height: 54px; }
.veltra__line { margin: 6px 0 0; min-height: 2.9em; font: 500 13px/1.45 "Orbitron", monospace; letter-spacing: 0.02em; color: #b9fbff; text-shadow: 0 0 8px rgba(34, 230, 255, 0.6); }
.veltra__line::after { content: "▌"; color: var(--accent-2); animation: led 0.8s steps(2) infinite; margin-left: 2px; }
.veltra__controls { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(34, 230, 255, 0.18); }
.veltra__vol { flex: 1; accent-color: var(--accent-2); height: 24px; cursor: pointer; }
.veltra__pct { min-width: 3.2em; text-align: right; font: 600 12px "Orbitron", monospace; color: var(--muted); }
.veltra__line.is-glitch { color: #ff8fd0; transform: translateX(1px) skewX(-6deg); }
@media (max-width: 640px) { .veltra__hint { display: none; } .play__inner .veltra-cta { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
