:root {
  /* Color system */
  --color-bg: #edf2f3;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f8f8;
  --color-surface-strong: #e5ecee;
  --color-paper: #fbfcf7;

  --color-text: #102c38;
  --color-text-muted: #49616a;
  --color-text-soft: #586d75;
  --color-text-inverse: #ffffff;

  --color-border: #cad6da;
  --color-border-strong: #aabcc3;

  /* PSI-inspired accent strategy: one primary + one restrained highlight */
  --color-accent: #00649f;
  --color-accent-strong: #004f7e;
  --color-accent-soft: #e1f0f7;
  --color-highlight: #d7e100;
  --color-highlight-soft: #f3f6c6;
  --color-brand-deep: #082f3d;
  --color-brand-text: #d8e3e6;
  --color-brand-text-muted: #a2b5bb;
  --color-brand-text-soft: #82989f;
  --color-heading: #082f3d;

  /* Functional colors */
  --color-success: #1f7a3d;
  --color-success-soft: #e8f6ec;
  --color-warning: #a26a12;
  --color-warning-soft: #fff3df;
  --color-danger: #b42318;
  --color-danger-soft: #feeceb;
  --color-info: #0a63ad;
  --color-info-soft: #e8f2fb;

  /* Typography */
  --font-sans: "IBM Plex Sans", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.6rem;
  --font-size-4xl: 3.6rem;

  --line-tight: 1.2;
  --line-snug: 1.35;
  --line-base: 1.55;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Layout */
  --container-sm: 46rem;
  --container-md: 68rem;
  --container-lg: 82rem;
  --container-xl: 96rem;
  --gutter: 1.25rem;

  /* Borders/radii/shadows */
  --radius-sm: 2px;
  --radius-md: 5px;
  --radius-lg: 9px;
  --border: 1px solid var(--color-border);
  --border-strong: 1px solid var(--color-border-strong);
  --shadow-sm: 0 1px 2px rgba(8, 47, 61, 0.05);
  --shadow-md: 0 12px 30px rgba(8, 47, 61, 0.1);

  /* Focus/motion */
  --focus-ring: 0 0 0 3px rgba(0, 94, 168, 0.28);
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;

  /* Component sizing */
  --header-height: 4.75rem;
  --control-height: 2.6rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111821;
    --color-surface: #16212c;
    --color-surface-muted: #1a2733;
    --color-surface-strong: #22313f;
    --color-paper: #18242c;

    --color-text: #e8eef4;
    --color-text-muted: #bcc9d6;
    --color-text-soft: #93a5b7;
    --color-text-inverse: #0f1b28;

    --color-border: #2e3f50;
    --color-border-strong: #405265;

    --color-accent: #56a2e5;
    --color-accent-strong: #72b7ef;
    --color-accent-soft: #1a2c3c;
    --color-highlight: #bcca1d;
    --color-highlight-soft: #303719;
    --color-brand-deep: #071f2a;
    --color-heading: #f2f6f7;

    --color-success: #62ba79;
    --color-success-soft: #173224;
    --color-warning: #f0bc66;
    --color-warning-soft: #3a2b16;
    --color-danger: #f58b82;
    --color-danger-soft: #3a1f1d;
    --color-info: #72b7ef;
    --color-info-soft: #1b2f41;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.45);
    --focus-ring: 0 0 0 3px rgba(86, 162, 229, 0.35);
  }
}
