/* =========================================================================
   DigitalHealthDesign.org — design system
   Direction: 5C "Civic Blue + Electric". Tokens from the design handoff.
   ========================================================================= */

:root {
  /* Brand — 3 hues, each with one exclusive role (kept disciplined per the
     original mood-board note: "brand owns navy and electric teal"; a second
     bright accent was tried and dropped for reading as noisy).
     navy = structure/headings/primary text. civic-blue = links + static
     informational emphasis. cyan = the one lively accent, action/interactive
     only (CTA, hover, active nav, focus-adjacent touches). */
  --navy: #0B2F5E;
  --civic-blue: #1668C4;
  --link-text: #0D5AAD;
  --footer-ground: #06203F;
  --cyan: #25E0C0;
  --cyan-ink: #023A31;
  --teal-ink: #0D5064;   /* dark teal (also the hero gradient's end) — Library tool/example card accent */
  --teal-deep: #0D4A63;  /* deeper teal, one step past --teal-ink — start of several Thumbnail-system gradients */

  /* Surfaces */
  --surface: #F2F6FB;
  --ice: #EAF2FC;
  --admin-ground: #EEF3F9;
  --card-border: #DDE5EF;
  --card-border-2: #D3DFEC;

  /* Text */
  --body-text: #16324E;
  --secondary-text: #33465B;
  --meta-text: #45566B;
  --label-text: #46617A;
  --placeholder: #5C6B7D;

  /* UI borders — must clear WCAG 2.2 SC 1.4.11 (3:1) wherever they mark an
     interactive control (input/button/chip), not just look right. */
  --ui-border: #6E86A2;
  --ui-border-navy: #7FA6D4;

  /* On navy */
  --on-navy-body: #C3D9F2;
  --on-navy-muted: #A7C3E4;

  /* Status traffic light — green/amber/red. Licence chips are the primary
     use, but the same 3 states cover general admin advisory/success/danger
     (form errors, callouts, badges) consistently; never used for brand
     accents (navy/civic-blue/cyan stay separate). */
  --lic-green: #1D6B2A;
  --lic-green-tint: #EEF8EF;
  --lic-amber-ink: #7A5410;
  --lic-amber-border: #9A6C16;
  --lic-amber-tint: #FDF6E8;
  --lic-red: #A32717;
  --lic-red-tint: #FBECEA;

  /* Focus */
  --focus-ring: #1668C4;
  --focus-halo: #CFE3FB;

  /* Gradients */
  --hero-grad: linear-gradient(118deg, #0B2F5E 0%, #113F72 55%, #0D5064 100%);
  --cta-grad: linear-gradient(112deg, #0B2F5E, #10406F 58%, #0E4F5E);
  --hero-scrim: linear-gradient(rgba(11, 47, 94, 0.85), rgba(11, 47, 94, 0.85));   /* over an uploaded hero image: white text stays above 7:1 even on a white photo */

  /* Colour strip (.colour-strip) — five flat blocks, brand tokens only. Change the
     palette here; never colour a strip block anywhere else. */
  --strip-1: var(--footer-ground);
  --strip-2: var(--civic-blue);
  --strip-3: var(--ui-border-navy);
  --strip-4: var(--cyan);
  --strip-5: var(--ice);
  --strip-h: clamp(10px, 1.4vw, 18px);      /* default: hero edge */
  --strip-h-thin: clamp(4px, 0.5vw, 6px);   /* --thin: divider / footer top */
  --strip-w1: 40; --strip-w2: 26; --strip-w3: 10; --strip-w4: 12; --strip-w5: 12;   /* block widths, as flex ratios */

  /* Interaction + on-navy tints — were literals scattered through the CSS. Same values, now named. */
  --navy-hover: #0D3A72;        /* .btn--primary:hover */
  --cyan-hover: #35ECCD;        /* .btn--cyan:hover */
  --disabled-bg: #E4EAF2;       /* disabled button ground */
  --chip-hover-bg: #DCEAFB;     /* a.chip:hover */
  --hairline: #E9EFF6;          /* lighter than --card-border: rules between list rows */
  --on-navy-strong: #DCE9F7;    /* emphasised text on the footer ground */
  --on-navy-faint: #7E9DC0;     /* small print on the footer ground */
  --on-navy-border: #4F7FB4;    /* 1px border of the hero stat panel (handoff README "Hero") */
  --on-navy-ok: #CFF7EF;        /* success text on navy */
  --on-navy-error: #FFD9D2;     /* error text on navy */
  --teal-mid: #0E5C63;          /* paused Community CTA gradient */
  --teal-grad: linear-gradient(140deg, #0D4A63, #0D5064);   /* "teal" card / hero ground (README principle tint #0D4A63 → --teal-ink) */
  --focus-ring-on-navy: var(--cyan);   /* focus ring on navy grounds (README "Focus") */

  /* Radius — README: 8 controls · 10 email field · 12 cards & tiles · 14 feature cards & bands · pill */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-pill: 999px;

  /* Elevation: none in this system, with one exception - the floating note of a Showcase mockup (.sc-tip),
     because it is a layer sitting on top of other content. */
  --elevation-float: 0 12px 28px rgba(11, 47, 94, 0.30), 0 2px 6px rgba(11, 47, 94, 0.20);

  /* Type */
  --font-display: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Type scale — 11 fixed steps (rem, so it scales with the reader's own
     font-size setting) replacing ~54 near-duplicate px values that had
     accumulated with no scale behind them. */
  --fs-100: 0.75rem;    /* 12px — chips, eyebrow, field-label, micro meta */
  --fs-200: 0.875rem;   /* 14px — nav items, buttons, secondary meta */
  --fs-300: 1rem;       /* 16px — card excerpts, notes, hints */
  --fs-400: 1rem;       /* 16px — body */
  --fs-500: 1.125rem;   /* 18px — lead paragraphs */
  --fs-600: 1.3125rem;  /* 21px — card titles */
  --fs-700: 1.5rem;     /* 24px — h3 / subheadings */
  --fs-800: 2rem;       /* 32px — section h2 */
  --fs-850: 2.25rem;    /* 36px — page-title, mobile */
  --fs-900: 3rem;       /* 48px — page-title, desktop */
  --fs-1000: 3.5rem;    /* 56px — hero display */

  --maxw: 1280px;
  --gutter: 28px;
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: 1.65;
  color: var(--body-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
svg { display: inline-block; vertical-align: middle; }
a { color: var(--link-text); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; }

/* ---- Layout helpers ----------------------------------------------------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-100);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--cyan);
}
.eyebrow--onnavy { color: var(--cyan); }

/* ---- Skip link + focus -------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--focus-halo);
  border-radius: 4px;
}
/* On navy grounds the ring is cyan (README "Focus"). */
:is(.hero, .cta-band, .site-footer, .principles-hero, .fn-hero, .sc-hero, .sc-tip, .ds-onnavy)
  :is(a, button, input, select, textarea):focus-visible {
  outline-color: var(--focus-ring-on-navy);
}

/* ---- Back to top ---------------------------------------------------------
   Hidden until the page is scrolled (site.js toggles .is-visible), so without
   JS the button simply never shows. */
.back-to-top {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 60;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, background 0.15s ease, color 0.15s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--cyan); color: var(--cyan-ink); }
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; transform: none; }
}

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: relative;
  border-bottom: 1px solid var(--navy);
  background: #fff;
}
.site-header__inner {
  min-height: 84px;
  /* vertical only — keep the container's horizontal gutter so the wordmark
     lines up with page content below it */
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-700);
  line-height: 1.2;   /* a wordmark, not body text: without this it inherited 1.65 and looked loose if it ever wrapped */
  letter-spacing: -0.025em;
  color: var(--navy);
  text-decoration: none;
}
.wordmark__tld { color: var(--civic-blue); }
.site-nav {
  position: relative;   /* the open search field is laid over this box (see "Header search") */
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.nav-item {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  color: var(--navy);
  text-decoration: none;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
}
.nav-item:hover { color: var(--civic-blue); }
.nav-item--active { border-bottom-color: var(--cyan); }
.issue-pill {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-200);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  border: 1.5px solid var(--ui-border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
}

/* ---- Header search (docs/SOT/IMPROVE.md "Search - plan"; mockup 2_design/Search-proposal.html; icon-only trigger
   at every desktop width owner feedback 2026-09-29, replacing the earlier "field when there's room, else a button
   with the word 'Search'" split) ------------------------------------------------------------------------------
   The nav always shows just the search icon, same colour/weight as the other .nav-item links. Click opens the
   field over the other items with the cursor already in it (site.js); Esc, the x or a click outside closes it.
   Below the burger breakpoint the burger menu shows the field inline instead, as its own first row - see the
   mobile block below. */
.nav-item--search { display: inline-flex; align-items: center; }
.hdr-search { display: none; align-items: center; gap: 10px; }
.hdr-search__field { position: relative; display: flex; align-items: center; width: 220px; flex: 0 0 auto; }
.hdr-search__field svg { position: absolute; left: 12px; color: var(--meta-text); pointer-events: none; }
/* Same icon inset/padding/font-size as .search-field (pages.css) - the Library/Showcase/Search filter bar's search
   box - so the two don't read as two different sizes of the same control (owner feedback 2026-09-29). No font-size
   override here: it inherits .input's --fs-300, same as .search-field. */
.hdr-search__field .input { padding-left: 40px; }
/* Only shown in the open state below. Two classes on purpose: .btn is declared later in this file and would win. */
.hdr-search .hdr-search__go, .hdr-search .hdr-search__close { display: none; }
.hdr-search__close {
  flex: 0 0 auto; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center;
  border: 1.5px solid transparent; border-radius: var(--radius-sm); background: #fff; color: var(--navy); cursor: pointer;
}
.hdr-search__close:hover { border-color: var(--ui-border); }
/* Open (site.js adds .is-search-open): the form is laid over the whole nav box, so the other items are covered.
   Guarded to the same width as the burger breakpoint below - under it the field is already inline in the burger
   menu, not something the icon can "open". */
@media (min-width: 1045px) {
  .is-search-open .hdr-search {
    display: flex; position: absolute; z-index: 5; top: 50%; left: -16px; right: 0;
    transform: translateY(-50%); padding-left: 16px; background: #fff;
  }
  .is-search-open .hdr-search__field { flex: 1 1 auto; width: auto; }
  .is-search-open .hdr-search__go { display: inline-flex; flex: 0 0 auto; }
  .is-search-open .hdr-search__close { display: inline-flex; }
}

/* Mobile menu button (CSS-only toggle) — hidden on desktop */
.nav-burger { display: none; }
.nav-burger__bars, .nav-burger__bars::before, .nav-burger__bars::after {
  content: ""; display: block; width: 22px; height: 2px; background: var(--navy);
  border-radius: 2px; transition: transform 150ms ease-out, opacity 150ms ease-out;
}
.nav-burger__bars { position: relative; }
.nav-burger__bars::before { position: absolute; top: -7px; }
.nav-burger__bars::after  { position: absolute; top: 7px; }

/* Mobile menu. The burger takes over up to 1044.98px (owner feedback 2026-09-29 dropped this from 1141.98px: an
   icon-only search trigger takes far less room than the old text-plus-icon "Search" button). Measured with the
   real fonts: 6 items (longest labels: Foundations, Showcase, Articles, Newsletter, Principles, Contact) + the
   search icon need 1025px on one line; +17px for a classic scrollbar, +a couple more for the fractional-width
   ".98" trick (keeps the ranges gap-free at browser zoom) = 1044.98px. If a label or the gap changes, re-measure
   (see 2_design/Search-proposal.html's own measurement script for the method). */
@media (max-width: 1044.98px) {
  .site-header__inner { flex-wrap: nowrap; gap: 12px; }
  /* One line on every phone. The wordmark is ~11.3 × its font size wide; the room left beside the menu button is
     (viewport − 2 × 20px gutter − 44px button − 12px gap), so the size follows the viewport (÷11.8 leaves ~5%
     spare for a fallback font) and stops at the normal 24px once there is room. */
  .wordmark { font-size: clamp(1.125rem, calc((100vw - 100px) / 11.8), var(--fs-700)); }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: -10px 0; cursor: pointer; flex: none;
  }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--navy);
    padding: 8px 0 16px; z-index: 50;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:checked ~ .nav-burger .nav-burger__bars { background: transparent; }
  .nav-toggle:checked ~ .nav-burger .nav-burger__bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger .nav-burger__bars::after  { transform: translateY(-7px) rotate(-45deg); }
  .site-nav .nav-item {
    padding: 13px var(--gutter); border-bottom: 0; min-height: 44px; display: flex; align-items: center;
  }
  .site-nav .nav-item--active { border-left: 3px solid var(--cyan); padding-left: calc(var(--gutter) - 3px); }
  /* Search in the menu: the field is the first row (DOM order follows the wide bar, so it is moved up here); the
     "Search" button is only used in the wide bar, except the active one on /search, which is the first row instead. */
  .site-nav .nav-item--search:not(.nav-item--here) { display: none; }
  .site-nav .nav-item--search.nav-item--here { order: -1; }
  .site-nav .hdr-search { display: flex; order: -1; margin: 6px var(--gutter) 10px; }
  .site-nav .hdr-search__field { width: 100%; }
  .issue-pill { align-self: flex-start; margin: 8px var(--gutter) 0; }
  .nav-burger:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
}

