/* Design tokens. Every colour, size, shadow and duration in the app resolves to one of
   these, so a change here moves the whole interface and nothing hardcodes a value.

   The canvas is a cool near-white that white cards lift off; depth comes from real shadows
   rather than from borders doing all the work. One blue carries everything interactive.
   Status colours are saturated enough to read at chip size, and six soft tints sit behind
   the icons. Dark is a designed palette, not an inversion. */

:root {
  /* ── canvas and surfaces ─────────────────────────────────────────── */
  --bg: #f1f5fb;
  --bg-top: #e7eefa;
  --bg-sunk: #e4eaf4;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #eaeef5;
  --border: #e4e9f1;
  --border-strong: #cfd7e3;

  /* ── ink ─────────────────────────────────────────────────────────── */
  --fg: #0f172a;
  --fg-2: #4a5568;
  --fg-3: #8b98ab;

  /* ── accent: what is interactive ─────────────────────────────────── */
  --accent: #2b6cf6;
  --accent-hover: #1d57d8;
  --accent-fg: #ffffff;
  --accent-soft: #eaf1ff;
  --accent-line: #c3d7fe;

  /* ── primary action ──────────────────────────────────────────────── */
  --ink: #111a2e;
  --ink-hover: #23304a;
  --ink-fg: #ffffff;

  /* ── status ──────────────────────────────────────────────────────── */
  --ok: #18874d;
  --ok-soft: #e7f7ed;
  --ok-line: #b6e4c8;
  --warn: #b25c06;
  --warn-soft: #fff4e2;
  --warn-line: #f6d3a0;
  --bad: #ca2b2b;
  --bad-soft: #fdecec;
  --bad-line: #f6c4c4;

  /* ── soft tints behind icons and tinted cards ────────────────────── */
  --t-violet: #ece9fe;
  --t-violet-fg: #6436d4;
  --t-sky: #dfeafe;
  --t-sky-fg: #1d5bd6;
  --t-mint: #d6f5e3;
  --t-mint-fg: #0d7c48;
  --t-sand: #fdf0cf;
  --t-sand-fg: #9a6508;
  --t-rose: #ffe3e6;
  --t-rose-fg: #be2d47;
  --t-stone: #e7ebf3;
  --t-stone-fg: #4e5a6e;

  /* ── type ────────────────────────────────────────────────────────── */
  --font-display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-display: 2rem;
  --t-h1: 1.5rem;
  --t-h2: 1.125rem;
  --t-h3: 0.9375rem;
  --t-body: 0.875rem;
  --t-small: 0.8125rem;
  --t-micro: 0.75rem;

  /* ── space, on an 8px grid with two half steps ───────────────────── */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  /* ── shape: softer than before, so a card reads as an object ─────── */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 22px;
  --r-full: 999px;

  /* ── depth ───────────────────────────────────────────────────────── */
  --shadow-card: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 6px -1px rgb(15 23 42 / 0.05);
  --shadow-lift: 0 2px 4px rgb(15 23 42 / 0.05), 0 10px 22px -6px rgb(15 23 42 / 0.12);
  --shadow-pop: 0 2px 6px rgb(15 23 42 / 0.06), 0 14px 34px -8px rgb(15 23 42 / 0.18);
  --shadow-panel: 0 2px 8px rgb(15 23 42 / 0.08), 0 24px 60px -12px rgb(15 23 42 / 0.24);

  /* ── motion ──────────────────────────────────────────────────────── */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --fast: 130ms var(--ease);
  --base: 220ms var(--ease);
  --slow: 340ms var(--ease);

  /* ── shell ───────────────────────────────────────────────────────── */
  --nav-w: 244px;
  --nav-w-rail: 64px;
  --top-h: 58px;

  color-scheme: light;
}

/* The dark palette, written once and applied both ways it can be chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e16;
    --bg-top: #0d1320;
    --bg-sunk: #060910;
    --surface: #121825;
    --surface-2: #19202f;
    --surface-3: #212a3b;
    --border: #232c3d;
    --border-strong: #35415a;

    --fg: #e9eefa;
    --fg-2: #a3aec4;
    --fg-3: #6d7a93;

    --accent: #5a92ff;
    --accent-hover: #7aa8ff;
    --accent-fg: #06122c;
    --accent-soft: #15213c;
    --accent-line: #273a63;

    --ink: #e9eefa;
    --ink-hover: #ffffff;
    --ink-fg: #0b1120;

    --ok: #46c77e;
    --ok-soft: #0f2a1d;
    --ok-line: #1f4a33;
    --warn: #e0a24a;
    --warn-soft: #2a2114;
    --warn-line: #4d3c1e;
    --bad: #f0706f;
    --bad-soft: #2e1618;
    --bad-line: #532629;

    --t-violet: #221c3c;
    --t-violet-fg: #b199fb;
    --t-sky: #15243f;
    --t-sky-fg: #7fb0ff;
    --t-mint: #0f2b1f;
    --t-mint-fg: #52cb8c;
    --t-sand: #2b2213;
    --t-sand-fg: #e0b05c;
    --t-rose: #2e1a1f;
    --t-rose-fg: #f08098;
    --t-stone: #1e2635;
    --t-stone-fg: #97a3ba;

    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.5), 0 10px 22px -6px rgb(0 0 0 / 0.6);
    --shadow-pop: 0 2px 6px rgb(0 0 0 / 0.5), 0 14px 34px -8px rgb(0 0 0 / 0.65);
    --shadow-panel: 0 2px 8px rgb(0 0 0 / 0.6), 0 24px 60px -12px rgb(0 0 0 / 0.75);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0e16;
  --bg-top: #0d1320;
  --bg-sunk: #060910;
  --surface: #121825;
  --surface-2: #19202f;
  --surface-3: #212a3b;
  --border: #232c3d;
  --border-strong: #35415a;

  --fg: #e9eefa;
  --fg-2: #a3aec4;
  --fg-3: #6d7a93;

  --accent: #5a92ff;
  --accent-hover: #7aa8ff;
  --accent-fg: #06122c;
  --accent-soft: #15213c;
  --accent-line: #273a63;

  --ink: #e9eefa;
  --ink-hover: #ffffff;
  --ink-fg: #0b1120;

  --ok: #46c77e;
  --ok-soft: #0f2a1d;
  --ok-line: #1f4a33;
  --warn: #e0a24a;
  --warn-soft: #2a2114;
  --warn-line: #4d3c1e;
  --bad: #f0706f;
  --bad-soft: #2e1618;
  --bad-line: #532629;

  --t-violet: #221c3c;
  --t-violet-fg: #b199fb;
  --t-sky: #15243f;
  --t-sky-fg: #7fb0ff;
  --t-mint: #0f2b1f;
  --t-mint-fg: #52cb8c;
  --t-sand: #2b2213;
  --t-sand-fg: #e0b05c;
  --t-rose: #2e1a1f;
  --t-rose-fg: #f08098;
  --t-stone: #1e2635;
  --t-stone-fg: #97a3ba;

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.5), 0 10px 22px -6px rgb(0 0 0 / 0.6);
  --shadow-pop: 0 2px 6px rgb(0 0 0 / 0.5), 0 14px 34px -8px rgb(0 0 0 / 0.65);
  --shadow-panel: 0 2px 8px rgb(0 0 0 / 0.6), 0 24px 60px -12px rgb(0 0 0 / 0.75);

  color-scheme: dark;
}
