/* ISA After Hours — Blog (static, public).
   Light theme only. Palette derived from the site tokens in src/index.css
   (primary hsl(152 69% 18%), card hsl(150 20% 96%), muted-foreground hsl(150 12% 38%)). */

:root {
  --paper: #fbfcfa;
  --card: #ffffff;
  --ink: #14231b;
  --green: #0e4d31;
  --green-deep: #082e1e;
  --mint: #e3efe8;
  --line: #d9e3dc;
  --muted: #566860;
  /* --gold is an ACCENT ONLY: rules, borders, hairlines. It is 3.24:1 on
     #ffffff and 3.15:1 on --paper, which fails WCAG 2 AA (4.5:1) for text.
     --gold-text is the same hue darkened until it passes: 6.35:1 on #ffffff,
     6.17:1 on --paper, 5.38:1 on --mint. Every gold-coloured TEXT rule below
     (eyebrows, fact labels) uses --gold-text; never --gold. */
  --gold: #b8862b;
  --gold-text: #7a5a1a;
  /* --gold-on-dark is the same hue lifted for the hero overlay: --gold-text is
     unreadable there and --gold measures only ~4.0:1 on the gradient, which
     fails AA. This one measures 6.8:1 against the darkest gradient stop. Use it
     ONLY over --scrim; on paper it fails badly. */
  --gold-on-dark: #e6bd6a;
  /* The hero overlay ink. Deep green-black rather than pure black so the
     gradient reads as our green, not as a generic photo scrim. */
  --scrim: 6, 30, 20;

  --font-display: "Archivo Black", "Archivo", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --shell: 1100px;
  --col: 720px;
  --rail: 240px;
  --gut: 4rem;
  --r-lg: 24px;
  --r-md: 14px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Body stays a BLOCK box on purpose. Making it a flex/grid container lets
     .tablewrap's 34rem min-content propagate up through <main> and blow the
     page out horizontally at 375px. The footer is pinned to the bottom of a
     short page (the blog index) with the sticky top:100vh trick instead,
     which needs no change to body's formatting context. */
  min-height: 100vh;
}

/* Paper texture — a faint green grid, drawn with gradients only (no image
   files). It lives on a FIXED pseudo-element behind the content instead of on
   body's own background so that axe still resolves every text node against a
   solid --paper: a background-image on <body> would turn every colour-contrast
   check on the page into "incomplete" and quietly stop proving anything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(14, 77, 49, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14, 77, 49, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: none; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { text-wrap: balance; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 252, 250, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.005em;
  color: var(--green);
  text-decoration: none;
}
.brand small {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--muted);
  margin-inline-start: 0.45rem;
}
.topnav { display: flex; gap: 1.25rem; }
.topnav a {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}
.topnav a:hover { color: var(--green); }

/* ------------------------------------------------------------------ shell */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.wrap { max-width: var(--shell); margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }

/* --------------------------------------------------------------- post head */

.posthead { padding: 3.5rem 0 0; }

.metarow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  margin: 0 0 1.4rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--mint);
  color: var(--green);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.metarow .dot { color: var(--line); }
.metarow time, .metarow .readtime {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin: 0 0 0.5rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.15rem, 5.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.018em;
  margin: 0 0 1rem;
  max-width: 22ch;
}
.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.32rem);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 60ch;
}
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 2.25rem;
}
.byline b { color: var(--ink); font-weight: 700; }

/* ------------------------------------------------------------------- hero */

