/* ============================================================
   stevenrouk.com — ported from redesign concept 06b (Oct 2026).
   Plain Index structure, Field Notes typography, evidence media.
   Fraunces (text & display serif) + Inter (labels & UI).
   White paper, hairline rules, cobalt accent.
   ============================================================ */

/* Self-hosted (latin subset) and preloaded in SiteLayout, so text renders
   in the right face on first paint instead of swapping in late. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 600;
  font-display: fallback;
  src: url("/fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 600;
  font-display: fallback;
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: fallback;
  src: url("/fonts/inter.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --paper-deep: #f2f4f8;
  --ink: #15171c;
  --ink-soft: #545b69;
  --rule: #e2e5eb;
  --rule-strong: #8a92a3; /* ≥3:1 against --paper: functional borders/underlines */
  --accent: #2343d1;
  --accent-deep: #1a33a3;
  --scrim: rgba(15, 18, 28, 0.4);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  /* spacing scale */
  --s1: 0.5rem;
  --s2: 0.75rem;
  --s3: 1.5rem;
  --s4: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12141a;
    --paper-deep: #1b1e26;
    --ink: #eceef3;
    --ink-soft: #a3a9b6;
    --rule: #2c303a;
    --rule-strong: #6d7485; /* ≥3:1 against dark --paper */
    --accent: #8fa3ff;
    --accent-deep: #b3c0ff;
    --scrim: rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #d6defc; color: #15171c; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Anchor targets land with a little air above them. */
section[id], [id] { scroll-margin-top: 1.25rem; }

/* Skip link — visually hidden until focused. */
.skip-link {
  position: fixed;
  top: -100vh;
  left: 1rem;
  z-index: 70;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.7rem 1rem;
  border-radius: 3px;
}

.skip-link:focus { top: 1rem; }

/* ============================================================
   Index page — masthead
   ============================================================ */

main.index {
  max-width: 44rem; /* ~65ch of Fraunces at this size */
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1.25rem, 5vw, 2rem) var(--s4);
}

.masthead h1 {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  font-weight: 340;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
}

.masthead__dek {
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin: var(--s2) 0 0;
}

.masthead__meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: var(--s3) 0 0;
}

.masthead__rule {
  border: 0;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  height: 3px;
  margin: var(--s3) 0 0;
}

