/*
 * Institute of AI — site styles
 * Requires tokens.css (load it first). Every colour, size and space
 * comes from a token; nothing is hard-coded here except breakpoints,
 * which cannot read custom properties (48rem = 768px, 64rem = 1024px).
 *
 * Class reference per block type: docs/handoffs/frontend.md.
 * Contents, in file order (=== marks a delimited section owned by one task)
 *   1  Reset and base
 *   2  Accessibility
 *   3  Layout utilities and shared type
 *   4  Buttons and links
 *   == Header, nav, footer (P2-F2)
 *      Contact details (config)
 *   == Blocks B1-B16 (P2-F3/F4; own contents list inside)
 *   == Page templates (P2-F8): surface band, form split
 *   14 Plate
 *   == Hero (P2-F6)
 *   15 Forms
 *   16 Motion: hover states and arrow nudges
 *   == Motion (P2-F7): reveal, framework diagram, reduced-motion kill switch
 *   == Style guide (P2-F9): /admin-styleguide only
 *   == R3 page heroes (D-047)
 *   == R3 type and bands (D-044, D-045): Inter display, shading
 *   == Logo (D-052): monogram + full name lockup, header and footer
 *   == R4 punch and infographics (D-048, D-050): punchy line, infographic block
 *   == R5 (D-058, D-054): ranked infographic, three-line footer notice
 *   == P3 Insights (F5, F6): filter form, pager, publication page
 */

/* 1 Reset and base ------------------------------------------------------ */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-snug);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

h2 { font-size: var(--step-3); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

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

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: var(--rule-width);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: var(--accent-rule-width);
}

strong { font-weight: 600; }

hr {
  border: 0;
  border-top: var(--rule-width) solid var(--rule);
  margin: var(--space-7) 0;
}

address { font-style: normal; }

[hidden] { display: none !important; }

/* 2 Accessibility ------------------------------------------------------- */

:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: var(--focus-offset);
}

.plate :focus-visible {
  outline-color: var(--plate-accent);
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  text-decoration: none;
  border: var(--rule-width) solid var(--ink);
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 3 Layout utilities and shared type ----------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Eyebrow / UI label register: small, uppercase, letter-spaced sans */
.label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  line-height: var(--leading-snug);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--accent);
}

.plate .label { color: var(--plate-accent); }

.lede {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--ink-soft);
  max-width: var(--measure-narrow);
}

.plate .lede { color: var(--plate-soft); }

.meta {
  font-size: var(--step--1);
  color: var(--ink-faint);
}

.tag {
  display: inline-block;
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
  border: var(--rule-width) solid var(--rule);
  padding: var(--space-1) var(--space-2);
}

.link-list {
  display: grid;
  gap: var(--space-2);
}

.link-list a {
  color: var(--ink);
  text-decoration: none;
}

.link-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.link-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

/* 4 Buttons and links -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  line-height: var(--leading-snug);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: var(--rule-width) solid currentColor;
  border-radius: 0;
  cursor: pointer;
}

.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.btn--solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--solid:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.btn--small {
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  font-size: var(--step--2);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Buttons on a plate: explicit overrides, they do not auto-invert */
.plate .btn {
  color: var(--plate-ink);
  border-color: var(--plate-ink);
  background: transparent;
}

.plate .btn:hover,
.plate .btn--solid {
  background: var(--plate-ink);
  border-color: var(--plate-ink);
  color: var(--plate);
}

.plate .btn--solid:hover {
  background: transparent;
  color: var(--plate-ink);
}

/* Text link with an arrow that nudges on hover */
.link-arrow {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  text-decoration: none;
  color: var(--accent);
}

.link-arrow:hover { text-decoration: underline; }

.arrow {
  display: inline-block;
  margin-left: var(--space-1);
  font-family: var(--font-sans);
}

.link-arrow:hover .arrow,
.ledger__row:hover .ledger__arrow {
  transform: translateX(var(--space-1));
}

.plate a:not(.btn) { color: var(--plate-accent); }

/* === Header, nav, footer (P2-F2) === */
/* D-034 as amended by D-041 (light only, no theme toggle). Owned by the
   frontend P2-F2 task; the blocks section lives elsewhere in this file.
   Breakpoint: 64rem (1024px) switches the nav between the native
   <details> "Menu" (below) and the inline list (from). Both copies come
   from one loop in partials/header.php; the copy not in use is
   display:none, so only one is in the tab order and accessibility tree. */

/* -- Header row ---------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 10;
  background: var(--ground);
  border-bottom: var(--rule-width) solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 4.5rem;
  padding-block: var(--space-3);
}

/* The logo (D-052) is styled in the "Logo (D-052)" section. */

.site-nav { display: flex; align-items: center; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__link {
  display: inline-block;
  padding-block: var(--space-2);
  font-size: var(--step--1);
  font-weight: var(--weight-body);
  line-height: var(--leading-snug);
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: var(--rule-width) solid transparent;
}

.site-nav__link:hover {
  color: var(--ink);
  border-bottom-color: currentColor;
}

.site-nav__link[aria-current="page"],
.site-nav__link[aria-current="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* CTA: bordered text button, sentence case so the header stays quiet */
.site-nav__cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  line-height: var(--leading-snug);
  text-decoration: none;
  color: var(--ink);
  border: var(--rule-width) solid currentColor;
}

.site-nav__cta:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

/* -- Inline list, from 1024px -------------------------------------------- */

.site-nav__list { display: none; }

@media (min-width: 64rem) {
  .site-nav__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-1) var(--space-5);
  }

  .site-nav__list .site-nav__item--cta { margin-left: var(--space-2); }

  .site-nav__menu { display: none; }
}

/* -- Native disclosure, below 1024px ------------------------------------- */

.site-nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}

.site-nav__toggle::-webkit-details-marker { display: none; }

/* +/− marker with empty alt text, so screen readers only hear "Menu" */
.site-nav__toggle::after {
  content: "+";
  content: "+" / "";
  display: inline-block;
  width: 1ch;
  font-size: var(--step-1);
  line-height: 1;
  text-align: center;
}

.site-nav__menu[open] > .site-nav__toggle::after {
  content: "\2212";
  content: "\2212" / "";
}

/* Open panel: full-width block on --ground below the header row */
.site-nav__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ground);
  border-top: var(--rule-width) solid var(--rule);
  border-bottom: var(--rule-width) solid var(--rule);
}

.site-nav .site-nav__menu-list {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: var(--space-2) var(--gutter) var(--space-5);
  display: grid;
}

.site-nav__menu-list .site-nav__item { border-bottom: var(--rule-width) solid var(--rule-soft); }

.site-nav__menu-list .site-nav__link {
  display: block;
  padding-block: var(--space-3);
  font-size: var(--step-1);
  color: var(--ink);
  border-bottom: 0;
}

.site-nav__menu-list .site-nav__link[aria-current] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: var(--rule-width);
  text-underline-offset: 0.2em;
}

.site-nav__menu-list .site-nav__item--cta {
  border-bottom: 0;
  padding-top: var(--space-5);
}

/* -- Over the Home hero media (plate colours on the scrim) --------------- */

.site-header--over-media {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom-color: transparent;
}

.site-header--over-media :focus-visible { outline-color: var(--plate-accent); }

.site-header--over-media .site-nav__toggle { color: var(--plate-ink); }

/* Links use --plate-ink, not --plate-soft: the media varies in brightness */
.site-header--over-media .site-nav__list .site-nav__link { color: var(--plate-ink); }

