/* ═══════════════════════════════════════════════════════
   ORBIT-X — MISSION CONTROL INTERFACE
   Premium Cinematic CSS
═══════════════════════════════════════════════════════ */

/* ─── TOKENS ──────────────────────────────────────── */
:root {
  --bg:         #020408;
  --surface:    rgba(6, 16, 30, 0.7);
  --border:     rgba(80, 160, 220, 0.15);
  --glow-blue:  rgba(56, 160, 255, 0.35);
  --glow-cyan:  rgba(0, 220, 255, 0.25);
  --blue:       #38a0ff;
  --cyan:       #00dcff;
  --white:      #f0f6ff;
  --muted:      rgba(160, 200, 240, 0.5);
  --font-disp:  'Courier New', 'Lucida Console', monospace;
  --font-body:  'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:cubic-bezier(0.65, 0, 0.35, 1);
}

/* ─── RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
}
a { text-decoration: none; color: inherit; }
button { cursor: none; border: none; background: none; font-family: inherit; }

/* ─── CURSOR ──────────────────────────────────────── */
#cursor-dot {
  position: fixed; z-index: 9999;
  width: 6px; height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.08s, opacity 0.2s;
  box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--glow-cyan);
}
#cursor-ring {
  position: fixed; z-index: 9998;
  width: 32px; height: 32px;
  border: 1px solid rgba(0, 220, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              border-color 0.3s, opacity 0.2s;
}
#cursor-ring.hover {
  width: 56px; height: 56px;
  border-color: var(--cyan);
  background: rgba(0, 220, 255, 0.05);
}

/* ─── UTILITY ─────────────────────────────────────── */
.hidden { display: none !important; }
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: 16px;
}

/* ─── LOADER ──────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  overflow: hidden;
}
.loader-bg-lines {
  position: absolute; inset: 0;
  display: flex; gap: 25%;
}
.loader-bg-lines span {
  flex: 0 0 1px;
  background: linear-gradient(to bottom, transparent, rgba(56,160,255,0.12), transparent);
  animation: lineFlash 3s ease-in-out infinite;
}
.loader-bg-lines span:nth-child(2) { animation-delay: 0.4s; }
.loader-bg-lines span:nth-child(3) { animation-delay: 0.8s; }
.loader-bg-lines span:nth-child(4) { animation-delay: 1.2s; }
@keyframes lineFlash {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1;   }
}

.loader-corner {
  position: absolute; font-size: 10px;
  color: rgba(0, 220, 255, 0.4);
  animation: cornerPulse 2s ease-in-out infinite;
}
.loader-corner.tl { top: 24px; left: 24px; }
.loader-corner.tr { top: 24px; right: 24px; }
.loader-corner.bl { bottom: 24px; left: 24px; }
.loader-corner.br { bottom: 24px; right: 24px; }
@keyframes cornerPulse {
  0%, 100% { opacity: 0.4; } 50% { opacity: 1; }
}

.loader-content {
  text-align: center;
  position: relative; z-index: 1;
}
.loader-logo {
  font-family: var(--font-disp);
  font-size: clamp(3rem, 10vw, 7rem);
  letter-spacing: 0.15em;
  line-height: 1;
  opacity: 0;
}
.logo-prefix { color: var(--white); }
.logo-dash   { color: var(--muted); margin: 0 0.1em; }
.logo-x      {
  color: var(--cyan);
  text-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(0,220,255,0.4);
}
.loader-subtitle {
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: var(--muted);
  margin-top: 16px;
  opacity: 0;
}
.loader-bar-wrap {
  display: flex; align-items: center; gap: 16px;
  margin-top: 40px; justify-content: center;
  opacity: 0;
}
.loader-bar {
  width: clamp(160px, 30vw, 320px); height: 2px;
  background: rgba(56,160,255,0.15);
  border-radius: 2px; overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 2px;
  box-shadow: 0 0 12px var(--glow-cyan);
  transition: width 0.1s linear;
}
.loader-percent {
  font-family: var(--font-disp);
  font-size: 0.75rem;
  color: var(--cyan);
  width: 36px;
}
.loader-status {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-top: 16px;
  opacity: 0;
}

/* ─── EXPERIENCE ──────────────────────────────────── */
#experience {
  position: relative;
  display: block !important; /* override .hidden when JS reveals */
}
#experience.hidden { display: none !important; }

/* Fixed 3-D canvas behind everything */
#webgl {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── NAV ─────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 48px;
  background: linear-gradient(to bottom, rgba(2,4,8,0.9), transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
}
.nav-logo {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  font-weight: 700;
}
.nav-logo span { color: var(--cyan); }
.nav-links { display: flex; gap: 40px; }
.nav-link {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  transition: color 0.3s;
}
.nav-link:hover { color: var(--white); }
.nav-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.6rem; letter-spacing: 0.2em;
  color: var(--muted);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* ─── SECTIONS (COMMON) ───────────────────────────── */
