/* Tokens: the values Clover's shared look is built from (see DESIGN.md and
   ADR-0016). components.css reads these; pages should too, rather than
   writing their own numbers or colours.

   Palette colours (--primary, --card, --border, ...) are not here: Franken UI
   and themes.css set them per Palette and Mode, and everything below that
   needs one refers to them, so it follows the Palette.

   Tones (see "Tone" in CONTEXT.md) are the exception: a fixed fill/text pair
   that is the same in every Palette but has its own dark Mode look. This file
   and themes.css are the only places a hex colour may be written. */

:root {
	/* Surfaces and text, from the Palette. */
	--cl-text: hsl(var(--foreground));
	--cl-muted: hsl(var(--muted-foreground));
	--cl-faint: hsl(var(--muted-foreground) / .7);
	--cl-border: hsl(var(--border));
	--cl-soft: hsl(var(--muted) / .55);
	--cl-card-bg: color-mix(in srgb, hsl(var(--primary)) 5%, hsl(var(--card)));
	--cl-primary: hsl(var(--primary));
	--cl-primary-fg: hsl(var(--primary-foreground));
	--cl-primary-soft: hsl(var(--primary) / .1);
	--cl-focus-ring: 0 0 0 3px hsl(var(--primary) / .15);

	/* Controls: buttons, inputs, selects. md is the default size; sm is for
	   toolbars and filter bars; xs is for actions inside a table row. */
	--cl-control-md: 36px;
	--cl-control-sm: 32px;
	--cl-control-xs: 28px;
	--cl-radius-md: 10px;
	--cl-radius-sm: 9px;
	--cl-radius-xs: 8px;

	/* Cards and the boxes inside them. */
	--cl-radius-card: 16px;
	--cl-radius-inner: 12px;
	--cl-card-pad: 18px;
	--cl-shadow-card: 0 1px 2px rgb(31 35 51 / .04);
	--cl-shadow-pop: 0 12px 32px rgb(31 35 51 / .14);

	/* Tones, light Mode. */
	--tone-red-bg: #fde8ec;     --tone-red-fg: #c92a4b;
	--tone-amber-bg: #fff3db;   --tone-amber-fg: #b86e00;
	--tone-green-bg: #e3f7ef;   --tone-green-fg: #0f8a5c;
	--tone-teal-bg: #dff6f3;    --tone-teal-fg: #138a7a;
	--tone-blue-bg: #e7efff;    --tone-blue-fg: #3b5bdb;
	--tone-indigo-bg: #e9e7fd;  --tone-indigo-fg: #4338ca;
	--tone-violet-bg: #f1ebff;  --tone-violet-fg: #7c4dde;
	--tone-pink-bg: #fde6ef;    --tone-pink-fg: #c2255c;
	--tone-grey-bg: hsl(var(--muted));
	--tone-grey-fg: hsl(var(--muted-foreground));

	/* Tones, solid: one strong colour per Tone for chart bars, donut arcs and
	   legend dots, the same in both Modes. Text on a solid is --tone-solid-text. */
	--tone-red-solid: #e11d48;
	--tone-amber-solid: #f59e0b;
	--tone-green-solid: #22c55e;
	--tone-teal-solid: #0f9d84;
	--tone-blue-solid: #3b82f6;
	--tone-indigo-solid: #6366f1;
	--tone-violet-solid: #8b5cf6;
	--tone-pink-solid: #ec4899;
	--tone-grey-solid: hsl(var(--muted-foreground));
	--tone-solid-text: #ffffff;
}

/* Tones, dark Mode: a lighter text colour on a faint wash of itself, so a
   Tone reads on any dark Palette background. */
.dark {
	--tone-red-bg: rgb(255 128 150 / .16);    --tone-red-fg: #ff8096;
	--tone-amber-bg: rgb(245 181 74 / .16);   --tone-amber-fg: #f5b54a;
	--tone-green-bg: rgb(74 209 154 / .16);   --tone-green-fg: #4ad19a;
	--tone-teal-bg: rgb(63 208 189 / .16);    --tone-teal-fg: #3fd0bd;
	--tone-blue-bg: rgb(142 168 255 / .16);   --tone-blue-fg: #8ea8ff;
	--tone-indigo-bg: rgb(165 160 255 / .16); --tone-indigo-fg: #a5a0ff;
	--tone-violet-bg: rgb(183 156 255 / .16); --tone-violet-fg: #b79cff;
	--tone-pink-bg: rgb(247 132 176 / .16);   --tone-pink-fg: #f784b0;
}

/* Meaning aliases: a Tone that reports a status is named by its meaning, so
   "late is amber" is decided here once. .dark sits on <html> like :root,
   so these pick up the dark values above without repeating them. */
:root {
	--tone-success-bg: var(--tone-green-bg);  --tone-success-fg: var(--tone-green-fg);
	--tone-warning-bg: var(--tone-amber-bg);  --tone-warning-fg: var(--tone-amber-fg);
	--tone-danger-bg: var(--tone-red-bg);     --tone-danger-fg: var(--tone-red-fg);
	--tone-info-bg: var(--tone-blue-bg);      --tone-info-fg: var(--tone-blue-fg);
	--tone-neutral-bg: var(--tone-grey-bg);   --tone-neutral-fg: var(--tone-grey-fg);
	--tone-success-solid: var(--tone-green-solid);
	--tone-warning-solid: var(--tone-amber-solid);
	--tone-danger-solid: var(--tone-red-solid);
	--tone-info-solid: var(--tone-blue-solid);
	--tone-neutral-solid: var(--tone-grey-solid);
}