.site-header--over-media .site-nav__list .site-nav__link[aria-current] { border-bottom-color: var(--plate-accent); }

.site-header--over-media .site-nav__list .site-nav__cta { color: var(--plate-ink); }

.site-header--over-media .site-nav__list .site-nav__cta:hover {
  background: var(--plate-ink);
  border-color: var(--plate-ink);
  color: var(--plate);
}

/* The open panel keeps ground colours (and its own focus ring) */
.site-header--over-media .site-nav__panel :focus-visible { outline-color: var(--accent); }

/* -- Footer -------------------------------------------------------------- */

.site-footer {
  padding-top: var(--space-6);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.site-footer__top {
  display: grid;
  gap: var(--space-7);
  padding-block: var(--space-6) var(--space-8);
  border-top: var(--rule-width) solid var(--rule);
}

.site-footer__newsletter {
  margin-top: var(--space-6);
  max-width: 28rem;
}

.newsletter-intro { margin-bottom: var(--space-3); }

.site-footer__columns {
  display: grid;
  gap: var(--space-6);
}

.site-footer__heading {
  margin-bottom: var(--space-3);
  color: var(--ink-faint);
}

.site-footer .link-list a { color: var(--ink); }

.site-footer .link-list a:hover { color: var(--accent); }

@media (min-width: 48rem) {
  .site-footer__columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .site-footer__top {
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    column-gap: var(--grid-gap);
  }

  .site-footer__brand { grid-column: 1 / span 6; }

  .site-footer__columns { grid-column: 7 / -1; }
}

.mailbox-links { gap: var(--space-3); }

.mailbox-links li { display: grid; }

.mailbox-links__label {
  color: var(--ink-faint);
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.mailbox-links a { overflow-wrap: anywhere; }

.site-footer .contact-details { margin-top: var(--space-5); }

.site-footer__legal {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-5) var(--space-6);
  border-top: var(--rule-width) solid var(--rule);
}

.site-footer__marks {
  display: grid;
  gap: var(--space-2);
  max-width: var(--measure);
}

.site-footer__identity {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
}

.site-footer__tm,
.site-footer__disclaimer { color: var(--ink-faint); }

@media (min-width: 64rem) {
  .site-footer__legal {
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: start;
  }

  .site-footer__marks { grid-column: 1 / span 7; }

  .site-footer__legal-nav {
    grid-column: 9 / -1;
    justify-self: end;
  }
}

/* === End header, nav, footer (P2-F2) === */

/* Contact details (config): the partial renders nothing when empty */
.contact-details { display: grid; gap: var(--space-3); }

.site-footer .contact-details { margin-top: var(--space-5); }

.contact-details dt {
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
}

.contact-details dd { margin: 0; }

/* === Blocks (P2-F3/F4) === */
/* Owned by the frontend blocks lane (app/views/blocks/, partials/block-head,
   partials/picture). Lean think-tank look (plan §1, D-032, D-041): content on
   --ground, hairline rules between sections, heading left and body right.
   Breakpoints: 48rem (768px) split 5/7, 64rem (1024px) split 6/6.
   Class reference: docs/handoffs/frontend.md (P2-F3/F4 entry).
   Contents
     B1 Section shell        B6 Ledger                B11 FAQ
     B2 Split layout         B7 Grid box (cards/stats) B12 Quote, notice
     B3 Legacy section-head  B8 Image cards           B13 CTA band
     B4 Page header          B9 Figure, picture       B14 Diagram caption
     B5 Columns              B10 Prose, module list,  B15 Dated index
                                 mailbox list         B16 Motion                     */

/* B1 Section shell ------------------------------------------------------- */

.section {
  padding-block: var(--space-8);
}

/* Consecutive sections: a hairline aligned with the content edge, then space */
.section + .section { padding-top: 0; }

.section + .section > .wrap::before {
  content: "";
  display: block;
  grid-column: 1 / -1;
  border-top: var(--rule-width) solid var(--rule);
  margin-bottom: var(--space-8);
}

/* In a split grid the row gap already adds space below the rule */
.section + .section > .wrap.split::before {
  margin-bottom: calc(var(--space-8) - var(--space-5));
}

/* A block with no head of its own (e.g. the ledger after "Advisory") joins
   the section before it: no rule, little space */
.section:has(+ .section--continued) { padding-bottom: var(--space-6); }

.section + .section--continued { padding-top: 0; }

.section + .section--continued > .wrap::before { content: none; }

/* Full-bleed surface band. Blocks no longer use it (D-032); kept for the
   newsletter section partial. */
.section--surface {
  background: var(--surface);
  border-block: var(--rule-width) solid var(--rule);
}

.section--surface + .section,
.section + .section--surface { padding-top: var(--space-8); }

.section--surface + .section > .wrap::before,
.section + .section--surface > .wrap::before { content: none; }

/* Block labels: quiet ink, not the accent */
.section .label { color: var(--ink-faint); }

/* B2 Split layout: heading left, body right ------------------------------ */

.split {
  display: grid;
  row-gap: var(--space-5);
  column-gap: var(--grid-gap);
}

@media (min-width: 48rem) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split > .split__head { grid-column: 1; }
  .split > .split__body { grid-column: 2; }
}

@media (min-width: 64rem) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A split used as the head above a full-width grid (cards, ledger, stats) */
.split--head { margin-bottom: var(--space-7); }

.split__head {
  display: grid;
  align-content: start;
  gap: var(--space-4);
}

/* Muted section number: large text only (>= 32px here), --ink-muted 3.56:1 */
.split__number {
  font-family: var(--font-sans);
  font-size: var(--step-number);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-hero);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.split__title {
  font-size: var(--step-split);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-hero);
  max-width: 18ch;
}

.split__body {
  max-width: var(--measure-split);
  min-width: 0;
}

.split__body > * + * { margin-top: var(--space-6); }

.split__lede {
  font-size: var(--step-2);
  line-height: var(--leading-snug);
  color: var(--ink);
}

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

.split__text strong { color: var(--ink); }

/* Ruled item list (ordered with 01, 02… when numbered_items) */
.split__items { border-top: var(--rule-width) solid var(--rule); }

.split__item {
  display: grid;
  gap: var(--space-2) var(--space-5);
  padding-block: var(--space-5);
  border-bottom: var(--rule-width) solid var(--rule);
}

.split__items--numbered .split__item { grid-template-columns: 2.5rem minmax(0, 1fr); }

.split__item-number {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-faint);
  padding-top: var(--space-1);
}

.split__item-title {
  font-size: var(--step-2);
  line-height: var(--leading-snug);
}

.split__item-body {
  margin-top: var(--space-2);
  color: var(--ink-soft);
}

.split__item-body > * + * { margin-top: var(--space-3); }

.split__item .link-arrow { margin-top: var(--space-3); }

/* Ruled text link (screenshot 04 "Stay informed →") */
.link-rule {
  display: block;
  padding-block: var(--space-4);
  border-block: var(--rule-width) solid var(--rule);
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--ink);
  text-decoration: none;
}

.link-rule:hover { color: var(--accent); }

.link-rule:hover .arrow { transform: translateX(var(--space-1)); }

/* B3 Legacy section-head (enquiry form, newsletter, contact details, error
   links): the same split, via display: contents on the inner div ---------- */

.section-head {
  display: grid;
  gap: var(--space-4) var(--grid-gap);
  margin-bottom: var(--space-7);
}

.section-head > div { display: contents; }

.section-head:last-child { margin-bottom: 0; }

