/* ==========================================================================
   Patient Safety 101: design system (v1, October 2026)
   One shared stylesheet for every page. Plain CSS, no build step.
   Tokens are custom properties on :root; components are BEM-style classes.
   See docs/redesign/DESIGN_SYSTEM.md for the reasoning behind every token.
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted, Latin subset, SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
/* Metric-matched fallbacks (Capsize) so the swap to web fonts does not shift layout. */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  ascent-override: 76.4676%; descent-override: 27.5699%; line-gap-override: 0%; size-adjust: 96.1192%;
}
@font-face {
  font-family: "Bricolage Grotesque Fallback";
  src: local("Arial"), local("ArialMT");
  ascent-override: 88.2116%; descent-override: 25.6098%; line-gap-override: 0%; size-adjust: 105.4283%;
}

/* ---------- 2. Tokens ---------- */
:root {
  /* Colour: ink is the company navy, interaction is brand teal, signal is brand crimson. */
  --ink: #081A43;
  --ink-muted: #46506B;
  --paper: #F7F4EE;
  --paper-2: #EDE7DC;
  --white: #FFFFFF;
  --rule: #CFC6B6;
  --rule-strong: #8C8270;
  --teal: #02807F;          /* brand teal: large text, rules and graphics only */
  --teal-ink: #006A69;      /* interactive teal for text and buttons (5.9:1 on paper) */
  --teal-ink-hover: #00504F;
  --signal: #A61D40;        /* brand crimson: "what changed" and the single most important action */
  --signal-hover: #861733;
  --navy: #081A43;          /* the CASCADE ground */
  --on-navy: #F7F4EE;
  --on-navy-muted: #B7C0D8;
  --teal-on-navy: #7FD3CB;
  --error: #A3261A;
  --success: #1F6A3B;
  --focus: var(--ink);
  --selection: #CDE7E4;

  /* Type */
  --font-serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --font-sans: "Bricolage Grotesque", "Bricolage Grotesque Fallback", Arial, sans-serif;
  --font-display: var(--font-serif);
  --font-text: var(--font-sans);
  --font-longform: var(--font-serif);

  --step--2: 0.8125rem;                                   /* 13px: legal small print */
  --step--1: 0.875rem;                                    /* 14px: metadata, captions, labels */
  --step-0: 1.0625rem;                                    /* 17px: interface body */
  --step-1: 1.25rem;                                      /* 20px: lede */
  --step-2: clamp(1.375rem, 1.17rem + 0.9vw, 1.625rem);   /* h3 */
  --step-3: clamp(1.75rem, 1.35rem + 1.7vw, 2.375rem);    /* h2 */
  --step-4: clamp(2.25rem, 1.55rem + 3vw, 3.5rem);        /* h1 */
  --step-5: clamp(2.6rem, 1.5rem + 4.7vw, 4.75rem);       /* display */
  --longform-size: clamp(1.125rem, 1.07rem + 0.25vw, 1.1875rem); /* 18 to 19px article body */

  --leading-tight: 1.06;
  --leading-snug: 1.25;
  --leading-body: 1.6;
  --leading-long: 1.68;
  --measure: 38rem;          /* about 66 characters of long-form text */
  --measure-wide: 46rem;

  /* Space (4px base) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 8rem;
  --section: clamp(3.5rem, 2rem + 6vw, 7rem);
  --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 2.5rem);
  --max: 75rem;

  /* Shape and motion */
  --radius: 2px;              /* one radius for controls; images and sections stay square */
  --rule-w: 1px;
  --dur-1: 150ms; --dur-2: 280ms; --dur-draw: 1000ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); color: var(--ink); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: var(--step-0); line-height: var(--leading-body);
  font-optical-sizing: auto; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, figure, blockquote { margin: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
::selection { background: var(--selection); color: var(--ink); }
hr { border: 0; border-top: var(--rule-w) solid var(--rule); margin: 0; }
abbr[title] { text-decoration: none; }

a { color: var(--teal-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--teal-ink-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: var(--s-3) var(--s-4);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
/* Small utilities (no inline styles anywhere, so a strict Content-Security-Policy can be used). */
.mt-0 { margin-top: 0 !important; } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); } .mt-7 { margin-top: var(--s-7); } .mt-8 { margin-top: var(--s-8); }
.self-end { align-self: end; } .self-center { align-self: center; } .text-right { text-align: right; }
.maxw-measure { max-width: var(--measure); } .maxw-none { max-width: none; }

/* ---------- 4. Layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), var(--measure-wide)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.section + .section { border-top: var(--rule-w) solid var(--rule); }
.ground-paper-2 { background: var(--paper-2); }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.stack-lg > * + * { margin-top: var(--s-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--s-6); }
.grid > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 56rem) {
  /* Spans live on grid-column-end so a .start-N class can move a column without losing its span. */
  .col-3 { grid-column: auto / span 3; } .col-4 { grid-column: auto / span 4; } .col-5 { grid-column: auto / span 5; }
  .col-6 { grid-column: auto / span 6; } .col-7 { grid-column: auto / span 7; } .col-8 { grid-column: auto / span 8; }
  .col-9 { grid-column: auto / span 9; } .col-12 { grid-column: 1 / -1; }
  .start-2 { grid-column-start: 2; } .start-5 { grid-column-start: 5; } .start-6 { grid-column-start: 6; }
  .start-7 { grid-column-start: 7; } .start-8 { grid-column-start: 8; } .start-9 { grid-column-start: 9; }
}

