/* Original article components, retrieved 2026-09-29. See README.md. */

/* Inter self-hosted for the apparatus voice; the prose serif is the
   reference's book stack (Iowan Old Style, with Charter/Georgia fallbacks). */
@font-face { font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap;
  src:url(assets/inter-latin.woff2) format('woff2'); }


/* ---------------------------------------------------------------
   1. Tokens — geometry and the ink ramp
   --------------------------------------------------------------- */
:root {
  --content-max: 660px;
  --sidenote-width: 230px;
  --sidenote-gap: 64px;
  --toc-width: 210px;
  --toc-gap: 34px;
  --site-header-height: 8px;

  --bg: #ffffff;
  --bg_code: #f3f3f2;
  --fg: #282828;
  --fg1: #3c3836;
  --fg2: #504945;
  --fg3: #6b6866;
  --fg4: #676767;
  --fg5: #969696;
  --red: #AD2111;
  --rule: rgba(103, 103, 103, 0.20);

  /* Validated ordinal green ramp (light -> dark), one hue, monotone lightness.
     Checked with the dataviz validator in --ordinal mode: all checks pass. */
  --g1: #6bb883;
  --g2: #37944f;
  --g3: #1c7038;
  --g4: #104a28;

  --font-serif: 'Iowan Old Style', 'Iowan Old Style BT', Charter, 'Bitstream Charter', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Menlo, Consolas, monospace;
}

@media (min-width: 1400px) { :root { --sidenote-width: 240px; } }
@media (min-width: 1600px) { :root { --sidenote-width: 250px; } }
@media (min-width: 1800px) { :root { --sidenote-width: 275px; } }

* { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--site-header-height) + 1rem);
  -webkit-text-size-adjust: 100%;
}
html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------
   2. Links — ink coloured, the underline is the affordance
   --------------------------------------------------------------- */
a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--fg4) 30%, transparent);
}
a:hover {
  color: #000;
  text-decoration-color: color-mix(in srgb, var(--fg4) 70%, transparent);
}

/* ---------------------------------------------------------------
   3. Site chrome
   --------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 21px;
  font-family: var(--font-sans);
}
.site-header .wordmark {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(11.5px, 2.6vw, 17px);
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--fg4);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 12px;
  transition: color .2s ease-in-out;
}
.site-header .wordmark:hover { color: var(--fg1); }
.site-nav { display: flex; align-items: center; flex-shrink: 0; gap: 28px; }
.site-nav a {
  display: inline-block;
  font-size: clamp(13px, 3vw, 15px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--fg1);
  text-decoration: none;
  padding-block: 14px;
  transition: color .2s ease-in-out;
}
.site-nav a:hover { color: var(--fg); }

@media (max-width: 379px) {
  .site-header { flex-direction: column; align-items: center; gap: 2px; }
  .site-nav { gap: 24px; }
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 20px 32px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg4);
  letter-spacing: 0.12em;
}

/* ---------------------------------------------------------------
   4. Title block
   --------------------------------------------------------------- */
.post-heading {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px 0;
  text-align: center;
}
.post-title {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 auto 20px;
  max-width: 710px;
  text-wrap: balance;
}
.publish-metadata {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 40px;
}
.publish-metadata .author { color: var(--fg1); }
.publish-metadata .date { color: var(--fg4); }

.cover {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}
.cover-frame { width: 100%; aspect-ratio: 980 / 460; }

/* The live cover: the homepage murmuration in its own palette (ink,
   cobalt, violet, gold), orbiting one still figure. Four glyph layers
   stack inside the frame; the script fills them. */
.cover-flock {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}
.cover-flock pre {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
  white-space: pre;
  text-align: left;
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 15px;
  user-select: none;
}

/* ---------------------------------------------------------------
   5. The three-column shell — only the centre holds prose
   --------------------------------------------------------------- */
#main.post { counter-reset: sidenote-counter figure-counter; }

.post-content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--content-max)) minmax(0, 1fr);
  align-items: start;
  max-width: 1030px;
  margin: 0 auto;
  padding: 64px 32px 40px;
}
.post-content-shell > article.content {
  grid-column: 2;
  max-width: var(--content-max);
  position: relative;
  overflow: visible;
}

article.content > p { margin: 0 0 1.45rem; }

/* ---------------------------------------------------------------
   6. Headings — hierarchy by style, not a wall of bold
   --------------------------------------------------------------- */
article.content h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 1.6em 0 0.6em;
}
article.content h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  margin: 1.4em 0 0.5em;
}
.heading-anchor {
  font-family: var(--font-serif);
  color: var(--fg4);
  opacity: 0;
  text-decoration: none;
  padding-left: 0.4em;
  transition: opacity 120ms ease;
}
h2:hover .heading-anchor, h3:hover .heading-anchor { opacity: 0.65; }

