/* Brand tokens (PLAN.md §3.3). WP0 owns this file: all modules use these names and never redefine them. */
:root{
  --night-950:#07061A; --night-900:#0B0A1A; --night-800:#15132B; --night-700:#1F1C3D; --night-600:#2C2853;
  --ink:#F7F3FF; --ink-2:#C9C3E6; --ink-3:#A9A3C9;
  --candle:#FFC94D; --party:#FF3D8B; --volt:#3DE7FF; --violet:#7B5CFF; --lime:#B6F36B; --coral:#FF7A59;
  --grad-candle:linear-gradient(120deg,#FFC94D 0%,#FF7A59 35%,#FF3D8B 65%,#7B5CFF 100%);
  /* type */
  --font-display:"Bricolage Grotesque Variable","Noto Sans",system-ui,sans-serif;
  --font-name:"Instrument Serif","Noto Serif",Georgia,serif;   /* always used with font-style:italic (§3.2) */
  --font-ui:"Instrument Sans Variable","Noto Sans",system-ui,sans-serif;
  --step-xl:clamp(3rem,8vw + 1rem,8.5rem); --step-l:clamp(2.25rem,5vw,5rem); --step-h2:clamp(1.75rem,3vw,3rem);
  --step-h3:1.375rem; --step-body:1.0625rem; --step-small:.875rem;
  /* space, radius, layout */
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px; --space-7:48px; --space-8:72px;
  --radius-s:10px; --radius-m:20px; --radius-l:32px; --radius-pill:999px;
  --gutter:16px; --maxw:1200px; --header-h:64px;
  /* motion */
  --dur-1:120ms; --dur-2:220ms; --dur-3:400ms; --dur-4:700ms; --dur-5:1200ms;
  --ease-out:cubic-bezier(.16,1,.3,1); --ease-in:cubic-bezier(.7,0,.84,0); --ease-io:cubic-bezier(.65,0,.35,1);
  --ease-spring:linear(0,.24 7%,.72 16%,1.05 25%,1.1 31%,1.04 40%,.99 52%,1 70%,1);
  /* elevation, layers */
  --glow:0 0 40px color-mix(in srgb,var(--accent) 45%,transparent);
  --z-bg:0; --z-fx:1; --z-stage:2; --z-hud:3; --z-sheet:10; --z-toast:20;
}
@media (min-width:768px){:root{--gutter:24px}}

/* ── Colour schemes ─────────────────────────────────────────────────────────────────────────────────────────────────────────
   The site chrome comes in two schemes: light (the first block, the default) and dark (the two blocks after it, the same values
   twice). A page follows the device (prefers-color-scheme) unless the visitor picked one in the header's Appearance switch: then
   <html data-theme="light|dark"> is set before the first paint by /js/theme-boot.js (client/pages/theme-boot.ts) and changed later by
   client/lib/theme.ts. The night pages (/live, /tv, /g and the design pages; shared/scheme.ts NIGHT_PAGES) always render
   html[data-theme="dark"]. The dark values are the site as it was before the light scheme: the dark site looks unchanged.
   The brand colours above never change: they paint what is night in either scheme (a stage, the marquee sign, a sponsor's card,
   the toast) and fills under dark text (the candle button with --night-900 on it). The page itself, and anything sitting on it, is
   painted with these semantic tokens:
     --bg --bg-deep         the page, and its deeper bands (the footer, the header's glass, a document's header)
     --surface --surface-2 --surface-3   panels, then raised or inset parts of them (a selected day mixes the candle into -2)
     --line --field-mix(-hover)          hairlines; a form field's border is color-mix(--text <field-mix>) (3:1 in light)
     --text --text-2 --text-3            body text, secondary, tertiary
     --accent               the candle as a fill (under --night-900 text); --accent-ink is the accent as TEXT or a link: candle on night,
                            a deep amber on light (the candle itself is 1.4:1 on the light ground)
     --party-ink --volt-ink --success --danger --danger-text   the brand's other colours as text or a state on the page
     --focus                the focus ring (3:1 against every ground)
     --shadow-1, --shadow-rgb + --shadow-a, --scrim-a   elevation: a shadow is rgb(var(--shadow-rgb) / calc(<alpha> * var(--shadow-a)))
                            and a backdrop rgb(7 6 26 / calc(<alpha> * var(--scrim-a))), so the dark values stay exact and light ones soften
     --edge                 the hairline round a themed object on the page (a theme swatch): never remapped by .themed
     --chevron-light(-sm)   a <select>'s arrow on the light scheme (-sm: the advertise kit's 12×8 one); `initial` on dark, so
                            var(--chevron-light, <the dark arrow>) keeps the dark one there
   Contrast (WCAG 2.2): every text token is 4.5:1 or more on --bg, --bg-deep, --surface and --surface-2 of its scheme (light: --text
   14.7–17.2, --text-2 7.8–9.1, --text-3 5.1–6.0, --accent-ink 5.2–6.0, --party-ink 4.9–5.7, --volt-ink 4.8–5.7, --success 5.3–6.2,
   --danger 5.0–5.8, --danger-text 5.5–6.4; --focus 4.5–5.3). Do not use light-dark(): older Safari has none. */
:root{
  color-scheme:light;
  --bg:#FBF5EB; --bg-deep:#F3EADA; --surface:#FFFCF7; --surface-2:#F4ECDF; --surface-3:#E8DCC8;
  --line:color-mix(in srgb,var(--text) 14%,transparent);
  --field-mix:48%; --field-mix-hover:68%;
  --text:#1B1530; --text-2:#4A4262; --text-3:#655D7E;
  --accent:var(--candle); --accent-ink:#8A5600;
  --party-ink:#C2175F; --volt-ink:#00707F; --success:#3A6B12; --danger:#B4380A; --danger-text:#B42318;
  --focus:#6A4BF0;
  --shadow-1:0 1px 2px rgb(68 44 18/.08),0 6px 18px -6px rgb(68 44 18/.16);
  --shadow-rgb:68 44 18; --shadow-a:.3; --scrim-a:.55;
  --edge:var(--text);
  --chevron-light:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23655D7E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  --chevron-light-sm:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%23655D7E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:var(--night-900); --bg-deep:var(--night-950); --surface:var(--night-800); --surface-2:var(--night-700); --surface-3:var(--night-600);
    --line:color-mix(in srgb,var(--ink) 14%,transparent);
    --field-mix:18%; --field-mix-hover:32%;
    --text:var(--ink); --text-2:var(--ink-2); --text-3:var(--ink-3);
    --accent:var(--candle); --accent-ink:var(--candle);
    --party-ink:var(--party); --volt-ink:var(--volt); --success:var(--lime); --danger:var(--coral); --danger-text:#FF9D85;
    --focus:var(--candle);
    --shadow-1:0 1px 2px rgb(0 0 0/.3),0 4px 16px rgb(0 0 0/.25);
    --shadow-rgb:0 0 0; --shadow-a:1; --scrim-a:1;
    --edge:var(--ink); --chevron-light:initial; --chevron-light-sm:initial;
  }
}
/* …and an element with class="scheme-dark": a night island on a light page (its descendants get the dark tokens, its form controls
   the dark color-scheme); on a dark page it changes nothing */
:root[data-theme="dark"],.scheme-dark{
  color-scheme:dark;
  --bg:var(--night-900); --bg-deep:var(--night-950); --surface:var(--night-800); --surface-2:var(--night-700); --surface-3:var(--night-600);
  --line:color-mix(in srgb,var(--ink) 14%,transparent);
  --field-mix:18%; --field-mix-hover:32%;
  --text:var(--ink); --text-2:var(--ink-2); --text-3:var(--ink-3);
  --accent:var(--candle); --accent-ink:var(--candle);
  --party-ink:var(--party); --volt-ink:var(--volt); --success:var(--lime); --danger:var(--coral); --danger-text:#FF9D85;
  --focus:var(--candle);
  --shadow-1:0 1px 2px rgb(0 0 0/.3),0 4px 16px rgb(0 0 0/.25);
  --shadow-rgb:0 0 0; --shadow-a:1; --scrim-a:1;
  --edge:var(--ink); --chevron-light:initial; --chevron-light-sm:initial;
}