/* ---------- 5. Typography ---------- */
.display, h1, .h1 { font-family: var(--font-display); font-weight: 420; line-height: var(--leading-tight); letter-spacing: -0.018em; }
.display { font-size: var(--step-5); max-width: 18ch; }
h1, .h1 { font-size: var(--step-4); max-width: 22ch; }
h2, .h2 { font-family: var(--font-display); font-size: var(--step-3); font-weight: 450; line-height: var(--leading-snug); letter-spacing: -0.012em; max-width: 30ch; }
h3, .h3 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; line-height: 1.3; }
h4, .h4 { font-family: var(--font-text); font-size: var(--step-0); font-weight: 650; line-height: 1.4; }
.lede { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 36rem; }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .35em; }
.muted { color: var(--ink-muted); }
.small, .meta, .caption { font-size: var(--step--1); line-height: 1.5; color: var(--ink-muted); }
.num { font-family: var(--font-text); font-variant-numeric: tabular-nums lining-nums; }

/* Section label: a number and a name, set on the static rule. Replaces caps eyebrows. */
.label {
  display: flex; align-items: baseline; gap: var(--s-3);
  font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; letter-spacing: .01em; color: var(--ink-muted);
  padding-top: var(--s-3); border-top: var(--rule-w) solid var(--ink); margin-bottom: var(--s-5);
}
.label__num { font-variant-numeric: tabular-nums; color: var(--ink); }

.pullquote {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem); line-height: 1.3;
  border-left: 2px solid var(--teal); padding-left: var(--s-5); max-width: 32ch;
}

/* ---------- 6. The rule line: "the line that completes itself" ---------- */
/* Draws once on load (about a second), then stays still. Complete under reduced motion.
   Runs vertically below 40rem. The steps are an ordered list, readable by assistive technology. */
