/* Tokens, page shell, header, prose, figures, chips, signature row. Loaded by every page;
   home.css, post.css, and pages.css add per-layout rules. */

:root {
  /* spacing scale, 4px base; margins, paddings, and gaps use these tokens
     (enforced by etc/check-spacing.sh) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-9: 40px; --sp-10: 48px;
  --sp-11: 56px; --sp-12: 64px;
  --font-sans: 'Geist', -apple-system, 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-wordmark: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  /* Just Be Nice palette */
  --paper: #FFFFFF;         /* the page */
  --ground: #D9EEFC;        /* figure and box interiors */
  --ink: #1A1A1A;           /* text, axes, frames */
  --brand: #1F5FBF;         /* the anchor blue: logo mark, squares, favicon, social card (etc/brand.py renders those) */
  --accent: #DC3A00;        /* the anchor warm colour: links, link chips, the current section, the figures' second ink */
  --accent-press: #BE1100;
  --brand-press: #174A96;
  /* data inks, in pick order; the JS figures read these at run time */
  --cyan: var(--brand);     /* first data ink and figure furniture */
  --orange: var(--accent);  /* second series: the testing, adversarial, or unverified side */
  --plum: #B0446E;
  --olive: #C9A800;
  --green: #008936;
  --pink: #F9A8C0;          /* rose petal inks that live outside the chart pick order */
  --yellow: #FFD400;
  --chip-bg: var(--accent); /* label chips */
  --chip-ink: var(--paper);
  --column: 840px;
}
* { box-sizing: border-box; }
/* every page reserves the scrollbar's gutter, whether or not it scrolls: with always-on scrollbars
   (a Mac with a mouse, Windows, Linux) a long page was 15px narrower than a short one, and the
   header's Blog and Careers, the centred column, and everything else moved between pages
   (2026-09-29; etc/check_header.py checks it) */
html { scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.6;   /* 24px line */
  -webkit-font-smoothing: antialiased;
  /* header, main, signature row stack to at least the viewport, so the row is at the foot */
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }   /* a flex item's auto margins need a width to centre on */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* focus on the accent chips: an ink outline, so it reads against both the chip and the page */
.readmore:focus-visible, .eyebrow .chip:focus-visible, .bar-label:focus-visible { outline-color: var(--ink); }
/* no motion for people who asked for none (the explorer's panel and loading bars included) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* mono microlabel: chips, navigation, figure furniture */
.site-header nav a, .brand-row nav a.txt, .eyebrow, .eyebrow .chip, .readmore .bar-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
}

/* header on every page: full page width, wordmark left, nav right */
.site-header {
  width: 100%; padding: var(--sp-6) var(--sp-6) 0;
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-6);
}
.site-header nav { display: flex; align-items: center; gap: var(--sp-5); }   /* the chip is taller than a link; centre everything on one line */
.site-header nav a { color: var(--ink); line-height: 18px; padding: var(--sp-1) 0; margin: calc(-1 * var(--sp-1)) 0; }   /* a 26px hit box on an 18px line, without moving it */
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--accent); }
/* header labels a size up from the other microlabels (12px at the same 600; Geist Mono ships no
   heavier cut, and the site never synthesizes bold) */
.site-header nav a { font-size: 12px; }
/* the header menu: a details/summary pair; the open panel is a ground block hung under its
   label (blocks of colour, no outline, per the spec), its links on the same mono microlabel */
.site-header nav .nav-menu { position: relative; }
.site-header nav summary {
  list-style: none; cursor: pointer; color: var(--ink); line-height: 18px;
  padding: var(--sp-1) 0; margin: calc(-1 * var(--sp-1)) 0;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.site-header nav summary::-webkit-details-marker { display: none; }
.site-header nav summary::after { content: '\25BE'; margin-left: var(--sp-1); }   /* the caret sits a hair off the word, not a full mono cell away */
.site-header nav .nav-menu[open] summary::after { content: '\25B4'; }
.site-header nav summary:hover, .site-header nav .nav-menu[open] summary, .site-header nav summary[aria-current] { color: var(--accent); }
.site-header nav .menu {
  position: absolute; left: calc(-1 * var(--sp-5)); top: calc(100% + var(--sp-3)); z-index: 5;
  min-width: 240px; margin: 0; padding: var(--sp-4) var(--sp-5); list-style: none;
  background: var(--ground); display: flex; flex-direction: column; gap: var(--sp-3);
}
.site-header nav .menu li { margin: 0; }
.site-header nav .menu a { white-space: nowrap; }
/* the one chip in the header: Talk to us, a solid accent block with paper text */
.site-header nav .nav-chip { background: var(--chip-bg); color: var(--chip-ink); padding: var(--sp-2) var(--sp-4); margin: 0; line-height: 1; }
.site-header nav .nav-chip:hover { background: var(--accent-press); color: var(--chip-ink); }
.site-header nav .nav-chip:focus-visible { outline-color: var(--ink); }
/* the phone nav is hidden until the phone breakpoint below */
.site-header .nav-phone { display: none; }

/* wordmark lockup: the mark sits on the baseline at half the cap height of the T */
.wordmark, .brand-row .logo {
  font-family: var(--font-wordmark); font-weight: 700; font-size: 2rem; line-height: 1;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: baseline; letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--brand); }
