
/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --neon-blue: #00d4ff;
  --neon-purple: #b400ff;
  --neon-green: #00ff9f;
  --neon-red: #ff003c;
  --neon-gold: #ffd700;
  --neon-pink: #ff00aa;
  --bg-dark: #02020f;
  --bg-card: rgba(0,10,30,0.85);
  --text-main: #c8d8f0;
  --text-dim: #5a6e8a;
  --font-title: 'Orbitron', monospace;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Exo 2', sans-serif;
  --slide-w: 100vw; --slide-h: 100vh;
}
html { font-size: 16px; }
body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow: hidden;
  cursor: none;
  user-select: none;
}

/* ===== CUSTOM CURSOR ===== */
#cursor-dot {
  width: 10px; height: 10px;
  background: var(--neon-blue);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: background .15s;
  box-shadow: 0 0 8px var(--neon-blue);
}
#cursor-ring {
  width: 28px; height: 28px;
  border: 2px solid var(--neon-blue);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .2s, height .2s, border-color .2s, transform .08s;
  box-shadow: 0 0 12px var(--neon-blue);
}
body.cursor-hover #cursor-ring {
  width: 48px; height: 48px;
  border-color: var(--neon-purple);
  box-shadow: 0 0 20px var(--neon-purple);
}

/* ===== PRELOADER ===== */
#preloader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg-dark);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
}
#preloader .pre-title {
  font-family: var(--font-title);
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--neon-blue);
  letter-spacing: .2em;
  text-shadow: 0 0 20px var(--neon-blue);
  animation: pulse-text 1s infinite alternate;
}
#preloader .pre-bar-wrap {
  width: min(400px, 80vw);
  height: 4px;
  background: rgba(0,212,255,.15);
  border-radius: 2px;
  overflow: hidden;
}
#preloader .pre-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 12px var(--neon-blue);
  transition: width .08s;
}
#preloader .pre-pct {
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--neon-blue);
  opacity: .7;
}
@keyframes pulse-text { from { opacity: .7; } to { opacity: 1; } }

/* ===== SLIDE WRAPPER ===== */
#slides-wrap {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  /* height will be set by JS: 14 * 100vh */
  transition: transform .7s cubic-bezier(.77,0,.175,1);
  will-change: transform;
}
.slide {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== TOP NAV ===== */
#topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(to bottom, rgba(2,2,15,.9) 0%, transparent 100%);
  pointer-events: none;
}
#topnav > * { pointer-events: auto; }
/* Nav buttons: perfectly round, symmetric */
.nav-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0,212,255,.1);
  border: 1.5px solid rgba(0,212,255,.4);
  color: var(--neon-blue);
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, box-shadow .2s;
  flex-shrink: 0;
  line-height: 1;
}
.nav-btn:hover {
  background: rgba(0,212,255,.22);
  box-shadow: 0 0 14px var(--neon-blue);
}
.nav-btn svg { display: block; }
#progress-wrap {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}
#progress-text {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--neon-blue);
  opacity: .7;
  letter-spacing: .1em;
}
#progress-bar-outer {
  height: 3px;
  background: rgba(0,212,255,.15);
  border-radius: 2px;
  overflow: hidden;
}
#progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 8px var(--neon-blue);
  transition: width .5s;
  width: 0%;
}
#menu-btn {
  background: rgba(0,212,255,.1);
  border: 1px solid rgba(0,212,255,.3);
  color: var(--neon-blue);
  width: 36px; height: 36px;
  border-radius: 6px;
  cursor: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: box-shadow .2s;
}
#menu-btn span {
  display: block; width: 18px; height: 2px;
  background: var(--neon-blue);
  border-radius: 1px;
}
#menu-btn:hover { box-shadow: 0 0 14px var(--neon-blue); }

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(360px, 90vw);
  background: rgba(2,4,20,.95);
  border-left: 1px solid rgba(0,212,255,.2);
  z-index: 800;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.77,0,.175,1);
  display: flex; flex-direction: column; overflow: hidden;
}
#sidebar.open { transform: translateX(0); }
#sidebar-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  color: var(--neon-blue); font-size: 1.4rem;
  cursor: none;
}
#sidebar-tabs {
  display: flex; border-bottom: 1px solid rgba(0,212,255,.15);
  padding: 0 16px; padding-top: 56px;
}
.s-tab {
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--text-dim); cursor: none;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  letter-spacing: .08em;
  background: none; border-top: none; border-left: none; border-right: none;
}
.s-tab.active { color: var(--neon-blue); border-bottom-color: var(--neon-blue); }
#sidebar-content { flex: 1; overflow-y: auto; padding: 16px; }
#sidebar-content::-webkit-scrollbar { width: 3px; }
#sidebar-content::-webkit-scrollbar-thumb { background: rgba(0,212,255,.3); }

