/* Tankmon design tokens (UI spec v1.1 §8): the only place colours, type, space, radii, depth and
   motion are defined. Light by default; dark follows the device (prefers-color-scheme) unless the
   Account page set a theme for this browser (data-theme on <html>). The dark values appear twice, once
   per way of choosing dark; tests/test_contrast.py checks the two copies match and that text passes
   WCAG AA. The names from before v1.1 (--ink, --paper, --bar...) stay as aliases of the new ones until
   every rule in app.css uses the new names. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  color-scheme: light;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;  /* codes and IDs only */

  /* brand: the top bar */
  --c-brand: #162942;
  --c-brand-2: #1f3a5c;  /* top bar hover and current link */
  --c-on-brand: #ffffff;
  --c-on-brand-2: #b9c7d8;  /* inactive links on the bar */
  /* surfaces */
  --c-bg: #eef1f4;
  --c-surface: #ffffff;
  --c-surface-2: #f6f8fa;
  --c-border: #dde2e8;
  --c-border-strong: #8492a3;  /* inputs and chips: 3:1 on the surface */
  /* text */
  --c-text: #0f1b2a;
  --c-text-2: #44546a;
  --c-text-3: #5c6a7c;
  --c-link: #1d5fae;
  /* actions */
  --c-primary: #162942;
  --c-on-primary: #ffffff;
  --c-primary-hover: #24436a;
  --c-focus: #2f7de1;
  /* water and the tank gauge */
  --c-water: #3369aa;
  --c-water-top: #4f8bcd;
  --c-water-deep: #24508a;
  --c-water-wave: #3f7bbf;
  --c-tank-wall: #22374f;
  --c-tank-inner: #e9eef4;
  --c-tank-mark: rgba(15, 27, 42, 0.38);
  --c-water-off: #9aa6b4;
  /* diesel in the gauge (docs/V4.md §3): a brown gold, apart from the water blue and the warning amber */
  --c-fuel: #7a5714;
  --c-fuel-top: #a07a2c;
  --c-fuel-deep: #57390a;
  --c-fuel-wave: #8c6a24;
  /* status: fg (text and icons, 4.5:1 on its bg and on the surface), bg, solid (lines and fills) */
  --ok-fg: #17663a;
  --ok-bg: #e5f4ea;
  --ok-solid: #1f8a4c;
  --warn-fg: #8a4b00;
  --warn-bg: #fff2d9;
  --warn-solid: #c77700;
  --crit-fg: #b42318;
  --crit-bg: #fde8e6;
  --crit-solid: #d92d20;
  --off-fg: #475467;
  --off-bg: #eceff3;
  --off-solid: #667085;
  --info-fg: #1d5fae;
  --info-bg: #e7f0fb;
  --info-solid: #2f7de1;
  /* the Alerts count, the live dot, QR codes */
  --badge: #b42318;
  --badge-ink: #ffffff;
  --live-on: #4fc27f;
  --live-retry: #edae55;
  --live-off: #b9c7d8;
  --danger: #b42318;
  --danger-ink: #ffffff;
  --qr-bg: #ffffff;  /* QR codes need a light quiet zone in both themes */

  /* type */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-hero: 3.5rem;
  --lh: 1.45;
  /* space (4 px grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  /* shape and depth */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(15, 27, 42, 0.06), 0 1px 1px rgba(15, 27, 42, 0.04);
  --shadow-2: 0 4px 16px rgba(15, 27, 42, 0.08), 0 1px 3px rgba(15, 27, 42, 0.06);
  /* sizing */
  --touch: 44px;
  --topbar-h: 56px;
  --tabbar-h: 64px;
  /* motion */
  --t-fast: 150ms;
  --t-level: 1200ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wave-speed: 7s;

  /* names from before v1.1 */
  --r-s: var(--r-sm);
  --r-m: var(--r-md);
  --paper: var(--c-bg);
  --surface: var(--c-surface);
  --field: var(--c-surface);
  --ink: var(--c-text);
  --ink-2: var(--c-text-2);
  --muted: var(--c-text-3);
  --rule: var(--c-border);
  --rule-2: var(--c-border);
  --bar: var(--c-brand);
  --bar-ink: var(--c-on-brand);
  --bar-muted: var(--c-on-brand-2);
  --bar-hover: var(--c-brand-2);
  --water: var(--c-water);
  --water-top: var(--c-water-top);
  --ok: var(--ok-fg);
  --warn: var(--warn-fg);
  --crit: var(--crit-fg);
  --off: var(--off-fg);
  --focus: var(--c-focus);
  --primary: var(--c-primary);
  --primary-ink: var(--c-on-primary);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --c-brand: #0d1a2b;
    --c-brand-2: #1a2d45;
    --c-on-brand-2: #a9b8ca;
    --c-bg: #0b1320;
    --c-surface: #121d2c;
    --c-surface-2: #17253a;
    --c-border: #25364b;
    --c-border-strong: #60758f;
    --c-text: #e7edf5;
    --c-text-2: #b3c0d0;
    --c-text-3: #94a3b8;
    --c-link: #8cc2ff;
    --c-primary: #2f6db5;
    --c-on-primary: #ffffff;
    --c-primary-hover: #3a7cc7;
    --c-focus: #8cc2ff;
    --c-water: #326cb0;  /* spec #2f66a8 is 2.90:1 on the dark surface; 3:1 needed */
    --c-water-top: #4a88cc;
    --c-water-deep: #1c3f6d;
    --c-water-wave: #3a74b8;
    --c-tank-wall: #7d93ad;
    --c-tank-inner: #0f1a28;
    --c-tank-mark: rgba(231, 237, 245, 0.38);
    --c-water-off: #4a5a6e;
    --c-fuel: #9a7426;
    --c-fuel-top: #b8913f;
    --c-fuel-deep: #5e4110;
    --c-fuel-wave: #a8832f;
    --ok-fg: #74d69c;
    --ok-bg: #10301e;
    --ok-solid: #3fb86f;
    --warn-fg: #f4bb55;
    --warn-bg: #33240a;
    --warn-solid: #e09a1a;
    --crit-fg: #ff8f85;
    --crit-bg: #3b1512;
    --crit-solid: #f0544a;
    --off-fg: #b3c0d0;
    --off-bg: #1d2a3b;
    --off-solid: #8394a9;
    --info-fg: #8cc2ff;
    --info-bg: #132a47;
    --info-solid: #5aa2f0;
    --badge: #b42318;
    --badge-ink: #ffffff;
    --live-off: #a9b8ca;
    --danger: #ff8f85;
    --danger-ink: #1a0806;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --c-brand: #0d1a2b;
  --c-brand-2: #1a2d45;
  --c-on-brand-2: #a9b8ca;
  --c-bg: #0b1320;
  --c-surface: #121d2c;
  --c-surface-2: #17253a;
  --c-border: #25364b;
  --c-border-strong: #60758f;
  --c-text: #e7edf5;
  --c-text-2: #b3c0d0;
  --c-text-3: #94a3b8;
  --c-link: #8cc2ff;
  --c-primary: #2f6db5;
  --c-on-primary: #ffffff;
  --c-primary-hover: #3a7cc7;
  --c-focus: #8cc2ff;
  --c-water: #326cb0;  /* spec #2f66a8 is 2.90:1 on the dark surface; 3:1 needed */
  --c-water-top: #4a88cc;
  --c-water-deep: #1c3f6d;
  --c-water-wave: #3a74b8;
  --c-tank-wall: #7d93ad;
  --c-tank-inner: #0f1a28;
  --c-tank-mark: rgba(231, 237, 245, 0.38);
  --c-water-off: #4a5a6e;
  --c-fuel: #9a7426;
  --c-fuel-top: #b8913f;
  --c-fuel-deep: #5e4110;
  --c-fuel-wave: #a8832f;
  --ok-fg: #74d69c;
  --ok-bg: #10301e;
  --ok-solid: #3fb86f;
  --warn-fg: #f4bb55;
  --warn-bg: #33240a;
  --warn-solid: #e09a1a;
  --crit-fg: #ff8f85;
  --crit-bg: #3b1512;
  --crit-solid: #f0544a;
  --off-fg: #b3c0d0;
  --off-bg: #1d2a3b;
  --off-solid: #8394a9;
  --info-fg: #8cc2ff;
  --info-bg: #132a47;
  --info-solid: #5aa2f0;
  --badge: #b42318;
  --badge-ink: #ffffff;
  --live-off: #a9b8ca;
  --danger: #ff8f85;
  --danger-ink: #1a0806;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.45);
}