nav.toc {
  margin: var(--s2) 0 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

nav.toc a {
  display: inline-block;
  padding: 0.72rem 0.15rem; /* 44px-class touch targets */
  text-decoration: none;
  color: var(--ink-soft);
}

nav.toc a:hover { color: var(--accent); }

nav.toc span[aria-hidden] { color: var(--rule-strong); margin: 0 0.35rem; }

/* ============================================================
   Index page — sections
   ============================================================ */

h2 {
  font-size: 1.55rem;
  line-height: 1.2;
  font-weight: 430;
  letter-spacing: -0.008em;
  margin: var(--s4) 0 var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
}

h2 a { color: inherit; text-decoration: none; }
h2 a:hover { color: var(--accent); }

h2 .h2-note {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-left: 0.5rem;
  white-space: nowrap;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.3;
  font-weight: 560;
  font-style: italic;
  margin: var(--s3) 0 var(--s1);
}

p { margin: 0 0 var(--s2); }
ul, ol { margin: 0 0 var(--s2); padding-left: 1.25rem; }
li { margin-bottom: var(--s1); }

.dim { color: var(--ink-soft); }

.demo {
  font-family: var(--sans);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* About: text with a small, restrained portrait. */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  gap: var(--s3);
  align-items: start;
}

figure.portrait { margin: 0.35rem 0 0; }

figure.portrait img {
  border: 1px solid var(--rule-strong);
}

figure.portrait figcaption {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* Dense metadata reads in Inter, a notch smaller: the "index" half
   of the synthesis. Project names, headings, ledes, and essay prose
   stay in Fraunces. */
ul.now .d,
#writing ul .d,
p.listnote {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

p.listnote { font-size: 0.85rem; }

/* Project index list */
dl.index { margin: 0; }
dl.index > div { margin-bottom: var(--s2); }
dl.index dt { font-weight: 560; display: inline; }
dl.index dd {
  display: inline;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
}
dl.index dd cite { font-family: var(--serif); font-size: 1.05em; }
dl.index dd a { color: var(--ink); }
dl.index dd a:hover { color: var(--accent); }

/* Writing list */
ul.essays { list-style: none; padding: 0; }
ul.essays li {
  border-top: 1px solid var(--rule);
  padding: 0.55rem 0 0.6rem;
  margin: 0;
}
ul.essays li:last-child { border-bottom: 1px solid var(--rule); }
ul.essays .d {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

cite { font-style: italic; }

details { margin: var(--s2) 0; }
summary {
  cursor: pointer;
  color: var(--accent);
  padding: 0.55rem 0; /* comfortable touch target */
}
details > ul, details > p { margin-top: var(--s1); }

/* How I work — numbered clauses with hairline rules. */
ol.rules {
  list-style: none;
  counter-reset: clause;
  margin: var(--s3) 0 0;
  padding: 0;
}

ol.rules li {
  counter-increment: clause;
  position: relative;
  border-top: 1px solid var(--rule);
  padding: 0.95rem 0 0.95rem 2.9rem;
  margin: 0;
}

ol.rules li:last-child { border-bottom: 1px solid var(--rule); }

ol.rules li::before {
  content: counter(clause, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}

ol.rules strong { font-weight: 560; }

/* Footnotes */
.fn {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  margin-top: var(--s4);
  padding-top: var(--s2);
}
.fn p { margin-bottom: var(--s1); }
sup { line-height: 0; font-size: 0.75em; }
sup a { text-decoration: none; color: var(--accent); }

/* ============================================================
   Essay page chrome
   ============================================================ */

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.topbar { border-bottom: 1px solid var(--rule); }

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.2rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar a { text-decoration: none; }

.topbar__brand,
.topbar__nav a {
  display: inline-block;
  padding-block: 0.95rem; /* ≥44px touch targets */
}

.topbar a:hover { color: var(--accent); }
.topbar__brand { color: var(--ink); white-space: nowrap; }

.topbar__nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.8rem);
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--ink-soft);
}

.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.essay-head {
  text-align: center;
  padding-block: clamp(3rem, 8vw, 5rem) clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.essay-head h1 {
  font-size: clamp(2.1rem, 5.8vw, 3.9rem);
  font-weight: 360;
  line-height: 1.08;
  letter-spacing: -0.012em;
  max-width: 24ch;
  margin: 0 auto;
}

.essay-head .dek {
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 1.4rem auto 0;
}

.byline {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2rem;
}

.byline .name { color: var(--ink); }

.draft-note {
  max-width: 46rem;
  margin: clamp(1.6rem, 4vw, 2.2rem) auto 0;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--rule-strong);
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: left;
}

.prose {
  width: min(42rem, calc(100% - 2.5rem));
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.prose p {
  font-size: 1.14rem;
  line-height: 1.72;
  margin: 0 0 1.35em;
}

.prose > p:first-of-type::first-letter {
  font-weight: 500;
  font-size: 4.6em;
  line-height: 0.78;
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent);
}

.prose .pull {
  border: 0;
  border-block: 1px solid var(--rule-strong);
  margin: 2.6rem 0;
  padding: 2.1rem 0;
  text-align: center;
}

.prose .pull p {
  font-size: clamp(1.5rem, 3.8vw, 2.1rem);
  font-weight: 340;
  font-style: italic;
  line-height: 1.3;
  max-width: 24ch;
  margin: 0 auto;
}

.contract {
  list-style: none;
  counter-reset: clause;
  margin: 2.2rem 0;
  padding: 0;
}

.contract li {
  counter-increment: clause;
  position: relative;
  border-top: 1px solid var(--rule);
  padding: 1.05rem 0 1.05rem 3.4rem;
  font-size: 1.08rem;
  line-height: 1.6;
}

.contract li:last-child { border-bottom: 1px solid var(--rule); }

.contract li::before {
  content: counter(clause, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.contract strong { font-weight: 560; }

.endmark::after {
  content: "❦";
  color: var(--accent);
  font-size: 1.15em;
  padding-left: 0.35em;
}

.essay-return {
  width: min(42rem, calc(100% - 2.5rem));
  margin-inline: auto;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.essay-return a { display: inline-block; padding-block: 0.8rem; }

/* ============================================================
   Footer (both pages)
   ============================================================ */

footer.colophon {
  border-top: 3px double var(--rule-strong);
}

.colophon__inner {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.2rem clamp(1.25rem, 5vw, 2rem) 2.2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.colophon__inner p { margin: 0; }

/* Full-width footer variant for the essay page */
footer.colophon--wide .colophon__inner {
  max-width: 72rem;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

/* Palette hint — hidden until palette.js confirms it works. */
#palette-hint-btn {
  font: italic 0.8rem/1.4 var(--serif);
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  background: none;
  border: 0;
  padding: 0.75rem 0; /* touch target */
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.22em;
}

#palette-hint-btn:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ============================================================
   Command palette (injected by palette.js)
   ============================================================ */

.palette-scrim[hidden] { display: none; }

.palette-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--scrim);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3rem, 14vh, 8rem) 1rem 1rem;
  overflow-y: auto; /* short viewports: the scrim scrolls */
}

.palette {
  width: min(34rem, 100%);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  box-shadow: 0 18px 50px -12px rgba(10, 14, 30, 0.35);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
}

.palette__top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.35rem 0.55rem 0.35rem 1rem;
}

#palette-input {
  flex: 1;
  min-width: 0;
  font: italic 1.05rem/1.4 var(--serif);
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0.65rem 0;
}

#palette-input::placeholder { color: var(--ink-soft); opacity: 1; }
#palette-input:focus { outline: none; }

#palette-close {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

#palette-close:hover { color: var(--accent); border-color: var(--accent); }

#palette-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  max-height: min(21rem, 55vh);
  flex: 1 1 auto;
  min-height: 0; /* let the list, not the dialog, be the scroller */
  overflow-y: auto;
}