/* ---------------------------------------------------------------
   7. The abstract — the only italic block on the page
   --------------------------------------------------------------- */
.epigraph {
  margin: 0 0 2rem;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--rule);
  font-style: italic;
  color: var(--fg1);
}
.epigraph p { margin: 0; }
.epigraph strong { font-style: normal; font-weight: 600; }

/* ---------------------------------------------------------------
   8. Sidenotes — numbered by CSS, toggled by a checkbox, zero JS
   --------------------------------------------------------------- */
.sidenote-number {
  counter-increment: sidenote-counter;
  position: relative;
  cursor: default;
}
.margin-toggle { display: none; }

.sidenote {
  float: right;
  clear: right;
  width: var(--sidenote-width);
  margin-right: calc(-1 * var(--sidenote-width) - var(--sidenote-gap));
  margin-left: var(--sidenote-gap);
  margin-bottom: 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--fg2);
  position: relative;
  text-indent: 0;
}
.sidenote-number::after,
.sidenote::before {
  content: counter(sidenote-counter);
  font-family: var(--font-serif);
  font-size: 0.8rem;
  position: relative;
  top: -0.5rem;
  color: var(--fg4);
}
.sidenote::before { padding-right: 0.35em; }

/* ---------------------------------------------------------------
   9. Figures — auto-numbered, captions below in the sans voice
   --------------------------------------------------------------- */
article.content figure {
  counter-increment: figure-counter;
  margin: 1.8rem 0;
  padding: 0;
}
article.content figcaption {
  margin-top: 13px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg3);
  text-align: left;
}
article.content figcaption::before {
  content: "Figure " counter(figure-counter) ": ";
  font-weight: 500;
  color: var(--fg2);
}
/* The frame wraps the figure's *content* only — never the caption, which
   belongs outside it in the apparatus voice. */
.figure-frame {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 22px 24px;
}

/* --- charts: no card, no shadow, one hairline baseline --- */
.chart { font-family: var(--font-sans); }
.chart-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg2);
  margin-bottom: 18px;
}
.chart-title .chart-source { font-weight: 400; color: var(--fg4); }
.bar-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.bar-label { font-size: 13px; color: var(--fg2); text-align: right; }
.bar-track { display: flex; align-items: center; gap: 10px; }
.bar { height: 22px; border-radius: 3px; }
.bar-value { font-size: 13px; color: var(--fg3); font-variant-numeric: tabular-nums; }
.chart-baseline {
  margin-left: 132px;
  border-top: 1px solid var(--rule);
  padding-top: 6px;
  font-size: 12px;
  /* --fg5 is the styleguide's rule/inactive colour (~2.8:1 on white); this is
     real text, so it takes --fg4 (5.7:1) and clears WCAG AA. */
  color: var(--fg4);
}

/* --- the loop diagram ---------------------------------------------
   Nodes are boxes; connectors are lines with arrowheads. The two must
   not read at the same weight, or the figure looks like five boxes.
   ------------------------------------------------------------------ */
.loop { font-family: var(--font-sans); }
.loop-flow {
  display: flex;
  align-items: center;
  justify-content: center;
}
.loop-node {
  border: 1px solid color-mix(in srgb, var(--fg4) 35%, transparent);
  border-radius: 3px;
  padding: 11px 18px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--fg);
  background: var(--bg);
  white-space: nowrap;
  flex: 0 0 auto;
}
.loop-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 88px;
  min-width: 76px;
}
.loop-link-label {
  font-size: 11px;
  line-height: 1.3;
  color: var(--fg4);
  text-align: center;
}
.loop-link-line {
  position: relative;
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--fg4) 40%, transparent);
}
.loop-link-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3.5px;
  border-left: 5px solid color-mix(in srgb, var(--fg4) 50%, transparent);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

/* the return path: a rule running back leftward, labelled on the line.
   Flex keeps the label and both line segments on one axis whatever the
   surrounding font metrics are — the old raised-inline-block trick
   drifted off the rule when inherited sizes changed. */
.loop-return {
  display: flex;
  align-items: center;
  margin-top: 30px;
}
.loop-return-line {
  position: relative;
  flex: 1 1 24px;
  min-width: 18px;
  border-top: 1px solid color-mix(in srgb, var(--fg4) 40%, transparent);
}
.loop-return-arrow::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -3.5px;
  border-right: 5px solid color-mix(in srgb, var(--fg4) 50%, transparent);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}
.loop-return-text {
  flex: 0 1 auto;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fg4);
  text-align: center;
}

/* --- transcript: speaker in the sans voice, words in the serif ------
   Separate conversations are separate scenes. Running them together
   reads as one exchange, which it isn't.
   ------------------------------------------------------------------ */
