/* @nax/ui tokens: the colours, sizes and spacing every Naxirion product draws with.

   Two layers. The palette (--nax-*) writes each value once. The tokens under it (--paper,
   --surface, --ink, --crit and the rest) say what a value is for, and change with the theme:
   dark follows the system setting unless <html> says data-theme="light" or data-theme="dark",
   and data-theme wins in both directions. Products draw with the tokens, and reach for the
   palette only where they must show both themes at once.

   The typefaces are the family's too (since 0.8.0): every product's pages read in Inter, their
   titles in Schibsted Grotesk and code in IBM Plex Mono, served by fonts.css.

   What stays with each product, defined after this file: its accent (--accent, --on-accent,
   --side-accent, --side-on-accent, in both themes, and a partner's brand colour over them), its
   logo, and anything only it draws.

   Taken value for value from Naxirion Discover on 2 Dec 2026 (its D122 and D231 to D233), whose
   grounds and sidebar were already Manage's. Change a value here, never in a product, and run
   scripts/palette_scss.py, which writes the palette below into palette.scss for Manage's Sass. */

:root {
  /* Neutrals: grey with no hue in it, so colour on a screen means a severity, a grade or
     something wrong rather than the brand. Boxes, tables, menus and fields are white on a grey
     page. Faint text holds 4.5:1 on the sunk grey. */
  --nax-n-page: #ffffff;
  --nax-n-sunk: #f3f4f6;
  --nax-n-sel: #e8eaed;
  --nax-n-ink: #15171a;
  --nax-n-ink-2: #3d434c;
  --nax-n-muted: #5d6470;
  --nax-n-faint: #666d79;
  --nax-n-rule: #e6e8eb;
  --nax-n-rule-strong: #d3d7dc;

  /* The page beneath the white boxes, so a box, a table or a field stands out white on it. A
     fill drawn on the page itself, not in a box, takes the ground's fill, a step darker, where the
     sunk grey would vanish into it. */
  --nax-n-ground: #f4f6f9;
  --nax-n-ground-fill: #e8edf3;

  /* The dark theme in slate: laid out as the light theme is, the page darker than the boxes on
     it, and lifted from near-black so it reads as a console rather than a terminal. Faint text holds
     4.5:1 on the sunk slate, and the page's fill is a step above the page. */
  --nax-d-n-page: #1f242c;
  --nax-d-n-surface: #272d36;
  --nax-d-n-sunk: #2e343e;
  --nax-d-n-sel: #353c47;
  --nax-d-n-ground-fill: #2c323c;
  --nax-d-n-ink: #e6eaf0;
  --nax-d-n-ink-2: #c4ccd7;
  --nax-d-n-muted: #aab3c0;
  --nax-d-n-faint: #98a2b0;
  --nax-d-n-rule: #363d48;
  --nax-d-n-rule-strong: #474f5c;

  /* The sidebar in the light theme: navy, with light words on it. Muted words hold 4.5:1 on the
     current section's band. */
  --nax-side: #0f1d33;
  --nax-side-2: #172842;
  --nax-side-hover: #1a2b47;
  --nax-side-sel: #233756;
  --nax-side-rule: #233756;
  --nax-side-rule-strong: #2e4466;
  --nax-side-ink: #c3cdda;
  --nax-side-strong: #f3f6fa;
  --nax-side-muted: #8fa3bf;

  /* The sidebar in the dark theme: the darkest slate, a step below the page. */
  --nax-d-side: #181c22;
  --nax-d-side-2: #20252d;
  --nax-d-side-hover: #22272f;
  --nax-d-side-sel: #2c323c;
  --nax-d-side-rule: #2c323c;
  --nax-d-side-rule-strong: #333a45;
  --nax-d-side-ink: #b4bcc8;
  --nax-d-side-strong: #f2f4f7;
  --nax-d-side-muted: #9aa4b2;

  /* Severity in words, each on its own tint. Info is what a scan or a sensor saw rather than a
     risk. */
  --nax-crit: #a3123a;
  --nax-crit-bg: #fae4ea;
  --nax-high: #bf3f0c;
  --nax-high-bg: #fceadf;
  --nax-med: #8a5e00;
  --nax-med-bg: #f8eed2;
  --nax-low: #2c5f94;
  --nax-low-bg: #e3ecf6;
  --nax-info: #55667a;
  --nax-info-bg: #e8eef5;

  /* Severity drawn as a meter: saturated fills, where the colours above are for text. An unlit
     bar is the off colour, so the meter's shape says the rank without its hue. */
  --nax-crit-fill: #b8123f;
  --nax-high-fill: #e0541b;
  --nax-med-fill: #e3a008;
  --nax-low-fill: #3a78d4;
  --nax-meter-off: #dadde2;

  /* Something went right, needs a look, or went wrong. */
  --nax-ok: #0e7450;
  --nax-ok-bg: #dff1e8;
  --nax-warn: #8a5000;
  --nax-warn-bg: #fbefd8;
  --nax-bad: #b0261b;
  --nax-bad-bg: #fbe6e3;

  /* The alarm, kept for what somebody is exploiting now. */
  --nax-signal: #c42a44;

  /* The same in the dark theme. */
  --nax-d-crit: #f47a9a;
  --nax-d-crit-bg: #36121d;
  --nax-d-high: #f4875a;
  --nax-d-high-bg: #361a0f;
  --nax-d-med: #e3b54a;
  --nax-d-med-bg: #30260b;
  --nax-d-low: #79aae0;
  --nax-d-low-bg: #0f2238;
  --nax-d-info: #9cabbd;
  --nax-d-info-bg: #172231;
  --nax-d-crit-fill: #ef4f78;
  --nax-d-high-fill: #f27a45;
  --nax-d-med-fill: #eab52f;
  --nax-d-low-fill: #5e9cf0;
  --nax-d-meter-off: #4a5260;
  --nax-d-ok: #4fc79a;
  --nax-d-ok-bg: #10291f;
  --nax-d-warn: #e9ae52;
  --nax-d-warn-bg: #31240d;
  --nax-d-bad: #f4806e;
  --nax-d-bad-bg: #351611;
  --nax-d-signal: #f47e92;
}

