/* The guides are static pages, so they carry a small copy of the app's tokens (web/theme.css) and its
   self-hosted fonts: Newsreader and Instrument Sans, both under the SIL Open Font License 1.1 (copied
   from @fontsource). Warm paper, brown-black ink, one book-cloth red accent. Borders only, 2px and
   4px corners, no shadows. Diagrams use the same tokens, so they follow the theme. */

@font-face { font-family: "Newsreader"; font-weight: 500; font-display: swap; src: url("fonts/newsreader-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 600; font-display: swap; src: url("fonts/newsreader-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #f2ede3;
  --surface: #f9f6ef;
  --surface-2: #e7e0d2;
  --line: #d8d0c0;
  --line-strong: #b9ae9a;
  --ink: #1f1a16;
  --ink-2: #4a423a;
  --ink-3: #665c51;
  --accent: #7e2a22;
  --accent-hover: #66211b;
  --accent-ink: #fbf7f0;
  --accent-soft: #efdcd5;
  --paper: #f6efdc;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
  font: 16px/1.6 var(--font-text);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120f;
    --surface: #1e1915;
    --surface-2: #28221d;
    --line: #342c25;
    --line-strong: #4d433a;
    --ink: #efe8dd;
    --ink-2: #c0b6a9;
    --ink-3: #9d9285;
    --accent: #e08a76;
    --accent-hover: #eba08e;
    --accent-ink: #16120f;
    --accent-soft: #3a231e;
    --paper: #28221d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 2px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.brand-mark svg { width: 16px; height: 16px; }
.spacer { flex: 1; }
.button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 2px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.button.quiet { background: transparent; border-color: transparent; color: var(--ink); font-weight: 500; }
.button.quiet:hover { background: var(--surface-2); color: var(--ink); }

main { max-width: 760px; margin: 0 auto; padding: 48px 16px 72px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.01em; margin: 8px 0 18px; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.2; margin: 44px 0 10px; }
h3 { font-size: 16px; margin: 24px 0 6px; }
p, li { color: var(--ink-2); }
li { margin: 4px 0; }
.lede { font-size: 18px; color: var(--ink); }
code, .mono { font-family: var(--font-mono); font-size: 0.88em; overflow-wrap: anywhere; }
kbd { font-family: var(--font-text); font-size: 0.9em; padding: 0 4px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--surface); color: var(--ink); white-space: nowrap; }
.path { font-weight: 600; color: var(--ink); }

/* Numbered steps: the number sits in the margin like a printer's mark. */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 16px 0 24px; border-top: 2px solid var(--ink); }
ol.steps > li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 0 8px; padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
ol.steps > li::before { content: counter(step); font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--accent); line-height: 1.3; }
ol.steps > li > * { grid-column: 2; margin: 0; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0 8px; }
caption { text-align: left; font-size: 13px; color: var(--ink-3); padding-bottom: 6px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13px; color: var(--ink-3); border-bottom: 2px solid var(--ink); font-weight: 600; }
td.num, th.num { font-variant-numeric: tabular-nums; }
.source { font-size: 13.5px; color: var(--ink-3); }

figure { margin: 24px 0; }
figure svg { display: block; width: 100%; height: auto; max-width: 640px; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.diagram-page { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.5; }
.diagram-text-block { fill: var(--surface-2); }
.diagram-gutter { fill: var(--accent-soft); }
.diagram-line { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.diagram-spine { stroke: var(--ink); stroke-width: 2; }
.diagram-label { fill: var(--ink); font: 600 13px var(--font-text); }
.diagram-note { fill: var(--ink-3); font: 12px var(--font-text); }

.try { margin: 44px 0 0; padding: 20px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); }
.try h2 { margin-top: 0; font-size: 21px; }
.try p { margin: 0 0 14px; }

.guide-list { list-style: none; padding: 0; margin: 20px 0; border-top: 2px solid var(--ink); }
.guide-list li { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.guide-list a { font-family: var(--font-display); font-weight: 600; font-size: 20px; text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list p { margin: 4px 0 0; font-size: 15px; }
.more { margin-top: 36px; font-size: 15px; }

.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 20px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.footer a { color: var(--ink-2); }

@media (max-width: 480px) {
  .topbar { gap: 4px; }
  .button.quiet { padding: 0 8px; font-size: 15px; }
}
.button { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
