/* NOVA design tokens - one place for every colour, space, radius, shadow and
   duration the framework uses. Apps override these in styles/app.css and the
   whole system follows. Dark is the native theme; light is a full peer. */

:root {
  color-scheme: dark;

  /* ---- space (4px scale, never improvise) ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;

  /* ---- radius ---- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* ---- type ---- */
  --font-sans: ui-sans-serif, "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-3xl: 44px;
  --lh-tight: 1.15;
  --lh-body: 1.55;

  /* ---- accents ---- */
  --c-cyan: #22d3ee;
  --c-violet: #7c8cff;
  --c-magenta: #ff4ecd;
  --c-lime: #a3e635;
  --c-amber: #fbbf24;
  --c-rose: #fb7185;
  --c-emerald: #34d399;

  /* ---- dark surfaces ---- */
  --bg-0: #05060b;
  --bg-1: #090c16;
  --bg-2: #0f1424;
  --bg-3: #161d33;
  --surface: rgba(18, 24, 43, 0.72);
  --surface-solid: #10152a;
  --surface-raised: rgba(28, 36, 62, 0.9);
  --line: rgba(124, 140, 255, 0.16);
  --line-strong: rgba(124, 140, 255, 0.34);
  --text: #eef2ff;
  --text-soft: #b9c3e6;
  --text-mute: #8792b8;
  --accent: var(--c-violet);
  --accent-ink: #080a14;
  --ok: var(--c-emerald);
  --warn: var(--c-amber);
  --error: var(--c-rose);
  --info: var(--c-cyan);

  /* ---- effects ---- */
  --glow-accent: 0 0 0 1px rgba(124, 140, 255, 0.4), 0 8px 32px -8px rgba(124, 140, 255, 0.55);
  --glow-soft: 0 0 24px -6px rgba(34, 211, 238, 0.45);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-3: 0 32px 80px -24px rgba(0, 0, 0, 0.85);
  --grid-line: rgba(124, 140, 255, 0.055);
  --glass-blur: blur(18px) saturate(150%);

  /* ---- motion ---- */
  --t-fast: 150ms;
  --t-base: 200ms;
  --t-slow: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- layout ---- */
  --rail-w: 248px;
  --rail-w-collapsed: 76px;
  --topbar-h: 64px;
  --content-max: 1180px;
  --z-topbar: 40;
  --z-rail: 50;
  --z-overlay: 100;
  --z-toast: 200;
}

/* Light theme: same tokens, different values. Not an inversion - surfaces,
   lines and glows are re-picked for daylight contrast. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f4f6fd;
  --bg-1: #eef1fa;
  --bg-2: #ffffff;
  --bg-3: #e6eaf7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-raised: #ffffff;
  --line: rgba(38, 52, 110, 0.14);
  --line-strong: rgba(38, 52, 110, 0.3);
  --text: #0d1230;
  --text-soft: #3a4468;
  --text-mute: #5d6789;
  --accent: #4f5fe8;
  --accent-ink: #ffffff;
  --ok: #059669;
  --warn: #b45309;
  --error: #e11d48;
  --info: #0e7490;
  --glow-accent: 0 0 0 1px rgba(79, 95, 232, 0.28), 0 10px 28px -12px rgba(79, 95, 232, 0.45);
  --glow-soft: 0 0 20px -8px rgba(14, 116, 144, 0.3);
  --shadow-1: 0 1px 2px rgba(13, 18, 48, 0.08);
  --shadow-2: 0 10px 28px -14px rgba(13, 18, 48, 0.28);
  --shadow-3: 0 28px 64px -28px rgba(13, 18, 48, 0.35);
  --grid-line: rgba(38, 52, 110, 0.06);
}

/* Density: comfortable by default, compact for dense decks. */
:root[data-density="compact"] {
  --s-6: 16px;
  --s-8: 24px;
  --fs-md: 14px;
  --fs-lg: 16px;
}

/* Follow the OS unless the user chose explicitly. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    color-scheme: light;
    --bg-0: #f4f6fd;
    --bg-1: #eef1fa;
    --bg-2: #ffffff;
    --bg-3: #e6eaf7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --surface-raised: #ffffff;
    --line: rgba(38, 52, 110, 0.14);
    --line-strong: rgba(38, 52, 110, 0.3);
    --text: #0d1230;
    --text-soft: #3a4468;
    --text-mute: #5d6789;
    --accent: #4f5fe8;
    --accent-ink: #ffffff;
    --ok: #059669;
    --warn: #b45309;
    --error: #e11d48;
    --info: #0e7490;
    --grid-line: rgba(38, 52, 110, 0.06);
  }
}