/* Mission list in sidebar */
.mission-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 6px;
  background: rgba(0,212,255,.04);
  border: 1px solid rgba(0,212,255,.1);
  border-radius: 6px;
  cursor: none;
  transition: background .2s, border-color .2s;
}
.mission-item:hover { background: rgba(0,212,255,.1); border-color: rgba(0,212,255,.3); }
.mission-item.done { border-color: rgba(0,255,159,.3); }
.mission-item.done .m-num { color: var(--neon-green); }
.m-num {
  font-family: var(--font-title); font-size: .65rem;
  color: var(--text-dim); letter-spacing: .06em; white-space: nowrap;
}
.m-name { font-family: var(--font-body); font-size: .8rem; color: var(--text-main); flex: 1; }
.m-status {
  font-size: .55rem; font-family: var(--font-mono);
  padding: 2px 6px; border-radius: 3px;
  background: rgba(0,212,255,.1); color: var(--neon-blue);
}
.m-status.done { background: rgba(0,255,159,.1); color: var(--neon-green); }

/* Code panel */
#code-panel { display: none; }
#code-panel.visible { display: block; }
.code-title {
  font-family: var(--font-title); font-size: .7rem;
  color: var(--neon-purple); letter-spacing: .1em; margin-bottom: 8px;
}
.code-block {
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(180,0,255,.2);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono); font-size: .72rem;
  color: #c8d8f0; line-height: 1.7;
  overflow-x: auto; margin-bottom: 10px;
  white-space: pre;
}
.copy-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(180,0,255,.15);
  border: 1px solid rgba(180,0,255,.4);
  color: var(--neon-purple);
  font-family: var(--font-mono); font-size: .72rem;
  border-radius: 4px; cursor: none;
  transition: background .2s; letter-spacing: .06em;
}
.copy-btn:hover { background: rgba(180,0,255,.3); }
.tech-note {
  margin-top: 12px;
  font-size: .74rem; color: var(--text-dim); line-height: 1.6;
  border-left: 2px solid rgba(180,0,255,.3);
  padding-left: 10px;
}

/* ===== COMMON SLIDE ELEMENTS ===== */
.slide-bg {
  position: absolute; inset: 0;
}
.slide-content {
  position: relative; z-index: 10;
  display: flex; height: 100%; padding: 80px 5% 40px;
  gap: 5%;
}
.slide-content.center-col {
  flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}

