/* base.css — THE ONE STYLESHEET EVERY PAGE LOADS FIRST.
 *
 * Everything shared lives here and nowhere else: the typeface, the tokens, the reset, the page
 * frame, and the header and footer. A page stylesheet may only add what is genuinely its own.
 *
 * WHY THIS EXISTS, from what was actually wrong on 2026-08-06:
 *
 *   * `@font-face` was declared in NINE stylesheets, all with the same broken path. Every page on
 *     the site fell back to the system font and preloaded 48KB it never used, and fixing it meant
 *     nine identical edits. One declaration cannot drift from itself.
 *   * TWO token sets used the SAME NAMES with DIFFERENT VALUES — `--muted` was #667085 on the
 *     homepage and #5b6677 everywhere else, `--line` #dfe5ee against #e3e8f0. Muted text and
 *     hairlines rendered differently on the page people land on and the page they buy from.
 *   * Four different `h2` sizes (21 / 19 / 18 / 17px), three page widths, and two body sizes
 *     (15 / 15.5px) across nine pages that are meant to look like one site.
 *
 * The homepage's values are canonical: it carries the full scale (13 tokens against 5) and the
 * policy pages were derived from it and drifted. weblint enforces both halves of this — every page
 * must link this file, and no page stylesheet may redeclare a token or the typeface.
 */

/* ── THE CASCADE, DECLARED ────────────────────────────────────────────────────────────────────
   Precedence is stated here and nowhere else. Later layers win, regardless of file order, load
   order or specificity.

   Before this, "base first, then the page" was enforced by a lint rule inspecting the order of
   <link> tags in the HTML — a workaround for not having a contract. With layers a page stylesheet
   cannot accidentally out-rank the base, and the base cannot accidentally out-rank a page: exactly
   the failure that collapsed the homepage hero when base's --max beat index.css.

   Anything OUTSIDE a layer beats everything inside one, so unlayered CSS is now the loudest thing
   on the site. That is deliberate: it makes an escape hatch visible rather than convenient. */
@layer tokens, base, components, page;

/* Self-hosted Inter (variable, latin 100–900) — no third-party font request, ever.
   The URL is relative to THIS FILE, which sits in assets/css/, so ../fonts/ is assets/fonts/. */
@layer tokens {
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
}

:root {
  /* Brand */
  --ink: #0b1320;          /* body text, headings */
  --ink-2: #26303f;        /* secondary body text */
  --muted: #667085;        /* captions, dates, fine print */
  --blue: #2563eb;         /* links, primary action */
  --blue-2: #1d4ed8;       /* hover/active */
  --sky: #dbe8ff;          /* tints */
  --paper: #f6f8fb;        /* page background */
  --white: #ffffff;        /* cards */
  --line: #dfe5ee;         /* hairlines, borders */
  --dark-line: rgba(255, 255, 255, .12);
  --warn: #b45309;

  /* Type scale — one ladder, so a heading means the same thing on every page */
  --t-h1: 30px;
  --t-h2: 19px;
  --t-h3: 16px;
  --t-body: 15.5px;
  --t-small: 13.5px;
  --leading: 1.65;

  /* Frame */
  --max: 760px;            /* the reading column; a page may widen it deliberately */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 19, 32, .04), 0 8px 24px rgba(11, 19, 32, .06);
}
}  /* end @layer tokens */

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

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  font-size: var(--t-body);
  line-height: var(--leading);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, figure { margin-top: 0; }
h1 { font-size: var(--t-h1); line-height: 1.2; margin-bottom: 6px; }
h2 { font-size: var(--t-h2); margin: 36px 0 10px; }
h3 { font-size: var(--t-h3); margin: 24px 0 8px; }
p, li, dd { color: var(--ink-2); }
ul, ol { padding-left: 20px; }
strong { color: var(--ink); }
small, .small { font-size: var(--t-small); color: var(--muted); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

a { color: var(--blue); }
a:hover { color: var(--blue-2); }

/* A visible focus ring, keyboard-only. Without this the site is navigable but not usable without a
   mouse — and `outline: none` is the most common way that gets broken silently. */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

img { max-width: 100%; height: auto; }

/* The reading column. A page may override --max rather than redefining .wrap. */
.wrap { max-width: var(--max); margin: 0 auto; padding: 32px 24px 80px; }
}  /* end @layer base */

@layer components {
/* ── the shared frame ─────────────────────────────────────────────────────────────────────────
   header.site / footer.site are the SAME markup on every page except the homepage, which has its
   own richer chrome (.site-header / .footer) and is left alone. */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 40px;
}
header.site a.home { display: block; line-height: 0; }
header.site a.home img { height: 34px; width: auto; display: block; }
header.site a.back { text-decoration: none; color: var(--blue); font-size: 14px; font-weight: 600; }

footer.site {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line);
  color: #8a93a3; font-size: 12.5px; line-height: 1.6;
}
footer.site strong { color: var(--ink); }
footer.site a { color: #8a93a3; margin-left: 8px; }

/* An effective date / standfirst line, used under the h1 on the policy pages. */
.eff { color: var(--muted); font-size: 14px; margin: 0 0 32px; }

/* A bordered callout. */
.note {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; font-size: 15px; color: var(--ink-2); margin: 18px 0;
}

/* A standfirst — the larger opening paragraph under an h1. PLAIN TEXT, no box.
   Was called `.lead` on two pages and `.lede` on a third, at 17px, 17.5px and 18px. Those two
   names differ by one letter and meant DIFFERENT THINGS: on responsible-use.html `.lede` was a
   bordered box. Hoisting one and deleting the other silently turned the course page's standfirst
   into a box. One name, one meaning. */
.lead { font-size: 17.5px; line-height: 1.6; color: var(--ink); margin: 0 0 32px; }

/* The boxed version, with an accent border — deliberately NOT called .lede. */
.callout {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 16px 18px;
  font-size: 16px; color: var(--ink); font-weight: 600;
}

/* Small print under a block: a legal line, an optional-field note. */
.fine { font-size: var(--t-small); color: var(--muted); line-height: 1.6; margin: 14px 0 0; }

/* A small capitalised label above a heading. */
.eyebrow {
  color: var(--blue); font-weight: 700; font-size: 12.5px;
  letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px;
}

footer.site .links { margin-top: 8px; }
}  /* end @layer components */

@media (max-width: 560px) {
  .wrap { padding: 24px 18px 64px; }
  :root { --t-h1: 26px; }
}

/* Anything that animates must ask first. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