.section-head h2 {
  font-size: var(--step-split);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-hero);
  max-width: 18ch;
}

.section-head .lede {
  font-size: var(--step-2);
  line-height: var(--leading-snug);
  color: var(--ink);
  max-width: var(--measure-split);
}

@media (min-width: 48rem) {
  .section-head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .section-head > .label,
  .section-head h2 { grid-column: 1; }
  .section-head .lede { grid-column: 2; grid-row: 1 / span 2; }
  .section-head--no-label .lede { grid-row: 1; }
  /* Body aligned with the right column: 5/12 of (width - gap) + gap */
  .section-body--offset { margin-left: calc(5 / 12 * 100% + 7 / 12 * var(--grid-gap)); }
}

@media (min-width: 64rem) {
  .section-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-body--offset { margin-left: calc(50% + var(--grid-gap) / 2); }
}

.section-body--offset { max-width: none; }

.section-body > * + * { margin-top: var(--space-6); }

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* B4 Page header: label, H1 left, lede right; no plate ------------------- */

.page-header { padding-block: var(--space-9) var(--space-8); }

.page-header__title { max-width: 16ch; }

.page-header__lede {
  font-family: var(--font-sans);
  font-size: var(--step-2);
  line-height: var(--leading-snug);
  color: var(--ink-soft);
}

/* B5 Columns: n-up under a hairline (no accent rule) -------------------- */

.columns {
  display: grid;
  gap: var(--space-6) var(--grid-gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  border-top: var(--rule-width) solid var(--rule);
}

.col { padding-top: var(--space-5); }

.col__title {
  font-size: var(--step-2);
  margin-bottom: var(--space-3);
}

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

.col__body > * + * { margin-top: var(--space-3); }

.col .link-arrow { margin-top: var(--space-4); }

/* B6 Ledger: large-text ruled rows with arrows --------------------------- */

.ledger { border-top: var(--rule-width) solid var(--rule); }

.ledger__item { border-bottom: var(--rule-width) solid var(--rule); }

.ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--grid-gap);
  align-items: baseline;
  padding-block: var(--space-5);
  color: var(--ink);
  text-decoration: none;
}

.ledger__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.ledger__row:hover .ledger__title { color: var(--accent); }

.ledger__desc {
  grid-column: 1 / 2;
  color: var(--ink-soft);
  max-width: var(--measure-split);
}

.ledger__arrow {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink);
  font-size: var(--step-2);
}

@media (min-width: 64rem) {
  .ledger__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .ledger__desc { grid-column: 2; }
  .ledger__arrow { grid-column: 3; }
}

.link-arrow:hover .arrow,
.ledger__row:hover .ledger__arrow {
  transform: translateX(var(--space-1));
}

/* B7 Grid box: bordered grid with shared hairline edges (screenshot 02).
   Used by numbered_cards and stat_strip. Cells draw right and bottom
   borders; the box clips the outer ones, so incomplete rows stay clean. --- */

.grid-box {
  border: var(--rule-width) solid var(--rule);
  overflow: hidden;
}

.grid-box__label {
  padding: var(--space-3) var(--space-5);
  border-bottom: var(--rule-width) solid var(--rule);
}

.section .grid-box__label { color: var(--ink); }

.grid-box__cells {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 calc(-1 * var(--rule-width)) calc(-1 * var(--rule-width)) 0;
}

.grid-box__cell {
  border-right: var(--rule-width) solid var(--rule);
  border-bottom: var(--rule-width) solid var(--rule);
  padding: var(--space-5);
}

@media (min-width: 48rem) {
  .grid-box__cells--2,
  .grid-box__cells--3,
  .grid-box__cells--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .grid-box__cells--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-box__cells--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Incomplete last rows never leave an empty cell: the last row's cells
   stretch to fill it (5 items at 1280 = 3 + 2 halves; 7 = 3 + 3 + 1 full).
   Two across (768px): an odd last item spans the row. */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .grid-box__cells--2 > .grid-box__cell:nth-child(odd):last-child,
  .grid-box__cells--3 > .grid-box__cell:nth-child(odd):last-child,
  .grid-box__cells--4 > .grid-box__cell:nth-child(odd):last-child { grid-column: 1 / -1; }
}

@media (min-width: 64rem) {
  .grid-box__cells--3 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid-box__cells--3 > .grid-box__cell { grid-column: span 2; }
  .grid-box__cells--3 > .grid-box__cell:nth-child(3n+1):nth-last-child(2),
  .grid-box__cells--3 > .grid-box__cell:nth-child(3n+2):last-child { grid-column: span 3; }
  .grid-box__cells--3 > .grid-box__cell:nth-child(3n+1):last-child { grid-column: 1 / -1; }
}

/* Numbered cards: number top, title, text pinned to the bottom */
.ncard {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-height: clamp(16rem, 10rem + 14vw, 28rem);
}

.ncard__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.ncard__number {
  font-family: var(--font-sans);
  font-size: var(--step-2);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}

.ncard__title {
  font-size: var(--step-3);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

.ncard__bottom { margin-top: auto; }

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

.ncard__body > * + * { margin-top: var(--space-3); }

.ncard__bottom .link-arrow { margin-top: var(--space-4); }

/* Test marks (sprite assets/img/tests.svg), drawn in currentColor */
.mark {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  color: var(--accent);
}

/* Stat strip: figures in display size, label at the bottom */
.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: clamp(10rem, 8rem + 6vw, 14rem);
}

.stat__figure {
  font-family: var(--font-display);
  font-size: var(--step-split);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-hero);
  color: var(--ink);
}

.stat__label {
  font-size: var(--step--1);
  color: var(--ink-soft);
  max-width: 28ch;
}

/* B8 Image cards (screenshot 04): 3 across, 2 at 768px, 1 at 390px ------- */

.icards {
  display: grid;
  gap: var(--space-7) var(--grid-gap);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48rem) {
  .icards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .icards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.icard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.icard__media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface);
}

.icard__media .picture,
.icard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icard__text > * + * { margin-top: var(--space-2); }

.icard__meta {
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
}

.icard__title {
  font-size: var(--step-2);
  line-height: var(--leading-snug);
}

.icard__summary { color: var(--ink-soft); max-width: var(--measure-narrow); }

/* One link per card: the title link is stretched over the whole card */
.icard__anchor {
  color: var(--ink);
  text-decoration: none;
}

.icard__anchor::after {
  content: "";
  position: absolute;
  inset: 0;
}

.icard--link:hover .icard__anchor {
  color: var(--accent);
  text-decoration: underline;
}

.icard__anchor:focus-visible { outline: none; }

.icard__anchor:focus-visible::after {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: var(--focus-offset);
}

/* B9 Figure and picture -------------------------------------------------- */

.picture { display: block; }

.picture img { width: 100%; height: auto; }

/* An opener figure has no hairline and no bottom padding; its top spacing
   after the page hero band is set in the R3 page heroes section. */
.figure-block { padding-bottom: 0; }

.figure-block > .wrap::before { content: none; }

.figure-block + .section { padding-top: var(--space-8); }

.figure-block + .section > .wrap::before { content: none; }

.figure .picture { background: var(--surface); }

.figure--bleed .picture,
.figure--bleed img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (min-width: 48rem) {
  .figure--bleed .picture,
  .figure--bleed img { aspect-ratio: 21 / 9; }
}

.figure__caption {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--ink-faint);
}

/* B10 Prose, article, module list, mailbox list -------------------------- */

.prose { max-width: var(--measure); }