.narrative {
  flex: 0 0 38%;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.narrative.right { flex: 0 0 38%; margin-left: auto; }
.mission-tag {
  display: flex; align-items: center; gap: 10px;
}
.mission-num {
  font-family: var(--font-title); font-size: .65rem;
  color: var(--text-dim); letter-spacing: .15em;
}
.mission-status {
  font-family: var(--font-mono); font-size: .6rem;
  padding: 3px 8px; border-radius: 2px;
  background: rgba(0,212,255,.1);
  color: var(--neon-blue); letter-spacing: .08em;
  border: 1px solid rgba(0,212,255,.3);
  transition: all .3s;
}
.mission-status.active-red {
  background: rgba(255,0,60,.1);
  color: var(--neon-red); border-color: rgba(255,0,60,.3);
}
.mission-status.done-green {
  background: rgba(0,255,159,.1);
  color: var(--neon-green); border-color: rgba(0,255,159,.3);
}
.sys-name {
  font-family: var(--font-title);
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: #fff; letter-spacing: .1em;
  text-shadow: 0 0 30px currentColor;
  line-height: 1.2;
}
.meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.meta-tag {
  font-family: var(--font-mono); font-size: .6rem;
  color: var(--text-dim);
  background: rgba(255,255,255,.04);
  padding: 3px 8px; border-radius: 2px;
  letter-spacing: .06em;
}
.story-text {
  font-size: .85rem; line-height: 1.8;
  color: var(--text-main);
  font-style: italic;
  background: rgba(0,10,30,.5);
  padding: 14px 16px;
  border-left: 2px solid rgba(0,212,255,.3);
  border-radius: 0 6px 6px 0;
}
.sci-note {
  font-size: .75rem; color: var(--text-dim);
  font-style: italic;
}
.interact-hint {
  font-family: var(--font-mono); font-size: .65rem;
  color: var(--neon-blue); letter-spacing: .08em;
  opacity: .7;
  animation: blink-hint 2s infinite;
}
@keyframes blink-hint { 0%,100%{opacity:.7} 50%{opacity:.3} }

.interact-zone {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
}

/* Generic neon button */
.neon-btn {
  font-family: var(--font-title);
  font-size: .75rem; letter-spacing: .12em;
  padding: 12px 28px;
  background: transparent;
  border: 1px solid var(--neon-blue);
  color: var(--neon-blue);
  border-radius: 4px; cursor: none;
  transition: background .2s, box-shadow .2s;
  text-transform: uppercase;
}
.neon-btn:hover {
  background: rgba(0,212,255,.1);
  box-shadow: 0 0 20px var(--neon-blue), inset 0 0 12px rgba(0,212,255,.05);
}
.neon-btn.green {
  border-color: var(--neon-green); color: var(--neon-green);
}
.neon-btn.green:hover {
  background: rgba(0,255,159,.1);
  box-shadow: 0 0 20px var(--neon-green);
}
.neon-btn.purple {
  border-color: var(--neon-purple); color: var(--neon-purple);
}
.neon-btn.purple:hover {
  background: rgba(180,0,255,.1);
  box-shadow: 0 0 20px var(--neon-purple);
}

/* ===== STARS CANVAS ===== */
#stars-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ===== STARFIELD CSS (layered moving stars) ===== */
@keyframes twinkle {
  0%,100% { opacity: .15; }
  50%      { opacity: 1; }
}
@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-100vh); }
}
#starfield {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.star-layer {
  position: absolute; inset: 0;
  background-repeat: repeat;
  animation: drift linear infinite;
}
.star-layer-1 {
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 72%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 33%, rgba(200,220,255,.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 88%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 20%, rgba(200,220,255,.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 60%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 5%  50%, rgba(255,255,255,.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 33% 5%,  rgba(200,230,255,.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 95%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 78%, rgba(255,255,255,.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 55%, rgba(200,220,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 90%, rgba(255,255,255,.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 40%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 38%, rgba(200,220,255,.8) 0%, transparent 100%);
  background-size: 600px 600px;
  animation-duration: 120s;
  opacity: .7;
}
.star-layer-2 {
  background-image:
    radial-gradient(1.5px 1.5px at 18% 28%, rgba(255,255,255,.9) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 38% 62%, rgba(180,210,255,.8) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 58% 18%, rgba(255,255,255,.7) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 82%, rgba(255,255,255,.9) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 10%, rgba(180,210,255,.8) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 8%  75%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 40%, rgba(255,255,255,.8) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 62% 70%, rgba(180,210,255,.7) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 28% 95%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 82% 55%, rgba(255,255,255,.9) 0%, transparent 100%);
  background-size: 800px 800px;
  animation-duration: 80s;
  opacity: .5;
}
.star-layer-3 {
  background-image:
    radial-gradient(2px 2px at 12% 42%, rgba(255,255,255,1) 0%, transparent 100%),
    radial-gradient(2px 2px at 30% 18%, rgba(150,200,255,.9) 0%, transparent 100%),
    radial-gradient(2px 2px at 52% 78%, rgba(255,255,255,.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 68% 32%, rgba(255,255,255,1) 0%, transparent 100%),
    radial-gradient(2px 2px at 82% 65%, rgba(150,200,255,.9) 0%, transparent 100%),
    radial-gradient(2px 2px at 95% 88%, rgba(255,255,255,.7) 0%, transparent 100%),
    radial-gradient(2px 2px at 22% 60%, rgba(255,255,255,.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 44% 25%, rgba(150,200,255,.9) 0%, transparent 100%);
  background-size: 1000px 1000px;
  animation-duration: 50s;
  opacity: .4;
}
/* Twinkle overlay */
.star-layer-twinkle {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 25%, rgba(0,212,255,.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 55%, rgba(180,0,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 15%, rgba(0,212,255,.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 75%, rgba(0,255,159,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 33% 85%, rgba(0,212,255,.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 40%, rgba(180,0,255,.5) 0%, transparent 100%);
  background-size: 700px 700px;
  animation: twinkle 4s ease-in-out infinite;
}



/* ===== SLIDE 0: HERO ===== */
#slide-0 {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  position: relative;
}
#galaxy-canvas {
  position: absolute; inset: 0;
}
.hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 6vw, 4.5rem);
  color: #fff; letter-spacing: .15em;
  text-shadow: 0 0 40px var(--neon-blue);
  position: relative; z-index: 10;
  animation: glitch 6s infinite;
}
@keyframes glitch {
  0%,90%,100% { clip-path: none; transform: none; text-shadow: 0 0 40px var(--neon-blue); }
  91% { clip-path: inset(10% 0 85% 0); transform: translate(-4px,0); color: var(--neon-blue); }
  92% { clip-path: inset(70% 0 5% 0); transform: translate(4px,0); color: rgba(0,180,255,0.9); }
  93% { clip-path: none; transform: none; }
}
.hero-sub {
  font-family: var(--font-mono); font-size: clamp(.75rem, 1.5vw, 1rem);
  color: var(--neon-blue); letter-spacing: .08em;
  position: relative; z-index: 10;
}
.typewriter-wrap {
  font-family: var(--font-mono); font-size: clamp(.7rem, 1.2vw, .9rem);
  color: var(--text-main); letter-spacing: .06em;
  position: relative; z-index: 10;
  max-width: min(600px, 90vw);
  line-height: 1.7;
}
#typewriter-text::after { content: '|'; animation: blink-cur .7s infinite; }
@keyframes blink-cur { 0%,100%{opacity:1}50%{opacity:0} }
.hero-cta {
  font-family: var(--font-title); font-size: .85rem; letter-spacing: .15em;
  padding: 16px 36px;
  background: transparent;
  border: 1px solid var(--neon-blue);
  color: var(--neon-blue);
  cursor: none;
  position: relative; z-index: 10;
  transition: all .3s;
  animation: glow-pulse 2s infinite alternate;
}
.hero-cta:hover {
  background: rgba(0,212,255,.15);
  box-shadow: 0 0 40px var(--neon-blue);
}
@keyframes glow-pulse {
  from { box-shadow: 0 0 10px rgba(0,212,255,.4); }
  to   { box-shadow: 0 0 30px rgba(0,212,255,.8); }
}
.scroll-hint {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: .6rem;
  color: var(--text-dim); letter-spacing: .12em;
  z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.scroll-arrow {
  width: 20px; height: 20px;
  border-right: 2px solid var(--neon-blue); border-bottom: 2px solid var(--neon-blue);
  transform: rotate(45deg);
  animation: scroll-bounce .8s ease-in-out infinite alternate;
}
@keyframes scroll-bounce { from{transform: rotate(45deg) translate(-3px,-3px)} to{transform:rotate(45deg) translate(3px,3px)} }

/* ===== SLIDE 1: GRAVIS — TILT ===== */
#slide-1 .slide-bg { background: radial-gradient(ellipse at 60% 50%, #1a0030 0%, #0a0015 60%, #02020f 100%); }
#bh-canvas { position: absolute; inset: 0; }
.tilt-card {
  width: clamp(200px, 28vw, 320px);
  aspect-ratio: 1;
  background: rgba(10,0,30,.7);
  border: 1px solid rgba(180,0,255,.4);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 24px;
  transform-style: preserve-3d;
  transition: box-shadow .2s;
  cursor: none;
  position: relative;
  box-shadow: 0 0 30px rgba(180,0,255,.2);
}
.tilt-gyro {
  width: 80px; height: 80px;
  border: 3px solid rgba(180,0,255,.5);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: spin-gyro 4s linear infinite;
  position: relative;
}
.tilt-gyro::after {
  content: '';
  position: absolute;
  width: 50%; height: 50%;
  border: 2px solid var(--neon-purple);
  border-radius: 50%;
  animation: spin-gyro 2s linear infinite reverse;
}
@keyframes spin-gyro { to { transform: rotate(360deg); } }
.tilt-label {
  font-family: var(--font-title); font-size: .65rem;
  color: var(--text-dim); letter-spacing: .12em;
  text-align: center;
}
.stab-bar-wrap {
  width: 100%; height: 6px;
  background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden;
}
.stab-bar {
  height: 100%; width: 0%;
  transition: width .1s, background .3s;
  border-radius: 3px;
  background: var(--neon-red);
}
.stab-pct {
  font-family: var(--font-mono); font-size: .8rem;
  letter-spacing: .06em;
}

/* ===== SLIDE 2: PULSAR — COUNTER ===== */
#slide-2 .slide-bg { background: radial-gradient(ellipse at 50% 50%, #001030 0%, #000518 60%, #02020f 100%); }
#pulsar-canvas { position: absolute; inset: 0; }
.decoder-panel {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 32px;
  background: rgba(0,5,30,.8);
  border: 1px solid rgba(0,212,255,.3);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  min-width: min(320px, 80vw);
}
.ring-container {
  position: relative; width: 140px; height: 140px;
}
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(0,212,255,.1); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--neon-blue); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 345; stroke-dashoffset: 345;
  transition: stroke-dashoffset .05s;
  filter: drop-shadow(0 0 6px var(--neon-blue));
}
.counter-val {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-family: var(--font-title); font-size: 2.2rem;
  color: var(--neon-blue);
  text-shadow: 0 0 20px var(--neon-blue);
}
.decoded-msg {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--neon-green);
  text-align: center; letter-spacing: .1em;
  opacity: 0; transition: opacity .5s;
  line-height: 1.7;
  text-shadow: 0 0 10px var(--neon-green);
}
.decoded-msg.visible { opacity: 1; }

/* ===== SLIDE 3: ORBITAL GRAVEYARD — DRAG ===== */
#slide-3 .slide-bg { background: radial-gradient(ellipse at 50% 40%, #1a0c00 0%, #0c0800 60%, #02020f 100%); }
#debris-canvas { position: absolute; inset: 0; }
.puzzle-zone {
  position: relative; width: clamp(260px, 38vw, 440px); height: clamp(260px, 38vw, 440px);
}
.orbit-ring {
  position: absolute; border: 2px dashed rgba(255,140,0,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.orbit-ring[data-orbit="0"] { width: 80px; height: 80px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.orbit-ring[data-orbit="1"] { width: 150px; height: 150px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.orbit-ring[data-orbit="2"] { width: 230px; height: 230px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.orbit-ring.correct { border-color: var(--neon-green); box-shadow: 0 0 12px rgba(0,255,159,.4); }
.orbit-ring.wrong { border-color: var(--neon-red); animation: shake-ring .3s; }
@keyframes shake-ring {
  0%,100%{transform:translate(-50%,-50%)} 25%{transform:translate(-48%,-50%)} 75%{transform:translate(-52%,-50%)}
}
.fragment {
  position: absolute;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: rgba(255,140,0,.15);
  border: 1px solid rgba(255,140,0,.4);
  border-radius: 8px; cursor: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
}
.fragment:hover { background: rgba(255,140,0,.3); transform: scale(1.1); }
.fragment.dragging { opacity: .6; transform: scale(1.15); }
.artifact-counter {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--neon-gold); letter-spacing: .1em;
  margin-top: 12px;
}

/* ===== SLIDE 4: NEBULA — PARTICLES ===== */
#slide-4 .slide-bg { background: radial-gradient(ellipse at 40% 50%, #0a0020 0%, #04001a 60%, #02020f 100%); }
#nebula-canvas { position: absolute; inset: 0; cursor: none; }
.nebula-msg {
  position: absolute; bottom: 15%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-title); font-size: clamp(.8rem, 2vw, 1.2rem);
  color: var(--neon-purple); letter-spacing: .15em;
  text-shadow: 0 0 20px var(--neon-purple);
  opacity: 0; transition: opacity 1s;
  white-space: nowrap;
  z-index: 20;
}
.nebula-msg.show { opacity: 1; }

/* ===== SLIDE 5: MIRAGES — SLIDER ===== */
#slide-5 .slide-bg { background: radial-gradient(ellipse at 50% 50%, #100020 0%, #080010 60%, #02020f 100%); }
#mirages-canvas { position: absolute; inset: 0; }
.planet-carousel {
  width: clamp(280px, 42vw, 520px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.carousel-inner {
  position: relative;
  border-radius: 16px;
  border: 1.5px solid rgba(255,255,255,.12);
  overflow: hidden;
  height: clamp(220px, 32vw, 380px);
  background: rgba(0,0,20,.6);
}
/* All slides stacked, CSS opacity transitions */
.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}
/* Planet SVG fills the area */
.carousel-slide svg {
  width: clamp(130px, 20vw, 220px);
  height: clamp(130px, 20vw, 220px);
  filter: drop-shadow(0 0 24px rgba(100,150,255,.35));
  transition: filter .3s;
}
.carousel-slide.chosen svg {
  filter: drop-shadow(0 0 36px rgba(0,255,159,.5));
}
.planet-label {
  font-family: var(--font-title);
  font-size: clamp(.6rem, 1vw, .8rem);
  color: var(--text-main);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.carousel-dots {
  display: flex; gap: 10px; justify-content: center;
}
.c-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  cursor: none;
  transition: background .25s, transform .25s;
  border: 1px solid rgba(255,255,255,.15);
}
.c-dot.active {
  background: var(--neon-blue);
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--neon-blue);
}
.carousel-nav {
  display: flex; justify-content: space-between; align-items: center;
}
.c-arrow {
  background: rgba(0,212,255,.08);
  border: 1px solid rgba(0,212,255,.3);
  color: var(--neon-blue);
  width: 38px; height: 38px;
  border-radius: 50%; cursor: none; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, box-shadow .2s;
}
.c-arrow:hover { background: rgba(0,212,255,.2); box-shadow: 0 0 12px var(--neon-blue); }
.choose-btn {
  display: none;
  width: 100%;
}
.choose-btn.show {
  display: block;
  animation: slide-up .35s ease;
}
@keyframes slide-up { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.reality-msg {
  font-family: var(--font-mono);
  font-size: clamp(.7rem, 1.1vw, .85rem);
  color: var(--neon-green);
  text-align: center;
  opacity: 0;
  transition: opacity .5s;
  line-height: 1.7;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0,255,159,.05);
  border: 1px solid rgba(0,255,159,.15);
}
.reality-msg.show { opacity: 1; }

/* ===== SLIDE 6: MAGNIFIER ===== */
#slide-6 .slide-bg { background: radial-gradient(ellipse at 50% 50%, #000a20 0%, #000510 70%, #02020f 100%); }
#starmap-container {
  position: relative; width: clamp(260px, 40vw, 480px); height: clamp(200px, 32vw, 380px);
  border: 1px solid rgba(0,212,255,.2); border-radius: 10px; overflow: hidden; cursor: none;
}
#starmap-bg { width: 100%; height: 100%; object-fit: cover; }
#starmap-canvas { position: absolute; inset: 0; cursor: none; }
#starmap-container { cursor: none; }
#magnifier {
  position: absolute; width: 100px; height: 100px;
  border-radius: 50%;
  border: 2px solid var(--neon-blue);
  box-shadow: 0 0 16px var(--neon-blue), inset 0 0 20px rgba(0,212,255,.15);
  pointer-events: none;
  transform: translate(-50%,-50%);
  display: none;
  overflow: hidden;
  z-index: 20;
  transition: border-color .3s, box-shadow .3s;
}
#magnifier.found { border-color: var(--neon-green); box-shadow: 0 0 24px var(--neon-green); }
#magnifier-inner { width: 200px; height: 200px; position: absolute; top: -50%; left: -50%; }
.capsule-found {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--neon-green); text-align: center; letter-spacing: .08em;
  margin-top: 12px; opacity: 0; transition: opacity .5s;
  line-height: 1.6;
}
.capsule-found.show { opacity: 1; }

/* ===== SLIDE 7: SILENCE — EQUALIZER ===== */
#slide-7 .slide-bg { background: radial-gradient(ellipse at 50% 50%, #000520 0%, #020215 60%, #02020f 100%); }
#wave-canvas { position: absolute; inset: 0; }
.eq-panel {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 28px;
  background: rgba(0,5,30,.8);
  border: 1px solid rgba(0,212,255,.2);
  border-radius: 12px;
}
#eq-bars {
  display: flex; align-items: flex-end; gap: 5px;
  height: 100px;
}
.eq-bar {
  width: 14px;
  background: linear-gradient(to top, var(--neon-blue), var(--neon-purple));
  border-radius: 2px 2px 0 0;
  transition: height .08s;
  box-shadow: 0 0 8px var(--neon-blue);
  min-height: 4px;
}
.notes-display {
  font-family: var(--font-title); font-size: 1rem;
  color: var(--neon-blue); letter-spacing: .2em;
  text-shadow: 0 0 12px var(--neon-blue);
  opacity: 0; transition: opacity .5s;
  text-align: center;
}
.notes-display.show { opacity: 1; }
.signal-msg {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--neon-green); text-align: center; letter-spacing: .08em;
  opacity: 0; transition: opacity .5s; line-height: 1.6;
}
.signal-msg.show { opacity: 1; }

/* ===== SLIDE 8: LIBRARY — SORTABLE ===== */
#slide-8 .slide-bg { background: linear-gradient(180deg, #0a0818 0%, #05040e 100%); }
#library-canvas { position: absolute; inset: 0; }
.books-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
  width: clamp(220px, 32vw, 360px);
}
.book-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(20,10,40,.8);
  border: 1px solid rgba(140,80,255,.2);
  border-radius: 8px;
  cursor: none;
  transition: background .2s, transform .2s, opacity .2s;
  touch-action: none;
}
.book-item:hover { background: rgba(40,20,70,.8); }
.book-item.dragging { opacity: .5; transform: scale(1.04); border-color: var(--neon-purple); }
.book-icon { font-size: 1.5rem; }
.book-name { font-family: var(--font-title); font-size: .7rem; letter-spacing: .1em; color: var(--text-main); }
.book-sub { font-size: .62rem; color: var(--text-dim); margin-top: 2px; }
.prophecy {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--neon-gold); line-height: 1.7;
  text-align: center; opacity: 0; transition: opacity .8s;
  font-style: italic;
  text-shadow: 0 0 10px var(--neon-gold);
  margin-top: 12px;
}
.prophecy.show { opacity: 1; }

/* ===== SLIDE 9: CHRONOSPHERE — CLOCK ===== */
#slide-9 .slide-bg { background: radial-gradient(ellipse at 50% 50%, #0a0820 0%, #04030e 60%, #02020f 100%); }
#gears-canvas { position: absolute; inset: 0; }
.clocks-panel {
  display: flex; gap: clamp(20px, 4vw, 60px); align-items: center;
}
.clock-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.clock-label {
  font-family: var(--font-title); font-size: .6rem; letter-spacing: .12em;
  color: var(--text-dim);
}
.clock-face {
  width: clamp(110px, 16vw, 180px); height: clamp(110px, 16vw, 180px);
  background: rgba(5,3,20,.8);
  border-radius: 50%;
  border: 2px solid rgba(0,212,255,.3);
  position: relative;
  box-shadow: 0 0 20px rgba(0,212,255,.2), inset 0 0 20px rgba(0,0,0,.5);
}
.clock-hand {
  position: absolute; bottom: 50%; left: 50%; transform-origin: 50% 100%;
  border-radius: 2px;
  transform: translateX(-50%);
}
.hand-h {
  width: 3px; height: 28%; background: var(--neon-blue);
  box-shadow: 0 0 6px var(--neon-blue);
}
.hand-m {
  width: 2px; height: 38%; background: var(--neon-purple);
  box-shadow: 0 0 6px var(--neon-purple);
}
.hand-s {
  width: 1px; height: 42%; background: var(--neon-red);
  box-shadow: 0 0 4px var(--neon-red);
}
.clock-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue);
}
.time-diff {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--neon-gold); letter-spacing: .08em;
  text-align: center;
}
.chrono-msg {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--neon-green); text-align: center; letter-spacing: .08em;
  opacity: 0; transition: opacity .5s; line-height: 1.6;
  margin-top: 12px;
}
.chrono-msg.show { opacity: 1; }

