/*
 * Documentation stylesheet.
 *
 * Tokens copied from frontend/src/globals.css :root and public/landing.html —
 * a visitor walking landing → docs → app should not feel three products. Keep
 * in sync when that palette moves.
 *
 * Served under a `style-src 'self' https://fonts.googleapis.com` CSP, so
 * every rule lives here: no inline style="" attributes anywhere in the docs,
 * or the browser drops them silently.
 */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.6%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --border: 0 0% 89.8%;
  --primary: 210 100% 40%;
  --surface-subtle: 210 40% 98%;
  --warn-bg: 45 100% 96%;
  --warn-border: 45 90% 70%;
  --radius-sm: 6px;
  --radius-md: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 16px;
}

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Chrome ─────────────────────────────────────────────────────────── */

.topbar {
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: hsl(var(--primary));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.topbar-spacer { flex: 1; }

.topbar a.plain { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

nav.sidebar {
  position: sticky;
  top: 72px;
  font-size: 0.9375rem;
}

nav.sidebar h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  font-weight: 700;
  margin: 22px 0 8px;
}

nav.sidebar h2:first-child { margin-top: 0; }

nav.sidebar ul { list-style: none; }
nav.sidebar li { margin: 2px 0; }

nav.sidebar a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: hsl(var(--foreground));
}

nav.sidebar a:hover { background: hsl(var(--muted)); text-decoration: none; }

nav.sidebar a[aria-current='page'] {
  background: hsl(var(--surface-subtle));
  color: hsl(var(--primary));
  font-weight: 600;
}

/* ── Content ────────────────────────────────────────────────────────── */

main { max-width: 760px; }

main h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}

main .lede {
  font-size: 1.0625rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 32px;
}

main h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 8px;
}

main h3 { font-size: 1.0625rem; font-weight: 700; margin: 26px 0 8px; }

main p, main ul, main ol, main table, main pre, main .note { margin-bottom: 16px; }

main ul, main ol { padding-left: 22px; }
main li { margin-bottom: 6px; }

code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: hsl(var(--muted));
  padding: 1px 5px;
  border-radius: 4px;
}

pre {
  background: hsl(var(--surface-subtle));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.55;
}

pre code { background: none; padding: 0; font-size: inherit; }

table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }

th, td {
  border: 1px solid hsl(var(--border));
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

th { background: hsl(var(--surface-subtle)); font-weight: 700; }

.note {
  border-left: 3px solid hsl(var(--primary));
  background: hsl(var(--surface-subtle));
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.note.warn {
  border-left-color: hsl(var(--warn-border));
  background: hsl(var(--warn-bg));
}

.note p:last-child { margin-bottom: 0; }

.note strong { font-weight: 700; }

/* Card grid for the index page */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card p { margin: 0; font-size: 0.9375rem; color: hsl(var(--muted-foreground)); }

footer.docs-footer {
  border-top: 1px solid hsl(var(--border));
  margin-top: 56px;
  padding-top: 20px;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  nav.sidebar { position: static; }
  main h1 { font-size: 1.625rem; }
}
