/*
 * Tidewater design tokens. Dark slate ink on cool paper, white surfaces with square 1px ink
 * borders and a flat pale-pink lift under cards, a teal-blue top bar with an aqua stripe, deep
 * teal for links, focus and data, aqua for what is selected and cyan for what is hovered.
 * Primary actions use ink (pale pink in the dark appearance), not the accent.
 * Canvas painting mirrors these values in src/appearance.ts (`palettes`).
 *
 * Type
 *   --font-sans      IBM Plex Sans: text and controls.
 *   --font-display   Bricolage Grotesque: headings and KPI figures. Follows an organization's typeface.
 *   --font-brand     Bricolage Grotesque: the Pastel BI wordmark only; never replaced.
 *   --font-mono      IBM Plex Mono: small uppercase labels, code, keys.
 *   All three are bundled with the build (fontsource); nothing is fetched from another origin.
 *
 * Tokens added for Tidewater (light / dark):
 *   --bar          top bar band                         #135a6d / #0e4453
 *   --on-bar       text and icons on the bar             #ffffff / #ffffff
 *   --bar-stripe   4px stripe under the bar; also the focus ring on the bar   #7ddfd5 / #7ddfd5
 *   --bar-field    search field on the bar               #0f4a5a / #0a3542
 *   --bar-muted    secondary text and field borders on the bar   #cfe6ec / #b9d9e0
 *   --select       selected or pressed fill (aqua)       #7ddfd5 / #7ddfd5
 *   --on-select    text on --select; always ink          #13212a / #13212a
 *   --hover        hovered fill (cyan in light)          #a8dbe4 / #1d3f4c   (existing name, new value)
 *   --on-hover     text on --hover                       #13212a / #e9f2f4
 *   --aqua, --cyan the raw fills, the same in both       #7ddfd5, #a8dbe4
 *   --pink         lead pale pink (cards, avatar)        #f8d7e0 / #3b2530
 *   --blush        lighter pink                          #fdf0f4 / #1b2630
 *   --pink-line    deeper pink, decorative only, never text   #ebb1c2 / #6d4553
 *   --aqua-tint    pale aqua (success, metric cards)     #e0f6f3 / #12332f
 *   --cyan-tint    pale cyan (query surfaces)            #e3f3f6 / #143541
 *   --body         running text                          #3d5560 / #c3d3d9
 *   --border       square ink border of cards, controls  #13212a / #5d7a86
 *   --lift         the flat colour under cards           #ebb1c2 / #0a6662
 *   --shadow-lift  0 2px 0 var(--lift)
 *   --canvas       board canvas ground                   #fdf0f4 / #101d25
 *   --canvas-dot   canvas dot grid                       #ebb1c2 / #2b4350
 *   --grid         canvas squares-grid lines             #f3c9d5 / #1f3540   (existing name, new value)
 *   --sticky       sticky-note yellow, the same in both  #fdf3a7
 *   --on-sticky    text on --sticky; always ink          #13212a
 *
 * Existing names whose meaning shifted: the radii --radius-sm/md/lg/xl are 0 (square; an
 * organization can choose other corners); --line-strong is the ink border (= --border);
 * --shadow-1 is the flat lift, --shadow-2/3 add a restrained shadow for layers that float
 * (popovers, menus, dialogs); --glass is an opaque surface and --glass-line the ink border;
 * --periwinkle, --peach and --mint hold Tidewater's cyan, pink and aqua; --mint-soft and
 * --mint-text are aqua-tint and deep teal; --success is deep teal; --danger is the negative red.
 *
 * Contrast (WCAG 2.1, computed): ink 16.4 on surface, 15.2 on page, 10.9 on --hover, 10.5 on
 * --select, 12.4 on pink, 14.8 on blush and canvas, 14.5 on sticky; body 7.9 / 7.3 / 5.2 on
 * hover; muted 6.2 on surface, 5.8 on page, 4.7 on pink; accent 6.8 on surface, 6.3 on page,
 * 6.0 on --accent-soft; white 7.8 on the bar; bar-muted 6.0 on the bar; danger 7.2 on surface.
 * Dark: ink 14.5 on surface, 16.2 on page, 9.9 on hover; muted 8.0 / 8.9; accent 10.5 / 11.8;
 * ink on pink primary 12.4; border 3.6 on surface. Muted text on light --hover (4.1) and on
 * --select (4.0) is below 4.5: text on those fills uses --on-hover / --on-select.
 */
