:root {
  --bg: #0b1020;
  --bg-elev: #111733;
  --bg-card: #131a36;
  --border: #1f2a4d;
  --border-strong: #2a3766;
  --text: #e6e9f5;
  --text-dim: #9aa3c7;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --accent-glow: rgba(125, 211, 252, 0.18);
  --code-bg: #0a0f1f;
  --max: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfcff;
    --bg-elev: #ffffff;
    --bg-card: #ffffff;
    --border: #e3e8f3;
    --border-strong: #c9d2e6;
    --text: #0f1733;
    --text-dim: #4b5478;
    --accent: #0ea5e9;
    --accent-strong: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.12);
    --code-bg: #0f172a;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

code, pre {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.92em;
}

/* ---------- nav ---------- */
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark,
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border-strong);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14.5px;
}
.nav-links a {
  color: var(--text-dim);
}
.nav-links a:hover { color: var(--text); }
.nav-github {
  color: var(--text) !important;
  font-weight: 500;
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-github) { display: none; }
}

/* ---------- hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 24px 60px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 40px 24px auto 24px;
  height: 360px;
  background:
    radial-gradient(600px 200px at 20% 30%, var(--accent-glow), transparent 70%),
    radial-gradient(500px 180px at 80% 60%, var(--accent-glow), transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.hero-inner { max-width: 820px; }

.badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.badge-shield { display: inline-flex; align-items: center; line-height: 0; }
.badge-shield img { display: block; height: 22px; }

.title {
  font-size: clamp(36px, 5.5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 22px;
}
.title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.title em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: linear-gradient(to right, var(--accent), transparent);
  opacity: 0.7;
}

.subtitle {
  font-size: 18px;
  color: var(--text-dim);
  margin: 0 0 36px;
  max-width: 620px;
}

/* terminal block */
.terminal {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.6);
  margin-bottom: 32px;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.dot-r { background: #ef4444; }
.dot-y { background: #eab308; }
.dot-g { background: #22c55e; }
.terminal-title {
  margin-left: 12px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.terminal-body {
  margin: 0;
  padding: 18px 20px;
  color: #e6e9f5;
  overflow-x: auto;
  white-space: pre;
  width: 100%;
  min-width: 0;
}
.terminal-body .prompt,
.code .prompt { color: var(--accent); user-select: none; margin-right: 8px; }
.terminal-body .flag,
.code .flag   { color: #fbbf24; }
.code .comment { color: var(--text-dim); }
.code .key     { color: var(--accent); }

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #0a0f1f;
}
.btn-primary:hover { background: var(--accent-strong); color: #0a0f1f; }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-elev); color: var(--text); }

/* ---------- sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 24px;
}
.section-head { margin-bottom: 40px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.section h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.muted { color: var(--text-dim); font-weight: 500; }

/* ---------- compare diagrams ---------- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) {
  .compare { grid-template-columns: 1fr; }
}
.compare-card {
  margin: 0;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.compare-card.highlight {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px var(--accent-glow) inset;
}
.compare-card figcaption h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}
.compare-card figcaption p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
}
.diagram {
  width: 100%;
  height: auto;
  max-height: 220px;
}
.diagram-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  fill: #f1f5f9;
  font-weight: 600;
}
.peer-nodes circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
  animation: pulse 2.6s ease-in-out infinite;
}
.peer-nodes circle:nth-child(2) { animation-delay: 0.4s; }
.peer-nodes circle:nth-child(3) { animation-delay: 0.8s; }
.peer-nodes circle:nth-child(4) { animation-delay: 1.2s; }
.peer-nodes circle:nth-child(5) { animation-delay: 1.6s; }
.peer-nodes circle:nth-child(6) { animation-delay: 2.0s; }
.peer-nodes circle:nth-child(7) { animation-delay: 1.0s; }
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 0 var(--accent-glow)); }
  50%      { filter: drop-shadow(0 0 6px var(--accent)); }
}
@media (prefers-reduced-motion: reduce) {
  .peer-nodes circle { animation: none; }
}

/* ---------- in-production stats ---------- */
.lead {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 720px;
  margin: -20px 0 36px;
}
.proof-head {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.stat-num {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(32px, 4.8vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat-unit {
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}
.stat-label {
  color: var(--text-dim);
  font-size: 14.5px;
}
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 22px; }
}

/* ---------- feature grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-dim);
}
.card code,
.step-body p code {
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}

/* ---------- quick start steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.steps li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.step-body { min-width: 0; }
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.step-body p {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.code {
  margin: 0;
  padding: 14px 18px;
  background: var(--code-bg);
  color: #e6e9f5;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.footnote {
  margin-top: 30px;
  color: var(--text-dim);
  font-size: 14.5px;
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-dim);
  font-size: 14px;
}
.footer strong { color: var(--text); margin-left: 6px; }
.footer-links { display: flex; gap: 18px; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .nav {
    padding: 16px 18px;
  }
  .hero {
    padding: 48px 18px 40px;
  }
  .hero::before {
    inset: 20px 0 auto 0;
    height: 280px;
  }
  .title {
    font-size: clamp(28px, 7.2vw, 40px);
    line-height: 1.12;
  }
  .title br { display: none; }
  .subtitle {
    font-size: 16px;
    margin-bottom: 28px;
  }
  .terminal-body,
  .code {
    font-size: 13px;
    padding: 14px 16px;
  }
  .cta { gap: 10px; }
  .btn {
    padding: 11px 18px;
    font-size: 14.5px;
  }

  .section {
    padding: 56px 18px;
  }
  .section-head { margin-bottom: 28px; }

  .compare-card { padding: 22px; }
  .card { padding: 20px; }

  .steps li {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
  }
  .step-num {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 18px;
  }
}

@media (max-width: 420px) {
  .nav-links { gap: 14px; }
  .badges { margin-bottom: 20px; }
  .badge { font-size: 11.5px; padding: 3px 8px; }
  .terminal-bar { padding: 8px 12px; }
  .terminal-body,
  .code { font-size: 12px; }
  .compare-card figcaption h3 { font-size: 16px; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
}
