/* Design tokens — the single source for colour, type, spacing, radius and motion. */
:root {
  color-scheme: light;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-sunken: #ececf0;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --surface: #ffffff;
  --surface-hover: #f7f7f9;
  --surface-active: #f0f0f3;

  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #a1a1a6;
  --text-inverse: #ffffff;

  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --divider: rgba(0, 0, 0, 0.06);

  --accent: #0a84ff;
  --accent-hover: #0071e3;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --accent-text: #0066cc;

  --success: #34c759;
  --success-soft: rgba(52, 199, 89, 0.14);
  --success-text: #1f8a3d;
  --warning: #ff9f0a;
  --warning-soft: rgba(255, 159, 10, 0.16);
  --warning-text: #b36b00;
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.12);
  --danger-text: #c6281f;
  --info: #5e5ce6;
  --info-soft: rgba(94, 92, 230, 0.12);
  --info-text: #4b49c7;
  --neutral-soft: rgba(60, 60, 67, 0.08);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.16), 0 8px 16px rgba(0, 0, 0, 0.06);
  --ring: 0 0 0 4px var(--accent-soft);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --text-xs: 11.5px;
  --text-sm: 13px;
  --text-md: 14.5px;
  --text-lg: 17px;
  --text-xl: 22px;
  --text-2xl: 28px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration: 180ms;

  --sidebar-width: 256px;
  --topbar-height: 60px;
  --content-max: 1400px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-sunken: #0d0d0f;
    --bg-glass: rgba(28, 28, 30, 0.72);
    --surface: #1c1c1e;
    --surface-hover: #242426;
    --surface-active: #2c2c2e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --text-inverse: #1d1d1f;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --divider: rgba(255, 255, 255, 0.08);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.22);
    --accent-text: #6cb4ff;
    --success-text: #5fd97a;
    --warning-text: #ffb340;
    --danger-text: #ff6b63;
    --info-text: #8e8cff;
    --neutral-soft: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-sunken: #0d0d0f;
  --bg-glass: rgba(28, 28, 30, 0.72);
  --surface: #1c1c1e;
  --surface-hover: #242426;
  --surface-active: #2c2c2e;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --text-inverse: #1d1d1f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --divider: rgba(255, 255, 255, 0.08);
  --accent-hover: #409cff;
  --accent-soft: rgba(10, 132, 255, 0.22);
  --accent-text: #6cb4ff;
  --success-text: #5fd97a;
  --warning-text: #ffb340;
  --danger-text: #ff6b63;
  --info-text: #8e8cff;
  --neutral-soft: rgba(255, 255, 255, 0.1);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.7);
}
