/* ==========================================================================
   Sorlos Insights · reading layer (direction C · Signal, design/final/)

   Loaded after tokens.css, which is the website's core layer copied as is.
   This file owns everything specific to reading: its own tokens (type scale,
   spacing, widths, signal and reading colours), the site chrome for
   articles, and every component. It uses core tokens wherever it can and
   adds no new brand colour.

   Contents
     1. Reading tokens          6. Article body
     2. Reset and base          7. Components
     3. Site header             8. Article footer
     4. Article head            9. Index pages
     5. Layout and contents    10. Site footer, motion, print
   ========================================================================== */

/* ---- 1. Reading tokens ------------------------------------------------- */

:root {
  /* Fonts (same families as the website) */
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Type scale. Fluid between 320 px and about 1080 px, then fixed.
     Body text is 17 px on a phone and 20 px on a desktop. */
  --step--2: 0.75rem;                                          /* 12 px  labels, chips */
  --step--1: 0.875rem;                                         /* 14 px  meta, captions, tables */
  --step-0: clamp(1.0625rem, 0.95rem + 0.45vw, 1.25rem);       /* 17→20  body */
  --step-1: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);          /* 18→22  dek, h3 */
  --step-2: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);            /* 22→28  h2 */
  --step-3: clamp(1.6rem, 1.25rem + 1.6vw, 2.25rem);           /* 26→36  featured card */
  --step-4: clamp(2.1rem, 1.25rem + 3.8vw, 3.75rem);           /* 34→60  article and index titles */

  --leading-body: 1.7;
  --leading-head: 1.15;
  --leading-display: 1.04;
  --tracking-label: 0.1em;

  /* Spacing: a 4 px base. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Widths. Text is about 66–70 characters at every size; wide adds the
     rail; full-bleed is the viewport. */
  --w-text: 700px;
  --w-rail: 248px;
  --w-gap: 72px;
  --w-wide: calc(var(--w-text) + var(--w-gap) + var(--w-rail)); /* 1020 px */
  --w-page: 1200px;
  --gutter: 16px;
  --header-h: 64px;
  --radius: 2px;

  /* Reading colours (dark). Body text a little softer than --text to limit
     glare on long reads: 14.9:1 on --bg, 12.8:1 on --band. */
  --reading-text: #d5e3e0;
  --band: var(--surface-2);          /* opening band, callouts, next steps */
  --panel: var(--surface);           /* contents panel, sidenotes, tables */
  --warning-line: #fdb15c;           /* 10.9:1 on --bg, 9.3:1 on --band; lines and labels */

  /* Signal: the solid mint block, identical in both themes. At most one in
     the reading flow (short answer or key takeaways) plus the contact block.
     #04241e on #3aefcc is 11.3:1. */
  --signal-bg: #3aefcc;
  --signal-text: #04241e;
}

:root[data-theme="light"] {
  --reading-text: #36393b;           /* brand Dark: 11.6:1 on white, 9.2:1 on --band */
  --panel: var(--bg-alt);            /* white panels would vanish on a white page */
  --warning-line: #9a4b00;           /* 6.2:1 on white, 4.9:1 on --band */
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

/* ---- 2. Reset and base ------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-5));
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "cv05", "cv08"; /* l with tail, I with serifs: ML-KEM-1024 reads unambiguously */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

.wrap {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--font-mono);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--action-bg);
  color: var(--action-text);
}

.skip-link:focus {
  top: var(--space-2);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

/* ---- 3. Site header ---------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease;
}

/* Articles: the header hides while scrolling down (reading.js). */
.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: var(--space-4);
}

.logo img {
  width: 108px;
  height: auto;
}

.logo-on-light {
  display: none;
}

:root[data-theme="light"] .logo-on-dark {
  display: none;
}