.transcript { display: flex; flex-direction: column; }
.scene { display: flex; flex-direction: column; gap: 14px; }
.scene + .scene {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.scene-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg4);
}
.turn {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}
.turn-speaker {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
  color: var(--fg4);
  text-align: right;
}
.turn-words { font-size: 16px; line-height: 1.55; color: var(--fg); margin: 0; }
.turn-words .beat { color: var(--fg4); font-style: italic; }
/* the assistant speaks a shade lighter than the member — the member's
   words are the ones that matter */
.turn-assistant .turn-words { color: var(--fg2); }

.model-formula {
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
  text-align: center;
  margin: 1.6rem 0 0.6rem;
}
.model-key {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg4);
  text-align: center;
  margin: 0 0 1.8rem;
}

.model-formula sup { font-size: 0.58em; }

/* ---------------------------------------------------------------
   10. Lists, quotes, code
   --------------------------------------------------------------- */
article.content ul { padding-left: 1.2em; margin: 0 0 1.45rem; }
article.content li { margin-bottom: 0.5rem; }
article.content li::marker { content: "▪  "; color: var(--fg4); }
article.content blockquote:not(.epigraph) {
  margin: 1.45rem 0;
  padding-left: 16px;
  border-left: 2px solid var(--rule);
  color: var(--fg2);
}
code { font-family: var(--font-mono); font-variant-ligatures: none; }
article.content pre {
  background: var(--bg_code);
  border-radius: 0.45rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 0 0 24px;
}
article.content pre code { font-size: 13px; line-height: 1.5; white-space: pre; color: var(--fg2); }
p code { font-size: 0.9em; color: var(--red); }

/* ---------------------------------------------------------------
   11. Table of contents — a courtesy, never a layout constraint
   --------------------------------------------------------------- */
.left-toc {
  grid-column: 1;
  justify-self: end;
  width: var(--toc-width);
  padding-right: var(--toc-gap);
  position: sticky;
  top: calc(var(--site-header-height) + 2rem);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
}
.left-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.left-toc li { display: flex; gap: 7px; align-items: baseline; }
.left-toc a { text-decoration: none; }

/* ---------------------------------------------------------------
   12. End matter
   --------------------------------------------------------------- */
.paginator {
  max-width: 1030px;
  margin: 0 auto;
  padding: 0 32px 72px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
}
.paginator a { color: var(--fg4); text-decoration: none; }
.paginator a:hover { color: var(--fg); }

/* ---------------------------------------------------------------
   13. Below 1280px the margins collapse — the paper becomes
       a single column and sidenotes tap to expand.
   --------------------------------------------------------------- */
@media (max-width: 1279px) {
  .left-toc { display: none; }
  .post-content-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 40px 24px 32px;
    max-width: calc(var(--content-max) + 48px);
  }
  .post-content-shell > article.content { grid-column: 1; }

  .sidenote {
    display: none;
    float: none;
    width: 100%;
    margin: 1rem 0 1.4rem;
    padding: 14px 16px;
    background: var(--bg_code);
    border-radius: 3px;
  }
  .margin-toggle:checked + .sidenote { display: block; }
  .sidenote-number { cursor: pointer; pointer-events: auto; }
  .sidenote-number::after { text-decoration: underline; text-underline-offset: 2px; }
}

@media (max-width: 640px) {
  .post-heading { padding: 36px 20px 0; }
  .post-title { font-size: 25px; }
  .site-header { padding: 0 20px; }
  .site-nav { gap: 24px; }
  .post-content-shell { padding: 32px 20px 24px; }
  .bar-row { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
  .chart-baseline { margin-left: 102px; }
  .model-formula { font-size: 19px; }
  .turn { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .turn-speaker { text-align: left; }

  /* the flow turns vertical: connectors become downward arrows */
  .loop-flow { flex-direction: column; align-items: stretch; }
  .loop-node { white-space: normal; text-align: center; }
  .loop-link { flex-direction: column-reverse; gap: 4px; padding: 8px 0; min-width: 0; }
  .loop-link-line { width: 0; height: 20px; border-top: 0; border-left: 1px solid color-mix(in srgb, var(--fg4) 40%, transparent); align-self: center; }
  .loop-link-line::after {
    right: auto; top: auto;
    left: -3.5px; bottom: -1px;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 5px solid color-mix(in srgb, var(--fg4) 50%, transparent);
    border-bottom: 0;
  }
  .loop-return { margin-top: 24px; }
  .paginator { padding: 0 20px 48px; flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ---------------------------------------------------------------
   Standalone additions. In the component build these three things
   came from framework state; here they are plain CSS + one class.
   --------------------------------------------------------------- */
/* hover for mice, focus-within for keyboards — the JS version had no
   keyboard path at all, so this is strictly better */
.posts-wrap:hover .posts-menu,
.left-toc a { color: var(--fg4); }
.left-toc li.is-active a { color: var(--fg); font-weight: 600; }

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

