/* Avrel design tokens: the one place for colours, type, radii, shadows and sizes.

   Every page links this file first: the app (index.html), sign-in (login.html), the 3D twin
   (twin_3d.html), the design reference (design.html) and docs.getavrel.com (server/docs_site.py
   inlines it). getavrel.com keeps a copy in its repo, checked against this one by its tests.

   Change a value here and every page follows. Do not write a colour, font size, font family,
   radius or shadow anywhere else: tests/test_design_system.py fails if you do. Light is the
   default; html[data-theme="dark"] overrides the same names. See DESIGN.md. */

@font-face {
  font-family: "Geist";
  src: url("/vendor/fonts/geist/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/vendor/fonts/geist/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;

  /* Brand */
  --brand: #1d2bd8;               /* Avrel blue: logo, deck, getavrel.com */
  --brand-hover: #1620a8;
  --brand-soft: #eef0fd;
  --on-brand: #ffffff;

  /* Neutrals: page, surfaces, lines, text */
  --bg: #f7f7f7;
  --sidebar: #f7f7f7;
  --surface: #ffffff;
  --surface-muted: #f1f1f3;
  --surface-subtle: #fafafa;
  --border: #e5e5e5;
  --line: #efefef;
  --border-strong: #d4d4d6;
  --ink: #1a1a1a;
  --ink-2: #3f3f42;
  --muted: #707073;
  --icon: #78787b;
  --nav-hover: #efefef;
  --nav-active: #e8e8e8;
  --code-bg: #f4f4f6;

  /* Action: the accent is the brand blue. Primary buttons, links, focus, selection. */
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --accent-soft: var(--brand-soft);
  --accent-ink: var(--brand);
  --on-accent: var(--on-brand);
  --primary: var(--accent);
  --primary-ink: var(--on-accent);
  --focus-ring: var(--accent);

  /* Status: text colour, dot colour, tinted background */
  --ok: #1f7a4f;
  --ok-dot: #4cb782;
  --ok-bg: #f2fbf6;
  --warn: #8a5a00;
  --warn-dot: #d9a400;
  --warn-bg: #fffbeb;
  --crit: #c9353b;
  --crit-dot: #e5484d;
  --crit-bg: #fff5f5;
  --info: var(--accent-ink);
  --info-dot: var(--accent);
  --info-bg: var(--accent-soft);
  --live: #d92d34;                /* the Live button while streaming */
  --on-status: #ffffff;

  /* Chart series, in order. Series 1 is the brand blue. */
  --series-1: #1d2bd8;
  --series-2: #d97706;
  --series-3: #1f7a4f;
  --series-4: #c9353b;
  --series-5: #0891b2;
  --series-6: #7c3aed;
  --series-7: #db2777;
  --series-8: #65a30d;
  --chart-window: rgba(29, 43, 216, 0.12);   /* the selected time window on a chart */
  --chart-fault: rgba(201, 53, 59, 0.08);    /* the span of a fault */
  --chart-gap: rgba(112, 112, 115, 0.16);    /* no data */
  --chart-gap-line: rgba(112, 112, 115, 0.8);

  /* Overlays */
  --scrim: rgba(10, 10, 12, 0.35);
  --scrim-strong: rgba(10, 10, 12, 0.45);
  --glass: rgba(255, 255, 255, 0.92);        /* sticky bars over content */
  --hud-bg: rgba(20, 20, 22, 0.86);          /* labels drawn over the 3D view */
  --hud-ink: #f4f4f5;
  --hud-border: rgba(255, 255, 255, 0.12);
  --hud-ok: #4cb782;
  --hud-warn: #e5b23a;
  --hud-crit: #f2777b;

  /* 3D scene */
  --scene-bg: #f1f1f3;
  --scene-floor: #e9e9eb;
  --scene-grid: #c6c6ca;
  --scene-grid-2: #dcdce0;
  --scene-label-bg: rgba(255, 255, 255, 0.92);
  --scene-label-border: rgba(15, 23, 42, 0.18);
  --scene-label-ink: #0f172a;
  --scene-label-ink-2: #334155;
  --scene-power: #dc2626;
  --scene-data: #3b82f6;
  --scene-idle: #94a3b8;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 12px 36px rgba(0, 0, 0, 0.16);
  --shadow-overlay: 0 20px 50px rgba(0, 0, 0, 0.18);
  --shadow-panel: -10px 0 30px rgba(0, 0, 0, 0.08);

  /* Type */
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --text-2xs: 10.5px;
  --text-xs: 11.5px;
  --text-sm: 12px;
  --text-md: 12.5px;
  --text-base: 13px;              /* body text in the app */
  --text-lg: 14px;
  --text-xl: 15px;                /* panel titles */
  --text-touch: 16px;             /* inputs on phones: iOS zooms in below 16 px */
  --text-2xl: 18px;
  --text-3xl: 20px;               /* page and section headings */
  --text-4xl: 28px;               /* docs page titles */

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;              /* the main canvas, popovers, modals */
  --radius-xl: 14px;              /* sheets on phones */
  --radius-full: 999px;
  --radius-canvas: var(--radius-lg);

  /* Spacing (4 px grid) and the compact layout */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --row-h: 40px;                  /* table and list rows */
  --control-h: 30px;              /* buttons, inputs, selects */
  --control-h-sm: 28px;
  --control-h-xs: 24px;
  --page-pad-y: 20px;
  --page-pad-x: 24px;
  --card-pad-y: 14px;
  --card-pad-x: 16px;
  --sidebar-w: 228px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --brand-hover: #3442ea;
  --bg: #0e0e10;
  --sidebar: #0e0e10;
  --surface: #161618;
  --surface-muted: #1f1f22;
  --surface-subtle: #1a1a1c;
  --border: #2a2a2e;
  --line: #232326;
  --border-strong: #3a3a3f;
  --ink: #ededee;
  --ink-2: #c4c4c8;
  --muted: #8e8e93;
  --icon: #8e8e93;
  --nav-hover: #1c1c1f;
  --nav-active: #222226;
  --code-bg: #1f1f22;

  --accent: #8a93ff;
  --accent-hover: #a5adf2;
  --accent-soft: rgba(29, 43, 216, 0.22);
  --accent-ink: #aab2ff;
  --on-accent: #0e0e10;
  --primary: #4f5bff;
  --primary-ink: #ffffff;

  --ok: #4cc38a;
  --ok-dot: #4cc38a;
  --ok-bg: rgba(76, 195, 138, 0.12);
  --warn: #e5b23a;
  --warn-dot: #e5b23a;
  --warn-bg: rgba(229, 178, 58, 0.12);
  --crit: #f2777b;
  --crit-dot: #f2777b;
  --crit-bg: rgba(242, 119, 123, 0.12);

  --series-1: #8a93ff;
  --series-2: #f59e0b;
  --series-3: #4cc38a;
  --series-4: #f2777b;
  --series-5: #22d3ee;
  --series-6: #a78bfa;
  --series-7: #f472b6;
  --series-8: #a3e635;
  --chart-window: rgba(138, 147, 255, 0.16);
  --chart-fault: rgba(242, 119, 123, 0.12);
  --chart-gap: rgba(142, 142, 147, 0.18);
  --chart-gap-line: rgba(142, 142, 147, 0.8);

  --glass: rgba(22, 22, 24, 0.92);
  --scene-bg: #161618;
  --scene-floor: #1f1f22;
  --scene-grid: #3a3a3f;
  --scene-grid-2: #2a2a2e;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-overlay: 0 20px 50px rgba(0, 0, 0, 0.55);
  --shadow-panel: -10px 0 30px rgba(0, 0, 0, 0.4);
}
