/* Design tokens in three layers: primitives (the only raw values), semantic roles, components. */

@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url('../fonts/space-grotesk-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  /* Primitives */
  --steel: #2F7098;
  --steel-light: #6394B2;
  --brand-orange: #EBA055;
  --brand-orange-deep: #A35C17;
  --ink: #16202A;
  --ink-soft: #4F5B68;
  --cloud: #F4F6F8;
  --white: #FFFFFF;
  --line-light: #D9DFE5;
  --night: #0B0F14;
  --night-surface: #141A22;
  --night-surface-2: #1C242E;
  --night-line: #2A3440;
  --mist: #E8ECF2;
  --mist-soft: #A3AEBC;
  --red-deep: #B42332;
  --red-light: #FF7A86;

  /* Typography */
  --font-display: 'Space Grotesk', 'Trebuchet MS', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;

  /* Spacing, radius */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius: 10px;
  --radius-sm: 6px;

  /* Motion: every transition and animation reads these durations */
  --dur-fast: 150ms;
  --dur-reveal: 420ms;
  --reveal-shift: 12px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Semantic roles — light */
  --bg: var(--cloud);
  --surface: var(--white);
  --border: var(--line-light);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --accent: var(--steel);
  --accent-text: var(--steel);
  --on-accent: var(--white);
  --signature: var(--brand-orange);
  /* The brand orange as text: 2.00:1 on --cloud, so its deep shade (4.73:1) in the light theme */
  --signature-text: var(--brand-orange-deep);
  --danger-text: var(--red-deep);
  --focus-ring: var(--steel);
}

:root[data-theme='dark'] {
  --bg: var(--night);
  --surface: var(--night-surface);
  --border: var(--night-line);
  --text: var(--mist);
  --muted: var(--mist-soft);
  --accent: var(--steel);
  --accent-text: var(--steel-light);
  --on-accent: var(--white);
  --signature-text: var(--brand-orange);
  --danger-text: var(--red-light);
  --focus-ring: var(--steel-light);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --bg: var(--night);
    --surface: var(--night-surface);
    --border: var(--night-line);
    --text: var(--mist);
    --muted: var(--mist-soft);
    --accent: var(--steel);
    --accent-text: var(--steel-light);
    --on-accent: var(--white);
    --signature-text: var(--brand-orange);
    --danger-text: var(--red-light);
    --focus-ring: var(--steel-light);
  }
}

/* Motion levels set by the user's setting (preferences.js) */
:root[data-motion='reduced'] {
  --dur-fast: 80ms;
  --dur-reveal: 120ms;
  --reveal-shift: 0px;
}

:root[data-motion='off'] {
  --dur-fast: 0ms;
  --dur-reveal: 0ms;
  --reveal-shift: 0px;
}
