/*
  tokens.css: theme colours, spacing, corners and fonts.

  Copied from the "Ops Admin Theme" design system. Change a colour here and
  every page follows. Never put colour codes directly in app.css or HTML.

  Light theme by default; the dark theme switches on automatically when the
  computer or phone is set to dark mode, unless the person chose one with
  the switch in the top bar (0.11.3: <html data-theme="light|dark">, kept
  in this browser by app.js part 0).

  0.11.3: IBM Plex Sans and Mono are part of the program (static/fonts,
  SIL Open Font License, OFL-IBM-Plex.txt): no font comes from another
  site (font-src 'self'). Their names carry the font's version (.v511 =
  5.1.1), so they are cached for a year (assets.rs); a new font file needs a
  new name (M2 of the review of 0.11.3).
*/

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.v511.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.v511.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.v511.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.v511.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.v511.woff2") format("woff2"); }

:root {
  /* Surfaces */
  --surface-0: #f4f6f8;      /* page background */
  --surface-1: #ffffff;      /* cards, sidebar */
  --surface-2: #edf0f3;      /* inputs, table headers, row hover */
  --border: #d5dbe1;         /* hairlines */
  --border-strong: #7d8895;  /* input and button borders (3:1 contrast) */

  /* Text */
  --ink: #111820;            /* main text */
  --ink-2: #3e4a57;          /* secondary text */
  --ink-3: #5a6673;          /* hints, timestamps */

  /* Accent */
  --primary: #1d5fb8;
  --primary-hover: #174c93;
  --primary-soft: #e6eef9;
  --on-primary: #ffffff;
  --focus: #1d5fb8;

  /* Status (text colour + soft background) */
  --success: #0b7a5c;  --success-soft: #e2f3ec;
  --warning: #9a5600;  --warning-soft: #fcf0dc;
  --danger: #b93224;   --danger-soft: #fbe7e4;
  --info: #17698a;     --info-soft: #e1f1f6;
  --paused: #6a4ca6;   --paused-soft: #efeaf8;

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* Corners */
  --radius-sm: 4px;   /* badges */
  --radius-md: 6px;   /* buttons, inputs */
  --radius-lg: 10px;  /* cards */

  /* Pop-ups and menus float above the page. */
  --shadow-pop: 0 18px 50px rgba(13, 17, 23, 0.22), 0 2px 6px rgba(13, 17, 23, 0.08);
  --scrim: rgba(13, 17, 23, 0.42);
  --surface-2h: #f7f9fb;     /* every other table row, pop-up footers */

  /* Fonts: IBM Plex (static/fonts), else the system font */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* Dark: chosen with the switch, or the device's choice when none. */
:root[data-theme="dark"] {
    --surface-0: #0d1117;
    --surface-1: #151b23;
    --surface-2: #1c232d;
    --border: #2b3440;
    --border-strong: #677383;

    --ink: #e7ecf2;
    --ink-2: #b4beca;
    --ink-3: #8b96a4;

    --primary: #6fa8f5;
    --primary-hover: #8dbbf7;
    --primary-soft: #172840;
    --on-primary: #0b1320;
    --focus: #8dbbf7;

    --success: #4dc79a;  --success-soft: #10291f;
    --warning: #ebb35a;  --warning-soft: #2c2210;
    --danger: #f27a6d;   --danger-soft: #33191a;
    --info: #5cc3e0;     --info-soft: #0f2730;
    --paused: #b39af0;   --paused-soft: #231c38;
    --surface-2h: #18202a;
    --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.5);
    --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
  }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-0: #0d1117;
    --surface-1: #151b23;
    --surface-2: #1c232d;
    --border: #2b3440;
    --border-strong: #677383;

    --ink: #e7ecf2;
    --ink-2: #b4beca;
    --ink-3: #8b96a4;

    --primary: #6fa8f5;
    --primary-hover: #8dbbf7;
    --primary-soft: #172840;
    --on-primary: #0b1320;
    --focus: #8dbbf7;

    --success: #4dc79a;  --success-soft: #10291f;
    --warning: #ebb35a;  --warning-soft: #2c2210;
    --danger: #f27a6d;   --danger-soft: #33191a;
    --info: #5cc3e0;     --info-soft: #0f2730;
    --paused: #b39af0;   --paused-soft: #231c38;
    --surface-2h: #18202a;
    --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.5);
    --scrim: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
