/* Gathr design tokens. Source of truth: docs/design/BRAND.md. Generated by docs/design/src/build.py - edit palette.py, then rebuild.
   Load order does not matter: legacy aliases use html:root (higher specificity than gather.css's :root).
   Themes:  <html data-theme="dark"> | <html data-theme="light"> | (none = follows prefers-color-scheme)
   Tone:    data-tone="calm" on <html> or any wrapper = quiet slate chrome for sombre events (memorial). Status colours stay vivid. */

:root {
  color-scheme: light;
  /* ---- Colour: neutrals ---- */
  --bg: #F7F5FD;
  --surface: #FFFFFF;
  --sunken: #EFECFB;
  --ink: #16112B;
  --muted: #57527A;
  --line: #E6E1F6;
  --line-strong: #8A83B5;
  --focus: #5336E8;
  --primary: #5336E8;
  --primary-hover: #4326D0;
  --primary-press: #3B22B8;
  --primary-lip: #2E1AA0;
  --on-primary: #FFFFFF;
  --primary-soft: #EEEAFE;
  --primary-ink: #3B22B8;
  --cta: #FF6A4D;
  --cta-hover: #FF7C61;
  --on-cta: #1D0B07;
  --night: #140C2B;
  --night-deep: #0B0718;
  --on-night: #F5F2FF;
  --on-night-muted: #BDB5DE;
  --night-line: #2E2552;
  --lilac: #A99BF5;
  --lilac-hi: #C9BDFF;
  --glow-violet: rgb(110 85 255 / .55);
  --glow-coral: rgb(255 106 77 / .4);
  --glow-cta: rgb(255 106 77 / .6);
  --glow-primary: rgb(83 54 232 / .5);
  --coral: #FF6A4D;
  --coral-soft: #FFE9E3;
  --coral-ink: #B23A20;
  --sun: #FFB199;
  --sun-soft: #FFF0EA;
  --sun-ink: #8A3A22;
  --mint: #A99BF5;
  --mint-soft: #EEEAFE;
  --mint-ink: #3B22B8;
  --sky: #8A83B5;
  --sky-soft: #F3F0FC;
  --sky-ink: #3F3A66;
  --pink: #C9BDFB;
  --pink-soft: #F3F0FF;
  --pink-ink: #2A1A8C;
  --success: #0B6B4C;
  --success-bg: #D9F7EB;
  --warning: #6F4A00;
  --warning-bg: #FFF1C2;
  --danger: #B4132B;
  --danger-bg: #FFE6E1;
  --info: #0B5CA8;
  --info-bg: #DCEFFF;
  /* ---- Colour: hero gradient stops (white text passes 4.5:1 on all three) ---- */
  --hero-1: #5336E8;
  --hero-2: #6A3FE6;
  --hero-3: #9A3F9E;
  --progress-end: var(--pink-ink);
  --lip-depth: 0px;
  /* ---- Colour: 8 categorical colours (fill + text-on-fill). Always pair with a text label/initials. ---- */
  --cat-1: #5336E8;    --cat-1-ink: #FFFFFF;
  --cat-2: #FF6A4D;    --cat-2-ink: #16112E;
  --cat-3: #2A1A8C;    --cat-3-ink: #FFFFFF;
  --cat-4: #A99BF5;    --cat-4-ink: #16112E;
  --cat-5: #FFB199;    --cat-5-ink: #16112E;
  --cat-6: #6F68A3;    --cat-6-ink: #FFFFFF;
  --cat-7: #D6CFFA;    --cat-7-ink: #16112E;
  --cat-8: #F7D3C8;    --cat-8-ink: #16112E;
  /* ---- Type ---- */
  --font-display: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;   /* h1, h2, hero lines, big figures: weight 700 (--fw-display), tight tracking */
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-accent: "Instrument Serif", Georgia, serif;   /* italic, ONE accent word or phrase inside a display line */
  --fw-display: 700;
  --fs-display: clamp(2.75rem, 1.6rem + 4vw, 5.25rem);
  --fs-h1: clamp(2.1rem, 1.5rem + 2.2vw, 3.4rem);
  --fs-h2: clamp(1.7rem, 1.3rem + 1.3vw, 2.6rem);
  --fs-h3: 1.1875rem;
  --fs-lead: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-xs: .75rem;
  --lh-tight: 1.02;
  --lh-snug: 1.25;
  --lh-body: 1.55;
  --ls-display: -.04em;
  --ls-figure: -.05em;
  --ls-eyebrow: .12em;
  /* ---- Space (4px base) ---- */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.5rem;
  --space-6: 2rem; --space-7: 3rem; --space-8: 4rem; --space-9: 6rem;
  --gutter: clamp(1rem, .5rem + 2.2vw, 3.5rem);
  /* ---- Fluid frame: content is min(viewport - 2 gutters, --page-max). rem scales with the viewport (see the html rule below), so the frame does too. ---- */
  --page-max: 96rem;      /* 1536px at 16px root, 1920px once the root reaches 20px (2560 wide and up) */
  --measure: 70ch;        /* longest comfortable line of running text */
  --prose-max: 46rem;     /* single-column reading width (articles, legal, forms) */
  /* ---- Radii ---- */
  --radius-xs: .375rem; --radius-sm: .625rem; --radius-md: .875rem; --radius-lg: 1.25rem; --radius-xl: 1.5rem; --radius-pill: 999px;
  /* ---- Elevation ---- */
  --shadow-1: 0 1px 2px rgb(40 20 120 / .06);
  --shadow-2: 0 1px 2px rgb(40 20 120 / .05), 0 12px 30px -14px rgb(40 20 120 / .22);
  --shadow-3: 0 2px 4px rgb(40 20 120 / .05), 0 24px 48px -20px rgb(40 20 120 / .32);
  /* ---- Motion ---- */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 120ms; --dur: 200ms; --dur-slow: 360ms;
  /* ---- Tap target ---- */
  --tap: 2.75rem;
}

