/* AuraTrack colour, type and shape tokens.
   The names are the signed-off mock-up's (theme.css). Dark is the base. Light is under [data-theme="light"], and the same
   light values apply when the person's theme is System and the system is light, so the block is written twice (once for
   each way in) and tests/tokens.test.js checks the two are the same.
   --accent is the colour the person chose, or the one sampled from mark.svg (src/data/accent.js sets it on <html>); the value
   here is what that sampling gives for today's mark.svg, so the first paint is the colour it settles on. --acc is the
   accent where it is used as text or as a line: the accent itself in dark, --acc-l, which data/accent.js sets to the accent at 70 % black-mixed (so it reads at 4.5:1 on the page and the panels). It is
   computed there, and not with color-mix(), so an older WebKitGTK still gets the colour; only the soft tints below use color-mix(). --on-acc is the text colour on a
   fill of --acc (white or near black, whichever reads better; data/accent.js works it out for the accent in use).
   --dim is the quietest text colour and is used for small labels, so it reads at 4.5:1 on every panel (the mock-up's #5f677c and
   #8a93a6 were 2.7 to 3.3:1); it stays lighter than --mute in dark and no darker than it in light.
   No gradients anywhere in Track, and corners are small (--r-sm 4px, --r 6px, --r-lg 8px). */

:root {
  color-scheme: dark;
  --bg: #090b10; --panel: #0f1219; --panel2: #141823; --panel3: #1a1f2c;
  --line: #212736; --line2: #2c3446;
  --text: #e7eaf3; --mute: #8d96ab; --dim: #808aa0;
  --accent: #f1617c; --acc: var(--accent); --acc2: #818cf8;
  --acc-l: #a94457;
  --on-acc-d: #0b0d12; --on-acc-l: #ffffff; --on-acc: var(--on-acc-d);
  --good: #34d399; --warn: #fbbf24; --bad: #f87171;
  --track: #1d2230; --codebg: #0b0d13;
  --tileA: #1a1f2c; --tileB: #11141c;
  --railbg: rgba(15, 18, 25, .85); --colbg: rgba(15, 18, 25, .7); --tilebg: rgba(15, 18, 25, .75); --drbg: rgba(13, 16, 23, .97);
  --shadow: rgba(0, 0, 0, .8); --scrim: rgba(3, 4, 8, .6); --bar0: #232a3a;

  --st-todo: #94a3b8; --st-inprogress: #38bdf8; --st-paused: #a78bfa; --st-blocked: #f87171; --st-done: #34d399;
  --st-failed: #fb923c; --st-cancelled: #64748b; --st-skipped: #64748b; --st-abandoned: #64748b;
}

/* Light, chosen. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa; --panel: #ffffff; --panel2: #fafbfd; --panel3: #eef1f6;
  --line: #e2e6ee; --line2: #d2d8e3;
  --text: #141821; --mute: #566074; --dim: #5f6a7e;
  --acc: var(--acc-l); --acc2: #4f46e5; --on-acc: var(--on-acc-l);
  --good: #059669; --warn: #b45309; --bad: #dc2626;
  --track: #e6eaf1; --codebg: #f6f8fb;
  --tileA: #ffffff; --tileB: #f3f5f9;
  --railbg: rgba(255, 255, 255, .85); --colbg: rgba(255, 255, 255, .6); --tilebg: rgba(255, 255, 255, .85); --drbg: rgba(255, 255, 255, .97);
  --shadow: rgba(30, 41, 59, .18); --scrim: rgba(30, 41, 59, .25); --bar0: #dfe4ec;

  --st-todo: #64748b; --st-inprogress: #0284c7; --st-paused: #7c3aed; --st-blocked: #dc2626; --st-done: #059669;
  --st-failed: #ea580c; --st-cancelled: #64748b; --st-skipped: #64748b; --st-abandoned: #64748b;
}

/* Light, because the theme is System and the system is light. The same values as above. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f6fa; --panel: #ffffff; --panel2: #fafbfd; --panel3: #eef1f6;
    --line: #e2e6ee; --line2: #d2d8e3;
    --text: #141821; --mute: #566074; --dim: #5f6a7e;
    --acc: var(--acc-l); --acc2: #4f46e5; --on-acc: var(--on-acc-l);
    --good: #059669; --warn: #b45309; --bad: #dc2626;
    --track: #e6eaf1; --codebg: #f6f8fb;
    --tileA: #ffffff; --tileB: #f3f5f9;
    --railbg: rgba(255, 255, 255, .85); --colbg: rgba(255, 255, 255, .6); --tilebg: rgba(255, 255, 255, .85); --drbg: rgba(255, 255, 255, .97);
    --shadow: rgba(30, 41, 59, .18); --scrim: rgba(30, 41, 59, .25); --bar0: #dfe4ec;

    --st-todo: #64748b; --st-inprogress: #0284c7; --st-paused: #7c3aed; --st-blocked: #dc2626; --st-done: #059669;
    --st-failed: #ea580c; --st-cancelled: #64748b; --st-skipped: #64748b; --st-abandoned: #64748b;
  }
}

/* The same in both themes. */
:root {
  --r-sm: 4px; --r: 6px; --r-lg: 8px;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* How far a status icon fades when its count is zero. */
  --zero-fade: .38;

  /* Type scale. Every font-size in Track's CSS is one of these (tests/type-scale.test.js checks it), so the same kind of text
     is the same size in every view, wide or docked.
     caption: counts, shortcuts, the "+2" more chips.
     body: titles, buttons, inputs, menus, rows, paragraphs, and secondary lines, labels, hints and timestamps (told apart by colour).  lead: section and group headings, bold counts.
     heading: dialog, card and board headings.  title: page titles and the big figures on Reports. */
  --fs-caption: 12px;
  --fs-body: 14px;
  --fs-lead: 16px;
  --fs-heading: 18px;
  --fs-title: 24px;
}

