/* ==========================================================================
   MF Automations — Proposals
   Design system: "compliance matrix"

   The visual language is lifted from the artifact of the trade: a compliance
   matrix. Hairline table rules, a left rail of monospace requirement IDs,
   status chips. Section markers use real solicitation vernacular (§, Exhibit,
   Addendum) rather than decorative 01/02/03 — the numbering encodes something
   true about the content.

   Colour discipline:
     gold  = action + verified. Nothing else may use it.
     flag  = a caught disqualifier. Appears deliberately, rarely.
     gate  = a hard gate marker (pass/fail screen, not a scored criterion).
   ========================================================================== */

/* ---------- faces ---------------------------------------------------------
   Syne and Instrument Sans ship here as VARIABLE fonts. Declaring the full
   axis range in one @font-face lets every weight render from a single file —
   do not add per-weight faces, it will silently download nothing extra and
   fall back to synthetic bolding.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Syne';
  src: url('/fonts/syne-500.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument_sans-400.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains_mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* ── BRIGHT THEME, 2026-07-28 ───────────────────────────────────────────
     Patrick's direction: "make it pop, bright colors", "make it brighter".
     Flipped from the dark ground to a light one. Every value below was
     contrast-checked numerically, not by eye:
       ink   18.72:1 on white   dim 8.02:1   faint 5.87:1
       primary #3D5AFE 5.13:1 as text AND 5.13:1 for white-on-fill
       ok #067647 5.69:1   flag #E02424 4.72:1   ink-on-gold 9.17:1
     GOLD IS FILL-ONLY. As text on white it is 2.04:1 — nowhere near legible —
     so links use --primary and gold survives only as a fill behind dark text
     (the MF mark, verified chips). Do not set `color: var(--gold)` on text.
     ---------------------------------------------------------------------- */
  --ink: #0B1220;
  --ground: #FFFFFF;
  --panel: #FFFFFF;
  --panel-2: #F4F7FE;
  --tint: #EEF2FF;

  --primary: #3D5AFE;
  --primary-dk: #2B44D6;
  --primary-soft: #E8EDFF;

  --gold: #F5A524;
  --gold-hi: #FFB93D;
  --gold-dim: #FFF3DC;

  /* #E02424 was 4.72:1 on WHITE but only 4.13:1 on its own --flag-dim tint,
     which is where it actually renders (chips, flagged rows). Checking a colour
     against the page ground instead of the surface it sits on is how that got
     missed. #C81E1E is 5.02:1 on the tint and 5.74:1 on white. */
  --flag: #C81E1E;
  --flag-dim: #FDECEC;
  --gate: #3D5AFE;
  --gate-dim: #E8EDFF;
  --ok: #067647;
  --ok-dim: #E3F7EE;

  --text: #0B1220;
  --dim: #475069;
  --faint: #5B6480;
  --rule: #E3E8F4;
  --rule-hi: #CBD4E8;

  --display: 'Syne', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --shell: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --rail: 108px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- type scale ---------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.06;
  letter-spacing: -.03em;
  margin: 0;
  font-weight: 800;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(1.95rem, 4vw, 3rem); letter-spacing: -.028em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.22; }
h4 { font-size: 1.03rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dk); text-decoration: underline; text-underline-offset: 3px; }

strong, b { font-weight: 700; color: var(--text); }

/* The monospace utility voice: requirement IDs, gate labels, deadlines.
   Always uppercase, always tracked out, never larger than body copy. */
.mono {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
}

.lede { font-size: clamp(1.06rem, 1.75vw, 1.24rem); color: var(--dim); line-height: 1.58; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.gold { color: var(--primary); }

/* ---------- shell --------------------------------------------------------- */
.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 116px); }
.section--tight { padding-block: clamp(44px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--rule); }

/* Section marker. Uses solicitation vernacular (§4, Exhibit C) because the
   content genuinely is sectioned that way — not decorative numbering. */
