/*
 * cc-remora design tokens. The reasoning behind every value is in docs/design.md.
 * Each colour is declared once with light-dark(); the scheme follows the system
 * unless theme.js pins it through <meta name="color-scheme">.
 */
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

  /* --- surfaces: shallows by day, deep water by night */
  --page: light-dark(#f1f4f8, #0a111c);
  --surface: light-dark(#ffffff, #101a29);
  --inset: light-dark(#f5f7fa, #0c1522);
  --raised: light-dark(#ffffff, #17243a);
  --field: light-dark(#ffffff, #0c1522);
  --line: light-dark(#dde3eb, #22304a);
  --line-strong: light-dark(#c3ccd8, #33445f);
  --hover: light-dark(#f0f3f7, #162235);
  --shadow: light-dark(rgb(14 24 38 / .07), transparent);
  --shadow-deep: light-dark(rgb(14 24 38 / .18), rgb(0 0 0 / .5));
  --edge: light-dark(transparent, rgb(255 255 255 / .035));

  /* --- ink */
  --ink: light-dark(#0e1826, #e8eef6);
  --ink-2: light-dark(#3c4a5d, #b6c2d2);
  --muted: light-dark(#5d6b7e, #8a9ab0);
  --on-solid: light-dark(#ffffff, #0a111c);

  /* --- meaning. Blue is what comes back to us, orange is what goes out. */
  --accent: light-dark(#1d66c2, #6fa8f0);
  --out: light-dark(#a8420d, #f0935f);
  --good: light-dark(#0b6b1c, #4cc35a);
  --warn: light-dark(#8a5700, #f0b53a);
  --bad: light-dark(#b3261e, #f2837c);
  --live: #c2500f;

  /* --- status marks (dots, icons): fixed in both schemes, always next to a label */
  --mark-good: #0ca30c;
  --mark-warn: #fab219;
  --mark-serious: #ec835a;
  --mark-bad: #d03b3b;

  /* --- chart series, validated with the dataviz validator on --surface in both schemes */
  --s-value: light-dark(#2a78d6, #3987e5);
  --s-cost: light-dark(#eb6834, #d95926);
  --s-net: light-dark(#1baf7a, #199e70);
  --s-quiet: light-dark(#aab4c2, #4a5a72);
  --grid: light-dark(#e6ebf1, #1a2638);
  --axis: light-dark(#c3ccd8, #33445f);
  /* pack tiers: one hue, common to epic. More valuable is darker by day, lighter by night. */
  --tier-4: light-dark(#86b6ef, #184f95);
  --tier-3: light-dark(#3987e5, #2a78d6);
  --tier-2: light-dark(#1c5cab, #6da7ec);
  --tier-1: light-dark(#0d366b, #cde2fb);

  /* --- the top bar is deep water in both schemes */
  --bar: #0b1524;
  --bar-ink: #e8eef6;
  --bar-muted: #94a4ba;
  --bar-line: #1f2d43;
  --bar-accent: #6fa8f0;
  --bar-hover: #15233a;

  /* --- scrollbars */
  --scroll-thumb: light-dark(#77859a, #5a6b84);
  --scroll-track: light-dark(#e6ebf1, #0c1522);

  /* --- spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  /* --- type scale (rem, so the browser's text size setting is respected) */
  --t-xs: .75rem; --t-sm: .8125rem; --t-md: .875rem; --t-lg: 1rem; --t-xl: 1.25rem; --t-2xl: 1.625rem; --t-hero: 2.375rem;
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* --- shape: cards, the controls inside them, the chips inside those */
  --r-card: 12px; --r-ctl: 8px; --r-chip: 6px;

  /* --- sizes */
  --ctl: 36px;
  --container: 1480px;
  --gutter: clamp(16px, 3vw, 32px);
}
@media (pointer: coarse) { :root { --ctl: 44px; } }
