/* ===========================================================================
   Design tokens — the single source of colour, type and spacing.
   Three theme states, per the audit:
     :root                                  -> complete light palette
     @media (prefers-color-scheme: dark)    -> dark, guarded so an explicit
        :root:not([data-theme="light"])        light choice beats a dark OS
     :root[data-theme="dark"]               -> explicit dark choice wins too
   Every colour in the app comes from here. No component may hardcode a hex.
   =========================================================================== */

:root {
  /* --- surfaces & ink (light) --- */
  --ground:#f4f6f5;
  --surface:#ffffff;
  --surface-2:#eaefed;
  --surface-3:#dfe6e3;
  --ink:#0d1614;
  --ink-2:#43514d;          /* 8.1:1 on --surface */
  --ink-3:#65726e;          /* 4.9:1 on --surface — passes AA at 14px */
  --line:#d6dedb;
  --line-2:#bfcac6;

  /* --- brand --- */
  --accent:#00776a;         /* 5.1:1 on white — the old #00c4b4 was 2.1:1 */
  --accent-hover:#005f55;
  --accent-ink:#ffffff;     /* text ON an accent fill */
  --accent-soft:rgba(0,119,106,.10);
  --accent-line:rgba(0,119,106,.30);

  /* --- semantic state (never reused as a series colour) --- */
  --good:#187a55;      --good-soft:rgba(24,122,85,.11);   --good-line:rgba(24,122,85,.30);
  --warn:#9c5c06;      --warn-soft:rgba(156,92,6,.11);    --warn-line:rgba(156,92,6,.30);
  --crit:#b33a28;      --crit-soft:rgba(179,58,40,.11);   --crit-line:rgba(179,58,40,.30);
  --info:#3f5f8c;      --info-soft:rgba(63,95,140,.11);   --info-line:rgba(63,95,140,.30);
  --idle:#6b5a8a;      --idle-soft:rgba(107,90,138,.11);  --idle-line:rgba(107,90,138,.30);

  /* --- the number plate (a real UK front/rear plate) --- */
  --plate:#f5cb00;
  --plate-ink:#111111;

  /* --- shape & depth --- */
  --r-xs:4px; --r-sm:7px; --r:10px; --r-lg:14px; --r-pill:999px;
  --sh-1:0 1px 2px rgba(13,22,20,.06);
  --sh-2:0 1px 2px rgba(13,22,20,.06), 0 6px 16px -8px rgba(13,22,20,.18);
  --sh-3:0 18px 44px -14px rgba(13,22,20,.30);

  /* --- type --- */
  --f-ui:'Archivo','Helvetica Neue',Arial,sans-serif;
  --f-mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  /* --- layout --- */
  --rail-w:216px;
  --list-w:352px;
  --topbar-h:52px;
  --proto-h:33px;   /* prototype notice; the top bar sticks below it */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:#090e0d;
    --surface:#111917;
    --surface-2:#19221f;
    --surface-3:#222d2a;
    --ink:#edf2f0;
    --ink-2:#a5b3af;         /* 8.4:1 on --surface */
    --ink-3:#82908c;         /* 5.6:1 on --surface — the old 0.34 alpha was 3.4:1 */
    --line:#24302d;
    --line-2:#33413d;

    --accent:#3ad9c8;
    --accent-hover:#5ee7d8;
    --accent-ink:#06201d;
    --accent-soft:rgba(58,217,200,.12);
    --accent-line:rgba(58,217,200,.32);

    --good:#4dc691;  --good-soft:rgba(77,198,145,.13);  --good-line:rgba(77,198,145,.32);
    --warn:#e0a24f;  --warn-soft:rgba(224,162,79,.13);  --warn-line:rgba(224,162,79,.32);
    --crit:#f0765f;  --crit-soft:rgba(240,118,95,.13);  --crit-line:rgba(240,118,95,.32);
    --info:#89aeda;  --info-soft:rgba(137,174,218,.13); --info-line:rgba(137,174,218,.32);
    --idle:#b3a0d6;  --idle-soft:rgba(179,160,214,.13); --idle-line:rgba(179,160,214,.32);

    --sh-1:0 1px 2px rgba(0,0,0,.5);
    --sh-2:0 1px 2px rgba(0,0,0,.5), 0 6px 16px -8px rgba(0,0,0,.7);
    --sh-3:0 18px 44px -14px rgba(0,0,0,.8);
  }
}

:root[data-theme="dark"] {
  --ground:#090e0d;
  --surface:#111917;
  --surface-2:#19221f;
  --surface-3:#222d2a;
  --ink:#edf2f0;
  --ink-2:#a5b3af;
  --ink-3:#82908c;
  --line:#24302d;
  --line-2:#33413d;

  --accent:#3ad9c8;
  --accent-hover:#5ee7d8;
  --accent-ink:#06201d;
  --accent-soft:rgba(58,217,200,.12);
  --accent-line:rgba(58,217,200,.32);

  --good:#4dc691;  --good-soft:rgba(77,198,145,.13);  --good-line:rgba(77,198,145,.32);
  --warn:#e0a24f;  --warn-soft:rgba(224,162,79,.13);  --warn-line:rgba(224,162,79,.32);
  --crit:#f0765f;  --crit-soft:rgba(240,118,95,.13);  --crit-line:rgba(240,118,95,.32);
  --info:#89aeda;  --info-soft:rgba(137,174,218,.13); --info-line:rgba(137,174,218,.32);
  --idle:#b3a0d6;  --idle-soft:rgba(179,160,214,.13); --idle-line:rgba(179,160,214,.32);

  --sh-1:0 1px 2px rgba(0,0,0,.5);
  --sh-2:0 1px 2px rgba(0,0,0,.5), 0 6px 16px -8px rgba(0,0,0,.7);
  --sh-3:0 18px 44px -14px rgba(0,0,0,.8);
}

/* The logo artwork is white/silver with no dark variant. Until a light-mode
   export exists, darken it so it does not vanish on a light surface. */
:root:not([data-theme="dark"]) .logo-img { filter:brightness(.3) contrast(1.2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img { filter:none; }
}
