/* Design tokens. Every colour in the product comes from here, so both themes stay in step. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Brand palette: navy, cobalt, gold. Red is reserved for danger. No greens anywhere. */
  --brand-navy: #14284b;
  --brand-cobalt: #2f5de0;
  --brand-gold: #d9a441;
  --brand-paper: #ffffff;

  --accent: #2f5de0;
  --accent-ink: #ffffff;
  --accent-strong: #2449b8;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.625rem;
  --text-3xl: 2.125rem;
  --text-4xl: clamp(2.375rem, 5vw, 3.75rem);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 220ms;

  --sidebar-w: 248px;
  --topbar-h: 64px;
  --content-max: 1240px;
}

/* Light theme */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e5e9f1;
  --border: #dde2ec;
  --border-strong: #c3cbdb;
  --text: #111b2e;
  --text-muted: #546078;
  --text-faint: #6b7791;

  --accent-weak: #e7edfc;
  --on-accent-weak: #1f3fa8;

  --ok-bg: #e4ebfb;
  --ok-text: #1d3a9e;
  --warn-bg: #fbf0d4;
  --warn-text: #7a4e00;
  --bad-bg: #fbe5e9;
  --bad-text: #a1263a;
  --info-bg: #eaedf3;
  --info-text: #3d4960;

  --shadow-sm: 0 1px 2px rgba(17, 27, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(17, 27, 46, 0.1);
  --scrim: rgba(12, 20, 36, 0.5);
  --sidebar-bg: #14284b;
  --sidebar-text: #c9d3ea;
  --sidebar-text-strong: #ffffff;
  --sidebar-hover: #1d3560;
  --sidebar-active: #243f72;
  --sidebar-border: #243f72;
}

/* Dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1322;
  --surface: #121c31;
  --surface-2: #19253f;
  --surface-3: #22314f;
  --border: #263452;
  --border-strong: #38496b;
  --text: #e8ecf5;
  --text-muted: #a1acc4;
  --text-faint: #8693ae;

  --accent: #7b9bff;
  --accent-ink: #0b1322;
  --accent-strong: #9db4ff;
  --accent-weak: #1c2a52;
  --on-accent-weak: #b4c6ff;

  --ok-bg: #1b2a55;
  --ok-text: #b4c6ff;
  --warn-bg: #3a2d10;
  --warn-text: #f0c36a;
  --bad-bg: #40191f;
  --bad-text: #f59aa8;
  --info-bg: #1f2b45;
  --info-text: #b6c0d6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --scrim: rgba(3, 7, 14, 0.65);
  --sidebar-bg: #0e1729;
  --sidebar-text: #a9b5cf;
  --sidebar-text-strong: #ffffff;
  --sidebar-hover: #16223b;
  --sidebar-active: #1d2c4c;
  --sidebar-border: #1d2c4c;
  --brand-navy: #243f72;
}

/* Accent presets set from Settings > Branding. Dark mode lifts each one for contrast. */
:root[data-accent="cobalt"] { --accent: #2f5de0; --accent-strong: #2449b8; --accent-weak: #e7edfc; --on-accent-weak: #1f3fa8; }
:root[data-accent="indigo"] { --accent: #4a3fd0; --accent-strong: #3a30b0; --accent-weak: #ebe9fb; --on-accent-weak: #3a30b0; }
:root[data-accent="slate"]  { --accent: #3b5b8c; --accent-strong: #2c466f; --accent-weak: #e6ecf5; --on-accent-weak: #2c466f; }
:root[data-accent="plum"]   { --accent: #7a3f9d; --accent-strong: #62307f; --accent-weak: #f1e8f7; --on-accent-weak: #62307f; }
:root[data-theme="dark"][data-accent="cobalt"] { --accent: #7b9bff; --accent-strong: #9db4ff; --accent-weak: #1c2a52; --on-accent-weak: #b4c6ff; }
:root[data-theme="dark"][data-accent="indigo"] { --accent: #9a92ff; --accent-strong: #b6b0ff; --accent-weak: #25225a; --on-accent-weak: #c9c4ff; }
:root[data-theme="dark"][data-accent="slate"]  { --accent: #8fb0e6; --accent-strong: #aec6f0; --accent-weak: #1d2c47; --on-accent-weak: #c0d2f2; }
:root[data-theme="dark"][data-accent="plum"]   { --accent: #cf9be8; --accent-strong: #deb8f0; --accent-weak: #35214a; --on-accent-weak: #e6c8f4; }