.ruleline { margin-top: var(--s-7); max-width: 52rem; }
.ruleline__steps {
  list-style: none; margin: 0; padding: var(--s-5) 0 0; position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4);
  font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; line-height: 1.35;
}
.ruleline__steps::before, .ruleline__steps::after {
  content: ""; position: absolute; top: 0; height: 1.5px;
  animation: ruleline-draw var(--dur-draw) var(--ease) both;
}
.ruleline__steps::before { left: 0; width: 50%; background: var(--ink); }
.ruleline__steps::after { left: 50%; width: 50%; background: var(--signal); animation-delay: calc(var(--dur-draw) * .45); }
.ruleline__step { position: relative; padding-top: var(--s-2); }
.ruleline__step::before {
  content: ""; position: absolute; left: 0; top: calc(-1 * var(--s-5) - 4px); width: 1.5px; height: 9px; background: currentColor;
}
.ruleline__step--signal { color: var(--signal); animation: ruleline-arrive var(--dur-2) var(--ease) both; }
.ruleline__step--signal:nth-child(3) { animation-delay: calc(var(--dur-draw) * .6); }
.ruleline__step--signal:nth-child(4) { animation-delay: calc(var(--dur-draw) * .8); }
/* clip-path reveal (paint-based) so the finished line always renders in full. */
@keyframes ruleline-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ruleline-arrive { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (max-width: 40rem) {
  .ruleline__steps { grid-template-columns: 1fr; gap: var(--s-3); padding: 0 0 0 var(--s-5); }
  .ruleline__steps::before, .ruleline__steps::after { top: 0; left: 0; width: 1.5px; height: 50%; animation-name: ruleline-draw-v; }
  .ruleline__steps::after { top: 50%; }
  .ruleline__step { padding-top: 0; }
  .ruleline__step::before { left: calc(-1 * var(--s-5) - 4px); top: .6em; width: 9px; height: 1.5px; }
  @keyframes ruleline-draw-v { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
}

/* Static recurrences of the rule: section divider with a question, and article endings. */
.rule-question {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--s-4);
  font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; color: var(--signal);
}
.rule-question::after { content: ""; height: 1.5px; background: linear-gradient(to right, var(--signal), var(--signal) 30%, var(--rule) 30%); }
.article-end { margin-top: var(--s-8); padding-top: var(--s-4); border-top: 1.5px solid var(--ink); }

/* ---------- 7. Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 2.875rem; padding: .7rem 1.25rem; border: 1.5px solid transparent; border-radius: var(--radius);
  font-family: var(--font-text); font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--teal-ink); color: var(--white); }
.btn--primary:hover { background: var(--teal-ink-hover); color: var(--white); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--paper); }
.btn--signal { background: var(--signal); color: var(--white); }
.btn--signal:hover { background: var(--signal-hover); color: var(--white); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.link-cta {
  font-family: var(--font-text); font-weight: 600; color: var(--teal-ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .24em;
}
.link-cta:hover { text-decoration-thickness: 2px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); margin-top: var(--s-6); }

/* ---------- 8. Header and navigation ---------- */
.site-header { background: var(--paper); border-bottom: var(--rule-w) solid var(--rule); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: 4.25rem; }
.brand { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.1; }
.brand:hover { color: var(--ink); }
.brand__name { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 500; letter-spacing: -.01em; }
.brand__by { font-family: var(--font-text); font-size: .75rem; color: var(--ink-muted); margin-top: 2px; }
.site-nav { display: none; }
.site-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--s-1); }
.site-nav__link {
  display: inline-block; padding: .55rem .7rem; font-size: .95rem; font-weight: 500; color: var(--ink); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav__link:hover { color: var(--teal-ink); border-bottom-color: var(--rule); text-decoration: none; }
.site-nav__link[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 650; }
.site-header__cta { display: none; }
@media (min-width: 64rem) {
  .site-nav, .site-header__cta { display: block; }
  .menu { display: none; }
}
/* Mobile menu: a <details> disclosure, so it works without JavaScript. site.js adds Escape and outside-click closing. */
.menu { position: static; }
.menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 2.75rem; padding: .5rem .85rem; border: 1.5px solid var(--ink); border-radius: var(--radius);
  font-weight: 600; font-size: .95rem;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::before { content: ""; width: 1rem; height: 9px; border-block: 1.5px solid currentColor; }
.menu[open] > summary::before { height: 0; border-bottom: 0; }
.menu__close { display: none; }
.menu[open] .menu__open { display: none; }
.menu[open] .menu__close { display: inline; }
.menu__panel {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: var(--rule-w) solid var(--rule);
  max-height: calc(100vh - 4.25rem); max-height: calc(100dvh - 4.25rem); overflow-y: auto;
  padding: var(--s-4) var(--gutter) var(--s-6);
}
.menu__list { list-style: none; margin: 0; padding: 0; }
.menu__list a {
  display: block; padding: .9rem 0; border-bottom: var(--rule-w) solid var(--rule);
  font-family: var(--font-serif); font-size: 1.35rem; color: var(--ink); text-decoration: none;
}
.menu__list a[aria-current="page"] { font-weight: 600; }
.menu__list a[aria-current="page"]::before { content: ""; display: inline-block; width: .6rem; height: 1.5px; background: var(--ink); margin: 0 .5rem .3rem 0; }
.menu__cta { margin-top: var(--s-5); }

/* Breadcrumbs */
.breadcrumb { font-size: var(--step--1); color: var(--ink-muted); margin-bottom: var(--s-5); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--rule-strong); }
.breadcrumb a { color: var(--ink-muted); }