/* ===== SLIDE 10: METEOR SHOWER — CLICKER ===== */
#slide-10 .slide-bg { background: radial-gradient(ellipse at 50% 30%, #0f0800 0%, #080500 60%, #02020f 100%); }
#asteroid-canvas { position: absolute; inset: 0; }
#meteor-field {
  position: relative;
  width: clamp(240px, 38vw, 440px); height: clamp(240px, 38vw, 440px);
  border: 1px solid rgba(255,200,0,.15);
  border-radius: 10px; overflow: hidden;
  background: rgba(0,0,0,.3);
  cursor: none;
}
.meteor {
  position: absolute; cursor: none;
  display: flex; align-items: flex-start; justify-content: center;
  filter: drop-shadow(0 0 8px #ff8800);
  z-index: 20;
  transition: opacity .1s;
}
@keyframes fall-meteor { to { transform: translateY(500px); } }
.meteor-explosion {
  position: absolute; pointer-events: none;
  animation: explode .5s forwards;
  z-index: 30;
}
@keyframes explode { 0%{opacity:1;transform:scale(.5)} 100%{opacity:0;transform:scale(2)} }
.meteor-counter {
  font-family: var(--font-title); font-size: .9rem;
  color: var(--neon-gold); letter-spacing: .1em;
  text-shadow: 0 0 10px var(--neon-gold);
}
.meteor-msg {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--neon-green); text-align: left; letter-spacing: .06em;
  opacity: 0; transition: opacity .5s; line-height: 1.8;
  margin-top: 8px;
}
.meteor-msg.show { opacity: 1; }