.prose > * + * { margin-top: var(--space-4); }

.prose h2 { font-size: var(--step-3); margin-top: var(--space-7); }
.prose h3 { font-size: var(--step-2); margin-top: var(--space-6); }
.prose h4 { font-size: var(--step-1); margin-top: var(--space-5); }
.prose > :first-child { margin-top: 0; }

.prose ul,
.prose ol { padding-left: var(--space-5); }

.prose li + li { margin-top: var(--space-2); }

.prose li::marker { color: var(--ink-faint); }

.prose blockquote {
  border-left: var(--rule-width) solid var(--ink);
  padding-left: var(--space-5);
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--ink);
}

.prose hr { margin-block: var(--space-6); }

/* Tables: hairline rows, label-style header; scroll sideways when narrow */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.prose th,
.prose td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: var(--rule-width) solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-size: var(--step--2);
  color: var(--ink-faint);
  border-bottom-color: var(--ink);
}

.prose figure { margin-block: var(--space-6); }

.prose figcaption,
.prose caption {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--ink-faint);
  text-align: left;
}

/* Footnote-style links */
.prose sup a { text-decoration: none; font-variant-numeric: tabular-nums; }

/* Article: heading (and key-facts rail) left, body right. DOM order is
   head, body, rail, so phones read the text before the facts. */
.article__title {
  font-size: var(--step-3);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  max-width: 20ch;
}

@media (min-width: 48rem) {
  .article > .article__head { grid-column: 1; grid-row: 1; }
  .article > .prose { grid-column: 2; grid-row: 1 / span 2; }
  .article > .article__meta { grid-column: 1; grid-row: 2; align-self: start; }
  .article:not(:has(> .article__head)) > .article__meta { grid-row: 1; }
}

.article__meta { font-size: var(--step--1); max-width: 24rem; }

.meta-list {
  display: grid;
  gap: var(--space-4);
  border-top: var(--rule-width) solid var(--rule);
  padding-top: var(--space-4);
}

.meta-list dt {
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
}

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

/* Consecutive prose blocks read as one article: no rule, less space */
.section--prose + .section--prose { padding-top: 0; }

.section--prose + .section--prose > .wrap::before { content: none; }

.section--prose:has(+ .section--prose) { padding-bottom: var(--space-7); }

/* Module list: ruled rows in the right column */
.module-list { border-top: var(--rule-width) solid var(--rule); }

@media (min-width: 80rem) {
  .module-list:not(.module-list--detailed) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--grid-gap); }
}

.module {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
  padding-block: var(--space-4);
  border-bottom: var(--rule-width) solid var(--rule);
}

.module__number {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-faint);
}

.module__name { color: var(--ink); }

.module-list--detailed .module__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: var(--leading-snug);
}

.module__text { display: grid; gap: var(--space-1); }

.module__desc { color: var(--ink-soft); font-size: var(--step--1); }

/* Mailbox list */
.mailbox-list { border-top: var(--rule-width) solid var(--rule); }

.mailbox {
  display: grid;
  gap: var(--space-1) var(--space-5);
  padding-block: var(--space-4);
  border-bottom: var(--rule-width) solid var(--rule);
}

@media (min-width: 64rem) {
  .mailbox { grid-template-columns: 10rem minmax(0, 1fr); align-items: baseline; }
}

.mailbox__label {
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
}

.mailbox__address { overflow-wrap: anywhere; }

/* B11 FAQ: native <details>/<summary>, no animation ---------------------- */

.faq { border-top: var(--rule-width) solid var(--rule); }

.faq__item { border-bottom: var(--rule-width) solid var(--rule); }

.faq__question {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-5);
  padding-block: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.faq__question::-webkit-details-marker { display: none; }

.faq__question::after {
  content: "+";
  content: "+" / "";
  flex: 0 0 auto;
  font-family: var(--font-sans);
  color: var(--ink-faint);
}

.faq__item[open] > .faq__question::after { content: "\2212"; content: "\2212" / ""; }

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

.faq__answer {
  padding-bottom: var(--space-5);
  color: var(--ink-soft);
}

.faq__answer > * + * { margin-top: var(--space-3); }

/* B12 Quote and notice --------------------------------------------------- */

.quote {
  border-left: var(--rule-width) solid var(--ink);
  padding-left: var(--space-5);
}

.quote__text {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: var(--leading-snug);
  color: var(--ink);
}

.quote__text p + p { margin-top: var(--space-4); }

.quote__attribution {
  margin-top: var(--space-4);
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
}

/* Pull variant: display size, upright, across the wide column, no mark art */
.split > .quote--pull { grid-column: 1 / -1; max-width: none; }

.quote--pull {
  border-left: 0;
  padding-left: 0;
}

.quote--pull .quote__text {
  font-size: var(--step-split);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-hero);
  max-width: 28ch;
}

.quote--pull .quote__attribution { margin-top: var(--space-6); }

.notice {
  padding: var(--space-4) var(--space-5);
  border: var(--rule-width) solid var(--rule);
  background: var(--surface);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.section--notice { padding-block: var(--space-6); }

.section + .section--notice > .wrap::before { content: none; }

.section--notice + .section { padding-top: var(--space-6); }

.section--notice + .section > .wrap::before { content: none; }

/* B13 CTA band (cta_plate): light ruled band, heading left, CTA right ---- */

.cta-band__body { align-self: end; }

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* B14 Framework diagram: caption only (the SVG diagram is in Motion, P2-F7) */

.diagram__caption {
  margin-top: var(--space-4);
  font-size: var(--step--1);
  color: var(--ink-faint);
  max-width: var(--measure);
}

/* B15 Dated index (no page uses it in Phase 2) --------------------------- */

.dated-index { border-top: var(--rule-width) solid var(--rule); }

.entry {
  display: grid;
  gap: var(--space-2) var(--space-6);
  padding-block: var(--space-5);
  border-bottom: var(--rule-width) solid var(--rule);
}

@media (min-width: 48rem) {
  .entry { grid-template-columns: var(--date-col) minmax(0, 1fr); }
}

.entry__date {
  font-size: var(--step--2);
  font-weight: var(--weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-faint);
  padding-top: var(--space-2);
}

.entry__title { font-size: var(--step-2); }

.entry__title a { color: var(--ink); text-decoration: none; }
.entry__title a:hover { color: var(--accent); text-decoration: underline; }

.entry__excerpt { margin-top: var(--space-2); color: var(--ink-soft); max-width: var(--measure); }

.entry__meta { margin-top: var(--space-3); font-size: var(--step--1); color: var(--ink-faint); }

/* B16 Motion: hover only; the global reduced-motion switch zeroes it ----- */

@media (prefers-reduced-motion: no-preference) {
  .link-rule,
  .icard__anchor,
  .ledger__title,
  .faq__question {
    transition: color var(--duration) var(--ease);
  }

  .icard__media img { transition: transform var(--duration-reveal) var(--ease); }

  .icard--link:hover .icard__media img { transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .link-rule:hover .arrow,
  .icard--link:hover .icard__media img { transform: none; }
}

/* === End blocks (P2-F3/F4) === */

/* === Page templates (P2-F8) === */
/* Owned by the page-templates lane (app/views/templates/). Page-level
   compositions only: block bands and the form sections (enquiry, newsletter)
   in the split layout. */

/* Band modifier: a full-bleed --surface band set by block data
   (`band: "surface"`, e.g. the Assessment independence section). The band
   replaces the hairline above it and the one in the section after it. */
.section--band-surface,
.section + .section--band-surface {
  background: var(--surface);
  padding-top: var(--space-8);
}

.section + .section--band-surface > .wrap::before,
.section--band-surface + .section > .wrap::before { content: none; }

.section--band-surface + .section { padding-top: var(--space-8); }

/* Form sections in the split: heading (and on /contact the mailboxes) left,
   form right */
.form-block .split__body > .form,
.form-block .split__body > .form-fallback { max-width: none; }

.form-block__aside {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.form-block__aside-title {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: var(--weight-label);
  line-height: var(--leading-snug);
  color: var(--ink);
}

/* The left column is narrow: keep label above address at every width */
.form-block__aside .mailbox { grid-template-columns: minmax(0, 1fr); }

/* Phones: heading, form, then mailboxes (source order). From 768px the
   mailboxes move under the heading in the left column. */
@media (min-width: 48rem) {
  /* Row 1 holds the section hairline (.wrap::before) when there is one */
  .form-block .split:has(> .form-block__aside) { grid-template-rows: auto auto 1fr; }
  .form-block .split::before { grid-row: 1; }
  .form-block .split > .split__head { grid-row: 2; }
  .form-block .split > .split__body { grid-row: 2 / span 2; }
  .form-block .split > .form-block__aside {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    margin-top: var(--space-6);
  }
}

/* === End page templates (P2-F8) === */

/* 14 Plate: fixed-dark ground, now the Home hero only (D-032) ----------- */

.plate {
  background: var(--plate);
  color: var(--plate-ink);
}

/* Two plates in a row (e.g. page header straight into a CTA band) */
.plate + .plate:not(.hero):not(.page-header) { border-top: var(--rule-width) solid var(--plate-rule); }

/* === Hero (P2-F6) === */
/* Home hero (plan §2, D-035/D-041). Without media: the plain plate hero.
   With media (.hero--media): full-bleed decorative picture (option B) and,
   when content adds a clip, the video layer (option A) above it; a flat
   scrim over both (40 % --plate since D-046); text bottom-left in --plate-ink. */

.hero { padding-block: var(--space-9); }

.hero__inner {
  display: grid;
  gap: var(--space-7);
  align-items: end;
}

@media (min-width: 64rem) {
  .hero__inner { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-8); }
}

.hero .label { margin-bottom: var(--space-5); }

.hero__title {
  font-size: var(--step-hero);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-hero);
  max-width: 15ch;
}

/* The headline's <em>law</em>: upright, in --plate-accent (D-045, R3 Type section). */

.hero__lede {
  margin-top: var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--plate-ink);
  max-width: var(--measure-narrow);
}

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

