/* Shared look of every page. Ink on paper, one rubric red; Newsreader (self-hosted, headings only), the system sans for text,
   the system mono for small labels and figures. Rules instead of boxes; one left edge for header, content and footer.
   The model page keeps only its demo rules inline. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-560.woff2") format("woff2");
  font-weight: 560; font-style: normal; font-display: swap;
}

:root {
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --paper: #f6f5f1;
  --ink: #141414;
  --muted: #5d5e64;
  --block: #141414;            /* the ink block of buttons and the demo, dark in both themes */
  --on-block: #f6f5f1;
  --mark: #e5462f;             /* red on the ink block (3:1 or more) */
  --rule: #dcd8ce;
  --accent: #b3261e;          /* rubric red */
  --on-accent: #ffffff;
  --accent-soft: rgba(179, 38, 30, .09);
  --hover: rgba(20, 20, 20, .035);
  --press: rgba(20, 20, 20, .07);
  --field: rgba(179, 38, 30, .035);

  --warn-bg: #fbefd9;
  --warn-ink: #7a4306;
  --warn-line: #efd7ab;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --dur-s: .2s;
  --dur-m: .45s;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c0c0e;
    --ink: #ecebe6;
    --muted: #8f9097;
    --rule: #28282d;
    --accent: #ff6b57;
    --block: #1d1d21;
    --on-block: #ecebe6;
    --mark: #ff6b57;
    --on-accent: #0c0c0e;
    --accent-soft: rgba(255, 107, 87, .13);
    --hover: rgba(255, 255, 255, .04);
    --press: rgba(255, 255, 255, .08);
    --field: rgba(255, 107, 87, .06);
    --warn-bg: #2b2010;
    --warn-ink: #f0b862;
    --warn-line: #473416;
    color-scheme: dark;
  }
}

@media (prefers-reduced-motion: reduce) { :root { --dur-s: .01ms; --dur-m: .01ms; } }

/* ---------- Page ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-synthesis: none; overflow-x: clip;
}
button, textarea { font: inherit; color: inherit; }
p { margin: 0; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw { white-space: nowrap; }

/* One width for everything; reading text is held to a measure inside it */
.wrap { width: min(calc(100% - 40px), 1120px); margin-left: auto; margin-right: auto; }
main { flex: 1 0 auto; width: 100%; }

/* ---------- Header: the wordmark and one link, on a baseline ---------- */
.site-head { border-bottom: 1px solid var(--ink); padding-top: env(safe-area-inset-top); }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 23px 0; }
.brand { color: var(--ink); text-decoration: none; }
.brand svg { display: inline-block; height: 21px; width: auto; vertical-align: baseline; }
.brand:hover { color: var(--ink); }
.site-head nav { display: flex; gap: 0 24px; }
.site-head nav a { font: 13px/1 var(--mono); letter-spacing: .02em; color: var(--muted); text-decoration: none; padding: 14px 0; margin: -14px 0; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }

/* ---------- Footer ---------- */
.site-foot { margin-top: 96px; border-top: 1px solid var(--ink); padding-bottom: env(safe-area-inset-bottom); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 32px; padding: 20px 0 44px; font: 12.5px/1.6 var(--mono); color: var(--muted); }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 0 20px; margin: -12px 0; }
.site-foot .links a { padding: 12px 0; }

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; font-weight: 560; text-wrap: balance; }
h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(42px, 7vw, 88px); line-height: 1.0; letter-spacing: -.022em; }
h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
h3 { font-size: 17px; line-height: 1.4; }
.lede { margin-top: 26px; max-width: 34em; font-size: 20px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.label { margin: 0 0 14px; font: 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.note { font: 12.5px/1.5 var(--mono); color: var(--muted); }
.label + h1 { margin-top: 22px; }

/* ---------- The button: an ink block with a red arrow ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 26px 0 22px;
  background: var(--block); color: var(--on-block); text-decoration: none;
  font-size: 17px; font-weight: 600; letter-spacing: -.005em;
}
.btn:hover { color: var(--on-block); background: color-mix(in srgb, var(--block) 86%, var(--mark)); }
.btn .arr { flex: none; color: var(--mark); }
.tri { flex: none; width: 0; height: 0; border-left: 12px solid var(--mark); border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; }

/* ---------- Sections ---------- */
.sec { margin-top: 64px; padding-top: 30px; border-top: 1px solid var(--rule); max-width: 760px; }
.sec > h2 { margin-bottom: 16px; }
.sec > p { margin: 0 0 14px; max-width: 62ch; text-wrap: pretty; }
.sec > p:last-child { margin-bottom: 0; }
.sec ul { margin: 0; padding-left: 1.15em; }
.sec > ul, .fold-body { max-width: 62ch; }
.sec li + li { margin-top: 6px; }
.small { font-size: 14px; line-height: 1.5; color: var(--muted); }
.sec > .small { margin-top: 16px; }

/* ---------- Figures: big serif numbers, mono labels ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--rule); max-width: 760px; }
.stats > div { display: flex; flex-direction: column; }
.stats dd { order: 1; margin: 0; font: 560 40px/1.05 var(--serif); letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.stats dt { order: 2; margin-top: 6px; font: 12px/1.4 var(--mono); color: var(--muted); }
@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .stats dd { font-size: 34px; }
}

/* ---------- Specs: a mono label and its value ---------- */
.specs { margin: 0; font-size: 16px; line-height: 1.5; border-top: 1px solid var(--rule); }
.specs > div { display: grid; grid-template-columns: minmax(0, 28%) minmax(0, 1fr); align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.specs dt { font: 12px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; }
@media (max-width: 480px) { .specs > div { grid-template-columns: 1fr; gap: 2px; } }

/* groups with a mono label on the left (the "does not do" list) */
.groups { border-top: 1px solid var(--rule); }
.groups > div { display: grid; grid-template-columns: minmax(0, 28%) minmax(0, 1fr); align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.groups h3 { font: 12px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.groups ul { font-size: 16px; }
@media (max-width: 480px) { .groups > div { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Disclosures (native <details>) ---------- */
.folds { border-top: 1px solid var(--rule); }
.sec > .folds { margin-top: 18px; }
/* the next section's rule closes a list that ends a section: one hairline, not two */
.sec:not(:last-child) > .folds > .fold:last-child, .sec:not(:last-child) > .groups > div:last-child { border-bottom: 0; }
.fold { border-bottom: 1px solid var(--rule); }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; font-size: 16px; font-weight: 600; line-height: 1.4; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fold .chev { flex: none; color: var(--muted); transition: transform var(--dur-s) var(--ease); }
.fold[open] > summary .chev { transform: rotate(180deg); }
.fold-body { padding: 0 0 18px; font-size: 16px; line-height: 1.55; }
.fold-body p { margin: 0 0 10px; }
.fold-body > :last-child { margin-bottom: 0; }
.fold-body ul { margin: 0; padding-left: 1.15em; }
.fold-body li + li { margin-top: 6px; }

/* ---------- Print ---------- */
@media print {
  body { min-height: 0; display: block; }
  .site-head nav, .sr { display: none !important; }
  .fold .chev { display: none; }
  details::details-content { content-visibility: visible; }
}