:root[data-theme="light"] .logo-on-light {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-links > a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-links > a:hover,
.nav-links > a[aria-current] {
  color: var(--text);
}

.nav-links > a[aria-current] {
  box-shadow: inset 0 -2px 0 var(--accent-line);
  padding-bottom: var(--space-1);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1px solid var(--accent-dim);
  color: var(--accent-text) !important;
  padding: 7px 14px;
  border-radius: var(--radius);
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-tint);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

.icon {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

@media (max-width: 559px) {
  .nav-links {
    gap: var(--space-3);
  }
  .nav-links > a:not([aria-current]):not(.nav-cta) {
    display: none;
  }
  .nav-cta {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* Reading progress (Reports only, reading.js). */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  pointer-events: none;
}

.progress-bar {
  display: block;
  height: 100%;
  background: var(--accent-line);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---- 4. Article head: the opening band --------------------------------- */

.article {
  overflow-x: clip; /* lets full-bleed figures span the viewport; keeps sticky working */
  padding-bottom: var(--space-8);
}

.band {
  background: var(--band);
}

.article-head {
  position: relative;
  max-width: var(--w-page);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(32px, 5vw, 56px);
}

.page-insight .article-head {
  padding-top: clamp(32px, 5vw, 64px);
}

.article-head-text {
  position: relative;
  z-index: 1;
  max-width: var(--w-text);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Format chips: Insight is outlined, Report is solid signal. */
.format {
  padding: 3px 10px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  color: var(--accent-text);
  font-weight: 500;
}

.format-report {
  border-color: var(--signal-bg);
  background: var(--signal-bg);
  color: var(--signal-text);
}

.category {
  color: var(--text-secondary);
  text-decoration: none;
}

a.category:hover {
  color: var(--text);
  text-decoration: underline;
}

.article-title {
  max-width: 22ch;
  font-family: var(--font-head);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: var(--leading-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.page-insight .article-title {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
}

.dek {
  max-width: 56ch;
  margin-top: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--step-1);
  line-height: 1.5;
  text-wrap: pretty;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-6);
}

.byline-photo {
  width: 48px;
  height: 48px;
  border: 2px solid var(--accent-dim);
  border-radius: 50%;
  object-fit: cover;
  background: var(--portrait-bg);
}

.byline-text {
  flex: 1 1 180px;
}

.byline-name {
  font-weight: 600;
}

.byline-name a {
  color: var(--text);
  text-decoration: none;
}

.byline-name a:hover {
  text-decoration: underline;
}

.byline-role {
  font-size: var(--step--1);
  color: var(--text-secondary);
}

/* Freshness: published, updated, last reviewed. */
.meta {
  display: flex;
  flex-wrap: wrap;
  flex-basis: 100%;
  gap: var(--space-1) var(--space-5);
  font-size: var(--step--1);
  color: var(--text-secondary);
}

.meta div {
  display: flex;
  gap: 6px;
}

.meta dd {
  color: var(--text);
}

.change-note {
  flex-basis: 100%;
  margin-top: var(--space-1);
  font-size: var(--step--1);
  color: var(--text-secondary);
}

.share {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.share-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.share-link:hover {
  border-color: var(--text-secondary);
}

.share-link[data-state="done"] {
  border-color: var(--accent-dim);
  color: var(--accent-text);
}

.share-link .icon {
  width: 16px;
  height: 16px;
}

.share-copy {
  display: none;
}

.js .share-copy {
  display: inline-flex;
}

/* Without JavaScript there is no copy button: the bottom bar shows the
   address to copy by hand (spec §8.1). */
.share-url {
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.js .share-url {
  display: none;
}

/* Report opener: the category motif sits at the right of the band. */
.head-motif {
  display: none;
}

@media (min-width: 900px) {
  .head-motif {
    display: block;
    position: absolute;
    right: var(--gutter);
    top: 50%;
    width: clamp(220px, 26vw, 340px);
    height: auto;
    transform: translateY(-50%);
    color: var(--accent-line);
    opacity: 0.9;
  }
}

/* ---- 5. Layout and contents -------------------------------------------- */

.article-layout,
.article-foot {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.article-layout {
  padding-top: var(--space-7);
}

.toc {
  margin-bottom: var(--space-7);
  padding: var(--space-4) var(--space-5);
  background: var(--panel);
  font-size: 0.9375rem;
}

.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.toc-title {
  color: var(--text-secondary);
}

.toc-toggle {
  min-height: 32px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.toc-toggle:hover {
  border-color: var(--text-secondary);
}

.toc ol {
  list-style: none;
  margin-top: var(--space-3);
}

.toc li + li {
  margin-top: 2px;
}

.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  box-shadow: inset 2px 0 0 var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.4;
}

.toc a:hover {
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--text-secondary);
}

.toc a[aria-current] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-line);
}

.toc .toc-top {
  display: none;
}

@media (max-width: 1079px) {
  .toc.is-collapsed ol {
    display: none;
  }
  /* Insights are short: on narrow screens the short answer stays first, so
     their contents only appear in the wide-screen rail. */
  .toc-rail-only {
    display: none;
  }
}

@media (min-width: 1080px) {
  .article-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--w-text)) var(--w-rail);
    column-gap: var(--w-gap);
    align-items: start;
  }

  .article-body {
    grid-column: 1;
    grid-row: 1;
  }

  .toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
    max-height: calc(100vh - var(--header-h) - var(--space-7));
    overflow-y: auto;
    margin: 0;
    font-size: var(--step--1);
  }

  .toc-toggle {
    display: none;
  }

  .toc .toc-top {
    display: inline-block;
    padding: 0;
    box-shadow: none;
    margin-top: var(--space-4);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
  }

  .toc .toc-top:hover {
    color: var(--text);
  }

  .article-foot > * {
    max-width: var(--w-text);
  }
}

/* ---- 6. Article body --------------------------------------------------- */

.article-body {
  color: var(--reading-text);
  font-size: var(--step-0);
  line-height: var(--leading-body);
}

.article-body > * + * {
  margin-top: 1.1em;
}

.article-body p,
.article-body li {
  text-wrap: pretty;
  hanging-punctuation: first;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: var(--leading-head);
  text-wrap: balance;
}

/* Section headings: bold, sentence case, a mint square. */
.article-body > h2 {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin-top: 2.4em;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.article-body > h2::before {
  content: "";
  flex: 0 0 auto;
  width: 0.5em;
  height: 0.5em;
  background: var(--accent-line);
}

.article-body h3 {
  margin-top: 1.9em;
  font-size: var(--step-1);
  font-weight: 700;
}

.article-body h2 + *,
.article-body h3 + * {
  margin-top: 0.6em;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 0.4em;
}

.article-body li::marker {
  color: var(--accent-line);
}

.article-body blockquote {
  padding-left: 1.1em;
  box-shadow: inset 3px 0 0 var(--text-secondary);
  color: var(--text);
}

.article-body blockquote p {
  font-size: 1.05em;
}

.article-body blockquote footer {
  margin-top: 0.5em;
  font-size: var(--step--1);
  color: var(--text-secondary);
}

/* Heading anchors: shown on hover and focus, always on touch screens. */
.anchor {
  margin-left: 0.15em;
  color: var(--text-secondary);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}

.anchor:hover {
  color: var(--accent-text);
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .anchor {
    opacity: 0.7;
  }
}

/* ---- 7. Components ----------------------------------------------------- */

/* Signal block: short answer (Insight) or key takeaways (Report). */
.short-answer,
.takeaways {
  padding: var(--space-5) var(--space-5) var(--space-6);
  background: var(--signal-bg);
  color: var(--signal-text);
}

@media (min-width: 560px) {
  .short-answer,
  .takeaways {
    padding: var(--space-6) var(--space-6) 36px;
  }
}

.short-answer h2,
.takeaways h2 {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--signal-text);
}

.short-answer p {
  margin-top: var(--space-2);
  color: var(--signal-text);
  font-size: 1.15em;
  font-weight: 500;
  line-height: 1.55;
}

.takeaways ul {
  margin-top: var(--space-3);
}

.takeaways li,
.takeaways strong,
.takeaways em,
.short-answer strong {
  color: var(--signal-text);
}

.takeaways li::marker {
  color: var(--signal-text);
}

.short-answer a,
.takeaways a {
  color: var(--signal-text);
  text-decoration-thickness: 2px;
}

.short-answer :focus-visible,
.takeaways :focus-visible {
  outline-color: var(--signal-text);
}

/* Next steps: band, not signal. */
.next-steps {
  padding: var(--space-6);
  background: var(--band);
}

.next-steps h2 {
  margin-top: 0;
  font-size: var(--step-2);
  font-weight: 700;
}

/* Callouts: note, warning, key date. */
.callout {
  padding: var(--space-4) var(--space-5);
  background: var(--band);
  box-shadow: inset 4px 0 0 var(--text-secondary);
  font-size: 0.95em;
}

.callout-key-date {
  box-shadow: inset 4px 0 0 var(--accent-line);
}

.callout-warning {
  box-shadow: inset 4px 0 0 var(--warning-line);
}

.callout-label {
  color: var(--text-secondary);
}

.callout-key-date .callout-label {
  color: var(--accent-text);
}

.callout-warning .callout-label {
  color: var(--warning-line);
}

.callout-label + p {
  margin-top: var(--space-1);
}

/* Sidenotes: compact inline notes after their paragraph. */
.note-ref {
  font-size: 0.7em;
  line-height: 0;
  margin-left: 1px;
}

.note-ref a {
  font-family: var(--font-mono);
  text-decoration: none;
  padding: 0 2px;
}

.sidenote {
  display: block;
  padding: var(--space-3) var(--space-4);
  background: var(--panel);
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--text-secondary);
}