/* ---- View nav (a small sub-nav switching between 2+ views of one section - e.g. Foundations
   "Topics | Principles") - reuses the same active language as .nav-item--active (cyan underline)
   rather than a filled pill, so it grows to a 3rd item for free instead of needing a redesign.
   Shared component (base.css, not pages.css). Owner feedback (2026-09-23): a first pass placed
   this inside the navy hero and it read as too faint there - moved to sit just below the hero, on
   the white section (same light-ground colours/sizing as the header's .nav-item, not a new
   language), with its own baseline rule since it no longer has the header's own border to sit on. */
.view-nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding-top: 22px; border-bottom: 1px solid var(--card-border); }
.view-nav__item {
  display: inline-flex; align-items: center; min-height: 52px;
  font-family: var(--font-body); font-weight: 600; font-size: 1.125rem; letter-spacing: 0.01em;
  color: var(--navy); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.view-nav__item:hover { color: var(--civic-blue); }
.view-nav__item[aria-current="true"] { border-bottom-color: var(--cyan); }

/* ---- Buttons (target-size scale) --------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-200);
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  padding: 14px 20px;
  transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-hover); }
.btn--secondary { background: #fff; color: var(--navy); border-color: var(--ui-border); }
.btn--secondary:hover { border-color: var(--navy); }
.btn--cyan { background: var(--cyan); color: var(--cyan-ink); }
.btn--cyan:hover { background: var(--cyan-hover); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--disabled-bg); color: var(--placeholder); cursor: not-allowed; border-color: transparent;
}
.btn--block { width: 100%; }
.link-tertiary {
  font-weight: 700;
  color: var(--link-text);
  text-decoration: none;
  border-bottom: 2px solid var(--cyan);
  padding-bottom: 1px;
}
.link-tertiary:hover { color: var(--navy); }

/* ---- Inputs ------------------------------------------------------------- */
.field-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-100);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label-text);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-300);
  color: var(--body-text);
  background: #fff;
  border: 1.5px solid var(--ui-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 44px;   /* control-md — every field and select is a 44px target (handoff README) */
}
.input::placeholder { color: var(--placeholder); }
.input--error { border-color: var(--lic-red); }
.field-error {
  color: var(--lic-red);
  font-size: var(--fs-200);
  margin: 6px 0 0;
}
.field-hint {
  color: var(--meta-text);
  font-size: var(--fs-200);
  margin: 6px 0 0;
}

