/*
 * DES-1 — the site's design-token layer.
 *
 * The British Schools design system is the base. Its three token files are in
 * assets/ds/, copied byte-for-byte from the kit and loaded before this file;
 * nothing here edits them. This file only does three things:
 *
 *   1. maps the site's semantic names onto the school's values,
 *   2. applies the accessibility overrides DES-4 requires, where a brand colour
 *      does not reach 4.5:1 for body text,
 *   3. adds the handful of tokens a website needs that a Power BI kit has no
 *      reason to define (reading measure, page container).
 *
 * Every contrast ratio quoted below is computed, not estimated.
 *
 * Deviations from the kit, each deliberate:
 *   * `tokens/fonts.css` is not loaded. It @imports Google Fonts, which the
 *     strict CSP of SEC-17 forbids and which would send every visitor's IP to
 *     a third party — awkward for a site used by schools and minors (DAT-4).
 *     The font stacks below are the kit's, unchanged; the substitute faces it
 *     names are already system fonts on the platforms that need them (Noto Sans
 *     is Android's system font; Times New Roman ships on Windows, macOS and
 *     iOS). Nobody loses the intended face.
 *   * The kit's spacing scale stops at --space-10. --space-12 and --space-16
 *     continue it at the same rhythm for page-level gaps.
 *   * No shadows anywhere: the kit says none are used.
 */

:root {
  /* Light only, whatever the visitor's system setting (owner decision, 26 Nov 2026).
     Also keeps browser-drawn controls and scrollbars light. */
  color-scheme: light;

  /* ---------------------------------------------------------------------
     Brand — straight from the school's design system.
     The primary colour is green. Gold is secondary.
     --------------------------------------------------------------------- */
  --color-brand: var(--tbs-green-950); /* #003B1F — 12.76:1 on white */
  --color-brand-strong: var(--tbs-green-900); /* #14432A — 11.25:1 */
  --color-brand-contrast: var(--tbs-white);
  --color-secondary: var(--tbs-gold-600); /* #C9A227 — decoration only */

  /* The green band (header, hero panel, save-the-date), which carries the
     white LAMUN mark. White on it is 12.76:1; gold-300 is 7.61:1. */
  --color-band: var(--tbs-green-950);
  --color-band-strong: var(--tbs-green-900);
  --color-band-contrast: var(--tbs-white);
  --color-band-kicker: var(--tbs-gold-300);

  /* ---------------------------------------------------------------------
     Accents.
     DES-2 asks for THIMUN blue as a secondary accent; DES-1 says the school's
     system wins where the two differ, and the school's secondary is gold. So
     the palette is the school's, and THIMUN blue keeps one narrow job: the
     affiliation mark in the footer. See docs/decisions/0002-design-system.md.
     --------------------------------------------------------------------- */
  --color-accent: var(--tbs-green-800); /* #005C30 — 8.16:1 on white */
  --color-accent-strong: var(--tbs-green-800);
  --color-accent-contrast: var(--tbs-white);
  /* #00A651 is 3.19:1 on white: a hover tint for artwork and strips, never
     behind text and never as text (DES-4). */
  --color-accent-bright: var(--tbs-green-bright);
  /* THIMUN blue, 3.06:1 on white — decoration only, same rule. */
  --color-thimun: #009ddc;

  /* ---------------------------------------------------------------------
     Surfaces and ink
     --------------------------------------------------------------------- */
  --color-bg: var(--tbs-white);
  --color-surface: var(--tbs-paper); /* #F7F6F2 */
  --color-surface-raised: var(--tbs-white);
  --color-surface-tile: var(--tbs-mint-50);
  --color-border: var(--tbs-stone-200); /* #E4E1D8 */
  --color-ink: var(--tbs-ink); /* #1F2A24 — 14.84:1 on white */

  /* DES-4 override. The kit's stone-500 (#7A8078) is 4.05:1 on white and
     3.74:1 on paper — under AA for body text, and it is used for subtitles.
     This is the same hue carried darker until it passes on both surfaces:
     5.24:1 on white, 4.84:1 on paper. stone-500 itself stays untouched for
     borders and other non-text work. */
  --color-ink-muted: #686e66;

  /* Links: the kit's #005C30, which passes comfortably. Its hover, #00A651,
     does not (3.19:1), so hovering darkens instead of brightening and the
     underline carries the state as well as the colour. */
  --color-link: var(--tbs-green-800);
  --color-link-hover: var(--tbs-green-950);
  --color-link-visited: var(--tbs-bronze); /* #9C6B2E — 4.61:1 */

  /*
   * Focus ring. WCAG 2.1 SC 1.4.11 wants 3:1 against whatever sits behind it.
   * Shield red is 4.29:1 on white, 3.97:1 on paper and 4.02:1 on the mint tile
   * fill, so it clears 3:1 on every light surface — but only 2.98:1 on the
   * brand green, which fails. The green
   * band therefore overrides this to white (12.76:1) in base.css rather than
   * one colour being stretched to cover both.
   */
  --color-focus: var(--tbs-shield-red); /* #E63338 */

  /* ---------------------------------------------------------------------
     Status. The kit's semantic trio, with amber swapped for its own bronze
     where it has to carry small text (#B8741A is 3.78:1; bronze is 4.61:1).
     --------------------------------------------------------------------- */
  --color-danger: var(--tbs-bad); /* #C0392B — 5.44:1 */
  --color-success: var(--tbs-green-500); /* #4F7864 — 5.00:1 */
  --color-warning: var(--tbs-bronze); /* #9C6B2E — 4.61:1 */

  /* ---------------------------------------------------------------------
     Type — the kit's stacks, unchanged.
     Times New Roman is the school's official face and carries the wordmark;
     Arial is the kit's choice for long-form reading; Segoe UI is the UI face.
     --------------------------------------------------------------------- */
  --font-display: var(--font-serif);
  --font-sans: var(--font-ui);
  --font-body: var(--font-serif-article);
  --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo, monospace;

  /* The kit's print/identity sizes, in rem so they follow a reader who has
     enlarged their default text. 1rem = 16px, so the values are the kit's. */
  --text-xs: 0.8125rem; /* 13px */
  --text-sm: 0.875rem; /* 14px */
  --text-base: 1rem; /* 16px — kit --type-body-size */
  --text-lg: 1.25rem; /* 20px — kit --type-h2-size */
  --text-xl: 1.5rem; /* 24px */
  --text-2xl: 1.75rem; /* 28px — kit --type-h1-size */
  --text-3xl: 2.5rem; /* 40px — kit --type-display-size */

  --line-tight: var(--leading-tight); /* 1.15 */
  --line-body: var(--leading-body); /* 1.45 */
  /* --tracking-caps comes from the kit (0.04em); it is not redefined here. */

  /* ---------------------------------------------------------------------
     Spacing and shape. The kit defines --space-1 to --space-10 and the radii;
     only the two largest steps and the page measures are added here.
     --------------------------------------------------------------------- */
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: var(--radius-visual); /* 6px */
  --radius-md: var(--radius-visual); /* 6px — the kit uses one card radius */
  --radius-lg: var(--radius-tile); /* 14px */

  --measure: 68ch;
  --container: 72rem;
  --strip-width: var(--tile-strip-width); /* 8px */
}