.sidenote:target {
  box-shadow: inset 2px 0 0 var(--accent-line);
}

.sidenote-number {
  font-family: var(--font-mono);
  color: var(--accent-text);
  margin-right: var(--space-1);
  text-decoration: none;
}

.sidenote-number:hover,
.sidenote-number:focus-visible {
  text-decoration: underline;
}

/* The note or reference a link jumped to. */
.sidenote:target,
.note-ref a:target {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

/* Glossary term: a native popover, no script. */
.term {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted var(--accent-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  cursor: help;
}

.term:hover {
  color: var(--text);
}

.term-pop {
  inset: auto var(--gutter) var(--gutter) var(--gutter);
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent-line);
  background: var(--surface-2);
  color: var(--reading-text);
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.35);
}

.term-pop::backdrop {
  background: rgb(0 0 0 / 0.2);
}

.term-pop .label {
  color: var(--accent-text);
}

.term-pop dfn {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

.term-pop .term-def {
  display: block;
  margin-top: var(--space-2);
}

.term-pop a {
  display: block;
  width: fit-content;
  margin-top: var(--space-3);
  font-size: var(--step--1);
}

/* Inline code and code blocks (highlighted at build time). */
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

pre[class*="language-"] {
  overflow-x: auto;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-alt);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 0.85rem;
  line-height: 1.6;
}