/* ---------- 9. Page intro ---------- */
.page-intro { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.page-intro .lede { margin-top: var(--s-5); }
.hero { padding-block: clamp(3rem, 1.5rem + 6vw, 6.5rem) clamp(3rem, 2rem + 4vw, 5rem); }
.hero .lede { margin-top: var(--s-5); }

/* ---------- 10. Start Here (progressive disclosure, no JavaScript needed) ---------- */
.needs { list-style: none; margin: 0; padding: 0; border-top: var(--rule-w) solid var(--ink); counter-reset: need; }
.needs > li { border-bottom: var(--rule-w) solid var(--rule); counter-increment: need; }
.need > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: baseline; gap: var(--s-3);
  padding: var(--s-4) 0; font-family: var(--font-serif); font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); line-height: 1.3;
}
.need > summary::-webkit-details-marker { display: none; }
.need > summary::before { content: counter(need, decimal-leading-zero); font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; color: var(--ink-muted); }
.need > summary::after { content: "+"; font-family: var(--font-text); font-size: 1.25rem; color: var(--teal-ink); width: 1.5rem; text-align: center; }
.need[open] > summary::after { content: "\2212"; }
.need > summary:hover { color: var(--teal-ink); }
.need__answer { padding: 0 0 var(--s-5) 2.5rem; max-width: 40rem; }
.need__answer > * + * { margin-top: var(--s-3); }

/* ---------- 11. Covers: the site provides the frame, the covers are untouched ---------- */
.cover {
  margin: 0; background: var(--paper-2); aspect-ratio: 4 / 5; display: grid; place-items: center; padding: 9%;
  border-top: 1.5px solid var(--ink);
}
.cover img { width: 100%; height: 100%; object-fit: contain; }
.cover figcaption { font-size: var(--step--1); color: var(--ink-muted); margin-top: var(--s-3); }

/* ---------- 12. The Suite: a contents page ---------- */
.suite { display: grid; gap: var(--s-7); }
.suite__list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.suite__item { border-bottom: var(--rule-w) solid var(--rule); }
.suite__row {
  display: grid; grid-template-columns: 2.75rem 1fr 4.5rem; grid-template-areas: "num title thumb" "num for thumb" "num formats thumb";
  column-gap: var(--s-4); row-gap: .15rem; align-items: start;
  padding: var(--s-4) 0; color: var(--ink); text-decoration: none;
}
.suite__row:hover { color: var(--ink); background: linear-gradient(to right, var(--paper-2), transparent 70%); }
.suite__num { grid-area: num; font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; color: var(--ink-muted); padding-top: .45rem; font-variant-numeric: tabular-nums; }
.suite__title { grid-area: title; font-family: var(--font-serif); font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); line-height: 1.2; font-weight: 450; }
.suite__row:hover .suite__title, .suite__row:focus-visible .suite__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.suite__for { grid-area: for; color: var(--ink-muted); font-size: var(--step-0); }
.suite__formats { grid-area: formats; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-top: .2rem; }
.suite__thumb { grid-area: thumb; background: var(--paper-2); aspect-ratio: 4 / 5; padding: 6%; }
.suite__thumb img { width: 100%; height: 100%; object-fit: contain; }
.suite__stage { display: none; }
@media (min-width: 64rem) {
  .suite { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: var(--gutter); }
  .suite__row { grid-template-columns: 3rem 1fr; grid-template-areas: "num title" "num for" "num formats"; }
  .suite__thumb { display: none; }
  .suite__stage { display: block; position: sticky; top: 6rem; }
  .suite__panel { display: none; }
  .suite__panel:first-child { display: block; }
  .suite:has(.suite__row:is(:hover, :focus-visible)) .suite__panel { display: none; }
  .suite:has(.suite__item:nth-child(1) .suite__row:is(:hover, :focus-visible)) .suite__panel:nth-child(1),
  .suite:has(.suite__item:nth-child(2) .suite__row:is(:hover, :focus-visible)) .suite__panel:nth-child(2),
  .suite:has(.suite__item:nth-child(3) .suite__row:is(:hover, :focus-visible)) .suite__panel:nth-child(3),
  .suite:has(.suite__item:nth-child(4) .suite__row:is(:hover, :focus-visible)) .suite__panel:nth-child(4),
  .suite:has(.suite__item:nth-child(5) .suite__row:is(:hover, :focus-visible)) .suite__panel:nth-child(5),
  .suite:has(.suite__item:nth-child(6) .suite__row:is(:hover, :focus-visible)) .suite__panel:nth-child(6) { display: block; }
  .suite__row { transition: background-color var(--dur-1) var(--ease); }
}
.suite__gain { margin-top: var(--s-5); }
.suite__gain h3, .suite__gain .h4 { font-family: var(--font-text); font-size: var(--step--1); font-weight: 650; color: var(--ink-muted); }
.suite__gain ul { list-style: none; padding: 0; margin: var(--s-2) 0 0; }
.suite__gain li { padding: .45rem 0; border-top: var(--rule-w) solid var(--rule); font-size: .95rem; }