/* The hero IS the title stage: the image is full-bleed inside the rounded box
   and the eyebrow, the h1 and the date sit on it over a bottom gradient.
 *
 * The 16:9 box is set by a zero-width ::before with percentage padding rather
 * than by `aspect-ratio`, because aspect-ratio gives the box a DEFINITE height
 * that a long title would simply overflow and get clipped by `overflow:hidden`.
 * The pseudo-element sets a MINIMUM instead, so 16:9 is what you normally get
 * and a seven-line title on a phone just makes the stage taller. */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin: 0 0 2.25rem;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--green-deep);
  box-shadow: 0 24px 60px -28px rgba(8, 46, 30, 0.45);
}
.hero::before {
  content: "";
  flex: none;
  width: 0;
  padding-top: 56.25%; /* 16:9 floor */
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The scrim's tall top padding is the fade zone. Because the gradient stops are
   percentages of THIS box, the text always lands in the bottom ~65% — the part
   that is at least 88% opaque — no matter how many lines the title runs to. */
.hero-cover {
  position: relative;
  width: 100%;
  /* MEASURED, not guessed. With a 5.5rem fade zone and the strong band ending
     at 60%, the eyebrow — the highest line in the block — landed at ~0.64
     opacity and read 2.61:1 on the brightest photograph (google-pics), well
     under the 4.5:1 AA floor. Deepening the band to 70% and lengthening the
     fade zone to 8rem puts every line of the block at >=0.85 opacity; the same
     eyebrow now measures 7.87:1. See the table in hero-contrast.mjs's output. */
  padding: 8rem 2.25rem 2rem;
  background: linear-gradient(
    to top,
    rgba(var(--scrim), 0.95) 0%,
    rgba(var(--scrim), 0.93) 70%,
    rgba(var(--scrim), 0.5) 88%,
    rgba(var(--scrim), 0) 100%
  );
}
.hero-cover .hero-eyebrow {
  display: block;
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-on-dark);
}
.hero-cover h1 {
  color: #fff;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.04;
  margin: 0 0 0.9rem;
  /* Wide enough that the longest headline we publish (17 words) still lands in
     four lines instead of five — a five-line title pushes the scrim up over
     most of the photograph. */
  max-width: 20ch;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(var(--scrim), 0.55);
}
.hero-cover .metarow {
  margin: 0;
  gap: 0.4rem 0.7rem;
}
.hero-cover .metarow time,
.hero-cover .metarow .readtime {
  color: #dbeae2;
}
/* Solid, not a 55% white: a translucent separator measured barely 4:1 on the
   lighter photographs, and a dot is still text as far as WCAG is concerned. */
.hero-cover .metarow .dot { color: #cddfd5; }

/* ----------------------------------------------------------------- layout */

.layout { display: block; padding-bottom: 5rem; }

/* Two TOCs, one shown per breakpoint: a <details> that is genuinely collapsed
   on phones, and a permanently open sticky <nav> rail on desktop. A single
   <details> cannot serve both — CSS cannot force a closed <details> open. */
.toc-desktop { display: none; }

.toc-mobile {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 0 1.1rem;
  margin: 0 0 2.5rem;
}
.toc > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after {
  content: "";
  width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
  flex: none;
}
.toc[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.toc-title {
  margin: 0;
  padding: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 0.32rem 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}
.toc a:hover { color: var(--green); text-decoration: underline; }

/* ------------------------------------------------------------------ prose */

article { min-width: 0; }
.prose { max-width: 68ch; }
.prose > * { margin-inline: 0; }

.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 3.5rem 0 1rem;
  scroll-margin-top: 6rem;
}
.prose h3 {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 2.25rem 0 0.6rem;
  color: var(--green);
  scroll-margin-top: 6rem;
}
.prose p { margin: 0 0 1.25rem; }
.prose ul, .prose ol { padding-inline-start: 1.35rem; margin: 0 0 1.5rem; }
.prose li { margin: 0.45rem 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--mint);
  color: var(--green-deep);
  padding: 0.12em 0.4em;
  border-radius: 5px;
  word-break: break-word;
}

/* external-link marker (no icon font) */
.prose a[href^="http"]::after {
  content: "↗";
  font-size: 0.75em;
  line-height: 1;
  margin-inline-start: 0.18em;
  vertical-align: 0.25em;
  text-decoration: none;
  color: var(--muted);
}
.sources a[href^="http"]::after,
.facts a[href^="http"]::after { content: none; }

/* ---------------------------------------------------------------- summary */

.summary {
  background: var(--mint);
  border-radius: var(--r-md);
  padding: 1.6rem 1.75rem;
  margin: 0 0 2rem;
}
.summary .eyebrow { color: var(--green); margin-bottom: 0.55rem; }
.summary p { margin: 0; font-size: 1.05rem; }

/* -------------------------------------------------------------- key facts */