.marker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.marker__id {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--primary);
  flex: none;
}
.marker__label {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- nav ----------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav__in { display: flex; align-items: center; gap: 12px; height: 62px; }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 800; letter-spacing: -.02em; font-size: 1rem; }
.nav__brand:hover { text-decoration: none; color: var(--text); }
.nav__mark {
  width: 27px; height: 27px; border-radius: 8px;
  background: var(--gold); color: #3A2600;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: .72rem; letter-spacing: -.02em;
  flex: none;
}
.nav__brand span.sub { color: var(--faint); font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 400; }
.nav__links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
/* :not(.btn) is load-bearing, not style.
   `.nav__links a` has specificity (0,1,1) and `.btn--gold` only (0,1,0), so
   without the exclusion the nav link rule WINS over the button rule and paints
   the primary CTA's label --dim on a --gold background: a 1.57:1 contrast ratio
   against WCAG AA's 4.5:1 minimum. Measured live 2026-07-28. Excluding buttons
   here (rather than raising .btn's specificity) keeps the button component
   self-contained and portable to any container. */
.nav__links a:not(.btn) { color: var(--dim); font-size: .92rem; font-weight: 500; }
.nav__links a:not(.btn):hover { color: var(--text); text-decoration: none; }
.nav__links a:not(.btn).is-active { color: var(--text); }
@media (max-width: 860px) {
  .nav__links a:not(.btn) { display: none; }
  .nav__links { gap: 0; }
}

/* ---------- buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px;
  border-radius: 9px;
  font-family: var(--body);
  font-weight: 600; font-size: .95rem; letter-spacing: -.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn--gold { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(61,90,254,.28); }
.btn--gold:hover { background: var(--primary-dk); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(61,90,254,.34); }
.btn--ghost { background: #fff; color: var(--primary-dk); border-color: var(--rule-hi); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary-dk); background: var(--primary-soft); }
.btn--lg { padding: 16px 30px; font-size: 1rem; border-radius: 10px; }
.btn--block { width: 100%; }
.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- status chips (the matrix vocabulary) -------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 5px; white-space: nowrap;
  border: 1px solid transparent;
}
.chip--ok   { background: var(--ok-dim); color: var(--ok); border-color: #B7E7D3; }
.chip--gold { background: var(--gold-dim); color: #8A5A00; border-color: #F3D6A0; }
.chip--gate { background: var(--gate-dim); color: var(--primary-dk); border-color: #C3CEFF; }
.chip--flag { background: var(--flag-dim); color: var(--flag); border-color: #F5B9B9; }
.chip--idle { background: var(--panel-2); color: var(--faint); border-color: var(--rule); }

/* ---------- the document panel -------------------------------------------- */
.doc {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 12px 28px rgba(11,18,32,.06);
}
.doc__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 18px;
  background: var(--tint);
  border-bottom: 1px solid var(--rule);
}
.doc__title { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.doc__body { padding: 6px 0; }

/* A matrix row: [mono requirement id] [requirement text] [status chip] */
.row {
  display: grid;
  grid-template-columns: var(--rail) 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
}
.row:last-child { border-bottom: 0; }
.row__id { font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; color: var(--faint); text-transform: uppercase; }
.row__text { font-size: .93rem; color: var(--text); line-height: 1.4; }
.row__text small { display: block; color: var(--faint); font-size: .82rem; margin-top: 2px; }
.row.is-flagged { background: var(--flag-dim); }
.row.is-flagged .row__id { color: var(--flag); }
@media (max-width: 620px) {
  .row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .row__id { grid-column: 1 / -1; }
}

/* ---------- grids --------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 10px 24px rgba(11,18,32,.05);
}
.card__id { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--dim); font-size: .94rem; margin-bottom: 0; }

/* A measured figure. The number carries a unit and a source, never a bare
   stat — every figure on this site must be traceable to something measured. */
.figure { border-left: 3px solid var(--primary); padding-left: 16px; }
.figure__n { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 3.4vw, 2.5rem); letter-spacing: -.035em; line-height: 1; }
.figure__u { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 9px; }

/* ---------- forms --------------------------------------------------------- */
.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-family: var(--mono); font-size: .69rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 7px;
}
.field__label .req { color: var(--flag); }
.field__hint { display: block; font-size: .82rem; color: var(--faint); margin-top: 6px; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--rule-hi);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--body); font-size: .96rem; line-height: 1.45;
  transition: border-color .15s ease, background .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.textarea { min-height: 118px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--flag); }