/* ---- Callouts ----------------------------------------------------------- */
.callout {
  border-top: 3px solid var(--navy);
  border-radius: 0 0 10px 10px;
  padding: 14px 16px;
  background: var(--surface);
  font-size: var(--fs-300);
}
.callout--amber { border-top-color: var(--lic-amber-border); background: var(--lic-amber-tint); color: var(--lic-amber-ink); }
.callout--green { border-top-color: var(--lic-green); background: var(--lic-green-tint); }
.callout--error { border-top-color: var(--lic-red); background: var(--lic-red-tint); color: var(--lic-red); }

/* ---- Licence chip (shared: front end + admin both load base.css) -------- */
.lic {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-100);
  letter-spacing: 0.06em; text-transform: uppercase; border-radius: var(--radius-pill); padding: 4px 11px;
  background: #fff; border: 1.5px solid var(--ui-border); color: var(--navy); white-space: nowrap;
}
.lic::before { content: "\25CF"; font-size: 9px; }
.lic--green { color: var(--lic-green); border-color: var(--lic-green); }
.lic--amber { color: var(--lic-amber-ink); border-color: var(--lic-amber-border); }
.lic--red   { color: var(--lic-red); border-color: var(--lic-red); }
/* Mini variant — inline next to a title/heading, where the full outlined
   chip reads too loud. No border, no bullet, a tint of its own colour
   instead of white — as quiet and small as the fs-100 floor allows. */