/* Names the stylesheets that are being replaced still use, mapped onto the tokens above, so the page is usable until the new
   views land. Delete this block with the last of the old stylesheets. They follow the theme because they are made from it. */
:root {
  --surface: var(--panel); --surface-2: var(--panel2); --surface-3: var(--panel3); --line-soft: var(--line);
  --ink: var(--text); --ink-2: var(--text); --muted: var(--mute);
  --blue: var(--acc); --blue-strong: var(--acc); --blue-wash: color-mix(in srgb, var(--accent) 16%, transparent);
  --on-blue: var(--on-acc); --on-fill: #ffffff; --focus: var(--acc);
  --attention-bg: color-mix(in srgb, var(--bad) 10%, var(--panel)); --attention-line: color-mix(in srgb, var(--bad) 40%, var(--line));
  --mark-overdue: var(--warn); --mark-stale: var(--mute);
  --shadow-pop: 0 10px 30px var(--shadow);
  --st-slate: var(--st-todo); --st-slate-text: color-mix(in srgb, var(--st-todo) 65%, var(--text)); --st-slate-tint: color-mix(in srgb, var(--st-todo) 16%, transparent);
  --st-blue: var(--st-inprogress); --st-blue-text: color-mix(in srgb, var(--st-inprogress) 65%, var(--text)); --st-blue-tint: color-mix(in srgb, var(--st-inprogress) 16%, transparent);
  --st-amber: var(--warn); --st-amber-text: color-mix(in srgb, var(--warn) 65%, var(--text)); --st-amber-tint: color-mix(in srgb, var(--warn) 16%, transparent);
  --st-orange: var(--st-failed); --st-orange-text: color-mix(in srgb, var(--st-failed) 65%, var(--text)); --st-orange-tint: color-mix(in srgb, var(--st-failed) 16%, transparent);
  --st-green: var(--st-done); --st-green-text: color-mix(in srgb, var(--st-done) 65%, var(--text)); --st-green-tint: color-mix(in srgb, var(--st-done) 16%, transparent);
  --st-red: var(--st-blocked); --st-red-text: color-mix(in srgb, var(--st-blocked) 65%, var(--text)); --st-red-tint: color-mix(in srgb, var(--st-blocked) 16%, transparent);
  --st-violet: var(--st-paused); --st-violet-text: color-mix(in srgb, var(--st-paused) 65%, var(--text)); --st-violet-tint: color-mix(in srgb, var(--st-paused) 16%, transparent);
  --st-teal: var(--acc2); --st-teal-text: color-mix(in srgb, var(--acc2) 65%, var(--text)); --st-teal-tint: color-mix(in srgb, var(--acc2) 16%, transparent);
  --st-stone: var(--st-cancelled); --st-stone-text: var(--mute); --st-stone-tint: color-mix(in srgb, var(--st-cancelled) 16%, transparent);
}