:root {
  /* Type at six sizes. */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 22px;
  --text-2xl: 30px;

  /* The family's typefaces (fonts.css serves them): a page's text, its title (only a page's
     title: Schibsted Grotesk's word space is narrow, and at section-heading sizes "Names we
     found" reads "Names wefound"), and code. Discover's, word for word. */
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* The frame's typeface: the sidebar, the phone's bar and the menus they open, which frame.css
     sets in it whatever a product's pages say. The family's text face, written out rather than
     named, since inside the frame --font-body is named after it. */
  --font-frame: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing, corners and depth: a control has the small corner, a box the larger one, and
     only what floats over the page has a shadow. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-control: 6px;
  --radius-box: 8px;

  /* The page is grey and the boxes on it white: --paper is the page, --surface a box, a
     table, a menu, a dialog or a field. A fill on the page itself is --ground-fill. */
  --paper: var(--nax-n-ground);
  --surface: var(--nax-n-page);
  --sunk: var(--nax-n-sunk);
  --ground-fill: var(--nax-n-ground-fill);
  --ink: var(--nax-n-ink);
  --muted: var(--nax-n-muted);
  --faint: var(--nax-n-faint);
  --rule: var(--nax-n-rule);
  --rule-strong: var(--nax-n-rule-strong);

  /* The alarm. */
  --signal: var(--nax-signal);

  /* The sidebar is navy beside the light page, and in the dark theme the
     darkest slate, a step below the page, with a line on its edge. It is dark either way,
     so it takes the product's dark-theme accent (--side-accent). Hover is a step short of
     the current section's band, so it is never mistaken for it. */
  --side: var(--nax-side);
  --side-2: var(--nax-side-2);
  --side-sel: var(--nax-side-sel);
  --side-ink: var(--nax-side-ink);
  --side-strong: var(--nax-side-strong);
  --side-muted: var(--nax-side-muted);
  --side-faint: var(--nax-side-muted);
  --side-rule: var(--nax-side-rule);
  --side-rule-strong: var(--nax-side-rule-strong);
  --side-hover: var(--nax-side-hover);
  --side-hover-line: color-mix(in srgb, var(--side-strong) 40%, var(--side));

  --crit: var(--nax-crit);
  --crit-bg: var(--nax-crit-bg);
  --high: var(--nax-high);
  --high-bg: var(--nax-high-bg);
  --med: var(--nax-med);
  --med-bg: var(--nax-med-bg);
  --low: var(--nax-low);
  --low-bg: var(--nax-low-bg);
  --info: var(--nax-info);
  --info-bg: var(--nax-info-bg);
  --crit-fill: var(--nax-crit-fill);
  --high-fill: var(--nax-high-fill);
  --med-fill: var(--nax-med-fill);
  --low-fill: var(--nax-low-fill);
  --meter-off: var(--nax-meter-off);

  --ok: var(--nax-ok);
  --ok-bg: var(--nax-ok-bg);
  --warn: var(--nax-warn);
  --warn-bg: var(--nax-warn-bg);
  --bad: var(--nax-bad);
  --bad-bg: var(--nax-bad-bg);

  --shadow-sm: 0 1px 2px rgba(21, 23, 26, 0.06);
  --shadow-lg: 0 2px 6px rgba(21, 23, 26, 0.06), 0 24px 56px -24px rgba(16, 17, 19, 0.4);
  --scrim: rgba(16, 17, 19, 0.5);

  /* The product's accent, washed into a box: --accent is the product's own. */
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --radius: var(--radius-box);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--nax-d-n-page);
    --surface: var(--nax-d-n-surface);
    --sunk: var(--nax-d-n-sunk);
    --ground-fill: var(--nax-d-n-ground-fill);
    --ink: var(--nax-d-n-ink);
    --muted: var(--nax-d-n-muted);
    --faint: var(--nax-d-n-faint);
    --rule: var(--nax-d-n-rule);
    --rule-strong: var(--nax-d-n-rule-strong);
    --signal: var(--nax-d-signal);
    --side: var(--nax-d-side);
    --side-2: var(--nax-d-side-2);
    --side-sel: var(--nax-d-side-sel);
    --side-ink: var(--nax-d-side-ink);
    --side-strong: var(--nax-d-side-strong);
    --side-muted: var(--nax-d-side-muted);
    --side-rule: var(--nax-d-side-rule);
    --side-faint: var(--nax-d-side-muted);
    --side-rule-strong: var(--nax-d-side-rule-strong);
    --side-hover: var(--nax-d-side-hover);
    --crit: var(--nax-d-crit);
    --crit-bg: var(--nax-d-crit-bg);
    --high: var(--nax-d-high);
    --high-bg: var(--nax-d-high-bg);
    --med: var(--nax-d-med);
    --med-bg: var(--nax-d-med-bg);
    --low: var(--nax-d-low);
    --low-bg: var(--nax-d-low-bg);
    --info: var(--nax-d-info);
    --info-bg: var(--nax-d-info-bg);
    --crit-fill: var(--nax-d-crit-fill);
    --high-fill: var(--nax-d-high-fill);
    --med-fill: var(--nax-d-med-fill);
    --low-fill: var(--nax-d-low-fill);
    --meter-off: var(--nax-d-meter-off);
    --ok: var(--nax-d-ok);
    --ok-bg: var(--nax-d-ok-bg);
    --warn: var(--nax-d-warn);
    --warn-bg: var(--nax-d-warn-bg);
    --bad: var(--nax-d-bad);
    --bad-bg: var(--nax-d-bad-bg);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 56px -24px rgba(0, 0, 0, 0.9);
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: var(--nax-d-n-page);
  --surface: var(--nax-d-n-surface);
  --sunk: var(--nax-d-n-sunk);
  --ground-fill: var(--nax-d-n-ground-fill);
  --ink: var(--nax-d-n-ink);
  --muted: var(--nax-d-n-muted);
  --faint: var(--nax-d-n-faint);
  --rule: var(--nax-d-n-rule);
  --rule-strong: var(--nax-d-n-rule-strong);
  --signal: var(--nax-d-signal);
  --side: var(--nax-d-side);
  --side-2: var(--nax-d-side-2);
  --side-sel: var(--nax-d-side-sel);
  --side-ink: var(--nax-d-side-ink);
  --side-strong: var(--nax-d-side-strong);
  --side-muted: var(--nax-d-side-muted);
  --side-rule: var(--nax-d-side-rule);
  --side-faint: var(--nax-d-side-muted);
  --side-rule-strong: var(--nax-d-side-rule-strong);
  --side-hover: var(--nax-d-side-hover);
  --crit: var(--nax-d-crit);
  --crit-bg: var(--nax-d-crit-bg);
  --high: var(--nax-d-high);
  --high-bg: var(--nax-d-high-bg);
  --med: var(--nax-d-med);
  --med-bg: var(--nax-d-med-bg);
  --low: var(--nax-d-low);
  --low-bg: var(--nax-d-low-bg);
  --info: var(--nax-d-info);
  --info-bg: var(--nax-d-info-bg);
  --crit-fill: var(--nax-d-crit-fill);
  --high-fill: var(--nax-d-high-fill);
  --med-fill: var(--nax-d-med-fill);
  --low-fill: var(--nax-d-low-fill);
  --meter-off: var(--nax-d-meter-off);
  --ok: var(--nax-d-ok);
  --ok-bg: var(--nax-d-ok-bg);
  --warn: var(--nax-d-warn);
  --warn-bg: var(--nax-d-warn-bg);
  --bad: var(--nax-d-bad);
  --bad-bg: var(--nax-d-bad-bg);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 56px -24px rgba(0, 0, 0, 0.9);
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