/* ===== SLIDE 11: 3D CUBE ===== */
#slide-11 .slide-bg { background: radial-gradient(ellipse at 30% 50%, #001020 0%, #000815 60%, #02020f 100%); }
#holo-canvas { position: absolute; inset: 0; }
.cube-wrap {
  perspective: 900px;
  width: clamp(180px, 26vw, 300px);
  height: clamp(180px, 26vw, 300px);
  cursor: none;
}
.cube {
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .05s;
  position: relative;
}
.cube-face {
  position: absolute; width: 100%; height: 100%;
  background: rgba(0,20,50,.8);
  border: 1.5px solid rgba(0,212,255,.5);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px;
  backface-visibility: hidden;
  transition: background .3s;
}
.cube-face svg {
  width: clamp(52px, 7vw, 76px);
  height: clamp(52px, 7vw, 76px);
  filter: drop-shadow(0 0 6px rgba(0,212,255,.5));
}
.cube-face-label {
  font-family: var(--font-title);
  font-size: clamp(.5rem, .8vw, .65rem);
  letter-spacing: .12em;
  color: var(--neon-blue);
  text-shadow: 0 0 8px var(--neon-blue);
}
.cube-face.found {
  background: rgba(0,50,25,.9);
  border-color: var(--neon-green);
  box-shadow: inset 0 0 30px rgba(0,255,159,.12);
}
.cube-face.found svg { filter: drop-shadow(0 0 10px var(--neon-green)); }
.cube-face.found .cube-face-label { color: var(--neon-green); text-shadow: 0 0 8px var(--neon-green); }

