:root {
  --bg: #060910;
  --bg-2: #0a0e14;
  --cyan: #38e1ff;
  --cyan-soft: #7af0ff;
  --cyan-deep: #0a5a72;
  --gold: #ffcf6b;
  --text: #cfeefb;
  --grid: rgba(56, 225, 255, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: radial-gradient(ellipse at center, var(--bg-2) 0%, var(--bg) 70%, #02040a 100%);
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  overflow: hidden;
  cursor: crosshair;
}

/* Grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 30;
  box-shadow: inset 0 0 220px 60px rgba(0, 0, 0, 0.85);
}

#reactor {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

.stage {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* HUD corners */
.hud {
  position: fixed;
  z-index: 5;
  font-family: "Orbitron", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--cyan-soft);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  animation: fadeHud 1.4s ease forwards 0.6s;
}
.hud-label { color: var(--cyan-deep); font-size: 0.5rem; }
.hud-val { color: var(--cyan); text-shadow: 0 0 12px rgba(56, 225, 255, 0.5); }
.hud-tl { top: 26px; left: 28px; }
.hud-tr { top: 26px; right: 28px; text-align: right; align-items: flex-end; }
.hud-bl { bottom: 26px; left: 28px; }
.hud-br { bottom: 26px; right: 28px; text-align: right; align-items: flex-end; }

.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Core text */
.core {
  text-align: center;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.headline {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 8vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.18em 0.4em;
  color: #eafaff;
  text-shadow:
    0 0 18px rgba(56, 225, 255, 0.55),
    0 0 42px rgba(56, 225, 255, 0.25);
}

.headline .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) scale(0.9);
  filter: blur(8px);
  animation: wordIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.headline .word:nth-child(1) { animation-delay: 0.9s; }
.headline .word:nth-child(2) { animation-delay: 1.1s; }
.headline .word:nth-child(3) { animation-delay: 1.3s; }
.headline .word:nth-child(4) { animation-delay: 1.5s; color: var(--gold); text-shadow: 0 0 22px rgba(255, 207, 107, 0.6); }

@keyframes wordIn {
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.subline {
  margin-top: 1.4rem;
  font-family: "Orbitron", sans-serif;
  font-weight: 400;
  font-size: clamp(0.6rem, 1.6vw, 0.95rem);
  letter-spacing: 0.5em;
  color: var(--cyan);
  opacity: 0;
  padding-left: 0.5em;
  animation: fadeHud 1.6s ease forwards 1.9s;
}

.ticker {
  margin-top: 2.2rem;
  height: 1.2em;
  overflow: hidden;
  font-family: "Orbitron", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  color: var(--cyan-deep);
  opacity: 0;
  animation: fadeHud 1.6s ease forwards 2.3s;
}
.ticker span {
  display: block;
  height: 1.2em;
  text-align: center;
  text-transform: uppercase;
  animation: tick 9s steps(1) infinite;
}
.ticker span::before { content: "› "; color: var(--cyan); }
@keyframes tick {
  0%, 22% { transform: translateY(0); }
  25%, 47% { transform: translateY(-1.2em); }
  50%, 72% { transform: translateY(-2.4em); }
  75%, 97% { transform: translateY(-3.6em); }
  100% { transform: translateY(0); }
}

.scanline {
  position: fixed;
  left: 0; right: 0;
  height: 140px;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(56, 225, 255, 0.06), transparent);
  animation: scan 7s linear infinite;
}
@keyframes scan {
  0% { top: -140px; }
  100% { top: 100%; }
}

.foot {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: "Orbitron", sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--cyan-deep);
  display: flex;
  gap: 12px;
  opacity: 0;
  animation: fadeHud 1.4s ease forwards 2.6s;
}
.foot .dot { color: var(--cyan); }

@keyframes fadeHud { to { opacity: 1; } }

@media (max-width: 640px) {
  .hud { font-size: 0.5rem; }
  .hud-tl, .hud-tr { top: 16px; }
  .hud-bl, .hud-br { bottom: 60px; }
  .hud-tl, .hud-bl { left: 16px; }
  .hud-tr, .hud-br { right: 16px; }
  body { cursor: default; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .headline .word { opacity: 1; transform: none; filter: none; }
}
