/* ==========================================================================
   Nivean design tokens
   Every colour, space, radius, shadow and type size used in the UI is defined
   here. Components reference tokens only; theming = redefining tokens.
   ========================================================================== */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/newsreader-latin-wght-normal.175a37868200.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.b058178d7f30.woff2") format("woff2-variations");
}

:root {
  color-scheme: light;

  /* Typography */
  --font-sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Newsreader Variable", "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --text-display: clamp(2.6rem, 1.4rem + 5vw, 5.25rem);
  --leading-tight: 1.15;
  --leading-normal: 1.55;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.06em;
  --tracking-mono: 0.12em;

  /* Spacing (4-pt scale) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgb(22 32 58 / 0.05);
  --shadow-sm: 0 1px 3px rgb(15 23 42 / 0.06), 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-md: 0 6px 16px -4px rgb(15 23 42 / 0.10), 0 2px 4px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 24px 48px -12px rgb(15 23 42 / 0.18);
  --ring: 0 0 0 3px var(--accent-soft);

  /* Layout */
  --container: 1200px;
  --sidebar-width: 248px;
  --topbar-height: 64px;
  --gutter: 16px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 200ms;

  /* Colour — light ("paper, ink and amber") */
  --bg: #f6f4ef;
  --surface: #fffefb;
  --surface-2: #f1eee7;
  --surface-3: #e8e4da;
  --border: #e4dfd4;
  --border-strong: #cfc8ba;
  --text: #16203a;
  --text-muted: #4f5669;
  --text-subtle: #767b88;

  --primary: #16203a;
  --primary-hover: #26324f;
  --primary-contrast: #fffdf8;

  --accent: #d2a03c;
  --accent-strong: #855c0f;
  --accent-soft: rgb(210 160 60 / 0.18);
  --accent-contrast: #1c1405;
  --focus: #855c0f;
  --dot-on-primary: #d2a03c;
  --grid-line: rgb(22 32 58 / 0.045);
  --ring-art: rgb(22 32 58 / 0.055);

  --success: #1f8a5f;
  --success-soft: rgb(31 138 95 / 0.12);
  --warning: #a86200;
  --warning-soft: rgb(217 139 12 / 0.14);
  --danger: #c23b3b;
  --danger-soft: rgb(194 59 59 / 0.11);
  --info: #2b59c3;
  --info-soft: rgb(43 89 195 / 0.10);
  --neutral: #5d6272;
  --neutral-soft: rgb(93 98 114 / 0.12);

  --sim-bar-bg: #16203a;
  --sim-bar-text: #e9e3d4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1220;
    --surface: #131a2a;
    --surface-2: #192134;
    --surface-3: #212a40;
    --border: #252e45;
    --border-strong: #353f59;
    --text: #efeadf;
    --text-muted: #aeb0b8;
    --text-subtle: #858995;
    --primary: #e7c172;
    --primary-hover: #f0cf88;
    --primary-contrast: #1c1405;
    --accent: #e0b04f;
    --accent-strong: #eec879;
    --accent-soft: rgb(224 176 79 / 0.16);
    --accent-contrast: #1c1405;
    --focus: #eec879;
  --dot-on-primary: #1c1405;
    --dot-on-primary: #1c1405;
    --grid-line: rgb(239 234 223 / 0.035);
    --ring-art: rgb(239 234 223 / 0.05);
    --success: #45c08c;
    --success-soft: rgb(69 192 140 / 0.14);
    --warning: #f0b44c;
    --warning-soft: rgb(240 180 76 / 0.14);
    --danger: #f07a72;
    --danger-soft: rgb(240 122 114 / 0.14);
    --info: #86a8ff;
    --info-soft: rgb(134 168 255 / 0.14);
    --neutral: #a3a7b3;
    --neutral-soft: rgb(163 167 179 / 0.14);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.55);
    --shadow-lg: 0 24px 48px -12px rgb(0 0 0 / 0.65);
    --sim-bar-bg: #080c16;
    --sim-bar-text: #d9d2c1;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1220;
  --surface: #131a2a;
  --surface-2: #192134;
  --surface-3: #212a40;
  --border: #252e45;
  --border-strong: #353f59;
  --text: #efeadf;
  --text-muted: #aeb0b8;
  --text-subtle: #858995;
  --primary: #e7c172;
  --primary-hover: #f0cf88;
  --primary-contrast: #1c1405;
  --accent: #e0b04f;
  --accent-strong: #eec879;
  --accent-soft: rgb(224 176 79 / 0.16);
  --accent-contrast: #1c1405;
  --focus: #eec879;
  --grid-line: rgb(239 234 223 / 0.035);
  --ring-art: rgb(239 234 223 / 0.05);
  --success: #45c08c;
  --success-soft: rgb(69 192 140 / 0.14);
  --warning: #f0b44c;
  --warning-soft: rgb(240 180 76 / 0.14);
  --danger: #f07a72;
  --danger-soft: rgb(240 122 114 / 0.14);
  --info: #86a8ff;
  --info-soft: rgb(134 168 255 / 0.14);
  --neutral: #a3a7b3;
  --neutral-soft: rgb(163 167 179 / 0.14);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 8px 20px -6px rgb(0 0 0 / 0.55);
  --shadow-lg: 0 24px 48px -12px rgb(0 0 0 / 0.65);
  --sim-bar-bg: #080c16;
  --sim-bar-text: #d9d2c1;
}

/* ---------- Data-viz tokens (validated with the dataviz palette validator) ----------
   Trend: single series in the brand hue, stepped per mode (dark #2fcf9d failed the
   lightness band, #1fae84 passes). Categorical: reference slots 1-3, all-pairs safe in
   both modes; light slot 3 is < 3:1 so allocation always shows labelled values. */
:root {
  --viz-trend: #0e9f76;
  --viz-trend-fill: rgb(14 159 118 / 0.14);
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-grid: #e7eaf0;
  --viz-axis: #c9d0da;
  --viz-muted: #7b8597;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --viz-trend: #1fae84;
    --viz-trend-fill: rgb(31 174 132 / 0.18);
    --viz-1: #3987e5;
    --viz-2: #d95926;
    --viz-3: #199e70;
    --viz-grid: #1c2638;
    --viz-axis: #2b384f;
    --viz-muted: #7d89a0;
  }
}
:root[data-theme="dark"] {
  --viz-trend: #1fae84;
  --viz-trend-fill: rgb(31 174 132 / 0.18);
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --viz-grid: #1c2638;
  --viz-axis: #2b384f;
  --viz-muted: #7d89a0;
}