.wordmark .qed, .brand-row .logo .qed { display: block; height: 0.225em; width: 0.225em; margin-left: 0.09em; flex-shrink: 0; }   /* spacing-exempt: scales with the wordmark */

/* article shell */
.article { max-width: var(--column); margin: 0 auto; padding: var(--sp-10) var(--sp-5) 0; }
.eyebrow { font-size: 11px; letter-spacing: 0.1em; color: var(--ink); margin-bottom: var(--sp-4); }
.eyebrow .chip {
  /* label chip: not clickable, ink block */
  display: inline-block; padding: var(--sp-2) var(--sp-4); margin-right: var(--sp-3);
  background: var(--chip-bg); color: var(--chip-ink); line-height: 1;
}
/* standalone eyebrow (blog and careers index, where the chip is alone on its line): the chip
   carries the bar-chip's 1.5px accent line to the column edge; the chip stays a label */
.eyebrow--bar { display: flex; align-items: center; }
.eyebrow--bar .chip { margin-right: 0; }
.eyebrow--bar::after { content: ''; flex: 1; height: 1.5px; background: var(--accent); }
h1 {
  font-family: var(--font-sans); font-size: 2.1rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); margin: 0 0 var(--sp-4);
}
h2 {
  font-family: var(--font-sans); font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.015em; color: var(--ink); margin: var(--sp-10) 0 var(--sp-3);
}
h3 {
  font-family: var(--font-sans); font-size: 1.15rem; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink); margin: var(--sp-8) 0 var(--sp-3);
}
h4 {
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 700;
  color: var(--ink); margin: var(--sp-6) 0 var(--sp-2);
}
p { margin: 0 0 var(--sp-5); }
em { font-style: italic; }
strong { font-weight: 600; color: var(--ink); }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-press); }
/* links inside ground-filled boxes: the accent on the ground is 3.78:1 (fails AA), so they take
   the pressed accent (5.4:1). Zero-specificity :where() so any classed link rule (explorer's
   cyan .github-link, .entry__title a) still wins. */
:where(.stamp, .cite-as-box, .post-figure, .entry) a { color: var(--accent-press); }
:where(.stamp, .cite-as-box, .post-figure, .entry) a:hover { color: var(--ink); }
.eqn { text-align: center; margin: var(--sp-5) 0; font-size: 1.05em; }
ol.env { padding-left: 1.3em; margin: 0 0 var(--sp-5); }
ol.env li { margin-bottom: var(--sp-3); }

/* statement square after the home sentence */
.dot {
  display: inline-block; width: 0.255em; height: 0.255em;
  background: var(--brand); overflow: hidden; color: transparent;
  margin-left: 0.14em; vertical-align: baseline;   /* spacing-exempt: scales with the sentence */
}
/* end-square after the last paragraph */
.prose-end::after {
  content: ''; display: inline-block; width: 0.55em; height: 0.55em;
  background: var(--brand); margin-left: 0.35em; vertical-align: baseline;   /* spacing-exempt: scales with the line */
  position: relative; top: -0.05em;
}