/* ---------- 13. The CASCADE change of ground ---------- */
.ground-navy { background: var(--navy); color: var(--on-navy); --focus: var(--on-navy); }
.ground-navy a { color: var(--teal-on-navy); }
.ground-navy a:hover { color: var(--on-navy); }
.ground-navy .muted, .ground-navy .meta, .ground-navy .small { color: var(--on-navy-muted); }
.ground-navy h2, .ground-navy h3 { font-family: var(--font-text); font-weight: 600; letter-spacing: -0.01em; }
.ground-navy .label { color: var(--on-navy-muted); border-top-color: var(--on-navy); }
.ground-navy .label__num { color: var(--on-navy); }
.ground-navy .btn--secondary { color: var(--on-navy); border-color: var(--on-navy); }
.ground-navy .btn--secondary:hover { background: var(--on-navy); color: var(--navy); }
.ground-navy .btn--signal { box-shadow: 0 0 0 1.5px var(--on-navy); }
.ground-navy ::selection { background: var(--teal-on-navy); color: var(--navy); }
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: q; }
.questions li {
  counter-increment: q; display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--s-3); align-items: baseline;
  padding: var(--s-4) 0; border-top: var(--rule-w) solid rgba(247, 244, 238, .28);
  font-family: var(--font-text); font-size: clamp(1.2rem, 1rem + .9vw, 1.6rem); font-weight: 500; line-height: 1.3;
}
.questions li::before { content: counter(q, decimal-leading-zero); font-size: var(--step--1); font-weight: 600; color: var(--on-navy-muted); }
.status-line { border-left: 2px solid var(--teal-on-navy); padding-left: var(--s-5); max-width: 40rem; font-size: 1.05rem; line-height: 1.6; }
.questions li:last-child { border-bottom: var(--rule-w) solid rgba(247, 244, 238, .28); }
@media (min-width: 56rem) { .questions--row { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); } .questions--row li:last-child { border-bottom: 0; } }