.field__error { display: none; color: var(--flag); font-size: .82rem; margin-top: 6px; font-family: var(--mono); letter-spacing: .04em; }
.field__error.is-shown { display: block; }
/* honeypot — must be unreachable to humans AND to assistive tech */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.note {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--gate);
  border-radius: 0 10px 10px 0;
  padding: 16px 18px;
  font-size: .9rem;
  color: var(--dim);
}
.note strong { color: var(--text); }
.note--gold { border-left-color: var(--gold); background: var(--gold-dim); }
.note--flag { border-left-color: var(--flag); }

/* ---------- prose (guides / legal) ---------------------------------------- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 2.2em; margin-bottom: .5em; }
.prose h3 { margin-top: 1.8em; margin-bottom: .45em; }
.prose p, .prose li { color: var(--dim); }
.prose ul, .prose ol { padding-left: 1.15em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--primary); }
.prose blockquote { margin: 1.6em 0; padding-left: 18px; border-left: 3px solid var(--primary); color: var(--text); font-size: 1.06rem; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--tint); padding: 2px 6px; border-radius: 4px; color: var(--primary-dk); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .9rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.prose th { font-family: var(--mono); font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; color: var(--faint); font-weight: 400; }
.prose td { color: var(--dim); }

/* ---------- accordion (FAQ) ------------------------------------------------ */
.faq { border-top: 1px solid var(--rule); }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  width: 100%; background: none; border: 0; cursor: pointer;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 0; text-align: left;
  color: var(--text); font-family: var(--display); font-weight: 700; font-size: 1.03rem; letter-spacing: -.015em;
}
.faq__q::after { content: '+'; margin-left: auto; color: var(--primary); font-family: var(--mono); font-size: 1.1rem; line-height: 1; flex: none; transition: transform .2s ease; }
.faq__item[open] .faq__q::after { transform: rotate(45deg); }
.faq__a { padding: 0 0 20px 0; color: var(--dim); font-size: .95rem; max-width: 680px; }
.faq__a p:last-child { margin-bottom: 0; }
summary::-webkit-details-marker { display: none; }
summary { list-style: none; }

/* ---------- footer -------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding-block: 48px 40px; margin-top: 20px; }
.foot__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 800px) { .foot__grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.foot h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); font-weight: 400; margin-bottom: 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 9px; }
.foot li a { color: var(--dim); font-size: .9rem; }
.foot li a:hover { color: var(--text); text-decoration: none; }
.foot__legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot__legal p { font-size: .82rem; color: var(--faint); margin: 0; }

/* ---------- motion --------------------------------------------------------
   One orchestrated reveal, not scattered effects. Everything obeys the
   reduced-motion preference by resetting to the final state.
   -------------------------------------------------------------------------- */