.facts-title { color: var(--green); margin: 0 0 0.85rem; }
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 0 0 2.75rem;
  padding: 0;
  list-style: none;
}
.facts li {
  margin: 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.facts .fact-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.facts .fact-body { font-size: 0.98rem; font-weight: 700; line-height: 1.35; }
.facts a {
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.1rem;
  align-self: flex-start;
}
.facts a:hover { color: var(--green); border-color: var(--green); }

/* --------------------------------------------------------------- callouts */

.note {
  border-inline-start: 3px solid var(--gold);
  background: var(--card);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 1.15rem 1.35rem;
  margin: 2rem 0;
  font-size: 0.98rem;
  box-shadow: 0 1px 0 var(--line), 0 8px 24px -20px rgba(8, 46, 30, 0.5);
}
.note .eyebrow { color: var(--gold-text); }
.note p { margin: 0; }
.note b { color: var(--green); }

/* ----------------------------------------------------------------- tables */

.tablewrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 1.5rem 0 2.25rem;
  border-block: 1px solid var(--line);
  /* scroll shadows: the right edge fades while there is more table to reach */
  background:
    linear-gradient(to right, var(--paper) 40%, rgba(251, 252, 250, 0)) left center / 42px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 40%, rgba(251, 252, 250, 0)) right center / 42px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(20, 35, 27, 0.16), rgba(20, 35, 27, 0)) left center / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(20, 35, 27, 0.16), rgba(20, 35, 27, 0)) right center / 16px 100% no-repeat scroll;
}

/* The wrapper scrolls, so each one carries tabindex="0" (+ role="region" and an
   aria-label naming its table) to stay reachable without a mouse — see the
   `scrollable-region-focusable` gate in e2e/blog.spec.ts. Anything focusable
   needs a focus indicator, and :focus-visible keeps it off mouse clicks. */
.tablewrap:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

table { border-collapse: collapse; width: 100%; font-size: 0.94rem; min-width: 34rem; }
th, td { text-align: start; vertical-align: top; padding: 0.8rem 1rem 0.8rem 0; }
th:first-child, td:first-child { padding-inline-start: 0.1rem; }
th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
}
td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; color: var(--green); }
.tablenote { font-size: 0.85rem; color: var(--muted); margin: -1.5rem 0 2.25rem; }

/* ------------------------------------------------------------------ steps */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0 2rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 3.25rem;
  min-height: 2rem;
  margin: 0 0 1.15rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0.05rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

/* ----------------------------------------------------------- prompt block */

.promptfig { margin: 1.25rem 0 2rem; }
.promptfig figcaption {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--muted);
  padding: 0 0 0.5rem;
}
pre.prompt {
  background: var(--green-deep);
  color: #d7e7de;
  padding: 1.35rem 1.5rem;
  border-radius: var(--r-md);
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  box-shadow: 0 16px 40px -28px rgba(8, 46, 30, 0.7);
}

/* ------------------------------------------------------------------ video */

.video { margin: 2rem 0 2.5rem; scroll-margin-top: 6rem; }

/* .video-box owns the 16:9 box. The poster button and the iframe that replaces
   it are both absolutely positioned inside it, so the swap cannot shift the
   page. */
.video-box {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--green-deep);
  box-shadow: 0 20px 50px -30px rgba(8, 46, 30, 0.6);
}
.video-box > .video-shell,
.video-box > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.video-box > iframe { border: 0; display: block; }
.video-shell {
  display: block;
  padding: 0;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: start;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
}
.video-shell::after { content: none; }
.video-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease, opacity 200ms ease;
}
.video-shell:hover .video-poster { transform: scale(1.02); opacity: 0.92; }

/* The whole poster is the hit area; the pill is the visible affordance. It sits
   bottom-left so the title baked into the poster frame stays readable. */