section {
  position: relative; z-index: 10;
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 120px 48px;
  overflow: hidden;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-eyebrow {
  font-family: var(--font-disp);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  color: var(--cyan);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(20px);
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 200;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(20px);
}
.section-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 480px;
  opacity: 0;
}

/* ─── HERO ────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  justify-content: flex-end;
  align-items: flex-start;
  padding-bottom: 12vh;
}
.hero-content {
  position: relative; z-index: 10;
  max-width: 640px;
}
.hero-eyebrow {
  font-family: var(--font-disp);
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  color: var(--cyan);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(30px);
}
.hero-title {
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 100;
  letter-spacing: -0.02em;
  line-height: 0.9;
  overflow: hidden;
}
.title-line {
  display: block;
  opacity: 0;
  transform: translateY(100%);
}
.title-line.accent {
  color: transparent;
  -webkit-text-stroke: 1px var(--blue);
  text-shadow: 0 0 60px rgba(56,160,255,0.3);
}
.hero-sub {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 32px;
  max-width: 400px;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(20px);
}
.hero-cta {
  display: flex; align-items: center; gap: 24px;
  margin-top: 48px;
  opacity: 0;
  transform: translateY(20px);
}

/* Buttons */
.btn-primary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--bg);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 4px;
  font-family: var(--font-disp);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
  box-shadow: 0 0 30px rgba(56,160,255,0.3);
}
.btn-primary svg { width: 16px; height: 16px; }
.btn-primary:hover {
  transform: scale(1.04);
  box-shadow: 0 0 50px rgba(0,220,255,0.5);
}
.btn-ghost {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  transition: color 0.3s, border-color 0.3s;
  font-family: var(--font-disp);
}
.btn-ghost:hover { color: var(--white); border-color: var(--cyan); }

.btn-glow {
  padding: 18px 52px;
  font-family: var(--font-disp);
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  color: var(--cyan);
  border: 1px solid rgba(0,220,255,0.3);
  border-radius: 4px;
  background: transparent;
  transition: all 0.4s var(--ease-out);
  box-shadow: 0 0 20px rgba(0,220,255,0.1), inset 0 0 20px rgba(0,220,255,0.03);
  opacity: 0;
  transform: translateY(30px);
}
.btn-glow:hover {
  background: rgba(0,220,255,0.08);
  box-shadow: 0 0 50px rgba(0,220,255,0.25), inset 0 0 40px rgba(0,220,255,0.06);
  color: var(--white);
}

/* HUD overlays */
.hud-tl, .hud-tr, .hud-br {
  position: absolute; z-index: 20;
  font-family: var(--font-disp);
  opacity: 0;
}
.hud-tl { top: 140px; left: 48px; }
.hud-tr { top: 140px; right: 48px; text-align: right; }
.hud-br { bottom: 80px; right: 48px; text-align: right; }
.hud-label {
  font-size: 0.5rem;
  letter-spacing: 0.35em;
  color: var(--cyan);
  margin-bottom: 4px;
}
.hud-val {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--white);
}

/* Scroll hint */
.scroll-hint {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  font-family: var(--font-disp);
  font-size: 0.5rem;
  letter-spacing: 0.35em;
  color: var(--muted);
  opacity: 0;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, transparent, var(--cyan));
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.3); opacity: 0.5; }
  50%       { transform: scaleY(1); opacity: 1; }
}

/* ─── DASHBOARD ───────────────────────────────────── */
#dashboard {
  min-height: 100vh;
  padding-top: 100px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
}
.panel {
  padding: 28px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
}
.panel::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top left, rgba(0,220,255,0.04), transparent 60%);
  pointer-events: none;
}
.panel.wide { grid-column: span 4; }
.panel-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.panel-icon {
  color: var(--cyan);
  font-size: 0.85rem;
}
.panel-title {
  font-family: var(--font-disp);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  flex: 1;
}
.panel-live {
  font-family: var(--font-disp);
  font-size: 0.45rem;
  letter-spacing: 0.25em;
  color: #00ff88;
  border: 1px solid rgba(0,255,136,0.3);
  padding: 2px 8px;
  border-radius: 2px;
}

/* Signal panel */
.panel-big-val {
  font-family: var(--font-disp);
  font-size: 2.5rem;
  color: var(--white);
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 20px;
}
.signal-bars {
  display: flex; align-items: flex-end; gap: 4px; height: 32px;
}
.bar {
  flex: 1;
  background: rgba(56,160,255,0.15);
  border-radius: 2px;
  transition: background 0.3s;
}
.bar.h1 { height: 40%; }
.bar.h2 { height: 55%; }
.bar.h3 { height: 70%; }
.bar.h4 { height: 85%; }
.bar.h5 { height: 100%; }
.bar.active {
  background: linear-gradient(to top, var(--blue), var(--cyan));
  box-shadow: 0 0 8px rgba(0,220,255,0.4);
}

