/*
 * styles.css — the whole site's presentation.
 *
 * The palette is the product's: `#101F2F` is `DEFAULT_THEME.ink`, the app icon's
 * own navy, which also colours the sidebar header and the heading of every PDF.
 * Kept in step by eye rather than by a test — unlike the sidebar's copy of it,
 * which `shell.test.js` asserts, because that one can silently disagree with a
 * document a driver is handed.
 *
 * System fonts only. The privacy policy says the product fetches nothing from a
 * third party, and a web font on the page making that claim would be a small
 * lie in a document whose whole value is being literally true.
 */

:root {
  --ink: #101f2f;
  --body: #26333f;
  --muted: #5b6a78;
  --accent: #1668c4;
  --line: #dfe5ea;
  --bg: #ffffff;
  --wash: #f6f8fa;
  --warn-bg: #fff6e0;
  --warn-ink: #7a5300;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eaf0f6;
    --body: #c3cfda;
    --muted: #8d9dac;
    --accent: #6fb2ff;
    --line: #23303d;
    --bg: #0d1620;
    --wash: #131f2b;
    --warn-bg: #2e2410;
    --warn-ink: #f0cd7d;
  }
}

* { box-sizing: border-box; }

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

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

a { color: var(--accent); }
a:hover { text-decoration: none; }

/* ── the draft banner ────────────────────────────────────────────────────── */

.draft {
  margin: 0;
  padding: 10px 20px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

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

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 62rem;
  margin: 0 auto;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand svg { width: 28px; height: 28px; display: block; }

.site-nav { display: flex; gap: 20px; flex-wrap: wrap; }

.site-nav a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

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

/* ── layout ──────────────────────────────────────────────────────────────── */

main {
  max-width: 62rem;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

main.has-toc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 62rem) {
  main.has-toc {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
  }
  .toc { position: sticky; top: 32px; order: -1; }
}

.prose { min-width: 0; max-width: var(--measure); }

/* ── contents ────────────────────────────────────────────────────────────── */

.toc {
  padding: 16px 18px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}

.toc-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: 6px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }

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

.prose h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 2.4rem 0 0.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 1.8rem 0 0.4rem;
  color: var(--ink);
  font-size: 1.06rem;
}

.prose h4 { margin: 1.4rem 0 0.3rem; color: var(--ink); font-size: 0.97rem; }

.prose > h1 + p { color: var(--muted); font-size: 1.05rem; }

.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }

.prose li + li { margin-top: 0.35rem; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose hr {
  margin: 2.4rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code {
  padding: 0.12em 0.34em;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.prose blockquote {
  margin: 0 0 1rem;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

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

/* ── tables ──────────────────────────────────────────────────────────────── */

/* Wide tables scroll inside their own box. The body must never scroll
 * sideways — the privacy policy has a three-column table and phones are where
 * these get read. */
.table-wrap {
  margin: 0 0 1.4rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--wash);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr + tr td { border-top: 1px solid var(--line); }

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

.site-foot {
  max-width: 62rem;
  margin: 0 auto;
  padding: 26px 20px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-foot p { margin: 0 0 6px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }

/* ── the home page's one flourish ────────────────────────────────────────── */

.prose > h1:first-child + p + hr + h2 { border-top: 0; padding-top: 0; }