.lic--mini {
  gap: 0; font-weight: 600; text-transform: none; letter-spacing: normal;
  padding: 1px 8px; border: none; vertical-align: middle;
}
.lic--mini::before { content: none; }
.lic--mini.lic--green { background: var(--lic-green-tint); }
.lic--mini.lic--amber { background: var(--lic-amber-tint); }
.lic--mini.lic--red   { background: var(--lic-red-tint); }

/* ---- Tag chip (domain / topic) -------------------------------------------
   Same small, no-outline form as the mini licence chip, but neutral: an --ice fill and body-grey text. Never green /
   amber / red (those mean licence, nothing else). A link variant (a.chip) filters a list by that tag. */
.chip {
  display: inline-block; max-width: 100%; font-size: var(--fs-100); font-weight: 600; line-height: 1.4;
  padding: 1px 8px; border-radius: var(--radius-pill); background: var(--ice); color: var(--secondary-text); vertical-align: middle;
}
a.chip { text-decoration: none; }
a.chip:hover { background: var(--chip-hover-bg); color: var(--navy); }
a.chip:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* ---- Colour strip -------------------------------------------------------
   Decorative band of five flat blocks of unequal width (idea: digital.nhs.uk,
   digitalhealth.gov.au; colours are ours). Markup:
   <div class="colour-strip" aria-hidden="true"><span></span> x5</div>
   Carries no meaning, so it is aria-hidden and needs no contrast of its own.
   Palette = --strip-1..5 in :root. --thin for dividers / footer top. */