/* Radar */
.radar-canvas {
  width: 100%; height: 160px;
  display: block;
}

/* Energy bars */
.energy-rows { display: flex; flex-direction: column; gap: 14px; }
.energy-row {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-disp);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.energy-bar {
  flex: 1; height: 3px;
  background: rgba(56,160,255,0.1);
  border-radius: 2px; overflow: hidden;
}
.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0,220,255,0.5);
}

/* Stats panel */
.stat-list { display: flex; flex-direction: column; gap: 10px; }
.stat-row {
  display: flex; justify-content: space-between;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.stat-val { color: var(--white); font-family: var(--font-disp); }

/* Mission stats */
.mission-stats {
  display: flex; gap: 0;
  justify-content: space-around;
}
.mstat { text-align: center; flex: 1; }
.mstat-val {
  font-family: var(--font-disp);
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--white);
  letter-spacing: -0.02em;
}
.mstat-label {
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 6px;
}

/* ─── PLANETS ─────────────────────────────────────── */
#planets { padding-top: 80px; }
.planet-cards {
  display: flex; gap: 24px;
  width: 100%; max-width: 1000px;
  flex-wrap: wrap; justify-content: center;
}
.planet-card {
  flex: 1 1 260px;
  max-width: 320px;
  glass: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px;
  position: relative;
  overflow: hidden;
  cursor: none;
  transition: border-color 0.4s, transform 0.4s var(--ease-out);
  opacity: 0;
  transform: translateY(40px);
}
.planet-card:hover { border-color: rgba(0,220,255,0.35); }
.pcard-glow {
  position: absolute; top: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.35;
  transition: opacity 0.4s;
}
.planet-card:hover .pcard-glow { opacity: 0.6; }
.p0 { background: radial-gradient(circle, var(--blue), transparent); }
.p1 { background: radial-gradient(circle, #ff8040, transparent); }
.p2 { background: radial-gradient(circle, #a040ff, transparent); }
.pcard-name {
  font-family: var(--font-disp);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 8px;
  position: relative; z-index: 1;
}
.pcard-dist {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--cyan);
  font-family: var(--font-disp);
  margin-bottom: 20px;
  position: relative; z-index: 1;
}
.pcard-tag {
  display: inline-block;
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 2px;
  position: relative; z-index: 1;
}

/* ─── PLANET MODAL ────────────────────────────────── */
.planet-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,4,8,0.7);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.planet-modal.active {
  opacity: 1;
  pointer-events: all;
  display: flex !important;
}
.modal-inner {
  padding: 48px;
  min-width: 360px;
  max-width: 560px;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.4s var(--ease-out);
}
.planet-modal.active .modal-inner { transform: scale(1); }
.modal-close {
  position: absolute; top: 20px; right: 20px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--white); }
.modal-planet-name {
  font-family: var(--font-disp);
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  margin-bottom: 32px;
}
.modal-rows { display: flex; flex-direction: column; gap: 12px; }
.modal-row {
  display: flex; justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-row span:last-child { color: var(--white); font-family: var(--font-disp); }

/* ─── OUTRO ───────────────────────────────────────── */
#outro {
  min-height: 100vh;
  background: radial-gradient(ellipse at center bottom, rgba(10,25,50,0.9), transparent 70%);
}
.outro-content { text-align: center; position: relative; z-index: 10; }
.outro-eyebrow {
  font-family: var(--font-disp);
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  color: var(--cyan);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
}
.outro-title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 100;
  letter-spacing: -0.02em;
  line-height: 1;
  opacity: 0;
  transform: translateY(40px);
}
.outro-accent {
  color: transparent;
  -webkit-text-stroke: 1px var(--cyan);
  text-shadow: 0 0 80px rgba(0,220,255,0.4);
}
.outro-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 400px;
  margin: 32px auto;
  opacity: 0;
  transform: translateY(20px);
}
.outro-grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(56,160,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,160,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .panel.wide { grid-column: span 2; }
}
@media (max-width: 768px) {
  #nav { padding: 20px 24px; }
  .nav-links { display: none; }
  section { padding: 80px 24px; }
  .hud-tl, .hud-tr, .hud-br { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel.wide { grid-column: span 1; }
  .mission-stats { flex-wrap: wrap; gap: 24px; }
  .mstat { flex: 0 0 45%; }
  .planet-cards { flex-direction: column; align-items: center; }
  .planet-card { max-width: 100%; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 4rem; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
}

/* ─── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── SELECTION ───────────────────────────────────── */
::selection { background: rgba(0,220,255,0.2); color: var(--white); }