/* Fluid root size: 16px up to 1280 wide, growing to 20px at 2560, so every rem-sized thing (type, spacing, the frame) scales with big screens.
   html:root beats the `font:` shorthands that pages set on :root. */
html:root { font-size: clamp(100%, .75rem + .3125vw, 125%); }

/* Dark theme: explicit */
html:root[data-theme="dark"], [data-theme="dark"] {
  --bg: #0B0718;
  --surface: #170F31;
  --sunken: #110A25;
  --ink: #F5F2FF;
  --muted: #BDB5DE;
  --line: #2E2552;
  --line-strong: #7A73B0;
  --focus: #C9BDFF;
  --primary: #A99BF5;
  --primary-hover: #BBAEFF;
  --primary-press: #9584F0;
  --primary-lip: #6B55D6;
  --on-primary: #140C2B;
  --primary-soft: #2A2160;
  --primary-ink: #D4CBFF;
  --cta: #FF7A5E;
  --cta-hover: #FF8C73;
  --on-cta: #1D0B07;
  --night: #1B1239;
  --night-deep: #120C26;
  --on-night: #F5F2FF;
  --on-night-muted: #BDB5DE;
  --night-line: #3A2F6B;
  --lilac: #A99BF5;
  --lilac-hi: #C9BDFF;
  --glow-violet: rgb(110 85 255 / .5);
  --glow-coral: rgb(255 106 77 / .32);
  --glow-cta: rgb(255 106 77 / .45);
  --glow-primary: rgb(110 85 255 / .45);
  --coral: #FF7F6B;
  --coral-soft: #3D1B2A;
  --coral-ink: #FF9D8E;
  --sun: #FFB199;
  --sun-soft: #3D2420;
  --sun-ink: #FFC4B0;
  --mint: #B4A3FF;
  --mint-soft: #2A2260;
  --mint-ink: #CFC4FF;
  --sky: #9A93C8;
  --sky-soft: #1F1B45;
  --sky-ink: #C9C4EA;
  --pink: #8E77F5;
  --pink-soft: #241D55;
  --pink-ink: #DCD4FF;
  --success: #5FE0B5;
  --success-bg: #123A33;
  --warning: #FFD66B;
  --warning-bg: #3A2F10;
  --danger: #FF8F82;
  --danger-bg: #3D1620;
  --info: #7CC4FF;
  --info-bg: #12304F;
  --hero-1: #4A30D4;
  --hero-2: #6239D6;
  --hero-3: #8E3A92;
  --cat-1: #8E7BFF;    --cat-1-ink: #14102E;
  --cat-2: #FF6A4D;    --cat-2-ink: #16112E;
  --cat-3: #6B55D6;    --cat-3-ink: #FFFFFF;
  --cat-4: #A99BF5;    --cat-4-ink: #16112E;
  --cat-5: #FFB199;    --cat-5-ink: #16112E;
  --cat-6: #6F68A3;    --cat-6-ink: #FFFFFF;
  --cat-7: #D6CFFA;    --cat-7-ink: #16112E;
  --cat-8: #F7D3C8;    --cat-8-ink: #16112E;
  --progress-end: var(--pink-ink);
  color-scheme: dark;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-2: 0 6px 18px rgb(0 0 0 / .45);
  --shadow-3: 0 18px 48px rgb(0 0 0 / .55);
}
/* Dark theme: follows the OS unless the page pins data-theme="light" */
@media (prefers-color-scheme: dark) {
  html:root:not([data-theme="light"]) {
    --bg: #0B0718;
    --surface: #170F31;
    --sunken: #110A25;
    --ink: #F5F2FF;
    --muted: #BDB5DE;
    --line: #2E2552;
    --line-strong: #7A73B0;
    --focus: #C9BDFF;
    --primary: #A99BF5;
    --primary-hover: #BBAEFF;
    --primary-press: #9584F0;
    --primary-lip: #6B55D6;
    --on-primary: #140C2B;
    --primary-soft: #2A2160;
    --primary-ink: #D4CBFF;
    --cta: #FF7A5E;
    --cta-hover: #FF8C73;
    --on-cta: #1D0B07;
    --night: #1B1239;
    --night-deep: #120C26;
    --on-night: #F5F2FF;
    --on-night-muted: #BDB5DE;
    --night-line: #3A2F6B;
    --lilac: #A99BF5;
    --lilac-hi: #C9BDFF;
    --glow-violet: rgb(110 85 255 / .5);
    --glow-coral: rgb(255 106 77 / .32);
    --glow-cta: rgb(255 106 77 / .45);
    --glow-primary: rgb(110 85 255 / .45);
    --coral: #FF7F6B;
    --coral-soft: #3D1B2A;
    --coral-ink: #FF9D8E;
    --sun: #FFB199;
    --sun-soft: #3D2420;
    --sun-ink: #FFC4B0;
    --mint: #B4A3FF;
    --mint-soft: #2A2260;
    --mint-ink: #CFC4FF;
    --sky: #9A93C8;
    --sky-soft: #1F1B45;
    --sky-ink: #C9C4EA;
    --pink: #8E77F5;
    --pink-soft: #241D55;
    --pink-ink: #DCD4FF;
    --success: #5FE0B5;
    --success-bg: #123A33;
    --warning: #FFD66B;
    --warning-bg: #3A2F10;
    --danger: #FF8F82;
    --danger-bg: #3D1620;
    --info: #7CC4FF;
    --info-bg: #12304F;
    --hero-1: #4A30D4;
    --hero-2: #6239D6;
    --hero-3: #8E3A92;
    --cat-1: #8E7BFF;    --cat-1-ink: #14102E;
    --cat-2: #FF6A4D;    --cat-2-ink: #16112E;
    --cat-3: #6B55D6;    --cat-3-ink: #FFFFFF;
    --cat-4: #A99BF5;    --cat-4-ink: #16112E;
    --cat-5: #FFB199;    --cat-5-ink: #16112E;
    --cat-6: #6F68A3;    --cat-6-ink: #FFFFFF;
    --cat-7: #D6CFFA;    --cat-7-ink: #16112E;
    --cat-8: #F7D3C8;    --cat-8-ink: #16112E;
    --progress-end: var(--pink-ink);
    color-scheme: dark;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-2: 0 6px 18px rgb(0 0 0 / .45);
    --shadow-3: 0 18px 48px rgb(0 0 0 / .55);
  }
}