#palette-list li[role="option"] {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  margin: 0;
  border-left: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

#palette-list li[aria-selected="true"] {
  background: var(--paper-deep);
  border-left-color: var(--accent);
}

#palette-list .pal-kind {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

#palette-list .pal-empty {
  padding: 0.9rem 1rem;
  font-style: italic;
  color: var(--ink-soft);
}

.palette__hint {
  flex-shrink: 0;
  margin: 0;
  padding: 0.55rem 1rem 0.7rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* Copy-email confirmation */
.palette-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0.6rem 1rem;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.palette-toast.show { opacity: 1; }

/* ============================================================
   Evidence media (06b)
   Images are evidence, not decoration. A thumbnail sits beside its
   entry, in the same treatment as the portrait: hairline border,
   slightly desaturated until it is on screen and moving.
   ============================================================ */

/* An entry that carries evidence becomes a two-column row on wide
   screens: text keeps the measure, the figure sits to the right. */
/* Evidence figures are sidenotes: the entry text keeps flowing, the
   figure floats right beside it. Below 900px it stacks under the entry. */
/* Floats escape their entry so the next entries flow up beside the
   figure; the list itself contains them. The data block clears its own. */
.has-evidence--data, dl.index { display: flow-root; }
.has-evidence figure.evidence,
.has-evidence figure.datafig { display: block; margin: 0.5rem 0 0.25rem; }

figure.evidence {
  margin: 0;
  width: 100%;
  max-width: 20rem; /* 320px */
  font-family: var(--sans);
}

.evidence__media {
  position: relative;
  border: 1px solid var(--rule-strong);
  background: var(--paper-deep);
  overflow: hidden;
}

.evidence__media[hidden] { display: none; }

.evidence__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.evidence__link:focus-visible { outline-offset: -2px; }

figure.evidence video,
figure.evidence .evidence__still,
figure.evidence .exhibit {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--paper-deep);
  transition: filter 400ms ease;
}

figure.evidence .exhibit { position: relative; }
figure.evidence .exhibit > img { display: block; width: 100%; height: 100%; object-fit: cover; }
figure.evidence .exhibit > img[hidden] { display: none; }
figure.evidence .exhibit > canvas { display: block; width: 100%; height: 100%; }
figure.evidence .exhibit.is-mounted { aspect-ratio: auto; }
.evidence__media--noposter { min-height: 0; }

figure.evidence.is-playing video,
figure.evidence.is-playing .exhibit { filter: none; }

/* Play/Pause — quiet: a small caps label in the corner, present for
   everyone, louder on hover and focus. Hidden until media.js runs. */
.evidence__toggle {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  min-width: 2.75rem;
  min-height: 2rem;
  padding: 0.25rem 0.55rem;
  font: 600 0.62rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--scrim);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 160ms ease, background 160ms ease;
}

.evidence__toggle[hidden] { display: none; }

.evidence__toggle:hover,
.evidence__toggle:focus-visible {
  opacity: 1;
  background: var(--ink);
}

.evidence__toggle:focus-visible { outline-color: var(--paper); outline-offset: 2px; }

figure.evidence figcaption {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

figure.evidence figcaption a { color: inherit; }

/* Empty state: sources and poster both missing. The caption still
   points at the live site, so the entry loses nothing. */
figure.evidence.evidence--empty figcaption { margin-top: 0; }

/* Data figures (inline SVG). Type inside the SVG is Inter; bars use
   the ink and accent tokens so they follow the colour scheme. */
figure.datafig {
  margin: 0;
  width: 100%;
  max-width: 20rem;
  font-family: var(--sans);
}

figure.datafig svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--sans);
}

