/* ────────────────────────────────────────────────────────────────
   Sage — document pages (about, privacy, terms, support)
   These are the same tokens as public/styles.css: the indigo brand, the
   layered near-black surfaces, the 4px spacing scale and the Inter stack.
   A colour or radius that moves in the app shell moves here with it, so a
   reader who comes back from /privacy never sees a different product.
   ──────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --bg: #080b12;
  --bg-elev: #0b1019;
  --surface: #111823;
  --surface-2: #16202d;
  --surface-3: #1c2836;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f0f2f7;
  --text-2: #c2c9d6;
  --muted: #838d9f;
  --faint: #5a6373;

  --brand: #38bdf8;
  --brand-2: #6ee7b7;
  --brand-ink: #04121c;
  --brand-soft: rgba(56, 189, 248, 0.14);
  --live: #2f9e6b;
  --live-bright: #34d399;
  --danger: #f87171;

  --r1: 4px;
  --r2: 6px;
  --r3: 8px;
  --r4: 12px;
  --r5: 16px;
  --r6: 24px;
  --r-full: 999px;

  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.32);

  --topbar: 56px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

html[data-theme='light'] {
  color-scheme: light;

  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --surface-3: #e9edf4;
  --line: rgba(16, 24, 40, 0.1);
  --line-strong: rgba(16, 24, 40, 0.2);

  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;

  --brand: #0369a1;
  --brand-2: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: rgba(3, 105, 161, 0.1);
  --live: #218358;
  --live-bright: #1a7f55;
  --danger: #d92d20;

  --shadow-2: 0 8px 24px rgba(16, 24, 40, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand-soft); }

/* ── header ─────────────────────────────────────────────────────── */

.doc-top {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.doc-top-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.doc-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--r-full);
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.doc-tag {
  font: 500 11px/1 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
}

.doc-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
}

.doc-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: var(--r2);
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.doc-nav a:hover { color: var(--text); background: var(--surface-2); }

.doc-nav a[aria-current='page'] {
  color: var(--text);
  background: var(--surface-2);
  font-weight: 550;
}

/* ── page ───────────────────────────────────────────────────────── */

.doc-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

.doc-head { margin-bottom: 28px; }

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}

.doc-lede {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 62ch;
}

.doc-meta {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--faint);
}

h2 {
  margin: 36px 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h3 {
  margin: 24px 0 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { margin: 0 0 14px; color: var(--text-2); }

ul, ol { margin: 0 0 16px; padding-left: 20px; }

li { margin: 7px 0; color: var(--text-2); }

li::marker { color: var(--faint); }

strong { color: var(--text); font-weight: 600; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); text-decoration: underline; text-underline-offset: 2px; }

code {
  font: 500 0.875em/1 var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 2px 5px;
  color: var(--text);
}

/* ── blocks ─────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r5);
  padding: 18px 20px;
  margin: 22px 0;
}

.card p:last-child { margin-bottom: 0; }

.card.lead {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.q {
  margin: 22px 0 4px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 14px/1 var(--font);
  color: var(--brand-ink);
  background: var(--brand);
  border: 1px solid transparent;
  border-radius: var(--r3);
  padding: 10px 16px;
  text-decoration: none;
  transition: filter 0.15s var(--ease);
}

.btn:hover { color: var(--brand-ink); filter: brightness(1.08); text-decoration: none; }

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn.ghost:hover { background: var(--surface-2); color: var(--text); }

.doc-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.doc-foot .doc-foot-links { display: flex; gap: 16px; margin-left: auto; }

.doc-foot a { color: var(--muted); }
.doc-foot a:hover { color: var(--brand); }

@media (max-width: 620px) {
  .doc-top-inner { gap: 10px; padding: 0 16px; }
  .doc-tag { display: none; }
  .doc-nav { font-size: 13px; gap: 0; }
  .doc-nav a { padding: 7px 8px; }
  .doc-wrap { padding: 28px 16px 60px; }
  h1 { font-size: 26px; }
  .doc-foot .doc-foot-links { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