/* table of contents; post.css lays out the list */
.toc { margin: var(--sp-8) 0 var(--sp-3); }
.toc a { font-family: var(--font-sans); font-size: 14.5px; font-weight: 500; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* figures: a ground block, no frame; header and caption inside */
figure.viz { margin: var(--sp-9) 0; }
.stamp { background: var(--ground); padding: var(--sp-4) var(--sp-6) var(--sp-4); }
.stamp__header {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: var(--sp-4);
}
.stamp__caption {
  margin-top: var(--sp-4); font-family: var(--font-mono); font-size: 13px;   /* 2026-09-29: up from 11.5px, which read small under the figures */
  line-height: 1.6; color: var(--ink);
}
.stamp__caption .caption-note { color: var(--ink); text-decoration: none; vertical-align: super; font-size: 0.85em; }   /* an asterisk to the appendix */
.stamp .svg-embed svg { width: 100%; height: auto; display: block; }
.stamp .svg-embed svg text, .stamp .plotly-container svg text { font-family: var(--font-mono); letter-spacing: 0.04em; }
.stamp .plotly-container { display: block; overflow: visible; }
.stamp .plotly-container g.annotation rect.bg,
.stamp .plotly-container .legend > rect.bg { filter: none; }
.stamp .explorer--figure { background: transparent; border: 0; padding: var(--sp-3) var(--sp-3) var(--sp-3); }
.stamp .explorer--figure .graph-hint { display: none; }

/* bar-chip: a link chip with a line to the column edge */
.readmore { display: flex; align-items: center; margin: 0 0 var(--sp-10); text-decoration: none; }
.readmore .bar-label {
  display: inline-block; padding: var(--sp-2) var(--sp-4);
  background: var(--accent); color: var(--paper); white-space: nowrap; flex-shrink: 0;
}
.readmore .bar-line { flex: 1; height: 1.5px; background: var(--accent); }
.readmore:hover .bar-label { background: var(--accent-press); }

/* signature row: the page's foot, on the header's frame (same side padding, so its right edge
   is the navigation's), pushed to the bottom of the viewport on short pages */
.brand-row {
  width: 100%; margin-top: auto;
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-6);
  padding: var(--sp-10) var(--sp-6) var(--sp-6);
}
.brand-row--links { justify-content: flex-end; }
.brand-row nav { display: flex; align-items: baseline; gap: var(--sp-5); }
.brand-row nav a.txt { color: var(--ink); line-height: 1; padding: var(--sp-2) 0; margin: calc(-1 * var(--sp-2)) 0; }   /* the same for the foot: the hit box, not the layout, grows */
.brand-row nav a.ico { display: inline-flex; align-items: baseline; color: var(--ink); padding: var(--sp-1); margin: calc(-1 * var(--sp-1)); }
.brand-row nav a.ico svg { display: block; position: relative; top: 3px; width: 18px; height: 18px; }
.brand-row nav a:hover { color: var(--accent); }

/* code never synthesizes bold: Geist Mono ships 400 and 600 only */
code, pre, .stamp__header { font-synthesis: none; }
h1 code, h2 code, h3 code, h4 code, .entry__title code { font-weight: 600; }

/* thin scrollbars inside the explorer, only where something overflows (the list, the panel, a
   code block). No ::-webkit-scrollbar rules: those turn the overlay scrollbar into a permanent
   8px ink bar on macOS. */
.explorer * { scrollbar-width: thin; scrollbar-color: color-mix(in oklab, var(--ink) 45%, transparent) transparent; }

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .brand-row { flex-direction: column; align-items: flex-end; }
  /* header stays one row on phones: smaller wordmark, links up top */
  .site-header { gap: var(--sp-4); }
  .site-header .wordmark { font-size: 1.6rem; }
  /* the row stays one line: the inline nav hides and the phone nav shows: the chip, then a two-bar
     icon that opens a full-screen sheet of grouped links under the row (the row stays on top; the
     bars cross into a close mark) */
  .site-header nav { display: none; }
  .site-header nav.nav-phone { display: flex; gap: var(--sp-4); }
  .site-header .wordmark, .site-header .nav-phone > .nav-chip, .site-header .nav-phone summary { position: relative; z-index: 21; }
  .site-header .nav-phone summary { display: flex; padding: var(--sp-2); margin: calc(-1 * var(--sp-2)); }   /* a 40px hit box on the 24px icon */
  .site-header .nav-phone summary::after, .site-header .nav-phone .nav-menu[open] summary::after { content: none; }
  .site-header .nav-phone .burger { display: block; width: 24px; height: 24px; }
  .site-header .nav-phone .burger path { transform-box: view-box; transform-origin: 12px 12px; transition: transform 160ms ease-out; }
  /* each bar slides to the middle, then turns about the icon's centre, so the cross is symmetrical */
  .site-header .nav-phone .nav-menu[open] .burger .b1 { transform: rotate(45deg) translateY(3.5px); }
  .site-header .nav-phone .nav-menu[open] .burger .b2 { transform: rotate(-45deg) translateY(-3.5px); }
  .site-header .nav-phone .menu {
    position: fixed; inset: 0; z-index: 20; min-width: 0; overflow-y: auto; background: var(--paper);
    padding: calc(var(--sp-12) + var(--sp-8)) var(--sp-6) var(--sp-8); gap: var(--sp-8);
  }
  .site-header .nav-phone .menu__group { display: flex; flex-direction: column; gap: var(--sp-1); }
  .site-header .nav-phone .menu__label {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    color: color-mix(in oklab, var(--ink) 60%, var(--paper)); margin-bottom: var(--sp-3);   /* the ink, lighter: one colour in the sheet, two tones */
  }
  .site-header .nav-phone .menu a {
    font-family: var(--font-sans); font-size: 1.6rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
    text-transform: none; padding: var(--sp-2) 0; margin: 0;
  }
  .site-header .nav-phone .menu a, .site-header .nav-phone .menu a:hover, .site-header .nav-phone .menu a[aria-current] { color: var(--ink); }   /* no accent in the sheet */
  body:has(.site-header .nav-phone .nav-menu[open]) { overflow: hidden; }
  .stamp { padding: var(--sp-4) var(--sp-4) var(--sp-3); margin-left: -20px; margin-right: -20px; }
}
