/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
  --bg: #F7F6F2;
  --surface: #FBFAF6;
  --surface-2: #F1EFE7;
  --border: #DCD9D0;
  --border-strong: #B8B5AB;
  --text: #1F1D17;
  --muted: #6B6A65;
  --faint: #A9A8A2;
  --primary: #01696F;
  --primary-hover: #0C4E54;
  --primary-tint: rgba(1, 105, 111, 0.08);
  --success: #437A22;
  --warn: #964219;
  --error: #A12C7B;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(31,29,23,0.04);
  --shadow: 0 4px 20px rgba(31,29,23,0.06);
  --measure: 62ch;
  --nav-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130F;
    --surface: #1A1916;
    --surface-2: #23221E;
    --border: #33322D;
    --border-strong: #55534C;
    --text: #E8E6DD;
    --muted: #999790;
    --faint: #62615C;
    --primary: #4F98A3;
    --primary-hover: #6EB4BF;
    --primary-tint: rgba(79, 152, 163, 0.14);
  }
}

body { background: var(--bg); color: var(--text); }

/* ── Navigation ────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 40px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.02em; font-size: 18px;
  color: var(--text);
}
.logo svg { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: clamp(12px, 3vw, 32px); font-size: 14px; }
.nav-links a { color: var(--muted); transition: color 120ms ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a[href="#status"] {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; background: var(--surface);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.dot.ok { background: var(--success); box-shadow: 0 0 0 4px rgba(67,122,34,0.15); }
.dot.bad { background: var(--error); }

/* ── Hero ──────────────────────────────────────────────────────────── */
main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }

.hero {
  padding: clamp(64px, 10vw, 128px) 0 clamp(56px, 8vw, 96px);
  max-width: 900px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary);
  padding: 6px 12px; border: 1px solid var(--primary); border-radius: 999px;
  margin-bottom: 32px;
}
.hero h1 {
  font-size: clamp(38px, 6.5vw, 72px);
  line-height: 1.05;
  margin-bottom: 24px;
}
.hero h1 em { font-style: italic; color: var(--primary); font-weight: 500; }
.lede {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 40px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 64px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 8px; font-size: 15px; font-weight: 500;
  transition: all 140ms ease; border: 1px solid transparent;
  min-height: 44px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--text); background: var(--surface); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(20px, 3vw, 40px);
  padding-top: 32px; border-top: 1px solid var(--border);
}
.stats > div { }
.stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.stats dd { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats .stat-note { font-size: 12px; color: var(--faint); font-weight: 400; margin-top: 4px; letter-spacing: 0; }

/* ── Sections ──────────────────────────────────────────────────────── */
.section {
  padding: clamp(64px, 8vw, 96px) 0;
  border-top: 1px solid var(--border);
}
.section h2 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 16px;
  max-width: 720px;
}
.section-lede { font-size: 17px; color: var(--muted); max-width: 640px; margin-bottom: 48px; }

/* Steps */
.steps {
  list-style: none;
  display: grid; grid-template-columns: 1fr; gap: 32px;
  counter-reset: none;
}
.steps li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.steps li:first-child { border-top: none; padding-top: 0; }
.step-n {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  padding-top: 4px;
}
.steps h3 { font-size: 20px; margin-bottom: 8px; }
.steps p { color: var(--muted); max-width: var(--measure); }

/* API live block */
.api-live {
  background: #1F1D17; color: #E8E6DD;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 48px;
  box-shadow: var(--shadow);
}
.api-live-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  background: #14130F;
  border-bottom: 1px solid #33322D;
  font-size: 13px; color: #999790;
}
.api-live-header code {
  margin-left: auto;
  color: #62615C;
  font-size: 12px;
}
.ping {
  width: 8px; height: 8px; border-radius: 50%;
  background: #62615C;
  transition: background 200ms;
}
.ping.live { background: #6DAA45; box-shadow: 0 0 0 4px rgba(109,170,69,0.2); }
.api-live-body {
  padding: 20px;
  font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  min-height: 84px;
}

/* Endpoints */
.endpoints { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 32px; }
.endpoint-group h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 12px; font-weight: 500;
}
.endpoint {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  align-items: center;
  font-size: 14px;
}
.endpoint:last-child { border-bottom: 1px solid var(--border); }
.method {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--primary);
  font-size: 12px;
}
.endpoint code { color: var(--text); font-size: 13px; }
.endpoint .desc { color: var(--muted); font-size: 12px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card h4 { font-size: 15px; margin-bottom: 8px; color: var(--primary); font-weight: 600; }
.card p { color: var(--muted); font-size: 14px; }

/* Pilot */
.pilot { text-align: left; }
.pilot .section-lede { margin-bottom: 32px; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px clamp(20px, 4vw, 40px) 32px;
  margin-top: 96px;
  background: var(--surface);
}
.footer-grid {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-tag { color: var(--muted); font-size: 14px; margin-top: 12px; }
.footer-logo { margin-bottom: 4px; }
.footer h5 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 16px; font-weight: 500; }
.footer a { display: block; padding: 4px 0; color: var(--text); font-size: 14px; }
.footer a:hover { color: var(--primary); }
.footer-note { max-width: 1180px; margin: 24px auto 0; color: var(--faint); font-size: 12px; }

/* ── Mobile refinements ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links a:not([href="#status"]) { display: none; }
  .hero { padding-top: 48px; }
  .steps li { grid-template-columns: 1fr; gap: 8px; }
  .step-n { padding-top: 0; }
}
