/* Shared by the site's pages: colors, type, header, buttons, figures and footer.
   Rules that only one page uses stay in that page's own <style>. */
:root {
  --page: #fbfbfa;
  --ink: #16181d;
  --ink-muted: #545a66;
  --rule: #dcdde0;
  --accent: #0b5cad;
  --plate: #070b14;

  --font-heading: "Source Serif 4", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, monospace;

  --measure: 68ch;
  --figure-width: 1120px;
  --radius: 6px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4.5rem;
}
/* Dark mode is the posters' look, not just inverted colors: warm near-black under a fine grain,
   Jost capitals for headings, serif reading text, and figures that sit straight on the page. */
@media (prefers-color-scheme: dark) {
  :root {
    --page: #141413;
    --ink: #e8e8e8;
    --ink-muted: #b3b3ad;
    --rule: #34342f;
    --accent: #62cde8;
    --plate: #141413;
    --font-display: "Jost", "Futura", system-ui, sans-serif;
    --font-reading: "Source Serif 4", Georgia, serif;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='2.6' intercept='-0.9'/%3E%3CfeFuncG type='linear' slope='2.6' intercept='-0.9'/%3E%3CfeFuncB type='linear' slope='2.6' intercept='-0.9'/%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link { position: absolute; left: var(--space-2); top: -3rem; padding: var(--space-1) var(--space-2); background: var(--ink); color: var(--page); z-index: 1; }
.skip-link:focus { top: var(--space-2); }

.page { max-width: calc(var(--figure-width) + 2 * var(--space-2)); margin-inline: auto; padding-inline: var(--space-2); }
.page :is(h1, h2, p, ol, pre) { max-width: var(--measure); }

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .page { display: flex; align-items: baseline; gap: var(--space-3); padding-block: var(--space-2); }
.wordmark { font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; gap: var(--space-3); margin-left: auto; font-size: 0.9375rem; }
.site-nav a { color: var(--ink-muted); text-decoration: none; padding-block: 0.6rem; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

h1, h2 { font-family: var(--font-heading); font-weight: 600; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); margin: var(--space-5) 0 var(--space-3); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin: 0 0 var(--space-2); }
p { margin: 0 0 var(--space-2); text-wrap: pretty; }
.lede { font-size: 1.25rem; line-height: 1.5; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 var(--space-5); }
.button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.15rem;
  border-radius: var(--radius); border: 1px solid var(--ink); color: var(--ink);
  font-weight: 600; text-decoration: none; transition: background-color 150ms ease-out;
}
.button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.button.primary { background: var(--ink); color: var(--page); }
.button.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--page)); }

figure { margin: var(--space-4) 0; }
.plate { background: var(--plate); border-radius: var(--radius); overflow: hidden; position: relative; }
figcaption { max-width: var(--measure); margin-top: var(--space-1); font-size: 0.9375rem; color: var(--ink-muted); }
figcaption b { color: var(--ink); font-weight: 600; }

section { padding-block: var(--space-5) var(--space-3); border-top: 1px solid var(--rule); }

.data { font-family: var(--font-data); font-size: 0.95em; font-variant-numeric: tabular-nums; }

.site-footer { border-top: 1px solid var(--rule); padding-block: var(--space-4) var(--space-5); color: var(--ink-muted); font-size: 0.9375rem; }
.site-footer p { margin-bottom: var(--space-1); }

@media (max-width: 560px) {
  .site-header .page { flex-wrap: wrap; row-gap: 0; }
  /* Five links don't fit on one line at 320 px, so they wrap whole. */
  .site-nav { margin-left: 0; flex-wrap: wrap; column-gap: var(--space-2); row-gap: 0; }
  .site-nav a { white-space: nowrap; }
  .lede { font-size: 1.125rem; }
}
/* Dark mode rules, after the base rules so they win. */
@media (prefers-color-scheme: dark) {
  /* The posters' grain, behind the content so text and figures stay clean. It never takes a click. */
  body::after {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: var(--grain); mix-blend-mode: overlay;
  }
  .page :is(p, ol):not(.setup-prompt-toast) { font-family: var(--font-reading); font-size: 1.1875rem; line-height: 1.55; }
  h1, h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
  /* The posters set Jost at 90 % width. */
  h2 { transform: scaleX(0.9); transform-origin: left; }
  h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); line-height: 1; }
  .button.primary { background: var(--ink); color: #111110; border-color: var(--ink); }
  .plate { border-radius: 0; overflow: visible; background: none; }
  figcaption { font-family: var(--font-body); }
  .page .data { font-family: var(--font-data); }
}
@media (prefers-color-scheme: dark) and (prefers-contrast: more), (forced-colors: active), print {
  body::after { display: none; }
}