.hero__aside {
  border-top: var(--rule-width) solid var(--plate-faint);
  padding-top: var(--space-4);
  font-size: var(--step--1);
  line-height: var(--leading-body);
  color: var(--plate-ink);
  max-width: var(--measure-narrow);
}

@media (min-width: 64rem) {
  .hero__aside {
    border-top: 0;
    border-left: var(--rule-width) solid var(--plate-faint);
    padding: 0 0 0 var(--space-5);
  }
}

.hero__aside p + p { margin-top: var(--space-3); }

/* -- With media ----------------------------------------------------------- */

.hero--media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: end;
  min-height: min(88svh, 56rem);
  /* top: clears the over-media header (4.5rem row); bottom: room for the toggle */
  padding-block: calc(4.5rem + var(--space-7)) var(--space-8);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--plate);
}

/* D-046: the clip and its poster have their own darkening and blue grade
   baked in (tools/hero-video.swift), so the scrim is lighter than the flat
   --media-scrim (still the fallback without color-mix()). 40 % --plate keeps
   --plate-ink >= 5.4:1 and the --plate-accent emphasis >= 3.6:1 (large text)
   against the brightest pixel behind each line, over 19 decoded video frames
   and the poster at 390/768/1280 (handoff D-046). Re-check if the grade or
   the clip changes. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--media-scrim);
  background: color-mix(in srgb, var(--plate) 40%, transparent);
}

.hero__picture,
.hero__image,
.hero__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video {
  position: absolute;
  inset: 0;
  opacity: 0;
  /* LCP guard (D-046, P2-AC3): the poster <img> is pixel-snapped, the video
     is not, so on fractional hero heights the fading-in video measured a few
     px² larger and became the LCP element. Clipping its bottom 1px keeps it
     strictly smaller than the poster at every size (checked 360-1366). */
  clip-path: inset(0 0 1px 0);
}

.hero__video.is-playing { opacity: 1; }

/* Pause/play control for the video (WCAG 2.2.2); revealed by hero-video.js */
.hero__toggle {
  position: absolute;
  right: var(--gutter);
  bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: var(--rule-width) solid var(--plate-ink);
  border-radius: 0;
  background: var(--plate);
  color: var(--plate-ink);
  cursor: pointer;
}

.hero__toggle[hidden] { display: none; }

.hero__toggle:hover {
  background: var(--plate-ink);
  color: var(--plate);
}

.hero__toggle-icon { fill: currentColor; }

.hero__toggle[aria-pressed="true"] .hero__toggle-icon--pause,
.hero__toggle:not([aria-pressed="true"]) .hero__toggle-icon--play { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .hero__video { transition: opacity var(--duration-reveal) var(--ease); }
}

/* Reduced motion: the video never shows (hero-video.js never loads it either) */
@media (prefers-reduced-motion: reduce) {
  .hero__video,
  .hero__toggle { display: none; }
}

@media print {
  .hero--media { min-height: 0; padding-block: var(--space-6); }
  .hero__media,
  .hero__toggle { display: none; }
  .hero__lede,
  .hero__aside { color: inherit; }
}

/* === End hero (P2-F6) === */

/* 15 Forms -------------------------------------------------------------- */

.form {
  display: grid;
  gap: var(--space-5);
  max-width: 40rem;
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  color: var(--ink);
}

.field__req {
  font-weight: 400;
  color: var(--ink-faint);
}

.field__hint {
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.field__input {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-3);
  font: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--surface);
  border: var(--rule-width) solid var(--ink-faint);
  border-radius: 0;
}

textarea.field__input {
  min-height: 9rem;
  resize: vertical;
}

.field__input:hover { border-color: var(--ink-soft); }

.field__input:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field__input[aria-invalid="true"] { border-color: var(--error); }

.field__error {
  font-size: var(--step--1);
  font-weight: var(--weight-label);
  color: var(--error);
}

.field__error:empty { display: none; }