pre[class*="language-"] code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

/* Prism token classes (highlighted at build time, four colours only). */
.token.function,
.token.keyword,
.token.builtin,
.token.tag,
.token.selector {
  color: var(--accent-text);
}

.token.parameter,
.token.operator,
.token.punctuation,
.token.attr-name {
  color: var(--text-secondary);
}

.token.string,
.token.number,
.token.variable,
.token.attr-value {
  color: var(--text);
}

.token.comment {
  color: var(--text-secondary);
  font-style: italic;
}

/* Formula (MathML, rendered at build time). */
.formula {
  padding: var(--space-3) 0;
  font-size: 1.5em;
  text-align: center;
  overflow-x: auto; /* a long formula scrolls on a phone, the page doesn't */
}

math {
  font-family: "STIX Two Math", "Cambria Math", math;
}

math[display="block"] {
  display: block math;
}

/* Figures at three widths: text (default), wide, full-bleed. */
.figure {
  margin-top: 2em;
  margin-bottom: 2em;
}

.figure figcaption {
  max-width: var(--w-text);
  margin-top: 10px;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--text-secondary);
}

.figure-full {
  position: relative;
  z-index: 2;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: var(--space-7) var(--gutter);
  background: var(--band);
}

.figure-full > * {
  max-width: var(--w-page);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1080px) {
  /* Wide covers the rail as it scrolls past; the contents panel reappears
     below it. */
  .figure-wide,
  .article-body > .table-wide {
    position: relative;
    z-index: 2;
    width: calc(100% + var(--w-gap) + var(--w-rail)); /* --w-wide at full size */
    max-width: none;
    background: var(--bg);
  }

  /* Full-bleed is centred on the page, not on the text column. */
  .figure-full {
    margin-left: calc(-1 * max(var(--gutter), (100vw - var(--w-page)) / 2 + var(--gutter)));
  }
}

.fig {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
}

.fig-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.fig-ticks text {
  fill: var(--text-secondary);
  font-size: 12px;
}

.fig-bar-y {
  fill: var(--surface-2);
}

.fig-bar-x {
  fill: var(--signal-bg);
}

.fig-bar-z {
  fill: none;
  stroke: var(--text-secondary);
  stroke-dasharray: 4 4;
}

.fig-label {
  fill: var(--text);
}

.fig-label-on-accent {
  fill: var(--signal-text);
}

.fig-marker {
  stroke: var(--warning-line);
  stroke-width: 2;
}

.fig-note {
  fill: var(--warning-line);
  font-size: 12px;
}

/* Tables: rules, no zebra; scroll inside the table only. */
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

caption {
  padding: var(--space-3) 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-secondary);
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--band);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom-color: var(--text-secondary);
}

tbody th {
  color: var(--text);
  font-weight: 600;
}