.face-front  { transform: translateZ(calc(clamp(90px, 13vw, 150px))); }
.face-back   { transform: rotateY(180deg) translateZ(calc(clamp(90px, 13vw, 150px))); }
.face-left   { transform: rotateY(-90deg) translateZ(calc(clamp(90px, 13vw, 150px))); }
.face-right  { transform: rotateY(90deg) translateZ(calc(clamp(90px, 13vw, 150px))); }
.face-top    { transform: rotateX(90deg) translateZ(calc(clamp(90px, 13vw, 150px))); }
.face-bottom { transform: rotateX(-90deg) translateZ(calc(clamp(90px, 13vw, 150px))); }
.cube-hint {
  font-family: var(--font-mono); font-size: .62rem;
  color: var(--text-dim); text-align: center; letter-spacing: .08em;
  margin-top: 10px;
}
.cube-msg {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--neon-green); text-align: center; opacity: 0; transition: opacity .5s;
  line-height: 1.6; letter-spacing: .08em; margin-top: 8px;
}
.cube-msg.show { opacity: 1; }

/* ===== SLIDE 12: EARTH ECHO — AJAX ===== */
#slide-12 .slide-bg { background: radial-gradient(ellipse at 50% 70%, #001020 0%, #000815 60%, #02020f 100%); }
#earth-canvas { position: absolute; inset: 0; }
.comm-panel {
  width: clamp(240px, 36vw, 400px);
  display: flex; flex-direction: column; gap: 14px;
}
.comm-select {
  background: rgba(0,10,30,.8);
  border: 1px solid rgba(0,212,255,.3);
  color: var(--neon-blue);
  font-family: var(--font-mono); font-size: .75rem;
  padding: 10px 14px; border-radius: 4px; cursor: none;
  letter-spacing: .08em;
}
.comm-select option { background: #020a1e; }
.signal-area {
  background: rgba(0,5,20,.7);
  border: 1px solid rgba(0,212,255,.15);
  border-radius: 8px; padding: 16px;
  min-height: 140px;
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--text-main); line-height: 1.8;
  position: relative;
}
.spinner {
  display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  flex-direction: column; align-items: center; gap: 10px;
}
.spinner.show { display: flex; }
.spin-ring {
  width: 32px; height: 32px;
  border: 2px solid rgba(0,212,255,.2);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin-text { font-size: .65rem; color: var(--neon-blue); letter-spacing: .1em; }
.received-msg { opacity: 0; transition: opacity .7s; }
.received-msg.show { opacity: 1; }
.msg-year { font-family: var(--font-title); font-size: .6rem; color: var(--neon-blue); letter-spacing: .12em; margin-bottom: 6px; }
.final-comm {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--neon-green); letter-spacing: .08em; line-height: 1.6;
  opacity: 0; transition: opacity .5s; margin-top: 8px;
}
.final-comm.show { opacity: 1; }