/* Web3Forms botcheck / newsletter honeypot: never visible, never focusable */
.field--honeypot,
.botcheck {
  display: none !important;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

/* Empty until forms.js lazily loads hCaptcha (D-043a): no row, no gap */
.form__captcha { min-height: 0; }
.form__captcha:empty { display: none; }

.form-status {
  font-size: var(--step--1);
  padding: var(--space-3) var(--space-4);
  border-left: var(--accent-rule-width) solid currentColor;
  background: var(--surface);
}

.form-status:empty { display: none; }

.form-status--success { color: var(--success); }
.form-status--error { color: var(--error); }

/* Shown instead of the form when keys are empty or in mailto mode */
.form-fallback {
  max-width: 40rem;
  padding: var(--space-4) var(--space-5);
  border: var(--rule-width) solid var(--rule);
  background: var(--surface);
}

/* Inline variant (newsletter): input and button share a row when there is room */
.form--inline { gap: var(--space-3); }

.form--inline .form__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.form--inline .field__input {
  flex: 1 1 14rem;
  min-width: 0;
}

.form--inline .btn { flex: 0 0 auto; }

/* 16 Motion: hover states and arrow nudges only ------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .site-nav__cta,
  .ledger__row,
  .site-nav__link,
  .field__input {
    transition:
      background-color var(--duration) var(--ease),
      border-color var(--duration) var(--ease),
      color var(--duration) var(--ease);
  }

  .arrow,
  .ledger__arrow {
    transition: transform var(--duration) var(--ease);
  }
}

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

  .link-arrow:hover .arrow,
  .ledger__row:hover .ledger__arrow {
    transform: none;
  }
}

/* Print: plates print as plain text on white */
@media print {
  .plate { background: none; color: inherit; }
  .site-nav, .site-footer__newsletter { display: none; }
  .site-header--over-media { position: static; }
}

/* === Motion (P2-F7) === */
/*
 * Scroll reveals and the framework diagram (plan §1.7). reveal.js adds the
 * pre-states only when motion is allowed, so with JS off or under reduced
 * motion everything below is simply the finished, static state.
 * Reveals use opacity and transform only: no layout shift.
 */

/* Reveal: opacity 0 → 1 plus an 8px rise, 300ms, once */
.reveal-pre {
  opacity: 0;
  transform: translateY(var(--space-2));
}

.reveal-pre.is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-pre.is-revealed {
    transition:
      opacity var(--duration-reveal) var(--ease),
      transform var(--duration-reveal) var(--ease);
  }
}

/* Framework diagram: one SVG per layout, intrinsic size from its width/height
   attributes, so the box is reserved before paint (no CLS). */
.diagram { margin: 0; }

.diagram__svg {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
  color: var(--ink);
}

.diagram__svg--row { display: none; width: 100%; }

@media (min-width: 64rem) {
  .diagram__svg--row { display: block; }
  .diagram__svg--col { display: none; }
}

/* SVG geometry is in viewBox user units (row: 1200 wide; column: 360 wide). */
.diagram__label {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 20px; /* user units: about 20px at 390 and 1280 */
}

.diagram__label--end { fill: var(--ink-soft); }

.diagram__seg,
.diagram__tip,
.diagram__frame,
.diagram__end {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.5;
}

.diagram__frame { stroke: var(--rule); fill: var(--ground); }
.diagram__mark { color: var(--accent); }
.diagram__verdict { fill: var(--accent); }

/* Pre-state (JS, motion allowed, below the fold): lines undrawn, nodes faded.
   Labels are never faded. */
.diagram--pre .diagram__seg {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.diagram--pre .diagram__fade { opacity: 0; }

.diagram--pre.diagram--in .diagram__seg { stroke-dashoffset: 0; }
.diagram--pre.diagram--in .diagram__fade { opacity: 1; }

/* In sequence, once: 9 steps 200ms apart, 300ms each = 1.9s in total, then still. */
@media (prefers-reduced-motion: no-preference) {
  .diagram--in .diagram__seg { transition: stroke-dashoffset var(--duration-reveal) var(--ease); }
  .diagram--in .diagram__fade { transition: opacity var(--duration-reveal) var(--ease); }

  .diagram--in .diagram__o1 { transition-delay: 200ms; }
  .diagram--in .diagram__o2 { transition-delay: 400ms; }
  .diagram--in .diagram__o3 { transition-delay: 600ms; }
  .diagram--in .diagram__o4 { transition-delay: 800ms; }
  .diagram--in .diagram__o5 { transition-delay: 1000ms; }
  .diagram--in .diagram__o6 { transition-delay: 1200ms; }
  .diagram--in .diagram__o7 { transition-delay: 1400ms; }
  .diagram--in .diagram__o8 { transition-delay: 1600ms; }
}

/* Global reduced-motion kill switch, extended (plan §1.7 item 7; scope §7 AC3).
   Nothing animates or transitions: durations and delays are zero, pre-states are
   forced to their finished state, view transitions are off. The hero video is
   never loaded under reduce (hero-video.js, P2-F6). */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto !important; }

  *,
  *::before,
  *::after,
  *::marker {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  .reveal-pre { opacity: 1 !important; transform: none !important; }
  .diagram--pre .diagram__seg { stroke-dashoffset: 0 !important; }
  .diagram--pre .diagram__fade { opacity: 1 !important; }
}

/* Print: never print a pending element half-revealed */
@media print {
  .reveal-pre { opacity: 1 !important; transform: none !important; }
  .diagram--pre .diagram__seg { stroke-dashoffset: 0 !important; }
  .diagram--pre .diagram__fade { opacity: 1 !important; }
}

/* === End motion (P2-F7) === */

/* === Style guide (P2-F9) === */
/* /admin-styleguide only (app/views/templates/styleguide.php, D-039).
   Plain, internal. Colour chips are SVG rects filled with the value read
   from tokens.css (the CSP blocks style attributes); type and spacing
   samples use one class per token below. */

.sg-intro h1 { margin-block: var(--space-3) var(--space-5); }

.sg-note {
  max-width: var(--measure);
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.sg-toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
}

.sg-section { border-top: var(--rule-width) solid var(--rule); }

.sg-title { font-size: var(--step-3); }

.sg-subtitle {
  margin-block: var(--space-7) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: var(--weight-strong);
}

/* Colour swatches */
.sg-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-5);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.sg-swatch {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  font-size: var(--step--1);
}

.sg-swatch__chip {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border: var(--rule-width) solid var(--rule);
}

.sg-swatch__name { color: var(--ink); }
.sg-swatch__value { color: var(--ink-soft); }
.sg-swatch__note { color: var(--ink-faint); }

/* Rows: name left, sample right */
.sg-rows { margin: var(--space-5) 0 0; padding: 0; list-style: none; }

.sg-row {
  display: grid;
  gap: var(--space-2) var(--space-5);
  align-items: baseline;
  padding-block: var(--space-4);
  border-bottom: var(--rule-width) solid var(--rule-soft);
}

@media (min-width: 48rem) {
  .sg-row { grid-template-columns: var(--label-col) minmax(0, 1fr); }
}

.sg-row__name { font-size: var(--step--1); color: var(--ink); }
.sg-row__use { display: block; color: var(--ink-faint); }

.sg-sample { line-height: var(--leading-tight); }
.sg-sample--display { font-family: var(--font-display); font-size: var(--step-2); }
.sg-sample--sans { font-family: var(--font-sans); font-size: var(--step-1); }

.sg-step--2 { font-size: var(--step--2); }
.sg-step--1 { font-size: var(--step--1); }
.sg-step-0 { font-size: var(--step-0); }
.sg-step-1 { font-size: var(--step-1); }
.sg-step-2 { font-size: var(--step-2); }
.sg-step-3 { font-size: var(--step-3); }
.sg-step-4 { font-size: var(--step-4); }
.sg-step-stat { font-size: var(--step-stat); }
.sg-step-split { font-size: var(--step-split); }
.sg-step-wordmark { font-size: var(--step-wordmark); }
.sg-step-hero { font-size: var(--step-hero); }

.sg-bar { display: block; height: var(--space-4); background: var(--accent); }
.sg-space-1 { width: var(--space-1); }
.sg-space-2 { width: var(--space-2); }
.sg-space-3 { width: var(--space-3); }
.sg-space-4 { width: var(--space-4); }
.sg-space-5 { width: var(--space-5); }
.sg-space-6 { width: var(--space-6); }
.sg-space-7 { width: var(--space-7); }
.sg-space-8 { width: var(--space-8); }
.sg-space-9 { width: var(--space-9); }
.sg-space-10 { width: var(--space-10); }

