/* Self-contained: no CDN, no web fonts, no analytics. The privacy policy promises no tracking,
   so the page that says so must not load any. */

:root {
  --bg: #ffffff;
  --fg: #1f2330;
  --muted: #5b6272;
  --rule: #e4e7ee;
  --accent: #4f46e5; /* the app icon's indigo */
  --accent-fg: #ffffff;
  --code-bg: #f4f5f8;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --fg: #e7e9f0;
    --muted: #a0a7b8;
    --rule: #2b2f3a;
    --accent: #8b85f0;
    --accent-fg: #14161c;
    --code-bg: #1e2129;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  padding: 0 1.25rem;
}

main, header.site, footer.site {
  max-width: var(--measure);
  margin-inline: auto;
}

/* ── header ─────────────────────────────────────────────────────────────── */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.brand {
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.94rem;
}

header.site nav a {
  color: var(--muted);
  text-decoration: none;
}

header.site nav a:hover { color: var(--fg); }

header.site nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

/* ── prose ──────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2.25rem 0 0.75rem;
}

h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.3rem; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
h3 { font-size: 1.06rem; }
h1 + p, h2 + p, h3 + p { margin-top: 0; }

p, ul, ol, blockquote, table { margin: 0 0 1.1rem; }

ul, ol { padding-left: 1.35rem; }
li { margin-bottom: 0.35rem; }
li > ul, li > ol { margin-top: 0.35rem; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

strong { font-weight: 650; }

em { color: var(--fg); }

blockquote {
  margin-inline: 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: break-word;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* Wide tables scroll inside their own box; the page body never scrolls sideways. */
.table-scroll, table { display: block; overflow-x: auto; }

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

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.85rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

th { font-weight: 650; white-space: nowrap; }

/* ── landing-page bits ──────────────────────────────────────────────────── */

.lede {
  font-size: 1.12rem;
  color: var(--muted);
}

.cta {
  display: inline-block;
  margin: 0.25rem 0 1.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 7px;
  font-weight: 600;
  text-decoration: none;
}

.cta:hover { filter: brightness(1.08); }

/* ── footer ─────────────────────────────────────────────────────────────── */

footer.site {
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--muted);
}

footer.site a { color: var(--muted); }
footer.site p { margin: 0 0 0.5rem; }
.fineprint { font-size: 0.82rem; }

@media (max-width: 30rem) {
  h1 { font-size: 1.55rem; }
  header.site nav { margin-left: 0; width: 100%; }
}
