/* Tiling patterns design tokens. Fonts are the same cuts as Aperiodic (SIL OFL), trimmed by
   scripts/fonts.mjs into public/fonts: Newsreader for names and headings, IBM Plex Mono for
   notation. Newsreader is fixed at one weight a file (400 upright and italic; 500 for the
   wordmark's letters only), its optical size left to the browser; the italic keeps only the
   characters in src/lib/fonts.mjs (ITALIC_CHARS), and its unicode-range says so. */
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader-latin.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212, U+2215, U+221A, U+221E, U+2248, U+2260, U+2264-2265, U+22A5, U+25A0-25FF, U+2600-27BF, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader-ext.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-036F, U+1D00-1DBF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader-500.woff2) format("woff2"); font-style: normal; font-weight: 500; font-display: swap; unicode-range: U+0020, U+0061-007A; }
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader-italic-latin.woff2) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; unicode-range: U+0020-007E, U+00A0, U+00B0, U+00B2-00B3, U+00B7, U+00C0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2026, U+2074, U+2076; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plex-mono-latin.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212, U+2215, U+221A, U+221E, U+2248, U+2260, U+2264-2265, U+22A5, U+25A0-25FF, U+2600-27BF, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plex-mono-ext.woff2) format("woff2"); font-style: normal; font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-036F, U+1D00-1DBF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light dark;
  --bg: #F4F1EA; --ink: #1B1A17; --soft: #4A4843; --muted: #6F6C65; --line: #E1DDD4; --line-2: #C9C4B9;
  --card: #FAF8F3; --surface: rgb(27 26 23 / 0.055); --accent: #D9472B; --accent-text: #B83A22;
  --serif: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
  /* the one weight past 400: the wordmark, which is the logo and not emphasis */
  --fw-mark: 500;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 88px); --measure: 1840px;
  /* what a read page's puzzles, lists and tables run to inside that measure (the header and footer keep the full one) */
  --measure-read: 1240px;
  /* the colour tilings are drawn in: ink softened halfway to the paper (light and dark alike) */
  --hair: color-mix(in srgb, var(--ink) 55%, var(--bg));

  /* ---- the design system: the few values everything is made of (DESIGN.md; a test keeps
     site.css to them) ---- */
  /* type: mono for labels and controls, serif for everything read */
  --fs-label: 11px;                         /* mono labels, captions, specs */
  --fs-small: 12px;                         /* mono in controls */
  --fs-ui: 15px;                            /* serif in controls and item names */
  --fs-body: 16px;                          /* serif text */
  --fs-lead: clamp(16px, 1.3vw, 18px);      /* serif lead: a product's name, the hero's line */
  --fs-title: 27px;                         /* a pane's title (the editor's) */
  --fs-heading: clamp(22px, 2.1vw, 28px);   /* section headings, a tiling's note */
  --fs-name: clamp(30px, 3.4vw, 52px);      /* a tiling's name, a step under the cover: the pattern leads */
  --fs-display: clamp(36px, 5vw, 76px);     /* the cover's title (and the 404's) */
  /* shape: square, as plates and rules are; only points are round */
  --r: 0;
  --r-dot: 50%;
  /* size: one control height (a compact one for small inline buttons), two colour wells, three icons */
  --h-control: 30px; --h-compact: 24px;
  --well: 28px; --well-sm: 22px;
  --icon: 16px; --icon-inline: 13px; --icon-tiny: 11px;
  /* the editor's pictures: the style's swatch by its title, a row's map of where its tiles are */
  --swatch: 56px; --map-w: 48px; --map-h: 32px;
  /* space: gaps, paddings and margins come from this scale (the page's own rhythm uses clamps) */
  --space-1: 2px; --space-2: 4px; --space-3: 6px; --space-4: 8px; --space-5: 12px; --space-6: 16px; --space-7: 24px; --space-8: 32px;
  --space-9: 48px; --space-10: 64px;
  /* the band round a plate where its crop marks sit */
  --mark: 11px;
  /* lift: what rises on hover (pictures; the gallery's plates, larger) */
  --lift: -2px; --lift-shadow: 0 8px 16px -12px rgb(0 0 0 / .35);
  --lift-lg: -4px; --lift-shadow-lg: 0 22px 36px -24px rgb(0 0 0 / .45);
  /* motion: state changes, panels and entrances, the playful flourishes */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 180ms; --dur-slow: 320ms; --dur-play: 600ms;
  /* focus: one ring everywhere */
  --focus: 2px solid var(--accent);
  /* things in the scenes and the shelf's drawings, the same in light and dark: a screen's bezel,
     a stand's metal, a frame's wood, printed paper, the rainbow of "any colour" */
  --device: #161514; --device-edge: #45423E; --device-metal: #2B2926; --device-shine: #3A3733; --device-glass: #0B0B0B;
  --frame: #2B2926; --frame-edge: #121110;
  --print-paper: #F6F4EE; --print-lines: #8A8780;
  --spectrum: conic-gradient(#E0452B, #F2C14E, #00A95C, #0078BF, #8A6F9E, #E0452B);
}
/* Dark follows the system, unless the reader picked light or dark with the switch in the header
   (kept in localStorage, set on <html data-theme> before the page is painted). The two dark
   blocks below are the same colours: keep them in step. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121110; --ink: #ECE8E0; --soft: #C6C1B7; --muted: #959189; --line: #272624; --line-2: #3B3936;
    --card: #1A1917; --surface: rgb(236 232 224 / 0.07); --accent: #F0704F; --accent-text: #F28E72;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
    --bg: #121110; --ink: #ECE8E0; --soft: #C6C1B7; --muted: #959189; --line: #272624; --line-2: #3B3936;
    --card: #1A1917; --surface: rgb(236 232 224 / 0.07); --accent: #F0704F; --accent-text: #F28E72;
}
:root[data-theme="light"] { color-scheme: light; }