.rise { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.skip {
  position: absolute; left: -9999px;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
  font-weight: 600; z-index: 100;
}
.skip:focus { left: 0; top: 0; }

/* ---------- link affordance inside body text ------------------------------
   A gold link inside --dim or --faint copy is only 1.92:1 against the text
   around it (WCAG wants 3:1 for colour-only differentiation) — and relying on
   hue alone fails 1.4.1 Use of Color for anyone who cannot separate the two.
   Underline them. Nav, buttons and cards are excluded: those are unambiguous
   affordances already. Measured 2026-07-28.
   -------------------------------------------------------------------------- */
.note a,
.mono a,
.row__text a,
.prose p a,
.prose li a,
.faq__a a,
.lede a,
main p a:not(.btn),
main li a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Footer column labels are not document structure.
   They were <h4> following an <h2>, which skips a level and trips axe's
   heading-order rule on every page. They carry no outline meaning, so they
   are plain elements now. */
.foot .foot-h {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin: 0 0 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CENTERED LAYOUT + FLUID SIZING  (Patrick, 2026-07-28:
   "center the website ... make sure that it resize any info that it's on")

   Centring is applied to the things that introduce a section — the hero, the
   section headers and the closing CTA — and deliberately NOT to long-form
   reading copy. Centred body text forces the eye to hunt for each new line
   start, which is measurably worse to read; the guides stay left-aligned and
   measure-capped so they remain usable.
   ═══════════════════════════════════════════════════════════════════════════ */

/* --- the hero becomes one centred column, matrix beneath ------------------ */
main > header.section .grid--2 {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: clamp(30px, 4vw, 46px);
}
main > header.section .grid--2 > div { width: 100%; max-width: 860px; }
main > header.section h1 { margin-inline: auto; }
main > header.section .lede { margin-inline: auto; }
main > header.section .rise[style*="display:flex"],
main > header.section div[style*="display:flex"] { justify-content: center; }
main > header.section .doc { max-width: 760px; margin-inline: auto; text-align: left; }

/* --- section headers centre; their content keeps its own alignment -------- */
.marker { justify-content: center; }
.section > .shell > h2,
.section > .shell > .lede,
.section > .shell > p.lede { text-align: center; margin-inline: auto; }
.section > .shell > h2 { max-width: 22ch; }
.section > .shell > .lede { max-width: 68ch; }

/* Two-column explainer blocks read better centred as one column on this
   brighter layout — the left/right split was a dark-theme device. */
.section .grid--2 > div > h2 { text-align: left; }

/* --- prose stays left, but centred as a block ---------------------------- */
.prose { margin-inline: auto; }

/* --- FLUID SIZING -------------------------------------------------------
   Nothing may exceed its container at any width. The matrix rail collapses
   before it can force a horizontal scrollbar, and any wide element scrolls
   inside itself rather than pushing the page sideways. */
/* NOT overflow-x:hidden — that clips the evidence and makes an overflow
   invisible instead of fixed. Constrain the cause instead. */
html, body { max-width: 100%; }
img, svg, video, table, pre { max-width: 100%; }
.doc, .card, .note { max-width: 100%; }
table { display: block; overflow-x: auto; }

@media (max-width: 1024px) {
  :root { --rail: 92px; }
}
@media (max-width: 760px) {
  :root { --rail: 0px; }
  body { font-size: 16px; }
  .row { grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; }
  .row__id { grid-column: 1 / -1; font-size: .64rem; }
  .row__text { font-size: .89rem; }
  .chip { font-size: .6rem; padding: 3px 7px; }
  .doc__head { padding: 11px 14px; }
  .card { padding: 20px; }
  .btn--lg { padding: 14px 22px; font-size: .95rem; }
  .figure__n { font-size: clamp(1.6rem, 8vw, 2.1rem); }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  h1 { font-size: clamp(2rem, 10vw, 2.6rem); }
  .btn { width: 100%; }
  main > header.section div[style*="display:flex"] { flex-direction: column; align-items: stretch; }
}


/* ── SMALL SCREENS: let the headline wrap on its own ───────────────────────
   The h1 carries hard <br> tags for the desktop line-break rhythm. At 375px
   "before they are" cannot fit on one line at display size, so the fixed breaks
   pushed the headline — and with it the page — past the viewport edge. Below
   760px the breaks are neutralised and the text wraps naturally.
   Measured 2026-07-28 at 375px: headline, nav CTA and the matrix all clipped. */
@media (max-width: 760px) {
  h1 br { display: none; }
  h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.4rem);
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .nav__in { gap: 8px; }
  .nav__brand { font-size: .92rem; }
  .nav__links .btn { padding: 10px 14px; font-size: .84rem; white-space: nowrap; }
  .shell { padding-inline: 18px; }
  main > header.section .doc { max-width: 100%; }
  .mono { word-break: break-word; }
}
@media (max-width: 400px) {
  h1 { font-size: clamp(1.6rem, 8vw, 2rem); }
  .nav__links .btn { padding: 9px 11px; font-size: .78rem; }
  .shell { padding-inline: 14px; }
}

/* ── VERY NARROW SCREENS (<=400px) ─────────────────────────────────────────
   A single long word in a heading cannot wrap and will push the whole document
   wider than the viewport. Measured 2026-07-28: /terms/ at 320px reported
   scrollWidth 369 against a 320 viewport, traced to an <h2> whose longest word
   ("Confidentiality") exceeded the 292px content box at display size.
   Headings get break/hyphenation and a smaller floor. Applies to every page,
   so a future heading cannot reintroduce it. */
@media (max-width: 400px) {
  h1, h2, h3, h4, .figure__n {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  h2 { font-size: clamp(1.45rem, 7vw, 1.9rem); }
  h3 { font-size: clamp(1.05rem, 5vw, 1.2rem); }
  .prose { font-size: .95rem; }
}
