/* Design tokens: the one place for spacing, type, radius, shadow, layering and motion.
   New and changed CSS uses these instead of loose numbers (scripts/design-check.mjs counts the loose ones and fails a push if they grow).
   Rules and reasons: docs/DESIGN.md. Colors and the first radius steps are in site.css. */
:root {
  /* Spacing, on a 4 px grid. Space between groups is bigger than space inside a group. */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  /* Type sizes and weights. Two weights per screen is plenty. */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 22px; --fs-3xl: 28px; --fs-4xl: 36px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-black: 800;
  --lh-tight: 1.15; --lh-snug: 1.3; --lh-body: 1.5;
  /* Radius: --r-sm to --r-xl live in site.css. Inner radius = outer radius minus the padding. */
  --r-pill: 999px;
  /* The Scale mark: a black circle with the gold star from the logo. Scale clients only, never Core. */
  --mark-bg: #0b0b0d; --mark-star: #f5b83d; --mark-ring: rgb(245 184 61 / .55);
  --mark-ink: #9a6700; /* gold that reads on white (text next to the Scale star) */
  /* Chart blue (Roman, 2026-11-20): the Home revenue line. Darker on light pages. */
  --chart-blue: #6f9cff; --chart-blue-light: #2f5fe0;
  /* Good / up / live is BLUE, never green (Roman, 2026-11-20). Dark themes override with #7ea6ff. */
  --good: #2f5fe0;
  /* Shadows: three levels, soft, never colored. */
  --sh-1: 0 1px 2px #0000000d; --sh-2: 0 6px 18px #00000014; --sh-3: 0 24px 60px #0000001f;
  /* Layering */
  --z-base: 1; --z-raised: 5; --z-sticky: 30; --z-menu: 40; --z-popover: 60; --z-modal: 90;
  /* Motion: ease out for things arriving, ease in-out for things already on screen, exits about 20% shorter than entrances. */
  --dur-fast: 90ms; --dur: 150ms; --dur-pop: 180ms; --dur-exit: 120ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  /* Smallest comfortable tap target: bigger on touch screens. */
  --target: 36px;
  /* Breakpoints (CSS can't read variables inside @media, so these are the numbers to use): phone up to 639, tablet 640 to 1099, desktop 1100 and up, wide 1700 and up. */
}
@media (pointer: coarse) { :root { --target: 44px; } }

/* Defaults that follow the type rules everywhere */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
table, .num, .kpi b { font-variant-numeric: tabular-nums; }

/* ===== Design tips (Roman, 2026-11-27) ===== */
/* Grays carry a slight blue tint, same hue from the lightest to the darkest step. */
:root:root { --canvas: #0c0d11; --s1: #15161c; --s2: #1d1e25; --s3: #292b33; --line: #2b2d36; --line-strong: #3f414d; --ink-muted: #dfe0e7; --ink-sub: #a4a6b3; --glass: #15161cf7; }
:root:root[data-theme="light"] { --canvas: #f5f6f9; --s1: #ffffff; --s2: #f0f1f5; --s3: #e4e6ec; --line: #e1e4ea; --line-strong: #cdd0d9; --ink: #0b0c10; --ink-muted: #2d2f38; --ink-sub: #5f626e; }
:root:root[data-app="hq"][data-theme="dark"] { --canvas: #101116; --s1: #17181e; --s2: #1e1f26; --s3: #282a32; --line: #25272f; --line-strong: #33353f; --ink: #f4f5f8; --ink-muted: #d5d7de; --ink-sub: #9a9ca9; }
:root:root[data-app="hq"][data-theme="light"] { --canvas: #f6f7f9; --s1: #ffffff; --s2: #f2f3f6; --s3: #e9ebf0; --line: #e6e8ee; --line-strong: #d4d7df; --ink: #101116; --ink-muted: #33353e; --ink-sub: #6a6d7a; }
/* Brand colors are calmer in dark mode: the gold and blue step down a little so they don't glow. */
:root:root[data-theme="dark"], :root:root:not([data-theme]) { --accent: #ecb245; --secondary: #789ff5; }
/* Layered small shadows instead of one big blur. Never colored. */
:root:root { --sh-1: 0 1px 1px #0000000a, 0 1px 3px #0000000f; --sh-2: 0 1px 2px #0000000a, 0 3px 6px #0000000d, 0 8px 16px #0000000d; --sh-3: 0 2px 4px #0000000d, 0 8px 16px #00000012, 0 24px 48px #00000017; }
