:root {
  --bg: #f6f6f3;
  --card: #ffffff;
  --fg: #1c1c1a;
  --muted: #6a6a64;
  --line: #e4e4de;
  --accent: #1f7a4d;
  --accent-soft: #e3f1e9;
  --warn: #b25e09;
  --bad: #b3261e;
  --steal: #c98a2b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --card: #1c1c1a;
    --fg: #ecece8;
    --muted: #9a9a93;
    --line: #2d2d2a;
    --accent: #4cc38a;
    --accent-soft: #173326;
    --warn: #e0a043;
    --bad: #f2867e;
    --steal: #d9a54f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1040px; margin-inline: auto; padding-inline: 20px; }

.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent);
       backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 650; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nav nav { display: flex; gap: 20px; font-size: 14px; }
.nav nav a { text-decoration: none; color: var(--muted); }
.nav nav a:hover { color: var(--fg); }

.hero { padding: 72px 20px 0; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 12px; }
h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 14ch; }
.lede { color: var(--muted); font-size: 18px; max-width: 60ch; margin: 0 0 24px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
        background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.pill.down { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } html { scroll-behavior: auto; } }

section { margin-bottom: 56px; scroll-margin-top: 72px; }
h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 16px; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .05em; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card.wide { grid-column: span 3; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.big { font-size: 28px; font-weight: 650; margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 13px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .6s ease; }
.bar span.warn { background: var(--warn); }
.bar span.bad { background: var(--bad); }

#cpu-chart { width: 100%; height: 120px; display: block; margin-top: 10px; }
#cpu-chart .grid-line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
#cpu-chart .busy { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
#cpu-chart .busy-fill { fill: var(--accent); opacity: .12; }
#cpu-chart .steal { fill: none; stroke: var(--steal); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: none; }
.key.busy { background: var(--accent); }
.key.steal { background: var(--steal); }

.services { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; font-size: 15px; }
.services li { display: flex; align-items: center; gap: 8px; }
.services .s { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.services .s.active { background: var(--accent); }

.latency { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
button { font: inherit; font-weight: 600; font-size: 15px; padding: 10px 20px; border-radius: 10px; border: 0;
         background: var(--accent); color: var(--card); cursor: pointer; flex: none; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .6; cursor: progress; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.flow { list-style: none; counter-reset: step; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.flow li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
           padding: 14px 18px 14px 56px; position: relative; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.flow li::before { content: counter(step); position: absolute; left: 18px; top: 14px; width: 24px; height: 24px;
                   border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px;
                   font-weight: 700; display: grid; place-items: center; }
.flow span { color: var(--muted); overflow-wrap: anywhere; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack span { font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px;
        padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--line); }

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card.wide, .card.full-sm { grid-column: span 2; }
}
@media (max-width: 520px) {
  .wrap { padding-inline: 16px; }
  .hero { padding: 48px 16px 0; }
  .nav nav { gap: 14px; }
  .nav nav a[href="#how"] { display: none; }
  .grid { gap: 10px; }
  .card { padding: 14px 16px; }
  .big { font-size: 24px; }
  section { margin-bottom: 44px; }
  .latency { flex-direction: column; align-items: stretch; }
}