:root {
  /* Type */
  --font-sans:
    "IBM Plex Sans Variable", "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --font-display:
    "Bricolage Grotesque Variable", "Bricolage Grotesque", "IBM Plex Sans Variable", ui-sans-serif,
    system-ui, sans-serif;
  --font-brand: "Bricolage Grotesque Variable", "Bricolage Grotesque", ui-sans-serif, sans-serif;
  --font-mono:
    "IBM Plex Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-lg: 15px;

  /* Geometry */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 160ms;
  --dur: 240ms;

  /* Color — light */
  --ink: #13212a;
  --body: #3d5560;
  --muted: #4f646d;
  --accent: #0a6662;
  --accent-hover: #07504d;
  --accent-soft: #e0f6f3;
  --on-accent: #ffffff;
  --primary: #13212a;
  --on-primary: #ffffff;
  --line: #c8d7db;
  --border: #13212a;
  --line-strong: var(--border);
  --surface: #ffffff;
  --surface-2: #f3f7f8;
  --surface-3: #e7eff1;
  --background: #f3f7f8;
  --hover: #a8dbe4;
  --on-hover: #13212a;
  --aqua: #7ddfd5;
  --cyan: #a8dbe4;
  --select: var(--aqua);
  --on-select: #13212a;
  --pink: #f8d7e0;
  --blush: #fdf0f4;
  --pink-line: #ebb1c2;
  --aqua-tint: #e0f6f3;
  --cyan-tint: #e3f3f6;
  --bar: #135a6d;
  --on-bar: #ffffff;
  --bar-stripe: #7ddfd5;
  --bar-field: #0f4a5a;
  --bar-muted: #cfe6ec;
  --canvas: #fdf0f4;
  --canvas-dot: #ebb1c2;
  --grid: #f3c9d5;
  --sticky: #fdf3a7;
  --on-sticky: #13212a;
  --note: #fdf8d4;
  --note-text: #6e5410;
  --mint-soft: #e0f6f3;
  --mint-text: #0a6662;
  --success: #0a6662;
  --danger: #a3244e;
  --lift: #ebb1c2;
  --shadow: #13212a1f;
  --glass: #ffffff;
  --glass-line: var(--border);
  --shadow-lift: 0 2px 0 var(--lift);
  --shadow-1: var(--shadow-lift);
  --shadow-2: 0 2px 0 var(--lift), 0 10px 24px -14px rgb(19 33 42 / 0.28);
  --shadow-3: 0 2px 0 var(--lift), 0 24px 48px -20px rgb(19 33 42 / 0.36);
  --scrim: rgb(19 33 42 / 0.32);
  --periwinkle: #a8dbe4;
  --peach: #f8d7e0;
  --mint: #7ddfd5;
}
:root[data-color-mode="dark"] {
  --ink: #e9f2f4;
  --body: #c3d3d9;
  --muted: #a2b8c2;
  --accent: #7ddfd5;
  --accent-hover: #a6ebe4;
  --accent-soft: #12332f;
  --on-accent: #13212a;
  --primary: #f8d7e0;
  --on-primary: #13212a;
  --line: #2b4350;
  --border: #5d7a86;
  --surface: #13212a;
  --surface-2: #101c24;
  --surface-3: #1b2d37;
  --background: #0b151b;
  --hover: #1d3f4c;
  --on-hover: #e9f2f4;
  --pink: #3b2530;
  --blush: #1b2630;
  --pink-line: #6d4553;
  --aqua-tint: #12332f;
  --cyan-tint: #143541;
  --bar: #0e4453;
  --bar-field: #0a3542;
  --bar-muted: #b9d9e0;
  --canvas: #101d25;
  --canvas-dot: #2b4350;
  --grid: #1f3540;
  --note: #2a2614;
  --note-text: #ecd58a;
  --mint-soft: #12332f;
  --mint-text: #a6ebe4;
  --success: #7ddfd5;
  --danger: #f29bb5;
  --lift: #0a6662;
  --shadow: #00000059;
  --glass: #13212a;
  --shadow-2: 0 2px 0 var(--lift), 0 10px 24px -14px rgb(0 0 0 / 0.6);
  --shadow-3: 0 2px 0 var(--lift), 0 24px 48px -20px rgb(0 0 0 / 0.7);
  --scrim: rgb(0 0 0 / 0.55);
}
/*
 * An organization's look (Admin → Platform Settings → Appearance), set as --brand-* on the
 * document by src/appearance.ts. Colours replace the product's tokens in the light appearance
 * only; the typeface and corner shape apply in both. A chosen page background is also the
 * canvas ground, and hover follows the chosen grounds. The top bar, stripe, selection fill,
 * pinks, lift and sticky notes stay the product's.
 */
:root[data-brand-accent]:not([data-color-mode="dark"]) {
  --accent: var(--brand-accent);
  --accent-hover: var(--brand-accent-hover);
  --accent-soft: var(--brand-accent-soft);
  --on-accent: var(--brand-on-accent);
}
:root[data-brand-primary]:not([data-color-mode="dark"]) {
  --primary: var(--brand-primary);
  --on-primary: var(--brand-on-primary);
}
:root[data-brand-ground]:not([data-color-mode="dark"]) {
  --ink: var(--brand-ink);
  --body: var(--brand-body);
  --muted: var(--brand-muted);
  --line: var(--brand-line);
  --border: var(--brand-line-strong);
  --line-strong: var(--brand-line-strong);
  --surface: var(--brand-surface);
  --surface-2: var(--brand-surface-2);
  --surface-3: var(--brand-surface-3);
  --background: var(--brand-background);
  --hover: var(--brand-hover);
  --on-hover: var(--brand-ink);
  --canvas: var(--brand-background);
  --canvas-dot: var(--brand-grid-mark);
  --grid: var(--brand-grid);
  --note: var(--brand-note);
  --glass: var(--brand-glass);
  --glass-line: var(--brand-glass-line);
}
:root[data-brand-font] {
  --font-sans: var(--brand-font);
  --font-display: var(--brand-font);
}
:root[data-brand-corners] {
  --radius-sm: var(--brand-radius-sm);
  --radius-md: var(--brand-radius-md);
  --radius-lg: var(--brand-radius-lg);
  --radius-xl: var(--brand-radius-xl);
}
html,
body {
  background: var(--background);
  color: var(--ink);
}