/* Buttons and forms */
.sg-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: var(--rule-width) solid var(--rule-soft);
}

.sg-form {
  display: grid;
  gap: var(--space-7);
  max-width: var(--measure-split);
  margin-top: var(--space-5);
}

/* Frames for full-width samples (nav, hero) */
.sg-frame {
  position: relative;
  border-block: var(--rule-width) solid var(--rule);
}

/* Force the Menu copy at every width (the real switch is at 64rem) */
.sg-frame--menu .site-nav__list { display: none; }
.sg-frame--menu .site-nav__menu { display: block; }

/* Room for the open panel, which is absolutely placed under the header row */
.sg-frame--open { padding-bottom: calc(var(--space-7) * 9); }  /* ~27rem: the panel with six links and the CTA */

/* Block samples */
.sg-block { border-top: var(--rule-width) solid var(--rule); }

.sg-block__name {
  padding-top: var(--space-5);
  font-size: var(--step--1);
  color: var(--accent);
}

/* === End style guide (P2-F9) === */

/* === R3 page heroes === */
/* D-047: every inner page opens with a page_header that is a full-bleed dark
   band over its section's generated graphic (App\Lib\PageHeroes), under the
   flat --media-scrim, text in plate colours. Moderate height, not full
   screen. The over-media header sits on top (layout.php switches it on from
   $page['page_header_media']), so the band clears the 4.5rem header row.
   Without media (error fallback) it is the plain dark plate. Owned by the
   frontend R3 page-heroes task; blocks/page_header.php. */

.page-header--hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--plate);
  color: var(--plate-ink);
  padding-block: var(--space-8);
}

.page-header--media {
  min-height: clamp(24rem, 60svh, 34rem);
  padding-block: calc(4.5rem + var(--space-7)) var(--space-8);
}

.page-header__inner { width: 100%; }

.page-header__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--plate);
}

.page-header__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--media-scrim);
}

.page-header__picture,
.page-header__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-header--hero .label { color: var(--plate-accent); }

.page-header--hero .page-header__title,
.page-header--hero .page-header__lede { color: var(--plate-ink); }

/* The section after the dark band starts fresh: no hairline, full top space */
.page-header--hero + .section { padding-top: var(--space-8); }

.page-header--hero + .section > .wrap::before,
.page-header--hero + .section > .wrap.split::before { content: none; }

/* An opener figure straight after the band (About, Methodology, programmes)
   follows it directly: a full-bleed figure sits flush under the band, an
   in-wrap figure keeps a short gap rather than a full section's padding. */
.page-header--hero + .figure-block { padding-top: var(--space-7); }

.page-header--hero + .figure-block--bleed { padding-top: 0; }

@media print {
  .page-header--hero,
  .page-header--media {
    min-height: 0;
    padding-block: var(--space-6);
    background: none;
    color: inherit;
  }
  .page-header__media { display: none; }
  .page-header--hero .label,
  .page-header--hero .page-header__title,
  .page-header--hero .page-header__lede { color: inherit; }
}

/* === End R3 page heroes === */

/* === R3 type and bands === */
/* Revision R3, owned by the frontend R3 type-and-bands task.
   D-045: Inter for every heading, display style, number, stat and pull
   quote (font-family is set in place in the rules above via --font-display);
   only the logo is serif, as an inline SVG (partials/logo.php, D-052).
   D-044: adjacent full-width sections alternate shades so they no longer
   blend: --ground and --surface in rhythm, --band for explicit bands and the
   footer. Hairline rules stay. AA ratios per shade: docs/handoffs/frontend.md. */

/* -- Type (D-045) ------------------------------------------------------- */

h3, h4 { letter-spacing: var(--tracking-heading); }

h4 { font-weight: var(--weight-heading); }

/* Home hero emphasis: upright, coloured instead of italic (no extra font
   file). --plate-accent on the scrimmed hero media: ratio in the handoff
   (large text, needs 3:1). */
.hero__title em {
  font-style: normal;
  color: var(--plate-accent);
}

/* -- Section bands (D-044) ---------------------------------------------- */

/* Rhythm: sections that start a new band are counted (S below); odd ones
   stay on --ground, even ones take --surface. Not counted, and so never
   breaking the alternation:
     .page-header (dark hero band, D-047)    .section--band (explicit, below)
     joined sections that read as part of the one before:
     .section--continued, .section--notice, a prose block after a prose block.
   Joined sections take the shade of the section they join (chains up to 6).
   The Home hero is not a .section, so the first block after it is --ground.
   Without :nth-child(of S) support the rule is dropped: all --ground, as before. */
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)),
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)) + :is(.section--continued, .section--notice, .section--prose + .section--prose),
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose),
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose),
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose),
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose),
.section:nth-child(even of .section:not(.page-header, .section--band, .section--continued, .section--notice, .section--prose + .section--prose)) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) + :is(.section--continued, .section--notice, .section--prose + .section--prose) {
  background: var(--surface);
  --well: var(--ground);
}

/* Each band carries its own hairline a little below its top edge, so the
   rule reads as part of the band rather than doubling the shade edge. */
.section + .section:not(:is(.section--continued, .section--notice, .section--prose + .section--prose),
  .page-header--hero + .section, .section--band, .section--band + .section,
  .section--surface, .section--surface + .section) {
  padding-top: var(--space-6);
}

/* Explicit band (block data `band`, e.g. the Assessment independence
   section): the deeper --band shade with full-bleed hairlines, distinct
   from both --ground and --surface whatever falls either side of it. */
.section.section--band {
  background: var(--band);
  border-block: var(--rule-width) solid var(--rule);
  padding-top: var(--space-8);
  --well: var(--ground);
}

.section--band + .section { padding-top: var(--space-8); }

/* Footer: --band, so the last section (always --ground or --surface) never
   blends into it. Its hairlines stay inside. */
.site-footer {
  background: var(--band);
  --well: var(--ground);
}

/* Inset fills follow the shade they sit on (--well): --surface on --ground,
   --ground on --surface and --band. */
.field__input,
.notice,
.form-status,
.form-fallback,
.icard__media,
.figure .picture { background: var(--well); }

@media print {
  .section,
  .site-footer { background: none; }
}

/* === End R3 type and bands === */

/* === Logo (D-052) === */
/* The "ai" monogram in a square + the full registered name, stacked on three
   lines (partials/logo.php, generated by tools/logo.py). Both parts are
   inline SVGs sized by height in em, so font-size on .logo scales the whole
   lockup: --step-logo in the header (never below 12px, so the name stays
   legible down to 320px), --step-logo-footer in the footer. 3.208em is the
   outlined name's height (viewBox 2816 x 802 at 250 units per em); the square
   matches it. Fill is currentColor: ink on ground, --plate-ink over media,
   --ink in print. On ground the square takes --accent, as in option V4a. */

.logo-link {
  display: inline-block;
  flex: none;
  line-height: 0;
  color: var(--ink);
  text-decoration: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-size: var(--step-logo);
}

.logo--footer { font-size: var(--step-logo-footer); }

.logo__mark,
.logo__name {
  display: block;
  flex: none;
  width: auto;
  height: 3.208em;
}

.logo__mark {
  aspect-ratio: 1;
  color: var(--accent);
}

.site-footer__logo:hover { color: var(--accent); }

.site-header--over-media .logo-link,
.site-header--over-media .logo__mark { color: var(--plate-ink); }