/* ---------- 14. Lists, tables, notes ---------- */
.list-ruled { list-style: none; margin: 0; padding: 0; }
.list-ruled > li { padding: .7rem 0; border-top: var(--rule-w) solid var(--rule); }
.list-ruled > li:last-child { border-bottom: var(--rule-w) solid var(--rule); }
.table-wrap { overflow-x: auto; border-top: 1.5px solid var(--ink); }
.table-wrap:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
caption { text-align: left; font-size: var(--step--1); color: var(--ink-muted); padding: var(--s-3) 0; caption-side: bottom; }
th, td { text-align: left; padding: .75rem .75rem .75rem 0; border-bottom: var(--rule-w) solid var(--rule); vertical-align: top; }
th { font-weight: 650; font-size: var(--step--1); color: var(--ink-muted); }
td.isbn, .isbn { font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.note { border-left: 2px solid var(--rule-strong); padding-left: var(--s-4); color: var(--ink-muted); font-size: .95rem; }

/* ---------- 15. Offers (For Organisations and similar): typographic, no card grid ---------- */
.offers { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.offer { display: grid; gap: var(--s-3) var(--gutter); padding: var(--s-6) 0; border-bottom: var(--rule-w) solid var(--rule); }
.offer__num { font-size: var(--step--1); font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.offer h3 { font-size: var(--step-2); }
@media (min-width: 56rem) { .offer { grid-template-columns: 3rem minmax(0, 5fr) minmax(0, 6fr); } }

/* ---------- 16. Forms ---------- */
.form { display: grid; gap: var(--s-5); max-width: 36rem; }
.field { display: grid; gap: var(--s-2); }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: var(--step--1); color: var(--ink-muted); }
.req { color: var(--ink-muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); padding: .7rem .8rem; min-height: 2.875rem;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
.form-status { font-weight: 600; min-height: 1.5em; margin: 0; }
.form-status.is-success { color: var(--success); }
.form-status.is-error { color: var(--error); }
.form-status.is-pending { color: var(--ink-muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: var(--step--1); color: var(--ink-muted); max-width: 36rem; }

/* ---------- 17. FAQ (native details, works without JavaScript) ---------- */
.faq { border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: var(--rule-w) solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: var(--s-4) 2.5rem var(--s-4) 0; position: relative;
  font-family: var(--font-serif); font-size: var(--step-2); line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: var(--s-4); font-family: var(--font-text); color: var(--teal-ink); font-size: 1.3rem; }
.faq details[open] summary::after { content: "\2212"; }
.faq .faq__answer { padding: 0 0 var(--s-5); max-width: var(--measure); }
.faq .faq__answer > * + * { margin-top: .8em; }

/* ---------- 18. Articles ---------- */
.article-head { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) var(--s-6); }
.article-head h1 { max-width: 24ch; }
.article-head .standfirst { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.45; margin-top: var(--s-4); max-width: 34rem; color: var(--ink-muted); }
.article-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-top: var(--s-5); font-size: var(--step--1); color: var(--ink-muted); }
.article-meta strong { color: var(--ink); font-weight: 600; }
.longform { font-family: var(--font-longform); font-size: var(--longform-size); line-height: var(--leading-long); max-width: var(--measure); }
.longform > * + * { margin-top: 1.05em; }
.longform h2 { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.8rem); margin-top: 1.9em; }
.longform h3 { font-size: 1.25rem; margin-top: 1.6em; }
.longform ul, .longform ol { padding-left: 1.3em; }
.longform li + li { margin-top: .4em; }
.longform blockquote { font-style: italic; border-left: 2px solid var(--teal); padding-left: var(--s-5); color: var(--ink); }
.longform a { color: var(--teal-ink); }
.longform strong { font-weight: 650; }
.outlet-note { margin-top: var(--s-7); padding: var(--s-5) 0; border-top: 1.5px solid var(--ink); border-bottom: var(--rule-w) solid var(--rule); max-width: var(--measure); }
.outlet-note p + p { margin-top: var(--s-3); }
.author-box { display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--s-4); align-items: start; max-width: var(--measure); margin-top: var(--s-7); }
.author-box img { width: 4.5rem; height: 4.5rem; object-fit: cover; }
.related { margin-top: var(--s-8); }