/* Calm tone (memorials and other sombre events): recolours chrome accents to quiet slate, removes decoration (see BRAND.md). */
html:root[data-tone="calm"], [data-tone="calm"] {
  --bg: #F4F5F8;
  --sunken: #ECEEF3;
  --ink: #232A43;
  --muted: #545B75;
  --line: #DDE0E8;
  --line-strong: #7A829E;
  --focus: #3C4A7D;
  --primary: #3C4A7D;
  --primary-hover: #2F3B66;
  --primary-press: #27315A;
  --primary-lip: #1D2547;
  --on-primary: #FFFFFF;
  --primary-soft: #E3E7F3;
  --primary-ink: #2F3B66;
  --cta: #3C4A7D;
  --cta-hover: #2F3B66;
  --on-cta: #FFFFFF;
  --night: #2B3352;
  --night-deep: #232A43;
  --on-night: #F2F4FA;
  --on-night-muted: #BFC5D8;
  --night-line: #3E4766;
  --lilac: #AEB9E8;
  --lilac-hi: #C9D1F5;
  --glow-violet: transparent;
  --glow-coral: transparent;
  --glow-cta: transparent;
  --glow-primary: transparent;
  --coral: #C9A296;
  --coral-soft: #F3E9E5;
  --coral-ink: #7A4A3E;
  --sun: #D9BF7A;
  --sun-soft: #F5EFDC;
  --sun-ink: #6B5420;
  --mint: #7FB5A0;
  --mint-soft: #E3F0EA;
  --mint-ink: #2F6552;
  --sky: #8AA6D1;
  --sky-soft: #E3EBF7;
  --sky-ink: #2F5185;
  --pink: #C79AB0;
  --pink-soft: #F4E6EE;
  --pink-ink: #7C3A5A;
  --hero-1: #2B3560;
  --hero-2: #3C4A7D;
  --hero-3: #4C5B94;
  --progress-end: var(--primary);
  --lip-depth: 0px;
}
html:root[data-theme="dark"][data-tone="calm"], [data-theme="dark"] [data-tone="calm"], [data-tone="calm"][data-theme="dark"] {
  --bg: #0E1018;
  --surface: #181B26;
  --sunken: #12141E;
  --ink: #E8EAF2;
  --muted: #A9AEC4;
  --line: #2A2F42;
  --line-strong: #6F7694;
  --focus: #AEB9E8;
  --primary: #AEB9E8;
  --primary-hover: #C2CBF0;
  --primary-press: #97A4DD;
  --primary-lip: #6C7AB8;
  --on-primary: #151A30;
  --primary-soft: #232A45;
  --primary-ink: #C9D1F5;
  --cta: #AEB9E8;
  --cta-hover: #C2CBF0;
  --on-cta: #151A30;
  --night: #1C2030;
  --night-deep: #151824;
  --on-night: #E8EAF2;
  --on-night-muted: #A9AEC4;
  --night-line: #2F3548;
  --lilac: #AEB9E8;
  --lilac-hi: #C9D1F5;
  --glow-violet: transparent;
  --glow-coral: transparent;
  --glow-cta: transparent;
  --glow-primary: transparent;
  --coral: #C9A296;
  --coral-soft: #2E2420;
  --coral-ink: #E0BFB3;
  --sun: #D9BF7A;
  --sun-soft: #2B2615;
  --sun-ink: #E6D193;
  --mint: #7FB5A0;
  --mint-soft: #16292A;
  --mint-ink: #9CCDB9;
  --sky: #8AA6D1;
  --sky-soft: #192438;
  --sky-ink: #A8C0E6;
  --pink: #C79AB0;
  --pink-soft: #2C1D27;
  --pink-ink: #DDB4C8;
  --hero-1: #1D2340;
  --hero-2: #2B3560;
  --hero-3: #3A4678;
}
@media (prefers-color-scheme: dark) {
  html:root[data-tone="calm"]:not([data-theme="light"]) {
    --bg: #0E1018;
    --surface: #181B26;
    --sunken: #12141E;
    --ink: #E8EAF2;
    --muted: #A9AEC4;
    --line: #2A2F42;
    --line-strong: #6F7694;
    --focus: #AEB9E8;
    --primary: #AEB9E8;
    --primary-hover: #C2CBF0;
    --primary-press: #97A4DD;
    --primary-lip: #6C7AB8;
    --on-primary: #151A30;
    --primary-soft: #232A45;
    --primary-ink: #C9D1F5;
    --cta: #AEB9E8;
    --cta-hover: #C2CBF0;
    --on-cta: #151A30;
    --night: #1C2030;
    --night-deep: #151824;
    --on-night: #E8EAF2;
    --on-night-muted: #A9AEC4;
    --night-line: #2F3548;
    --lilac: #AEB9E8;
    --lilac-hi: #C9D1F5;
    --glow-violet: transparent;
    --glow-coral: transparent;
    --glow-cta: transparent;
    --glow-primary: transparent;
    --coral: #C9A296;
    --coral-soft: #2E2420;
    --coral-ink: #E0BFB3;
    --sun: #D9BF7A;
    --sun-soft: #2B2615;
    --sun-ink: #E6D193;
    --mint: #7FB5A0;
    --mint-soft: #16292A;
    --mint-ink: #9CCDB9;
    --sky: #8AA6D1;
    --sky-soft: #192438;
    --sky-ink: #A8C0E6;
    --pink: #C79AB0;
    --pink-soft: #2C1D27;
    --pink-ink: #DDB4C8;
    --hero-1: #1D2340;
    --hero-2: #2B3560;
    --hero-3: #3A4678;
  }
}

