/* ═══════════════════════════════════════════════════════
   ASTEROID TRACER — RESEARCH PAPER DASHBOARD
   Design System & Component Styles
═══════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS + CSS VARIABLES ─────────────────── */
:root {
  --bg:       #030614;
  --bg2:      #070d24;
  --bg3:      #0c1535;
  --card:     rgba(12, 21, 55, 0.72);
  --card-b:   rgba(0, 200, 220, 0.12);

  --cyan:     #00ffcc;
  --magenta:  #ff4466;
  --blue:     #4488ff;
  --purple:   #8855ff;
  --gold:     #ffcc44;

  --text:     #e8eaf6;
  --muted:    #7b82a8;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'Inter', sans-serif;

  --radius:   16px;
  --radius-lg:24px;
  --glass:    blur(14px);
  --shadow:   0 8px 40px rgba(0,0,0,0.55);
  --glow-c:   0 0 24px rgba(0,255,204,0.22);
  --glow-m:   0 0 24px rgba(255,68,102,0.22);
}

/* ── RESET & BASE ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(0,255,204,0.1);
  border: 1px solid rgba(0,255,204,0.2);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--cyan);
}
strong { color: #c6cbf0; font-weight: 600; }

/* ── STAR-FIELD CANVAS ─────────────────────────────── */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── NAVBAR ────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 60px;
  background: rgba(3, 6, 20, 0.85);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid rgba(0,255,204,0.1);
  transition: background 0.3s;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}
.nav-icon { font-size: 1.3rem; }

.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--cyan); }

/* ── HERO ──────────────────────────────────────────── */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 60px;
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  max-width: 780px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid rgba(0,255,204,0.35);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 28px;
  background: rgba(0,255,204,0.07);
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 50%, var(--magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
  line-height: 1.75;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.chip {
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(68,136,255,0.12);
  border: 1px solid rgba(68,136,255,0.25);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--blue);
  font-family: var(--mono);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #030614;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px rgba(0,255,204,0.3);
}
.cta-btn.secondary {
  background: rgba(255, 68, 102, 0.1);
  border: 1px solid rgba(255, 68, 102, 0.4);
  color: var(--magenta);
  box-shadow: 0 0 20px rgba(255, 68, 102, 0.1);
  cursor: pointer;
}
.cta-btn.secondary:hover {
  background: rgba(255, 68, 102, 0.2);
  box-shadow: 0 0 30px rgba(255, 68, 102, 0.3);
  color: var(--magenta);
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* ── TERMINAL OUTPUT ─────────────────────────────── */
#terminal-container {
  position: relative;
  z-index: 5;
  width: 90%;
  max-width: 900px;
  margin: 40px auto 0;
  background: #02040d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  text-align: left;
}

.terminal-header {
  background: #111420;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f56; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:nth-child(3) { background: #27c93f; }

.terminal-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.terminal-actions button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  font-family: var(--mono);
  cursor: pointer;
}

.terminal-actions button:hover {
  color: var(--text);
}

.terminal-body {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: #a5accc;
  height: 300px;
  overflow-y: auto;
  line-height: 1.6;
}

.line { margin-bottom: 4px; }
.line.muted { color: #5d6180; }
.line.success { color: var(--cyan); }
.line.error { color: var(--magenta); }
.line.highlight { color: var(--gold); }
.cta-arrow {
  animation: bounce 1.6s ease-in-out infinite;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* Orbit rings */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,255,204,0.06);
  pointer-events: none;
  z-index: 2;
  animation: spin linear infinite;
}
.orbit-1 { width: 500px; height: 500px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-duration: 30s; }
.orbit-2 { width: 750px; height: 750px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-duration: 55s; animation-direction: reverse; border-color: rgba(68,136,255,0.05); }
.orbit-3 { width: 1000px; height: 1000px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-duration: 80s; border-color: rgba(255,68,102,0.04); }

@keyframes spin {
  from { transform: translate(-50%,-50%) rotate(0deg); }
  to   { transform: translate(-50%,-50%) rotate(360deg); }
}