.colour-strip { display: flex; height: var(--strip-h); }
.colour-strip--thin { height: var(--strip-h-thin); }
.colour-strip span { display: block; height: 100%; }
.colour-strip span:nth-child(1) { flex: var(--strip-w1); background: var(--strip-1); }
.colour-strip span:nth-child(2) { flex: var(--strip-w2); background: var(--strip-2); }
.colour-strip span:nth-child(3) { flex: var(--strip-w3); background: var(--strip-3); }
.colour-strip span:nth-child(4) { flex: var(--strip-w4); background: var(--strip-4); }
.colour-strip span:nth-child(5) { flex: var(--strip-w5); background: var(--strip-5); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--footer-ground);
  color: var(--on-navy-muted);
  padding: 132px 0 120px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
}
.site-footer__col { display: flex; flex-direction: column; }
.site-footer .wordmark { color: #fff; font-size: var(--fs-800); }
.site-footer .wordmark__tld { color: var(--cyan); }
/* Phones: one line here too (room = viewport − 2 × 20px gutter; same ~11.3 × font-size width as the header wordmark).
   Must sit after the rule above — same specificity, so the later one wins. */
@media (max-width: 760px) {
  .site-footer .wordmark { font-size: clamp(1.25rem, calc((100vw - 40px) / 11.8), var(--fs-800)); }
}
.site-footer__desc { font-size: var(--fs-300); line-height: 1.7; max-width: 42ch; margin: 20px 0 0; }
.site-footer__desc strong { color: var(--on-navy-strong); font-weight: 600; }
.site-footer__builtby { font-size: var(--fs-300); color: var(--on-navy-muted); margin: 24px 0 0; }
.site-footer__builtby a {
  color: var(--on-navy-muted);
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-underline-offset: 3px;
}
.site-footer__builtby a:hover { color: #fff; }
.site-footer__copy { font-size: var(--fs-200); color: var(--on-navy-faint); margin: 24px 0 0 0; }
.site-footer__col .site-footer__copy:last-child { margin-top: auto; }
.footer-cols { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-100);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 12px;
}
.footer-col a { display: block; color: var(--on-navy-muted); text-decoration: none; font-size: var(--fs-300); padding: 5px 0; }
.footer-col a:hover { color: #fff; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 88px 0 calc(80px + var(--strip-h));   /* bottom grows by the colour strip's height */
  background: var(--hero-grad);
  background-size: 200% 200%;
  animation: heroPan 22s ease-in-out infinite;
  isolation: isolate;
}
/* Living gradient drift */
@keyframes heroPan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Subtle dot grid, fading toward the lower-left so it never fights the copy */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.3px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 0%, #000 30%, transparent 72%);
          mask-image: radial-gradient(120% 120% at 100% 0%, #000 30%, transparent 72%);
  pointer-events: none;
}
/* Soft cyan glow, top-right. `closest-side` makes the glow reach zero inside its own box on every screen size:
   a plain `circle` measured to the far corner was wider than half of a narrow, tall box on phones and
   tablets, so it was cut off at the box's left edge and showed as a vertical stripe across the hero. */
.hero::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60%;
  height: 130%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(37, 224, 192, 0.16) 0%, transparent 85%);
  pointer-events: none;
}
@media (max-width: 900px) {
  /* Narrow screens: a roundish box (not a tall thin one) so the glow stays a soft corner glow. */
  .hero::after { top: -15%; right: -35%; width: 100%; height: auto; aspect-ratio: 1 / 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
}
/* Own background image (Admin → Homepage → Hero background): the navy scrim keeps the copy readable,
   the picture is decorative only. Still (no drift), and no dot grid / glow on top of a photo. */
.hero--image {
  background: var(--hero-scrim), var(--hero-img) center / cover no-repeat;
  animation: none;
}
.hero--image::before, .hero--image::after { display: none; }
.hero__inner {
  position: relative;
}
/* Hero: the strip sits on the bottom edge (the hero's bottom padding already leaves room for it). */
.hero .colour-strip { position: absolute; left: 0; right: 0; bottom: 0; }
/* Two-column hero only when the optional stat box / accent is actually present —
   ratio + gap per the design handoff (DHD Site.dc.html / README "Hero"). */
.hero__inner:has(.hero__stats),
.hero__inner:has(.hero__accent) {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: start;
  gap: 48px;
}
/* The accent is a small decorative element, not a second block of copy - centring it next to the
   copy column reads better than top-aligning it with the headline. */
.hero__inner:has(.hero__accent) { align-items: center; }
.hero__copy { min-width: 0; }
.hero h1 {
  font-size: var(--fs-1000);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 20px 0 0;
  max-width: 720px;
}
.hero h1 .accent { color: var(--cyan); }
.hero__subhead { color: var(--on-navy-body); font-size: var(--fs-500); line-height: 1.7; margin: 18px 0 0; max-width: 52ch; }
/* Input + button together are capped to roughly the old field width */
.hero__ctas { display: flex; gap: 12px; margin: 32px 0 0; flex-wrap: wrap; }
.btn--hero-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn--hero-outline:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.hero__capture { display: flex; gap: 10px; margin: 32px 0 0; flex-wrap: wrap; max-width: 460px; }
.hero__capture .input {
  border-radius: var(--radius-md); border-color: transparent; flex: 1 1 180px; min-width: 0; padding: 15px 16px;
}
.hero__capture .btn { flex: 0 0 auto; white-space: nowrap; }
.hero__links { display: flex; gap: 20px; margin: 16px 0 0; flex-wrap: wrap; }
.hero__links a { color: #fff; }
.hero__alt { margin: 16px 0 0; color: var(--on-navy-muted); font-size: var(--fs-300); }
.hero__alt .link-tertiary { color: #fff; margin-left: 14px; }
@media (max-width: 560px) {
  .hero__alt .link-tertiary { display: inline-block; margin: 8px 14px 0 0; }
}
/* Optional stat box, Admin -> Homepage; hidden entirely when no stat has a
   label. Panel + cell spec from the design handoff (DHD Site.dc.html /
   README "Hero"): 1px #4F7FB4 border, 14px radius, 0.04 white fill, three
   stacked 20px cells separated by 1px rules. */
.hero__stats {
  border: 1px solid var(--on-navy-border);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  /* Starts a bit below the eyebrow/H1 line instead of running level with
     them, so it reads as a side note, not a second headline. */
  margin-top: 64px;
}
.hero__stat { padding: 16px; }
.hero__stat + .hero__stat { border-top: 1px solid var(--on-navy-border); }
.hero__stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-700);
  line-height: 1;
  letter-spacing: -0.045em;
  color: #fff;
}
.hero__stat:first-child .hero__stat-num { color: var(--cyan); }
.hero__stat-lbl {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-100);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
}
/* Newsletter mode only: a light, borderless accent (just the 3 Highlight numbers) instead of a
   bordered card - a mini "latest issue" teaser and trust badges used to live here too, but
   together with the headline/subhead/form above, the card read as a second, competing block
   (owner feedback from live: the hero felt overloaded, "the right side should only be a light
   secondary graphic"). The eyebrow above the headline already covers "latest issue"; Intro
   mode's own .hero__stats keeps the full card treatment, unchanged. */