figure.datafig .bar { fill: var(--ink); }
figure.datafig .bar--accent { fill: var(--accent); }
figure.datafig .bar--guess { fill: none; stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; }
figure.datafig .num { fill: var(--ink); font-weight: 600; }
figure.datafig .lab { fill: var(--ink-soft); }
figure.datafig .lab--em { fill: var(--accent); font-weight: 600; }
figure.datafig .base { stroke: var(--rule-strong); stroke-width: 1; }

figure.datafig figcaption {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* The essay-page figure sits inside the prose column. */
.prose figure.datafig {
  margin: 0.6rem 0 2.2rem;
  max-width: 30rem;
}

/* Wide screens: figure beside the entry. Wider still: the figure hangs
   in the right margin so the text keeps its full measure. */
@media (min-width: 900px) {
  .has-evidence figure.evidence,
  .has-evidence figure.datafig { float: right; width: 18rem; margin: 0.2rem 0 0.75rem var(--s3); }
}

/* Only hang into the margin when the viewport can hold column + figure
   on both sides: ~44rem column + 2 × (20rem + gap) ≈ 1440px. */
@media (min-width: 1440px) {
  .has-evidence figure.evidence,
  .has-evidence figure.datafig { width: 20rem; margin-right: calc(-20rem - var(--s3)); margin-left: 0; }
}

/* ============================================================
   Motion & responsive
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a, .palette-toast, .evidence__toggle, figure.evidence video, figure.evidence .exhibit { transition: none; }
}

@media (max-width: 560px) {
  .about-grid { grid-template-columns: 1fr; }
  figure.portrait { max-width: 8.5rem; }
  .topbar__inner { flex-direction: column; gap: 0; align-items: flex-start; }
  .topbar__nav { justify-content: flex-start; }
  .colophon__inner { flex-direction: column; gap: 0.15rem; }
}

/* ============================================================
   Showcase: five demos, text left / clip right, one row each.
   Breaks out of the reading column on wide screens so the clip
   reads like a real desktop view. Below 900px it stacks.
   ============================================================ */
.showcase__lede { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 var(--s2); }
.showcase { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.showcase__row {
  display: grid;
  gap: var(--s2);
  padding: var(--s3) 0;
  border-top: 1px solid var(--rule);
}
.showcase__row:last-child { border-bottom: 1px solid var(--rule); }
.showcase__title { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.2; margin: 0 0 0.45rem; }
.showcase__title a { text-decoration: none; }
.showcase__title a:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); }
.showcase__text p { font-family: var(--sans); font-size: 0.95rem; line-height: 1.55; margin: 0; }
.showcase__meta { margin-top: 0.6rem !important; font-size: 0.74rem; letter-spacing: 0.05em; color: var(--ink-soft); }
.showcase__meta a { color: inherit; }
.showcase figure.evidence { max-width: none; width: 100%; margin: 0; }
.index-h { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 var(--s2); }

@media (min-width: 900px) {
  .showcase {
    /* centered break-out: up to 72rem wide, never wider than the viewport minus gutters */
    width: min(100vw - 3rem, 72rem);
    margin-inline: calc(50% - min(50vw - 1.5rem, 36rem));
  }
  .showcase__row {
    grid-template-columns: minmax(15rem, 1fr) minmax(0, 1.7fr);
    align-items: center;
    gap: var(--s4);
    padding: var(--s4) 0;
  }
}