/* ===== SLIDE 13: FINALE ===== */
#slide-13 .slide-bg { background: radial-gradient(ellipse at 50% 80%, #001528 0%, #000a18 50%, #02020f 100%); }
#finale-canvas { position: absolute; inset: 0; }
.finale-content {
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  height: 100%; gap: 24px; padding: 80px 5% 40px;
}
.mission-complete {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  color: var(--neon-gold); letter-spacing: .15em;
  text-shadow: 0 0 40px var(--neon-gold), 0 0 80px rgba(255,215,0,.3);
}
.stats-row {
  display: flex; gap: clamp(16px, 4vw, 48px); justify-content: center; flex-wrap: wrap;
}
.stat-card {
  background: rgba(0,10,30,.7);
  border: 1px solid rgba(255,215,0,.2);
  border-radius: 12px; padding: clamp(16px, 2.5vw, 28px);
  text-align: center; min-width: 100px;
}
.stat-num {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--neon-gold);
  text-shadow: 0 0 20px var(--neon-gold);
}
.stat-label { font-size: .65rem; color: var(--text-dim); letter-spacing: .12em; margin-top: 4px; font-family: var(--font-mono); }
.finale-text {
  max-width: min(600px, 90vw);
  font-size: .85rem; line-height: 1.9;
  color: var(--text-main); font-style: italic;
}
.finale-sig {
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--text-dim); letter-spacing: .08em;
}
.finale-btns {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
}
.social-links {
  display: flex; gap: 16px;
}
.soc-btn {
  width: 40px; height: 40px;
  border: 1px solid rgba(0,212,255,.3);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: none; color: var(--text-dim);
  transition: border-color .2s, color .2s, box-shadow .2s;
  text-decoration: none;
}
.soc-btn:hover { border-color: var(--neon-blue); color: var(--neon-blue); box-shadow: 0 0 14px var(--neon-blue); }

/* ===== FIREWORKS ===== */
.firework-particle {
  position: fixed; pointer-events: none; z-index: 9000;
  width: 5px; height: 5px; border-radius: 50%;
  animation: fw-fly linear forwards;
}
@keyframes fw-fly {
  0% { opacity: 1; transform: translate(0,0); }
  100% { opacity: 0; }
}

/* ===== FLASH OVERLAY ===== */
#flash-overlay {
  position: fixed; inset: 0; z-index: 5000;
  pointer-events: none;
  opacity: 0; transition: opacity .1s;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
  .slide-content { flex-direction: column; padding: 70px 5% 30px; gap: 20px; overflow-y: auto; }
  .narrative, .narrative.right { flex: none; width: 100%; }
  .interact-zone { flex: none; min-height: 280px; }
  #topnav { padding: 10px 16px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .stats-row { gap: 12px; }
  .stat-card { min-width: 80px; padding: 12px; }
}
