/* StatsPoint design tokens — THE single place where colours, type and shape
   values live (UX program 2026-09, docs/ux/decisions_2026-09-13.md D-12/D-13).

   Rules
   - Every other stylesheet consumes these via var(--sp-*); none re-defines them.
     Dash serves assets alphabetically, so this file ("00_") loads first and a
     later definition of the same name would silently win — do not add one.
   - This is the runtime source; Python reads it via utils/design_tokens.py.
     Design handoff copies under docs/ are reference material only.
   - Layout sizes (--sp-header-h, bottom bar) stay with their owners
     (assets/zz_site_chrome.css) until Phase 2.2.
   - Chart fonts are bundled in 01_font_aliases.css; the other web fonts
     are loaded by app.py external_stylesheets. */
:root {
  /* Surfaces */
  --sp-bg: #0D0E12;
  --sp-surface: #15161C;
  --sp-chrome: #101117;
  --sp-border: #1B1C22;
  --sp-border-strong: #2A2C33;
  --sp-chip: #22242B;
  --sp-scrim: rgba(8, 9, 12, 0.6);
  /* Legacy page aliases, also used by unscaffolded settings/admin pages. */
  --sp-surface-page: var(--sp-bg);
  --sp-surface-soft: var(--sp-chrome);
  --sp-surface-tint: var(--sp-surface);
  --sp-surface-panel: var(--sp-surface);
  --sp-border-soft: var(--sp-border-strong);
  --sp-text-primary: var(--sp-text);
  --sp-text-muted: var(--sp-text-2);
  /* Text */
  --sp-text: #F2EFE9;
  --sp-text-2: #B8B4AC;
  --sp-text-3: #6E6A63;
  --sp-on-accent: #0D0E12;
  /* BRAND COLOR: change this six-digit hex, then restart the app.
     CSS and Mantine controls derive from this value. The tab icon and the loading tile are drawn artwork
     (assets/brand) with this orange inside: redraw them if it changes. */
  --sp-accent: #FF7A1A;  /* one orange for the app, the Home's (owner, 2026-11-18); was #FF6B2C */
  --sp-accent-hover: color-mix(in srgb, var(--sp-accent) 65%, white);
  --sp-accent-strong: color-mix(in srgb, var(--sp-accent) 75%, black);
  --sp-accent-soft: color-mix(in srgb, var(--sp-accent) 14%, transparent);
  /* The accent as TYPE on a surface: the accent itself on dark; light mode darkens it (orange on white is 2.3:1). */
  --sp-accent-ink: var(--sp-accent);
  /* Compatibility aliases: old pages consume the same brand. */
  --sp-accent-primary: var(--sp-accent);
  --sp-accent-primary-strong: var(--sp-accent-strong);
  --sp-accent-brand: var(--sp-accent);
  --sp-accent-blue: var(--sp-accent);
  --sp-accent-blue-strong: var(--sp-accent-strong);
  --sp-accent-teal: var(--sp-accent);
  /* Selected state = inverted (YouTube / Instagram chips) */
  --sp-selected-bg: #F2EFE9;
  --sp-selected-text: #0D0E12;
  /* Data colours (charts only, never UI chrome) */
  --sp-series-1: #FF6B2C;
  --sp-series-2: #7C3AED;
  --sp-series-3: #B4FF3A;
  --sp-series-4: #38BDF8;
  /* Type */
  --sp-font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --sp-font-ui: "Instrument Sans", system-ui, sans-serif;
  --sp-font-mono: "Space Mono", ui-monospace, monospace;
  /* Shape */
  --sp-radius-pill: 999px;
  --sp-radius-card: 14px;
  --sp-radius-sheet: 20px;
  /* Layout */
  --sp-gutter: 16px;
}

/* Light mode "Den" (owner choice 2026-11-21; SP_LIGHT_MODE, assets/00_appearance.js sets the attribute). Dark above
   stays the base and the default. The looks' own sets (--hl-*, --hh-*) take these values in
   assets/zzzzzzzzzzzzzzzzzzzzz_light_mode.css; Python reads only the base block (utils/design_tokens.py). */
:root[data-sp-theme="light"] {
  color-scheme: light;
  --sp-bg: #F3F3F1;
  --sp-surface: #FFFFFF;
  --sp-chrome: #FFFFFF;
  --sp-border: rgba(18, 18, 20, 0.10);
  --sp-border-strong: #CFCDC8;
  --sp-chip: #E9E8E4;
  --sp-scrim: rgba(20, 20, 22, 0.38);
  --sp-text: #141416;
  --sp-text-2: #5C5A55;
  --sp-text-3: #6E6B65;
  --sp-selected-bg: #141416;
  --sp-selected-text: #FFFFFF;
  --sp-accent-ink: #A03F00;
  /* Loading skeletons: a light block on the white cards, and the sweep that passes over it. The dark skeletons keep
     their own per-surface values; only light mode shares these two (assets/zzzzzzzzzzzzzzzzzzzzz_light_mode.css, section 4). */
  --sp-skeleton: #E4E2DD;
  --sp-skeleton-shine: rgba(255, 255, 255, 0.75);
}

/* Light pages retain neutral surfaces while using the same brand. */
:root[data-mantine-color-scheme="light"] {
  --sp-surface-page: #F5F5F6;
  --sp-surface-soft: #ECEDEF;
  --sp-surface-tint: #F1F1F2;
  --sp-surface-panel: #FFFFFF;
  --sp-border-soft: #D7D8DC;
  --sp-text-primary: #151922;
  --sp-text-muted: #67707E;
}
