/* Timevault design tokens. The ONLY file that may contain colours.
   One look everywhere: the time-ship HUD of the 3D viewer (dark glass panels, cyan holo lines, amber = active),
   in both OS themes. The portal tokens below map onto the --hud-* palette further down. */
:root, [data-theme="light"], [data-theme="dark"] {
  /* colour (portal) */
  --bg: #04061a;
  --surface: #0c164a;
  --text: #eaf4ff;
  --muted: #96a9de;
  --accent: #ffa62b;
  --border: rgba(68, 114, 245, 0.42);
  --track: rgba(56, 98, 240, 0.2);
  --ok: #45e0d4;
  --warn: #ffa62b;
  --idle: #7d8cc4;
  /* full-screen viewer: dark in both themes */
  --scrim: #02030d;
  --scrim-text: #eaf4ff;
  --scrim-muted: #96a9de;
  --scrim-btn: #0c164a;
  color-scheme: dark;

  /* fonts */
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* type scale (5 steps) */
  --fs-1: 0.75rem;
  --fs-2: 0.875rem;
  --fs-3: 1rem;
  --fs-4: 1.125rem;
  --fs-5: clamp(1.35rem, 4.6vw, 2.25rem);
  --fw-regular: 400;
  --fw-strong: 600;
  --lh-body: 1.55;
  --tracking-tight: -0.02em;
  --tracking-caps: 0.08em;

  /* spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* shape and sizes */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-pill: 999px;
  --shadow: none;
  --wrap: 1120px;
  --card-min: 300px;
  --stat-min: 180px;
  --log-time-w: 17rem;
  --track-h: 8px;
  --dot: 8px;
  --focus-w: 2px;
  --lift: -2px;
  --dur: 0.15s;
  --boot-step: 0.07s;
}

/* 3D viewer (/<id>/viewer/): its own dark "bridge console" look in both themes.
   Navy glass panels, cyan/teal holo lines, amber for active state and warnings.
   The --hud-3d-* values are read by viewer.js for the three.js scene (canvas, edges, cut faces). */
:root, [data-theme="light"], [data-theme="dark"] {
  --hud-bg: #04061a;
  --hud-bg-2: #0e1650;
  --hud-panel: rgba(12, 22, 80, 0.62);
  --hud-panel-solid: #0c164a;
  --hud-panel-hi: rgba(56, 98, 240, 0.28);
  --hud-line: rgba(68, 114, 245, 0.66);
  --hud-line-hi: rgba(124, 212, 252, 0.95);
  --hud-grid: rgba(84, 122, 245, 0.07);
  --hud-scan: rgba(0, 0, 0, 0.18);
  --hud-cyan: #46ebfa;
  --hud-blue: #3763f0;
  --hud-teal: #45e0d4;
  --hud-amber: #ffa62b;
  --hud-amber-dim: rgba(255, 166, 43, 0.18);
  --hud-red: #f8335a;
  --hud-text: #eaf4ff;
  --hud-muted: #96a9de;
  --hud-dim: #5363a5;
  --hud-glow: 0 0 0.85rem rgba(70, 235, 250, 0.5);
  --hud-glow-blue: 0 0 1.15rem rgba(55, 99, 240, 0.45);
  --hud-inner: inset 0 0 1.5rem rgba(55, 99, 240, 0.24);
  --hud-glow-amber: 0 0 0.9rem rgba(255, 166, 43, 0.55);
  --hud-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.45);
  --hud-display: "Michroma", "JetBrains Mono", ui-monospace, monospace;
  --hud-bw: 2px;
  --hud-bracket: 10px;
  --hud-bar-h: 52px;
  --hud-tool: 40px;
  --hud-side: 17rem;
  --hud-props: 18rem;
  --hud-sheet-peek: 56px;
  --hud-blur: 10px;
  --hud-3d-bg: #070c2a;
  --hud-3d-bg-2: #142058;
  --hud-3d-edge: #070a1f;
  --hud-3d-edge-hl: #8be6ff;
  --hud-3d-wire: #5ce1ee;
  --hud-3d-fill-hl: #111936;
  --hud-3d-xray: #5ce1ee;
  --hud-3d-select: #ffa62b;
  --hud-3d-measure: #ffa62b;
  --hud-3d-cube: #16245e;
  --hud-3d-cube-text: #bfeeff;
  --hud-3d-x: #ec3d5c;
  --hud-3d-y: #6be38a;
  --hud-3d-z: #5f86e0;
  --hud-3d-neutral: #8a96a3;
}

/* 3D viewer model backgrounds (picker in the toolbar, data-bg on <html>). Each sets the canvas gradient and the
   colours that must contrast with it: hidden-line fill = the background, wire / x-ray / hidden-line edges. */
:root {
  --hud-3d-cube-line: #5ce1ee;
  --hud-sw-graphite: #2a2c31;
  --hud-sw-slate: #142058;
  --hud-sw-studio: #8a8f96;
  --hud-sw-light: #eef0f2;
}
:root[data-bg="graphite"] {
  --hud-3d-bg: #16171a; --hud-3d-bg-2: #2e3036; --hud-3d-fill-hl: #1d1e22;
  --hud-3d-wire: #7fd8e6; --hud-3d-xray: #7fd8e6; --hud-3d-edge-hl: #c8e9f2;
}
:root[data-bg="studio"] {
  --hud-3d-bg: #5b6067; --hud-3d-bg-2: #959aa1; --hud-3d-fill-hl: #767b82;
  --hud-3d-wire: #f2fbff; --hud-3d-xray: #f2fbff; --hud-3d-edge-hl: #10141a;
}
:root[data-bg="light"] {
  --hud-3d-bg: #c4c9d0; --hud-3d-bg-2: #f4f5f7; --hud-3d-fill-hl: #eef0f2;
  --hud-3d-wire: #1c5fa8; --hud-3d-xray: #1c5fa8; --hud-3d-edge-hl: #141a24;
}

/* 3D viewer "Print" look: filament / hardware colours for page.json parts[].look and parts[].accent.look */
:root {
  --hud-mat-pla-white: #f1efe9;
  --hud-mat-pla-grey: #8d9197;
  --hud-mat-pla-black: #1d1e21;
  --hud-mat-pla-blue: #2a5bd7;
  --hud-mat-pla-red: #c8322c;
  --hud-mat-pla-orange: #e8752a;
  --hud-mat-pla-yellow: #f2c230;
  --hud-mat-pla-green: #2f9a4b;
  --hud-mat-petg-clear: #d9eef2;
  --hud-mat-tpu-black: #232427;
  --hud-mat-steel: #b9bec5;
  --hud-mat-brass: #c9a24f;
  --hud-mat-aluminium: #d0d4d8;
  --hud-3d-rim: #7fe9ff;
  --hud-3d-floor: #46ebfa;
}
:root {
  --hud-3d-pad: rgba(120, 190, 230, 0.26);
  --hud-3d-pad-mid: rgba(90, 160, 220, 0.1);
  --hud-3d-pad-edge: rgba(70, 130, 210, 0);
}
