:root {
  --bg: #07090e;
  --bg-dark: #040508;
  --panel: #0d121d;
  --panel-border: #1a233a;
  --panel-hover: #141c2e;
  --accent: #00e5ff;
  --accent-glow: rgba(0, 229, 255, 0.25);
  --emerald: #00ff88;
  --purple: #c084fc;
  --purple-glow: rgba(192, 132, 252, 0.25);
  --text: #f1f5f9;
  --text-dim: #64748b;
  --text-muted: #94a3b8;
  --font-main: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glows */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.glow-1 { top: -10%; left: 20%; width: 500px; height: 500px; background: var(--accent); }
.glow-2 { top: 40%; right: -10%; width: 600px; height: 600px; background: var(--purple); }
.glow-3 { bottom: 10%; left: -10%; width: 500px; height: 500px; background: var(--emerald); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--panel-border);
  z-index: 100;
  padding: 14px 0;
}
.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.brand-icon {
  font-size: 24px;
}
.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  display: block;
  color: var(--accent);
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  display: block;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover {
  background: #33ebff;
  box-shadow: 0 0 32px rgba(0, 229, 255, 0.45);
  transform: translateY(-2px);
}
.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
}
.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: var(--accent);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
  justify-content: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.badge-accent {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.3);
}
.badge-purple {
  background: rgba(192, 132, 252, 0.1);
  color: var(--purple);
  border: 1px solid rgba(192, 132, 252, 0.3);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Hero */
.hero {
  padding: 100px 0 60px;
  text-align: center;
}
.hero-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

/* Telemetry Bar */
.telemetry-bar {
  display: flex;
  justify-content: space-around;
  background: rgba(13, 18, 29, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 18px;
  max-width: 960px;
  margin: 0 auto;
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
  gap: 16px;
}
.ticker-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ticker-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ticker-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

/* Sections */
.section {
  padding: 90px 0;
}
.section-dark {
  background: var(--bg-dark);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}
.section-header {
  margin-bottom: 48px;
}
.section-header.text-center {
  text-align: center;
}
.section-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}
.section-sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* Grids */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.25s;
}
.card-glow:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(0, 229, 255, 0.15);
  transform: translateY(-4px);
}
.card-icon {
  font-size: 32px;
  margin-bottom: 16px;
}
.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}
.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Simulator Grid */
.sim-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .sim-grid { grid-template-columns: 1fr; }
}
.canvas-container {
  background: #020305;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.canvas-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0a0e17;
  border-bottom: 1px solid var(--panel-border);
  font-size: 11px;
  font-family: var(--font-mono);
}
canvas {
  width: 100%;
  height: 380px;
  background: #020305;
  cursor: crosshair;
}
.canvas-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0a0e17;
  border-top: 1px solid var(--panel-border);
  font-size: 12px;
  font-family: var(--font-mono);
}

.sim-controls {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sim-controls h3 {
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.control-group label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-select, .form-range {
  background: #030407;
  border: 1px solid var(--panel-border);
  color: #fff;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.slider-val {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--purple);
  margin-bottom: 4px;
}
.checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

/* Binary Box */
.binary-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto 36px;
}
.binary-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}
.binary-cell {
  padding: 16px 20px;
  font-size: 14px;
}
.label-cell {
  background: #090d15;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #fff;
  border-right: 1px solid var(--panel-border);
}
.desc-cell {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
}
.tag-cyan { background: rgba(0,229,255,0.15); color: var(--accent); }
.tag-emerald { background: rgba(0,255,136,0.15); color: var(--emerald); }
.tag-purple { background: rgba(192,132,252,0.15); color: var(--purple); }

.formula-card {
  background: #0a0e17;
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 12px;
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.formula-card h3 {
  font-size: 15px;
  color: var(--purple);
  margin-bottom: 12px;
}
.math-block {
  font-family: var(--font-mono);
  font-size: 16px;
  background: #020305;
  padding: 14px;
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 12px;
  border: 1px solid var(--panel-border);
}
.formula-caption {
  font-size: 13px;
  color: var(--text-dim);
}

/* Quickstart */
.quickstart-box {
  max-width: 800px;
  margin: 0 auto 36px;
  background: #030407;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0a0e17;
  border-bottom: 1px solid var(--panel-border);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}
pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #cbd5e1;
}
.code-inline {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

.step-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 20px;
}
.step-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.step-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #fff;
}
.step-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--panel-border);
  padding: 40px 0;
  background: #030407;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

.text-cyan { color: var(--accent); }
.text-emerald { color: var(--emerald); }
.text-purple { color: var(--purple); }
.text-dim { color: var(--text-dim); }
