/* =========================================================
   HEENESIS — base: tokens, reset, pantallas, cosmos
   ========================================================= */

:root {
  --bg: #02040a;
  --ink: #e8f6f7;
  --ink-dim: rgba(220, 240, 242, .64);
  --ink-faint: rgba(220, 240, 242, .38);

  --energy: #8ff3e6;             /* turquesa de energía */
  --energy-rgb: 143, 243, 230;
  --pearl: #f4fbff;
  --glass: rgba(6, 14, 24, .42);
  --glass-line: rgba(170, 240, 235, .16);

  --font: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { position: fixed; inset: 0; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Cosmos ---------- */
.cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
#nebula { z-index: 0; }
#stars  { z-index: 1; }

/* Si el dispositivo no tiene WebGL, un cielo suave en CSS */
.no-webgl body {
  background:
    radial-gradient(ellipse 60% 45% at 30% 35%, rgba(40, 110, 130, .25), transparent 70%),
    radial-gradient(ellipse 50% 40% at 72% 65%, rgba(90, 70, 150, .2), transparent 70%),
    var(--bg);
}

/* ---------- Pantallas ---------- */
#app { position: fixed; inset: 0; z-index: 2; }

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s var(--ease-soft), visibility 0s linear 1.1s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.6s var(--ease-soft), visibility 0s;
}

/* ---------- Destello de transición ---------- */
.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%,
    rgba(240, 255, 252, .85) 0%,
    rgba(var(--energy-rgb), .28) 38%,
    transparent 72%);
}
.flash.is-on { animation: flash 1.9s var(--ease-soft); }
@keyframes flash {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Botón de vidrio reutilizable ---------- */
.glass-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 21px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  font-size: .7rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  transition: color .4s, border-color .4s, box-shadow .4s;
}
.glass-btn:hover, .glass-btn:focus-visible {
  color: var(--ink);
  border-color: rgba(var(--energy-rgb), .45);
  box-shadow: 0 0 22px rgba(var(--energy-rgb), .16);
  outline: none;
}

.noscript {
  position: fixed; inset: 0; z-index: 99;
  display: grid; place-items: center;
  margin: 0; letter-spacing: .2em; color: var(--ink-dim);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