.hero__accent { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 4px 18px; border-left: 1px solid var(--on-navy-border); }
.hero__accent-item { display: flex; align-items: baseline; gap: 8px; }
.hero__accent-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-500);
  line-height: 1;
  color: var(--on-navy-body);
}
.hero__accent-item:first-child .hero__accent-num { color: var(--cyan); }
.hero__accent-lbl {
  font-size: var(--fs-100);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
}

/* ---- Utility ------------------------------------------------------------ */
.section { padding: 72px 0; }
@media (min-width: 1000px) { .section { padding: 88px 0; } }
.stack-8 > * + * { margin-top: 8px; }
.muted { color: var(--meta-text); }
.center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero h1 { font-size: var(--fs-850); }
  .hero__inner:has(.hero__stats),
  .hero__inner:has(.hero__accent) { grid-template-columns: 1fr; }
  .hero__stats { max-width: 480px; margin-top: 8px; }
  /* Below the copy instead of beside it, so the accent turns into one light row rather than a
     tall left-bordered column eating into the already-tight mobile height. */
  .hero__accent {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 24px;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid var(--on-navy-border);
  }
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer { padding: 72px 0 64px; }
}
@media (max-width: 560px) {
  :root { --gutter: 20px; }
  /* Phone: less air above and below the hero, so the stat box is not pushed a whole screen away. */
  .hero { padding-top: 56px; padding-bottom: calc(56px + var(--strip-h)); }
  /* Same copy, smaller type - the 5-line subhead was a big share of the hero's height on a phone. */
  .hero__subhead { font-size: var(--fs-400); line-height: 1.6; }
}