/* ============================================================
   Production additions (Oct 2026): post bodies from the content
   collection (old WordPress HTML + Markdown), archive list.
   ============================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.kicker a { text-decoration: none; color: inherit; }
.kicker a:hover { color: var(--accent-deep); }

.essay-cover {
  width: min(48rem, calc(100% - 2.5rem));
  margin: clamp(2rem, 5vw, 3rem) auto 0;
}
.essay-cover img { width: 100%; border: 1px solid var(--rule); }

.post-body { font-size: 1.14rem; line-height: 1.72; }

.post-body h2,
.post-body h3,
.post-body h4 {
  border: 0;
  padding: 0;
  font-style: normal;
  line-height: 1.25;
}
.post-body h2 { font-size: 1.6rem; font-weight: 450; margin: 2.4rem 0 0.9rem; }
.post-body h3 { font-size: 1.3rem; font-weight: 500; margin: 2rem 0 0.75rem; }
.post-body h4 { font-size: 1.12rem; font-weight: 560; margin: 1.6rem 0 0.6rem; }
.post-body ul,
.post-body ol { font-size: 1.1rem; line-height: 1.65; margin: 0 0 1.35em; padding-left: 1.4rem; }
.post-body li > p { margin-bottom: 0.4em; }
.post-body blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
}
.post-body blockquote p { font-size: 1.06rem; }
.post-body figure { margin: 2rem 0; }
.post-body img { border: 1px solid var(--rule); }
.post-body figcaption {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.post-body pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--paper-deep);
  font-size: 0.9rem;
}
.post-body code { font-size: 0.9em; }
.post-body table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.9rem; margin: 0 0 1.35em; }
.post-body th,
.post-body td { border-bottom: 1px solid var(--rule); padding: 0.5rem 0.4rem; text-align: left; }
.post-body a { text-decoration-color: var(--accent); }
.post-body iframe { max-width: 100%; }

.crosspost {
  font-family: var(--sans);
  font-size: 0.85rem !important;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
  margin-top: 2.5rem !important;
}

/* Writing archive and category pages */
.archive-head { padding-block: clamp(2.5rem, 7vw, 4rem) 0; }
.archive-head h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 340;
  line-height: 1.05;
  margin: 0;
}
.archive-head p { color: var(--ink-soft); margin-top: var(--s2); }
.archive-year {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  border: 0;
  padding: 0;
  margin: var(--s4) 0 var(--s1);
}
ul.essays a { text-decoration: none; }
ul.essays a:hover cite { color: var(--accent); }
ul.essays .blurb {
  display: block;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

/* ============================================================
   Project pages (HR 1 policy analysis)
   ============================================================ */
:root {
  --seq-0: var(--rule);
  --seq-1: #9fb0f4;
  --seq-2: #6a80e8;
  --seq-3: #3a52d6;
  --seq-4: #1a2c96;
}
@media (prefers-color-scheme: dark) {
  :root {
    --seq-1: #3a4a9a;
    --seq-2: #5168d6;
    --seq-3: #7f95f5;
    --seq-4: #c0cbff;
  }
}

.project h2 {
  border: 0;
  padding: 0;
  margin: 2.6rem 0 0.8rem;
  font-size: 1.5rem;
}
.project ol,
.project ul { font-size: 1.1rem; line-height: 1.65; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s2);
  margin: 0 0 var(--s3);
  border-block: 1px solid var(--rule);
  padding: var(--s3) 0;
}
.stats dt {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  order: 2;
}
.stats div { display: flex; flex-direction: column; gap: 0.2rem; }
.stats dd {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 380;
  line-height: 1.1;
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s3); }
}

ol.steps { padding-left: 1.3rem; }
ol.steps li { margin-bottom: 0.8rem; }
ol.steps strong { font-weight: 560; }

ul.findings { list-style: none; padding: 0; }
ul.findings li {
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
  margin: 0;
}
ul.findings li:last-child { border-bottom: 1px solid var(--rule); }
ul.findings strong { font-weight: 560; }
.ref {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  white-space: nowrap;
}
ul.downloads { list-style: none; padding: 0; }

/* Bill map: the bill as a wrapped ribbon of sections. */
.billmap {
  width: min(52rem, calc(100% - 2.5rem));
  margin: 0 auto;
  font-family: var(--sans);
}
.billmap__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.billmap__key { display: inline-flex; align-items: center; gap: 0.35rem; }
.billmap__key i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.billmap__keylabel { font-weight: 600; }
.billmap__ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
}
.billmap__block {
  min-width: 4px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.billmap__block.is-active,
.billmap__block:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.b0 { background: var(--seq-0); }
.b1 { background: var(--seq-1); }
.b2 { background: var(--seq-2); }
.b3 { background: var(--seq-3); }
.b4 { background: var(--seq-4); }
.billmap__tip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 4.2rem;
  margin: 0.9rem 0 0;
  padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--accent);
  background: var(--paper-deep);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.billmap__tip strong { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; color: var(--ink); }
.billmap__tip-head { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.billmap figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.9rem;
}
.billmap__table { margin-top: 0.6rem; font-size: 0.85rem; }
.billmap__table table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.billmap__table th,
.billmap__table td { text-align: left; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--rule); }
.billmap__table td:nth-child(n+3),
.billmap__table th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.prose.project > p:first-of-type::first-letter {
  font-size: inherit; float: none; padding: 0; color: inherit; font-weight: inherit; line-height: inherit;
}
.billmap__tip[hidden] { display: none; }
ul.essays li.essay-row {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: baseline;
}
ul.essays .essay-date {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
}