tbody tr:last-child > * {
  border-bottom: none;
}

tbody tr:hover > * {
  background: var(--accent-tint);
}

.num {
  text-align: right;
  white-space: nowrap;
}

.table-wrap:focus-visible {
  outline-offset: 0;
}

/* Timeline: an ordered list; readable as a list without CSS. */
.timeline {
  list-style: none;
  padding-left: 0 !important;
  margin-left: 6px;
  box-shadow: inset 2px 0 0 var(--border);
}

.timeline-item {
  position: relative;
  padding-left: var(--space-5);
}

.timeline-item + .timeline-item {
  margin-top: 1.1em;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.4em;
  width: 12px;
  height: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 2px var(--accent-line);
}

.timeline-past::before {
  background: var(--accent-line);
}

.timeline-now::before {
  background: var(--warning-line);
  box-shadow: none;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
}

.timeline-now .timeline-date {
  color: var(--warning-line);
}

.timeline-title {
  color: var(--text);
  font-weight: 600;
}

.timeline-text {
  font-size: 0.92em;
  color: var(--text-secondary);
}

/* Sources */
.sources {
  margin-top: 3em !important;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--text-secondary);
}

.sources h2 {
  font-size: 1rem;
  font-weight: 700;
}

.sources ol {
  margin-top: var(--space-2);
}

.sources .ai-disclosure {
  margin-top: var(--space-3);
}

.sources li {
  overflow-wrap: anywhere;
}

/* ---- 8. Article footer ------------------------------------------------- */

.article-foot {
  padding-top: var(--space-7);
}

.article-foot > * + * {
  margin-top: var(--space-7);
}

.share-bottom {
  margin-top: 0;
}

.share-bottom .share-link {
  background: var(--panel);
}

.contact-block {
  padding: 36px var(--space-6);
  background: var(--action-bg);
  color: var(--action-text);
}

.contact-block h2 {
  font-family: var(--font-head);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
}

.contact-block p {
  margin-top: var(--space-2);
  max-width: 60ch;
  color: var(--action-text);
}

.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 22px;
  background: var(--action-text);
  color: var(--action-bg);
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.contact-block :focus-visible {
  outline-color: var(--action-text);
  outline-offset: 3px;
}