.hero-planet {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1a2a6c 0%, #030614 70%);
  top: 55%; left: 70%;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 60px rgba(68,136,255,0.2), inset -20px -20px 40px rgba(0,0,0,0.6);
  z-index: 2;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translate(-50%,-50%) translateY(0); }
  50%      { transform: translate(-50%,-50%) translateY(-18px); }
}

/* ── GENERAL SECTION LAYOUT ──────────────────────── */
section {
  position: relative;
  z-index: 1;
  padding: 100px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.section-desc {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ── REVEAL ANIMATION ────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── PIPELINE PROGRESS BAR ───────────────────────── */
.pipeline-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 56px;
}
.pp-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(0,255,204,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg2);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  z-index: 2;
}
.pp-dot.active, .pp-dot.completed {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--glow-c);
  background: rgba(0,255,204,0.12);
}
.pp-line {
  width: 60px; height: 2px;
  background: rgba(0,255,204,0.15);
}

/* ── STAGE CAROUSEL ──────────────────────────────── */
.pipeline-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.stages-slider-wrap {
  flex: 1;
  overflow: hidden;
  padding: 20px 0;
  border-radius: var(--radius-lg);
}

.stages-grid {
  display: flex; /* Changed from grid */
  gap: 0;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.stage-card {
  flex: 0 0 100%; /* Each card takes full width of container */
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--card-b);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s, opacity 0.4s;
  opacity: 0.6;
  transform: scale(0.9);
}

.stage-card.active-card {
  opacity: 1;
  transform: scale(1);
  box-shadow: var(--glow-c), 0 20px 60px rgba(0,0,0,0.6);
  border-color: rgba(0,255,204,0.3);
}

.carousel-nav {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0,255,204,0.1);
  border: 1px solid rgba(0,255,204,0.3);
  color: var(--cyan);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
}

.carousel-nav:hover {
  background: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 20px var(--cyan);
}

.carousel-nav:disabled {
  opacity: 0.1;
  cursor: not-allowed;
}
.stage-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}
.stage-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0,255,204,0.3);
  box-shadow: var(--glow-c), var(--shadow);
}

.stage-number {
  position: absolute;
  top: 18px; right: 24px;
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(0,255,204,0.06);
  line-height: 1;
  font-family: var(--mono);
}
.stage-icon { font-size: 2.2rem; margin-bottom: 14px; }
.stage-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #d0d8ff;
}
.stage-desc {
  font-size: 0.91rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Stage visual boxes */
.stage-visual {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* FITS stack visual */
.fits-stack {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.fits-frame {
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  font-size: 0.65rem;
  font-family: var(--mono);
  color: var(--cyan);
  border: 1px solid rgba(0,255,204,0.25);
  background: rgba(0,255,204,0.07);
  animation: fadeInUp 0.5s ease both;
}
.f1 { animation-delay: 0.1s; height: 44px; }
.f2 { animation-delay: 0.2s; height: 54px; }
.f3 { animation-delay: 0.3s; height: 64px; }
.f4 { animation-delay: 0.4s; height: 74px; }
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}

.fits-counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.fc-label { color: var(--muted); }
.fc-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cyan);
}

/* ZScale demo */
.zscale-demo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.zs-before, .zs-after { text-align: center; }
.zs-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.zs-arrow {
  font-size: 1.5rem;
  color: var(--blue);
}
#raw-canvas, #norm-canvas {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  display: block;
}

/* Motion demo */
.motion-demo { width: 100%; }
#motion-canvas { border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); display: block; }

/* Slider rows */
.slider-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--mono);
}
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,255,204,0.15);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,255,204,0.6);
}

/* Track scatter */
#track-canvas { border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); display: block; }