/* Legacy aliases + derived tokens */
html:root, [data-theme], [data-tone] {
  /* ---- Backward-compatible aliases (legacy names -> new tokens). Re-declared wherever a theme/tone is set so they re-resolve. ---- */
  --paper: var(--bg);
  --sage: var(--primary-soft);
  --forest: var(--primary);
  --linen: var(--sunken);
  --lavender: var(--primary-soft);
  --blush: var(--pink-soft);
  --serif: "Instrument Serif", Georgia, serif; /* stationery previews and the host's own designs only */
  /* ---- Derived tokens (also re-resolved per theme/tone) ---- */
  --grad-hero: linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%);   /* the violet countdown card */
  --grad-night: radial-gradient(60% 90% at 100% 0%, var(--glow-violet), transparent 70%), radial-gradient(55% 80% at 0% 100%, var(--glow-coral), transparent 72%), var(--night);   /* dark hero panels */
  --grad-progress: linear-gradient(90deg, var(--primary), var(--progress-end));
  --grad-ring: linear-gradient(135deg, var(--primary), var(--lilac));
  --shadow-pop: 0 10px 24px -10px var(--glow-primary);        /* violet button glow */
  --shadow-cta: 0 10px 26px -10px var(--glow-cta), inset 0 1px 0 rgb(255 255 255 / .3);   /* coral call-to-action glow */
  --shadow-hero: 0 30px 60px -30px rgb(11 7 24 / .7), 0 16px 40px -24px var(--glow-primary);
  --shadow-focus: 0 0 0 3px var(--surface), 0 0 0 6px var(--focus);
}
[data-theme], [data-tone] { color: var(--ink); }
[data-theme="dark"], [data-theme="light"] { background: var(--bg); }

/* Accessibility baselines every page gets */
html body :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: inherit; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