.author-box {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.author-box img {
  width: 72px;
  height: 72px;
  border: 2px solid var(--accent-dim);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-name {
  font-weight: 600;
}

.author-name a {
  color: var(--text);
  text-decoration: none;
}

.author-name a:hover {
  text-decoration: underline;
}

.author-bio {
  margin-top: var(--space-1);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.section-label {
  color: var(--text-secondary);
}

/* ---- 9. Index pages ---------------------------------------------------- */

.index-head {
  padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px);
}

.eyebrow {
  color: var(--accent-text);
}

.index-title {
  margin-top: var(--space-3);
  max-width: 18ch;
  font-family: var(--font-head);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: var(--leading-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.index-intro {
  margin-top: var(--space-4);
  max-width: 60ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--text-secondary);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.filters a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid transparent;
  background: var(--bg);
  font-size: var(--step--1);
  color: var(--text-secondary);
  text-decoration: none;
}

.filters a:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

.filters a[aria-current] {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.filters-format {
  align-items: center;
  margin-top: var(--space-3);
}

.filters-label {
  margin-right: var(--space-1);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.index-featured {
  margin-top: var(--space-7);
  margin-bottom: var(--space-7);
}

.index-list {
  padding-bottom: var(--space-8);
}

/* Cards: flat tiles with a top bar; mint bar for Reports. */
.card-list {
  list-style: none;
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

@media (min-width: 720px) {
  .card-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--panel);
  box-shadow: inset 0 4px 0 var(--border);
}

.card:has(.format-report) {
  box-shadow: inset 0 4px 0 var(--accent-line);
}

.card .kicker {
  margin-bottom: var(--space-3);
  font-size: 11px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

.card-title a {
  color: var(--text);
  text-decoration: none;
}

.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card:hover .card-title a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent-line);
}

.card:focus-within {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.card-title a:focus-visible {
  outline: none;
}

.card-dek {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.card-meta {
  margin-top: auto;
  padding-top: var(--space-4);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Featured Report: a signal block with its motif. */
.card-featured {
  display: grid;
  gap: var(--space-5);
  padding: clamp(24px, 4vw, 48px);
  background: var(--signal-bg);
  box-shadow: none !important;
}

.card-featured .card-title {
  max-width: 28ch;
  font-size: var(--step-3);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.card-featured .card-title a,
.card-featured .card-dek,
.card-featured .card-meta,
.card-featured .category {
  color: var(--signal-text);
}

.card-featured .card-dek {
  max-width: 62ch;
  font-size: 1.0625rem;
}

.card-featured .format {
  border-color: var(--signal-text);
  background: var(--signal-text);
  color: var(--signal-bg);
}

.card-featured:hover .card-title a {
  text-decoration-color: var(--signal-text);
}

.card-featured:focus-within {
  outline-color: var(--accent-text);
  outline-offset: 3px;
}

.card-motif {
  display: none;
}

@media (min-width: 900px) {
  .card-featured {
    grid-template-columns: 1fr 220px;
    align-items: center;
  }
  .card-motif {
    display: block;
    width: 220px;
    color: var(--signal-text);
  }
}

/* Pagination and empty state */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-7);
  font-family: var(--font-mono);
  font-size: 13px;
}

.pagination ol {
  display: flex;
  gap: var(--space-1);
  list-style: none;
}

.pagination a,
.pagination span[aria-current],
.pagination .is-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 var(--space-3);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.pagination a:hover {
  box-shadow: inset 0 0 0 1px var(--text-secondary);
}

.pagination span[aria-current] {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}

.pagination .is-disabled {
  background: none;
  color: var(--text-secondary);
}

.empty-state {
  padding: var(--space-7) var(--space-5);
  background: var(--panel);
  text-align: center;
  color: var(--text-secondary);
}

.empty-state strong {
  display: block;
  margin-bottom: var(--space-1);
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--text);
}

/* ---- 10. Site footer, motion, print ------------------------------------ */

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.logo-small {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo-small span {
  color: var(--accent-text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.footer-links a {
  display: inline-block;
  padding: 4px 0; /* 24 px target (WCAG 2.2, 2.5.8) */
  font-size: var(--step--1);
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.site-footer .mono {
  font-size: 12px;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .share,
  .toc,
  .head-motif,
  .contact-block .btn,
  .related,
  .skip-link,
  .anchor {
    display: none !important;
  }
  :root,
  :root[data-theme="light"] {
    --bg: #fff;
    --band: #fff;
    --panel: #fff;
    --surface-2: #f3f2f3;
    --text: #000;
    --reading-text: #111;
    --text-secondary: #333;
    --accent-text: #000;
    --accent-line: #377067;
    --warning-line: #9a4b00;
    --signal-bg: #fff;
    --signal-text: #000;
    --action-bg: #fff;
    --action-text: #000;
  }
  body {
    font-size: 11pt;
  }
  .article-head {
    padding: 0 0 12pt;
  }
  .article-layout {
    padding-top: 0;
  }
  .short-answer,
  .takeaways,
  .contact-block,
  .callout,
  .next-steps {
    border: 1px solid #999;
    box-shadow: none;
  }
  .article-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
  .figure,
  .table-wrap,
  .callout,
  pre[class*="language-"],
  .timeline-item {
    break-inside: avoid;
  }
  h2,
  h3 {
    break-after: avoid;
  }
}

/* ---- 11. Additions from the build (P3) --------------------------------- */

/* Content for the PDF only (tools/pdf/pdf.css shows it). */
.pdf-only {
  display: none;
}

/* Previews only: drafts and scheduled articles say so. */
.draft-note {
  display: inline-block;
  margin-bottom: var(--space-5);
  padding: var(--space-1) var(--space-3);
  border: 1px dashed var(--warning-line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

/* Author page head */
.author-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
  margin-top: var(--space-3);
}

.author-head img {
  width: 96px;
  height: 96px;
  border: 2px solid var(--accent-dim);
  border-radius: 50%;
  object-fit: cover;
}

.author-head .index-title {
  margin-top: 0;
}

/* Glossary page */
.glossary {
  display: grid;
  gap: var(--space-4);
  max-width: var(--w-text);
}

.glossary-entry {
  padding: var(--space-5);
  background: var(--panel);
}

.glossary-entry:target {
  box-shadow: inset 3px 0 0 var(--accent-line);
}

.glossary dt {
  font-family: var(--font-head);
  font-size: var(--step-1);
  font-weight: 700;
}

.glossary dd {
  margin-top: var(--space-2);
  color: var(--reading-text);
  font-size: var(--step-0);
  line-height: var(--leading-body);
}