/* Score bars */
.score-bars { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.sb-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 50px;
}
.sb-bar-wrap {
  flex: 1;
  height: 22px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
}
.sb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: #030614;
  font-weight: 700;
  transition: width 1s ease;
}
.sb-bar.b2 { background: linear-gradient(90deg, #4488ff, #8855ff); color: white; }
.sb-bar.b3 { background: linear-gradient(90deg, #8855ff, #aa44aa); color: white; }
.sb-bar.b4 { background: rgba(255,68,102,0.4); color: var(--magenta); }
.sb-bar.b5 { background: rgba(255,68,102,0.2); color: var(--muted); }
.sb-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--mono);
  white-space: nowrap;
}

/* Stage params */
.stage-params {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.param-tag {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-family: var(--mono);
  background: rgba(68,136,255,0.1);
  border: 1px solid rgba(68,136,255,0.2);
  color: var(--blue);
}

/* ── RESULTS DASHBOARD ───────────────────────────── */
#results { background: transparent; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.metric-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.metric-card:hover::after { transform: scaleX(1); }
.metric-card:hover {
  transform: translateY(-5px);
  border-color: rgba(68,136,255,0.3);
}

.mc-primary {
  border-color: rgba(0,255,204,0.25);
  box-shadow: var(--glow-c);
}
.mc-primary::after { background: linear-gradient(90deg, var(--cyan), var(--blue)); }

.mc-wide {
  grid-column: span 3;
  text-align: left;
}

.metric-icon { font-size: 1.6rem; margin-bottom: 10px; }

.metric-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: var(--mono);
  line-height: 1;
  margin-bottom: 8px;
}
.metric-unit {
  font-size: 1rem;
  color: var(--blue);
  margin-left: 4px;
}
.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.metric-sub { font-size: 0.75rem; color: var(--muted); }

/* Performance table */
.perf-table { display: flex; flex-direction: column; gap: 0; }
.perf-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem;
  transition: background 0.2s;
}
.perf-row:hover { background: rgba(0,255,204,0.04); }
.perf-row.header {
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(0,255,204,0.2);
}
.perf-row:last-child { border-bottom: none; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0,255,204,0.6);
}

/* ── VISUAL RESULT (FIGURE) ──────────────────────── */
#visual-result {
  max-width: 1000px;
  margin: 0 auto;
}

.figure-container {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--card-b);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

#track-visual-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #01030a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#main-track-canvas {
  width: 100%;
  height: 100%;
}

.figure-caption {
  margin-top: 24px;
  font-family: var(--inter);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: left;
  border-left: 3px solid var(--cyan);
  padding: 10px 20px;
  background: rgba(0,255,204,0.03);
  max-width: 800px;
  margin: 24px auto 0;
}

.figure-caption strong {
  color: var(--cyan);
}

/* ── TRACK VISUALIZATION (Legacy/Hidden) ─────────── */
#track { display: none; }

.track-container {
  position: relative;
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid rgba(0,255,204,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow), var(--glow-c);
  overflow: hidden;
}

#main-track-canvas {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.track-legend {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.tl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}
.tl-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tl-start { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.tl-end { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.tl-grad {
  width: 50px; height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
}

.track-stats-overlay {
  position: absolute;
  top: 36px;
  right: 36px;
  background: rgba(10,14,40,0.88);
  border: 1px solid rgba(68,136,255,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  backdrop-filter: blur(10px);
  min-width: 240px;
}
.tso-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: var(--mono);
}
.tso-row:last-child { border-bottom: none; }
.tso-row span:first-child { color: var(--muted); }
.tso-row span:last-child { color: var(--cyan); font-weight: 600; }

/* ── ALGORITHM EXPLORER ──────────────────────────── */
#explorer { background: transparent; }

.explorer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.formula-card, .pseudocode-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.formula-card h3, .pseudocode-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-block {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(0,255,204,0.15);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}
.formula-line {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 14px;
  line-height: 1.6;
}
.formula-vars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--muted);
}
.formula-vars span strong { color: var(--cyan); }

.algo-sliders {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}
.asl-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.83rem;
  color: var(--muted);
  font-family: var(--mono);
}

.score-output {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(0,255,204,0.2);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.so-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.so-value {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: var(--mono);
  margin-bottom: 10px;
}
.so-bar-wrap {
  height: 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.so-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--magenta));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.so-verdict {
  font-size: 0.82rem;
  font-family: var(--mono);
}

