:root {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --text: #0d1420;
  --muted: #4a5668;
  --line: #d9e0eb;
  --accent: #2a6df4;
  --accent-soft: rgba(42, 109, 244, 0.16);
  --terminal: #0b1020;
  --good: #4ee2a8;
}

:root[data-theme='dark'] {
  --bg: #070b14;
  --bg-elev: #0f1628;
  --text: #e8eef9;
  --muted: #a1adc2;
  --line: #25314a;
  --accent: #7ca5ff;
  --accent-soft: rgba(124, 165, 255, 0.2);
  --terminal: #05080f;
  --good: #61f8ba;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system;
  background: radial-gradient(circle at 20% -10%, var(--accent-soft), transparent 35%), var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.grid-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.18;
  animation: gridMotion 16s linear infinite;
}

.noise::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.04), transparent 40%);
  background-size: 4px 4px;
  mix-blend-mode: overlay;
  opacity: 0.16;
  animation: noiseShimmer 5s steps(10) infinite;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  z-index: 40;
}
.nav-link { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav-link:hover, .nav-active { color: var(--text); }
.brand { letter-spacing: .16em; font-weight: 700; font-size: .82rem; }
.btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  padding: .58rem .92rem;
  border-radius: .7rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 8px 30px var(--accent-soft); }

.panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 1rem; }
.muted { color: var(--muted); }
.section { padding: 4.5rem 0; }
.section-title { font-size: clamp(1.6rem, 2.6vw, 2.6rem); line-height: 1.12; margin: 0; }
.section-eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }

.hero-title {
  font-size: clamp(2.2rem, 6vw, 5rem);
  letter-spacing: -0.03em;
  line-height: .95;
  margin: .45rem 0 1rem;
}
.editorial-underline {
  background: linear-gradient(90deg, var(--accent), transparent);
  height: 2px;
  width: 0;
  animation: underlineGrow 1.1s ease forwards;
}

.code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #0b1220;
  color: #d7e4ff;
  border: 1px solid #1d2a41;
  border-radius: .8rem;
  padding: 1rem;
  overflow: auto;
  white-space: pre;
}
.code .kw { color: #8ab4ff; }
.code .fn { color: #88f0ff; }
.code .str { color: #8ef7be; }
.code .num { color: #ffc48f; }

.terminal {
  background: var(--terminal);
  color: #d6e1ff;
  border: 1px solid #1b2642;
  border-radius: .9rem;
  position: relative;
  overflow: hidden;
}
.terminal::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.04), rgba(255,255,255,.04) 1px, transparent 1px, transparent 3px);
  opacity: .18;
  animation: scanlines 6s linear infinite;
}

.reveal { opacity: 0; transform: translateY(18px); transition: .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.metric-table td { border-bottom: 1px solid var(--line); padding: .65rem; }
.metric-table tr:last-child td { border-bottom: none; }

.compare-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 960px) { .compare-grid { grid-template-columns: 1fr 1fr; } }

.docs-shell { display:grid; grid-template-columns: 250px 1fr; gap:1.2rem; }
@media (min-width: 1200px) { .docs-shell { grid-template-columns: 250px 1fr 220px; } }
@media (max-width: 1023px) { .docs-shell { grid-template-columns: 1fr; } }

.footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0 3rem; }

@keyframes gridMotion { from { background-position: 0 0, 0 0;} to { background-position: 34px 34px, -34px -34px;} }
@keyframes noiseShimmer { 0% {opacity: .12;} 50% {opacity:.22;} 100% {opacity:.12;} }
@keyframes scanlines { from { transform: translateY(0);} to { transform: translateY(8px);} }
@keyframes underlineGrow { to { width: 100%; } }
@keyframes typing { from { width:0;} to { width:100%; } }
@keyframes collapseLines { 0% {height: 140px;} 100% {height: 72px;} }
@keyframes gradientDrift { 0% {background-position: 0 0;} 100% {background-position: 120% 0;} }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