.video-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4rem 1.25rem 1.15rem;
  background: linear-gradient(
    to top,
    rgba(8, 46, 30, 0.95) 0%,
    rgba(8, 46, 30, 0.72) 45%,
    rgba(8, 46, 30, 0) 100%
  );
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  pointer-events: none;
}
.video-play {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  background: #fbfcfa;
  color: var(--green-deep);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 26px -10px rgba(8, 46, 30, 0.7);
  transition: transform 180ms ease, background-color 180ms ease;
}
.video-play svg { width: 0.6rem; height: 0.7rem; flex: none; display: block; }
.video-shell:hover .video-play,
.video-shell:focus-visible .video-play { transform: translateY(-1px); background: #fff; }
.video-label {
  color: #eef5f1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* the poster has bright artwork behind this line */
  text-shadow: 0 1px 4px rgba(8, 46, 30, 0.95);
}
.video figcaption {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

/* -------------------------------------------------------------------- FAQ */

.faq { display: flex; flex-direction: column; gap: 0.5rem; margin: 1.5rem 0 0; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  padding: 0 1.2rem;
}
.faq details[open] { border-color: #bfd2c7; }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 0;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.faq details p { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.98rem; }

/* -------------------------------------------------------------------- CTA */

.cta {
  margin: 4rem 0 0;
  padding: 2.5rem 2rem;
  border-radius: var(--r-lg);
  background: var(--green-deep);
  color: #eaf3ee;
  text-align: center;
}
.cta .eyebrow { color: #9dc9b1; }
.cta h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.15;
  margin: 0 auto 0.75rem;
  color: #fff;
  max-width: 22ch;
  scroll-margin-top: 6rem;
}
.cta p { margin: 0 auto 1.5rem; color: #b9d3c5; max-width: 52ch; font-size: 1rem; }
.cta .btn {
  display: inline-block;
  background: #fff;
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
}
.cta .btn:hover { background: var(--mint); }

/* ---------------------------------------------------------------- sources */

.sources { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.sources li {
  margin: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}
.sources li:last-child { border-bottom: 0; }
.sources a { font-weight: 700; text-decoration: none; }
.sources a:hover { text-decoration: underline; }
.sources .src-host {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

/* ------------------------------------------------------------ author card */

.authorcard {
  margin: 3rem 0 0;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.authorcard .avatar {
  flex: none;
  width: 3.25rem; height: 3.25rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.authorcard .eyebrow { color: var(--muted); }
.authorcard h2 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
  scroll-margin-top: 6rem;
}
.authorcard p { margin: 0; font-size: 0.94rem; color: var(--muted); }

/* ------------------------------------------------------------ index page */

/* --- category filter chips ------------------------------------------------
   Real <button>s: keyboard-operable before public/blog/blog.js touches them,
   and aria-pressed (not a class) carries the state to assistive tech. */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2.25rem 0 0;
}
.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.chip:hover { color: var(--green); border-color: #bfd2c7; }
.chip[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.chip:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Announced on filter, never rendered — the visible answer is the grid itself. */
.filter-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- the card grid -------------------------------------------------------- */

.posts {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: minmax(0, 1fr);
}
.posts li { margin: 0; }
.post-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.post-card:hover {
  box-shadow: 0 26px 54px -28px rgba(8, 46, 30, 0.42);
  transform: translateY(-3px);
  border-color: #c7d8ce;
}
.post-card:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.post-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--green-deep);
  overflow: hidden;
}
.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}
.post-card:hover .post-thumb img { transform: scale(1.02); }

/* Overlaid on the photograph, so it carries its own dark ground. */
.post-badge {
  position: absolute;
  top: 0.7rem;
  inset-inline-end: 0.7rem;
  max-width: calc(100% - 1.4rem);
  background: rgba(var(--scrim), 0.82);
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.post-body {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-accent {
  display: block;
  width: 2.2rem;
  height: 3px;
  border-radius: 2px;
  background: var(--gold);
  margin: 0 0 0.85rem;
}
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.22rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0 0 0.55rem;
  color: var(--green);
  /* two lines, always — this is what keeps a row of cards aligned */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.post-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.post-rule {
  display: block;
  height: 1px;
  background: var(--line);
  margin: 1.1rem 0 0.85rem;
  /* the hairline is pushed to the bottom so every card's meta row lines up */
  margin-top: auto;
}
.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.post-by { display: flex; flex-direction: column; min-width: 0; }
.post-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.post-by time { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.post-read {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-arrow {
  font-size: 0.94rem;
  line-height: 1;
  color: var(--green);
  transition: transform 200ms ease;
}
.post-card:hover .post-arrow { transform: translateX(3px); }

/* ----------------------------------------------------------------- footer */

.sitefoot {
  position: sticky;
  top: 100vh;
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--card);
}
.sitefoot a { margin: 0 0.5rem; color: var(--muted); }
.sitefoot a:hover { color: var(--green); }

/* ------------------------------------------------------------- responsive */

/* A hidden card must leave no empty grid cell behind. */
.posts li[hidden] { display: none; }

@media (min-width: 700px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* The newest post runs two columns wide — but only in the unfiltered view.
     Inside one category a single oversized cell reads as a mistake, so
     blog.js sets .posts--filtered and the grid goes uniform.
   *
     It also turns SIDEWAYS. Keeping the image on top at double width would
     hold a 16:9 crop 690px wide and ~390px tall, which drags the whole first
     row down and leaves a chasm of white under its neighbour. Side-by-side,
     the featured card is exactly as tall as the ordinary card beside it. */
  .posts:not(.posts--filtered) .post-item--featured { grid-column: span 2; }
  .posts:not(.posts--filtered) .post-item--featured .post-card {
    flex-direction: row;
    align-items: stretch;
  }
  .posts:not(.posts--filtered) .post-item--featured .post-thumb {
    flex: 0 0 52%;
    aspect-ratio: auto;
  }
  .posts:not(.posts--filtered) .post-item--featured .post-body {
    padding: 1.9rem 2rem 1.7rem;
    justify-content: center;
  }
  .posts:not(.posts--filtered) .post-item--featured h2 {
    font-size: 1.72rem;
    line-height: 1.14;
    margin-bottom: 0.7rem;
    /* the featured column is narrower than it looks (the image takes half), so
       the lead headline gets a third line before it is cut */
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  .posts:not(.posts--filtered) .post-item--featured .post-excerpt { font-size: 1rem; }
  .posts:not(.posts--filtered) .post-item--featured .post-accent { width: 3rem; }
  /* justify-content:center would otherwise fight margin-top:auto and float the
     hairline; pin it back to the bottom of the card. */
  .posts:not(.posts--filtered) .post-item--featured .post-rule { margin-top: 1.4rem; }
}

@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: minmax(0, var(--col)) var(--rail);
    gap: var(--gut);
    align-items: start;
    justify-content: center;
  }
  .layout > article { grid-column: 1; grid-row: 1; }
  .layout > .toc-desktop { grid-column: 2; grid-row: 1; }

  .toc-mobile { display: none; }
  .toc-desktop {
    display: block;
    position: sticky;
    top: 96px;
    border-inline-start: 1px solid var(--line);
    padding: 0 0 0 1.35rem;
    margin: 0.4rem 0 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  .toc-desktop ol { padding-bottom: 0; }
}

@media (max-width: 1023px) {
  .prose { max-width: 68ch; margin-inline: auto; }
  .posthead { max-width: 68ch; margin-inline: auto; }
  .layout { max-width: 68ch; margin-inline: auto; }
}

@media (max-width: 760px) {
  /* the two-row bar would eat a quarter of a phone screen if it stayed pinned */
  .topbar { position: static; backdrop-filter: none; background: var(--card); }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 1.95rem; }
  .cta .eyebrow { letter-spacing: 0.09em; }
  .wrap { padding: 2.25rem 1.15rem 3.5rem; }
  .shell { padding: 0 1.15rem; }
  .posthead { padding-top: 1.75rem; }

  /* On a phone the stage goes portrait (4:5 floor) so a long title has room,
     the gradient is pushed harder because the readable band is proportionally
     bigger, and the h1 comes down enough to keep ~5 words a line. */
  .hero { border-radius: 16px; margin-bottom: 1.75rem; }
  .hero::before { padding-top: 125%; }
  .hero-cover {
    padding: 5rem 1.25rem 1.4rem;
    background: linear-gradient(
      to top,
      rgba(var(--scrim), 0.97) 0%,
      rgba(var(--scrim), 0.94) 66%,
      rgba(var(--scrim), 0.62) 86%,
      rgba(var(--scrim), 0) 100%
    );
  }
  .hero-cover h1 { font-size: clamp(1.45rem, 6.6vw, 2rem); max-width: none; }
  .hero-cover .hero-eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; margin-bottom: 0.5rem; }
  .hero-cover .metarow time,
  .hero-cover .metarow .readtime { font-size: 0.72rem; }
  .summary { padding: 1.25rem 1.25rem; }
  .cta { padding: 2rem 1.25rem; border-radius: 16px; }
  .authorcard { flex-direction: column; gap: 0.9rem; padding: 1.35rem; }
  .topnav { gap: 0.9rem; }
  .topbar-inner { padding: 0.7rem 1.15rem; }
}

@media (max-width: 700px) {
  /* Our categories are long phrases, so a wrapping row costs seven lines and
     pushes the first card off the phone screen. One swipeable row instead.
     The row is a scroll container, but every child is a <button>, so it stays
     keyboard-reachable and axe's scrollable-region-focusable rule is satisfied
     without a tabindex of its own. */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    /* room for the focus ring, which would otherwise be clipped by the scroller */
    padding: 4px;
    margin-inline: -4px;
    scroll-padding-inline: 4px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  /* Suppressing the transition alone would only make the lift/zoom INSTANT.
     Under reduced motion the card must not move at all — the shadow and the
     border are the whole hover affordance. */
  .post-card:hover { transform: none; }
  .post-card:hover .post-thumb img { transform: none; }
  .post-card:hover .post-arrow { transform: none; }
}
