/*
 * Victory Games design tokens — the single source of truth for colour, type,
 * spacing, shape and elevation. Components reference these custom properties
 * only; no raw colour values outside this file (enforced by
 * tests/architecture.test.js).
 *
 * Loaded once on the document. Custom properties inherit into every shadow
 * root, so components do not need to re-import this file.
 */
:root {
  color-scheme: light;

  /* Brand */
  --color-primary: #25337a;
  --color-primary-hover: #1c2865;
  --color-on-primary: #ffffff;
  --color-secondary: #f2b230;
  --color-secondary-hover: #e09f17;
  --color-on-secondary: #2a1d00;

  /* Neutrals */
  --color-bg: #f5f6fa;
  --color-surface: #ffffff;
  --color-surface-alt: #eceef7;
  --color-text: #161a33;
  --color-text-muted: #585f82;
  --color-border: #d8dbe9;

  /* Inverse surfaces (header, hero, footer) */
  --color-inverse-bg: #e4e8fa;
  --color-inverse-surface: #ffffff;
  --color-inverse-track: #d8dbe9;
  --color-on-inverse: #161a33;
  --color-on-inverse-muted: #585f82;
  --color-on-inverse-divider: rgb(22 26 51 / 0.15);
  --color-accent-ink: #8f5800; /* gold as text/icon colour on light grounds */

  /* Semantic */
  --color-success: #17794f;
  --color-success-bg: #dff3e9;
  --color-warning: #8f5800;
  --color-warning-bg: #fcefd6;
  --color-danger: #b4282e;
  --color-danger-hover: #8f1f24;
  --color-danger-bg: #fbe3e3;
  --color-on-danger: #ffffff;
  --color-info: #25337a;
  --color-info-bg: #e4e8fa;
  --color-focus: #f2b230;
  --color-focus-ring: rgb(37 51 122 / 0.22);

  /* Illustration (exercise pictograms) */
  --color-figure: #25337a;
  --color-figure-ground: #d8dbe9;

  /* Type */
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: 2.25rem;
  --text-3xl: clamp(2.25rem, 5.5vw, 3.75rem);
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-section: clamp(48px, 7vw, 88px);
  --gutter: 16px;

  /* Shape & elevation */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(22 29 69 / 0.06), 0 2px 8px rgb(22 29 69 / 0.05);
  --shadow-md: 0 8px 28px rgb(22 29 69 / 0.12);

  /* Layout */
  --container: 1120px;
  --header-height: 68px;

  /* Motion */
  --duration-fast: 0.15s;
}

/* Dark theme: follows the OS unless a page forces data-theme="light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-primary: #9db0ff;
    --color-primary-hover: #b8c6ff;
    --color-on-primary: #0d1333;
    --color-secondary-hover: #ffc54d;
    --color-bg: #0e1124;
    --color-surface: #161a33;
    --color-surface-alt: #1f2443;
    --color-text: #eceefa;
    --color-text-muted: #a4aacb;
    --color-border: #2d3358;
    --color-inverse-bg: #121839;
    --color-inverse-surface: #1f2856;
    --color-inverse-track: #1f2856;
    --color-on-inverse: #f3f4fb;
    --color-on-inverse-muted: #aab1d6;
    --color-on-inverse-divider: rgb(243 244 251 / 0.15);
    --color-accent-ink: #f2b230;
    --color-success: #5fd39d;
    --color-success-bg: #12301f;
    --color-warning: #f5bf5a;
    --color-warning-bg: #33260c;
    --color-danger: #ff8a8f;
    --color-danger-hover: #ffa3a7;
    --color-danger-bg: #3a1517;
    --color-on-danger: #1a0506;
    --color-info: #b8c6ff;
    --color-info-bg: #222a55;
    --color-focus-ring: rgb(157 176 255 / 0.3);
    --color-figure: #c3cdfb;
    --color-figure-ground: #2d3358;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-primary: #9db0ff;
  --color-primary-hover: #b8c6ff;
  --color-on-primary: #0d1333;
  --color-secondary-hover: #ffc54d;
  --color-bg: #0e1124;
  --color-surface: #161a33;
  --color-surface-alt: #1f2443;
  --color-text: #eceefa;
  --color-text-muted: #a4aacb;
  --color-border: #2d3358;
  --color-inverse-bg: #121839;
  --color-inverse-surface: #1f2856;
  --color-inverse-track: #1f2856;
  --color-on-inverse: #f3f4fb;
  --color-on-inverse-muted: #aab1d6;
  --color-on-inverse-divider: rgb(243 244 251 / 0.15);
  --color-accent-ink: #f2b230;
  --color-success: #5fd39d;
  --color-success-bg: #12301f;
  --color-warning: #f5bf5a;
  --color-warning-bg: #33260c;
  --color-danger: #ff8a8f;
  --color-danger-hover: #ffa3a7;
  --color-danger-bg: #3a1517;
  --color-on-danger: #1a0506;
  --color-info: #b8c6ff;
  --color-info-bg: #222a55;
  --color-focus-ring: rgb(157 176 255 / 0.3);
  --color-figure: #c3cdfb;
  --color-figure-ground: #2d3358;
}