/* Pseudocode */
.pseudo-block {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 2;
  margin-bottom: 18px;
}
.pseudo-comment { color: rgba(136,136,136,0.7); font-style: italic; }
.pseudo-kw { color: var(--blue); display: inline; font-weight: 600; }
.pseudo-step {
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
  cursor: default;
}
.active-step {
  background: rgba(0,255,204,0.12);
  color: var(--cyan);
}
.ps-num { color: rgba(68,136,255,0.6); margin-right: 6px; }

.btn-secondary {
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid rgba(0,255,204,0.4);
  background: rgba(0,255,204,0.08);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-secondary:hover {
  background: rgba(0,255,204,0.18);
  box-shadow: var(--glow-c);
}

/* ── PARAMETER SENSITIVITY ───────────────────────── */
#sensitivity { background: transparent; }

.sensitivity-container {
  overflow-x: auto;
}
.sens-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sens-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cyan);
  font-family: var(--mono);
  background: rgba(0,255,204,0.06);
  border-bottom: 1px solid rgba(0,255,204,0.15);
}
.sens-table td {
  padding: 14px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
  transition: background 0.2s;
}
.sens-row:hover td { background: rgba(0,255,204,0.04); }
.sens-row:last-child td { border-bottom: none; }

.default-row td { background: rgba(0,255,204,0.06); }
.default-row:hover td { background: rgba(0,255,204,0.1); }

.val-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(68,136,255,0.1);
  border: 1px solid rgba(68,136,255,0.2);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--blue);
}
.default-badge {
  background: rgba(0,255,204,0.12);
  border-color: rgba(0,255,204,0.3);
  color: var(--cyan);
}

.obs-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
}
.obs-ok   { background: rgba(0,255,204,0.1);  color: var(--cyan);    border: 1px solid rgba(0,255,204,0.25); }
.obs-warn { background: rgba(255,204,68,0.1); color: #ffcc44;        border: 1px solid rgba(255,204,68,0.25); }
.obs-bad  { background: rgba(255,68,102,0.1); color: var(--magenta); border: 1px solid rgba(255,68,102,0.25); }

/* ── PAPER SECTION ───────────────────────────────── */
#paper { background: transparent; }

.paper-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}

.paper-abstract-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 32px;
  border-left: 4px solid var(--cyan);
}
.pac-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.pac-text {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 20px;
  border: none;
  padding: 0;
  font-style: normal;
}
.pac-terms {
  font-size: 0.8rem;
  color: rgba(123,130,168,0.7);
  line-height: 1.7;
}

.paper-meta-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pm-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
}
.pm-author {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cyan);
}
.pm-affil { font-size: 0.82rem; color: var(--muted); }
.pm-divider { height: 1px; background: rgba(255,255,255,0.07); }
.pm-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pm-tech {
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(136,85,255,0.12);
  border: 1px solid rgba(136,85,255,0.25);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--purple);
}
.pm-ref-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 8px;
}
.pm-ref {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
  line-height: 1.8;
  border-left: 2px solid rgba(68,136,255,0.25);
  padding-left: 10px;
  margin-bottom: 4px;
}

/* ── FOOTER ──────────────────────────────────────── */
#footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 40px 48px;
  text-align: center;
}
.footer-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 8px;
}
.footer-tagline { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.footer-tech { font-size: 0.78rem; color: rgba(123,130,168,0.5); font-family: var(--mono); }

/* ── COUNTER ANIMATION ───────────────────────────── */
@keyframes countUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.counter { animation: countUp 0.5s ease; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  #navbar { padding: 0 20px; }
  .nav-links { gap: 18px; font-size: 0.82rem; }
  section { padding: 70px 20px; }
  .stages-grid { grid-template-columns: 1fr; }
  .explorer-grid { grid-template-columns: 1fr; }
  .paper-grid { grid-template-columns: 1fr; }
  .mc-wide { grid-column: span 1; }
  .track-stats-overlay { position: static; margin-top: 16px; min-width: unset; }
  .hero-planet { display: none; }
  .orbit-ring { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.4rem; }
  .metrics-grid { grid-template-columns: 1fr; }
}

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0,255,204,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,255,204,0.45); }