/* ---------- 19. Insights list ---------- */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.entry { border-bottom: var(--rule-w) solid var(--rule); }
.entry a { display: grid; gap: .3rem var(--gutter); padding: var(--s-5) 0; color: var(--ink); text-decoration: none; }
.entry a:hover .entry__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; color: var(--teal-ink); }
.entry__meta { font-size: var(--step--1); color: var(--ink-muted); }
.entry__title { font-family: var(--font-serif); font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); line-height: 1.25; font-weight: 450; }
.entry__summary { color: var(--ink-muted); max-width: 40rem; }
@media (min-width: 56rem) { .entry a { grid-template-columns: 12rem minmax(0, 1fr); } .entry__meta { grid-row: span 2; padding-top: .35rem; } }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.filters button {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; padding: .45rem .85rem; min-height: 2.5rem;
  background: transparent; color: var(--ink); border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 20. Feature blocks used on the homepage ---------- */
.outlets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
.outlets li { padding: var(--s-4) 0; border-bottom: var(--rule-w) solid var(--rule); }
.outlets strong { display: block; font-family: var(--font-serif); font-size: 1.25rem; font-weight: 500; }
@media (min-width: 56rem) { .outlets { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); } }
.portrait { margin: 0; max-width: 22rem; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--paper-2); }
.portrait figcaption { margin-top: var(--s-3); font-size: var(--step--1); color: var(--ink-muted); }
.endnote { display: grid; gap: var(--s-6) var(--gutter); }
@media (min-width: 56rem) { .endnote { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.endnote > div { border-top: 1.5px solid var(--ink); padding-top: var(--s-5); }

/* ---------- 21. Footer ---------- */
.site-footer { background: var(--paper-2); border-top: 1.5px solid var(--ink); padding-block: var(--s-8) var(--s-6); font-size: .95rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--teal-ink); text-decoration: underline; }
.site-footer__grid { display: grid; gap: var(--s-6) var(--gutter); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__brand .brand__name { font-size: 1.5rem; }
.site-footer h2 { font-family: var(--font-text); font-size: var(--step--1); font-weight: 650; color: var(--ink-muted); margin-bottom: var(--s-3); max-width: none; letter-spacing: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.site-footer ul a { display: inline-block; padding: .35rem 0; }
.site-footer__legal { margin-top: var(--s-7); padding-top: var(--s-4); border-top: var(--rule-w) solid var(--rule); font-size: var(--step--2); color: var(--ink-muted); display: grid; gap: var(--s-2); }
.site-footer__legal a { color: var(--ink-muted); text-decoration: underline; }
@media (min-width: 56rem) { .site-footer__grid { grid-template-columns: minmax(0, 4fr) repeat(4, minmax(0, 2fr)); } .site-footer__brand { grid-column: auto; } }

/* ---------- 22. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .ruleline__steps::before, .ruleline__steps::after { clip-path: none; }
  .ruleline__step--signal { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html { scroll-padding-top: 5rem; }

/* ---------- 23. Print ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .menu, .actions, .filters { display: none !important; }
  body, .ground-navy { background: #fff; color: #000; }
  a { color: #000; }
}

/* ---------- 24. Refinements ---------- */
.site-header__cta[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.offers, .needs { border-top-width: var(--rule-w); border-top-color: var(--rule); }
.label + .offers, .label + .visually-hidden + .offers { border-top: 0; }
/* Button labels keep their own colours on the navy ground (the link colour rule must not reach them). */
.ground-navy a.btn--signal, .ground-navy a.btn--signal:hover, .ground-navy a.btn--primary, .ground-navy a.btn--primary:hover { color: var(--white); }
.ground-navy a.btn--secondary { color: var(--on-navy); }
.ground-navy a.btn--secondary:hover { color: var(--navy); }

.questions.mt-6 { margin-top: var(--s-6); }

/* ---------- Page components: books (merged from css/add-books.css) ---------- */
/* Books page (/books) only. Two small components for the lead to merge into system.css:
   .toc   a compact numbered contents list that links to each title on the page;
   .book  one title, with its cover always in the left column (small beside the title on phones). */

/* ---------- Contents ---------- */
.toc__list { list-style: none; margin: 0; padding: 0; border-bottom: var(--rule-w) solid var(--rule); }
.toc__list li + li { border-top: var(--rule-w) solid var(--rule); }
.toc__list a {
  display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: baseline; gap: var(--s-3);
  padding: .55rem 0; color: var(--ink); text-decoration: none;
  font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.3;
}
.toc__list a:hover { color: var(--teal-ink); }
.toc__list a:hover .toc__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.toc__num { font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- One title ---------- */
/* Phones: the label runs full width, the cover sits small beside the title, the rest follows below. */
.book {
  display: grid; align-items: start;
  grid-template-columns: clamp(5.5rem, 28vw, 12rem) minmax(0, 1fr);
  grid-template-areas: "label label" "cover title" "body body";
  gap: var(--s-5) var(--s-4);
}
.book__label { grid-area: label; margin-bottom: 0; }
.book__title { grid-area: title; }
.book__cover { grid-area: cover; }
.book__body { grid-area: body; max-width: var(--measure); }
.book__tagline { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.45; color: var(--ink-muted); }
.book__for { font-size: var(--step--1); color: var(--ink-muted); }
.book__for strong { color: var(--ink); font-weight: 650; }

/* Desktop: the cover keeps the left four columns for every title (it never alternates sides) and
   stays in view while the text beside it scrolls. The last row absorbs a cover taller than its text. */
@media (min-width: 56rem) {
  .book {
    grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto auto 1fr;
    grid-template-areas: none; gap: 0 var(--gutter);
  }
  .book__cover { grid-column: 1 / span 4; grid-row: 1 / -1; position: sticky; top: 6rem; }
  .book__label, .book__title, .book__body { grid-column: 6 / span 7; }
  .book__label { grid-row: 1; margin-bottom: var(--s-5); }
  .book__title { grid-row: 2; }
  .book__body { grid-row: 3; margin-top: var(--s-4); }
}

/* ---------- Page components: cascade (merged from css/add-cascade.css) ---------- */
/* Additions for /cascade only; the lead merges them into system.css.
   .cover--narrow keeps a book cover at book size when the grid stacks (below 56rem).
   From 56rem the grid column is already narrower than this, so desktop is unaffected. */
.cover--narrow { max-width: 24rem; }

/* ---------- Page components: pathways (merged from css/add-pathways.css) ---------- */
/* Pathway pages (For Libraries, Learning): two small additions on the system tokens.
   To be merged into system.css by the lead. */

/* Status note on paper: states the honest status of something in development where it is seen first. */
.status-note {
  border-left: 2px solid var(--teal); padding: var(--s-1) 0 var(--s-1) var(--s-4);
  max-width: 36rem; font-weight: 600; line-height: 1.5; color: var(--ink);
}

/* Stacked table: a normal table from 40rem; below that, one block per row with each value labelled,
   so no column ever sits off-screen. The ARIA roles in the markup keep the table semantics
   when the display changes; the visible labels are aria-hidden because the headers are still announced. */
.table-stack tbody th { font-size: inherit; font-weight: 600; color: var(--ink); }
.cell-label { display: none; }
@media (max-width: 39.99rem) {
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack th { display: block; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .table-stack tbody tr { padding: var(--s-4) 0; border-bottom: var(--rule-w) solid var(--rule); }
  .table-stack th, .table-stack td { padding: 0; border: 0; }
  .table-stack tbody th { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; line-height: 1.3; margin-bottom: var(--s-2); }
  .table-stack td { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--s-3); align-items: baseline; padding-block: .15rem; }
  .table-stack .cell-label { display: block; font-size: var(--step--1); font-weight: 650; color: var(--ink-muted); }
}

/* ---------- Page components: insights (merged from css/add-insights.css) ---------- */
/* Insights and References additions (to be merged into system.css). Existing tokens only. */

/* Insights */
.credentials { margin-top: var(--s-5); max-width: 40rem; }
.credentials strong { color: var(--ink); font-weight: 600; }
.entry__outlet { display: block; color: var(--ink); font-weight: 600; }
.filter-count:not(:empty) { margin-bottom: var(--s-4); }

/* References: contents and search beside the lists (sticky on tall desktop screens) */
.refs-search { margin-bottom: var(--s-6); }
.refs-search__row { display: flex; gap: var(--s-2); }
.refs-search__row input { flex: 1; min-width: 0; }
.refs-search__count { min-height: 1.5em; margin-top: var(--s-2); }
.refs-toc .list-ruled { margin-top: var(--s-3); }
.refs-toc .list-ruled > li { padding: 0; }
.refs-toc a { display: block; padding: .5rem 0; color: var(--ink); text-decoration: none; line-height: 1.35; }
.refs-toc a:hover { color: var(--teal-ink); text-decoration: underline; }
@media (min-width: 56rem) and (min-height: 46rem) { .refs-aside { position: sticky; top: 6rem; align-self: start; } }

/* References: chapter groups and numbered lists (numbers stay fixed while searching: li value) */
.refs-group { border-top: 1.5px solid var(--ink); padding-top: var(--s-4); }
.refs-group + .refs-group { margin-top: var(--s-8); }
.refs-group__title { font-size: var(--step-2); max-width: 40ch; }
.refs-group__num { display: block; margin-bottom: var(--s-2); font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; color: var(--ink-muted); }
.refs-group__count { margin-top: var(--s-2); }
.refs { margin: var(--s-5) 0 0; padding-left: 2.5rem; font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.55; }
.refs > li { padding: .6rem 0; border-top: var(--rule-w) solid var(--rule); }
.refs > li:last-child { border-bottom: var(--rule-w) solid var(--rule); }
.refs > li::marker { font-family: var(--font-text); font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.refs > li:target { background: var(--paper-2); }
.refs-back { margin-top: var(--s-4); }
.refs-az { margin-top: var(--s-5); }
.refs-az ul { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
.refs-az a { display: grid; place-items: center; min-width: 2.5rem; min-height: 2.5rem; border: 1.5px solid var(--rule-strong); border-radius: var(--radius); font-weight: 600; color: var(--ink); text-decoration: none; }
.refs-az a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ref-copy {
  margin-left: var(--s-1); min-height: 1.75rem; padding: .1rem .5rem; cursor: pointer;
  font: 600 var(--step--1)/1.2 var(--font-text); color: var(--teal-ink);
  background: transparent; border: var(--rule-w) solid var(--rule-strong); border-radius: var(--radius);
}
.ref-copy:hover { border-color: var(--teal-ink); }
.refs-colophon { margin-top: var(--s-8); }
@media print { .refs-search, .refs-toc, .refs-az, .refs-back, .ref-copy { display: none !important; } }
