/* 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; }
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;
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* 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; gap: var(--sp-5); }
.site-header nav a { color: var(--ink); line-height: 18px; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--accent); }

/* 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;
}
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); }
.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 with a hairline frame; header and caption inside */
figure.viz { margin: var(--sp-9) 0; }
.stamp { background: var(--ground); border: 0.6px solid var(--ink); 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: 11.5px;
  line-height: 1.6; color: var(--ink);
}
.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 */
.brand-row {
  max-width: var(--column); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-6);
  padding: 0 var(--sp-5) var(--sp-6);
}
.brand-row--links { justify-content: flex-end; padding-top: var(--sp-2); }
.brand-row nav { display: flex; align-items: baseline; gap: var(--sp-5); }
.brand-row nav a.txt { color: var(--ink); line-height: 1; }
.brand-row nav a.ico { display: inline-flex; align-items: baseline; color: var(--ink); }
.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 ink scrollbars inside the explorer */
.explorer * { scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.explorer ::-webkit-scrollbar { width: 8px; height: 8px; }
.explorer ::-webkit-scrollbar-track { background: transparent; }
.explorer ::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 0; }
.explorer ::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .brand-row { flex-direction: column; align-items: flex-start; }
  /* header stays one row on phones: smaller wordmark, links up top */
  .site-header { gap: var(--sp-4); }
  .site-header .wordmark { font-size: 1.6rem; }
  .stamp { padding: var(--sp-4) var(--sp-4) var(--sp-3); margin-left: -20px; margin-right: -20px; }
}