@media print {
  .logo-link,
  .logo__mark,
  .site-header--over-media .logo-link,
  .site-header--over-media .logo__mark { color: var(--ink); }
}

/* === End logo (D-052) === */

/* === R4 punch and infographics === */
/* Revision R4, owned by the frontend R4 task.
   D-048: the page_header lede is the page's one punchy line, under the H1, in
   the Home hero's display type (Inter 400, --tracking-hero, display leading),
   one step below the H1 so the title still leads: H1 --step-split (about 32 /
   42 / 56px at 390 / 768 / 1280), punchy line --step-2 below 48rem and
   --step-3 from 48rem (about 22 / 32 / 37px). Its emphasis word is
   --plate-accent, as Home's "law". The service template uses the same block.
   D-050: the infographic block (blocks/infographic.php). Layout switching,
   connectors, captions and all motion are shared with framework_diagram
   (.diagram__*, "Motion (P2-F7)" section, kill switch included); only the
   infographic's own shapes and text styles are here. SVG text sizes are in
   user units (the same documented exception as .diagram__label): the row
   SVG renders at 0.8-1.13x (1024-1440px), the column SVG at about 1x. */

/* -- Punchy line (D-048) ------------------------------------------------- */

.page-header__inner {
  display: grid;
  gap: var(--space-5);
}

.page-header .punch {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-hero);
  max-width: 28ch;
  text-wrap: balance;
}

@media (min-width: 48rem) {
  .page-header .punch { font-size: var(--step-3); }
}

.page-header--hero .punch { color: var(--plate-ink); }

.punch__em { color: var(--accent); }

.page-header--hero .punch__em { color: var(--plate-accent); }

@media print {
  .page-header--hero .punch__em { color: inherit; }
}

/* -- Infographic (D-050) ------------------------------------------------- */

.infographic__label { font-weight: var(--weight-heading); }

.infographic__note {
  fill: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 17px; /* user units, see above */
}

.infographic__marker {
  fill: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 15px; /* user units, see above */
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.infographic__node { fill: var(--accent); }

.diagram__seg.infographic__bar {
  stroke: var(--accent);
  stroke-width: 3;
}

.infographic__tick {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.5;
}

/* Group frames (apart): --ink-muted, >= 3:1 on every shade (non-text contrast) */
.infographic__frame {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.5;
}

.infographic__divide {
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
}

/* === End R4 punch and infographics === */

/* === R5 === */
/* Revision R5, owned by the frontend R5 task.
   D-058: the infographic `ranked` variant (blocks/infographic.php). Bars are
   .diagram__seg paths (pathLength 1), so they draw left to right once in view
   through the shared Motion (P2-F7) rules, kill switch and print included;
   JS off or reduced motion shows them complete. Sizes are SVG user units, the
   same documented exception as .diagram__label. A "Sold separately" tier
   (line adoption) gets a --ink-muted bar (>= 3:1 on every shade) so the
   accent run stops at the gap.
   D-054: the footer prints three notice lines from site.json; they share the
   existing .site-footer__tm / __disclaimer type, nothing new here. */

.diagram__seg.infographic__rank-bar {
  stroke: var(--accent);
  stroke-width: 14; /* user units: bar thickness, matches $barH */
  stroke-linecap: butt;
}

.diagram__seg.infographic__rank-bar--apart { stroke: var(--ink-muted); }

.infographic__rank-num {
  fill: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 34px; /* user units, see above */
  font-weight: var(--weight-display);
  font-variant-numeric: tabular-nums;
}

@media print {
  .diagram__seg.infographic__rank-bar { stroke: var(--ink); }
  .diagram__seg.infographic__rank-bar--apart { stroke: var(--ink-faint); }
}

/* === End R5 === */

/* === P3 Insights (F5 listing, F6 publication page) === */

.pubfilter {
  display: grid;
  gap: var(--space-5);
  max-width: 60rem;
}

.pubfilter__selects {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 48rem) {
  .pubfilter__selects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

select.field__input {
  appearance: auto;
  padding-right: var(--space-4);
}

.pubindex__status { margin-top: var(--space-6); }
.pubindex__for { font-size: var(--step-2); letter-spacing: var(--tracking-heading); }
.pubindex__empty { margin-top: var(--space-5); max-width: var(--measure); }
.pubindex__empty > * + * { margin-top: var(--space-3); }
.pubindex__empty-title { font-size: var(--step-1); color: var(--ink); }

/* Neutral "browse by type" section between an Assessment group and an adoption group (D-012, D-105c) */
.pubindex__browse { padding-block: var(--space-6); }
.pubindex__types { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin-top: var(--space-3); padding: 0; list-style: none; }

.pubindex__foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.pager__of { font-size: var(--step--1); color: var(--ink-soft); }

/* Publication page */
.publication .article__action { margin-top: var(--space-5); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin-top: var(--space-1);
}

.tag-list a.tag { text-decoration: none; color: var(--ink-soft); }
.tag-list a.tag:hover { color: var(--accent); border-color: var(--accent); }

/* Body: footnotes, wide figures, data tables */
.prose .footnotes {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: var(--rule-width) solid var(--rule);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.prose .footnotes ol { padding-left: var(--space-5); }
.prose .footnote-ref a { padding-inline: var(--space-1); }
.prose :target { scroll-margin-top: var(--space-7); }
.prose li:target { background: var(--surface); }
.prose figure.figure--wide { max-width: none; }
.prose figure img { width: 100%; height: auto; }
.prose table.table--data td { font-variant-numeric: tabular-nums; }
.prose caption { caption-side: top; margin-bottom: var(--space-2); }

.reflist {
  padding-left: var(--space-5);
  max-width: var(--measure);
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.reflist li + li { margin-top: var(--space-3); }
.reflist li { scroll-margin-top: var(--space-7); overflow-wrap: anywhere; }
.reflist li:target { background: var(--band); outline: var(--rule-width) solid var(--ink-faint); outline-offset: var(--space-1); }
.reflist a { display: inline-block; margin-left: var(--space-1); }

.datelist {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
  border-top: var(--rule-width) solid var(--rule);
}

.datelist li {
  padding-block: var(--space-3);
  border-bottom: var(--rule-width) solid var(--rule);
}

.datelist time { color: var(--ink-faint); font-size: var(--step--1); margin-right: var(--space-2); }
.split__lede + .datelist { margin-top: var(--space-5); }

/* Cite this */
.cite { max-width: var(--measure); }

.cite__details { border-top: var(--rule-width) solid var(--ink); border-bottom: var(--rule-width) solid var(--rule); }

.cite__summary {
  cursor: pointer;
  padding-block: var(--space-4);
  font-size: var(--step-1);
  letter-spacing: var(--tracking-heading);
  color: var(--ink);
}

.cite__summary:focus-visible,
.cite__pre:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: var(--focus-offset);
}

.cite__details[open] > .cite__summary { padding-bottom: var(--space-3); }
.cite__note { color: var(--ink-soft); font-size: var(--step--1); }
.cite__block { margin-top: var(--space-5); display: grid; gap: var(--space-2); justify-items: start; }
.cite__block:last-child { margin-bottom: var(--space-5); }
.cite__label { font-size: var(--step--2); font-weight: var(--weight-label); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--ink-faint); }

.cite__pre {
  width: 100%;
  margin: 0;
  padding: var(--space-4);
  background: var(--well);
  border: var(--rule-width) solid var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--step--1);
  line-height: var(--leading-snug);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cite__copy[hidden] { display: none; }

/* === End P3 Insights === */
