/* ==========================================================================
   CHASSIS — ApexSnipe's proprietary design language
   --------------------------------------------------------------------------
   The interface is treated as one machined instrument under a single light.
   Structure is graphite; colour is reserved exclusively for data meaning.
   Everything here is a token — no component invents its own values.
   ========================================================================== */

:root {
  /* ---- substrate: warm-biased graphite, not blue-black ------------------ */
  --ink-000: #08090b;
  --ink-050: #0b0c0f;
  --ink-100: #101217;
  --ink-150: #14161c;
  --ink-200: #191c23;
  --ink-250: #1f232b;
  --ink-300: #262b34;
  --ink-400: #333944;
  --ink-500: #454d5a;
  --ink-600: #5d6675;
  --ink-700: #7d8794;
  --ink-800: #a9b2be;
  --ink-900: #dfe4ea;
  --ink-999: #f4f6f8;

  /* ---- data inks: the only saturated colour in the system --------------- */
  --sig-gain: #74e3c3;     /* ion — value increasing, healthy, live        */
  --sig-loss: #e8735c;     /* rust — value decreasing, failing             */
  --sig-warn: #d9e564;     /* sodium — attention, degraded, review needed  */
  --sig-mind: #9089ec;     /* iris — inference, model output, prediction   */
  --sig-brand: #e9a45f;    /* amber — the product's own voice, interactive */
  --sig-cool: #8fd8e8;     /* arctic — reference, neutral instrumentation  */

  --gain-dim: color-mix(in oklab, var(--sig-gain) 22%, transparent);
  --loss-dim: color-mix(in oklab, var(--sig-loss) 22%, transparent);
  --warn-dim: color-mix(in oklab, var(--sig-warn) 20%, transparent);
  --mind-dim: color-mix(in oklab, var(--sig-mind) 22%, transparent);
  --brand-dim: color-mix(in oklab, var(--sig-brand) 20%, transparent);

  /* ---- surfaces --------------------------------------------------------- */
  --plate: color-mix(in oklab, var(--ink-150) 88%, var(--sig-brand) 1.5%);
  --plate-raised: color-mix(in oklab, var(--ink-200) 90%, var(--sig-brand) 2%);
  --plate-sunken: var(--ink-100);
  --plate-line: color-mix(in oklab, var(--ink-400) 62%, transparent);
  --plate-line-bright: color-mix(in oklab, var(--ink-600) 55%, transparent);
  --kerf: color-mix(in oklab, var(--ink-000) 70%, transparent);

  /* ---- the lamp: one global light, set by the pointer -------------------- */
  --lamp-x: 50%;
  --lamp-y: 24%;
  --lamp-warmth: 0.9;
  --lamp-reach: 68vmax;
  --sheen: color-mix(in oklab, #ffffff 6%, transparent);

  /* ---- parallax bindings (written once per frame by motion.js) ---------- */
  --px: 0;         /* pointer offset from centre, -1 .. 1                   */
  --py: 0;
  --scroll: 0;     /* page scroll in px                                     */
  --tilt: 0deg;

  /* ---- geometry: chamfer is the signature silhouette -------------------- */
  --chamfer: 14px;
  --chamfer-sm: 8px;
  --chamfer-lg: 22px;
  --hair: 1px;

  /* ---- rhythm ----------------------------------------------------------- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 22px;
  --s6: 30px;
  --s7: 42px;
  --s8: 58px;
  --s9: 80px;
  --s10: 112px;

  /* ---- type ------------------------------------------------------------- */
  --font-ui: "Inter", "SF Pro Text", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "JetBrains Mono", "SF Mono", ui-monospace, "Roboto Mono",
    "DejaVu Sans Mono", Menlo, Consolas, monospace;

  --t-micro: 10px;
  --t-label: 11px;
  --t-small: 12px;
  --t-body: 13px;
  --t-base: 14px;
  --t-lead: 16px;
  --t-sub: 20px;
  --t-title: 27px;
  --t-display: clamp(34px, 4.6vw, 62px);
  --t-hero: clamp(42px, 7.4vw, 104px);

  --track-label: 0.24em;   /* instrument labelling                          */
  --track-tight: -0.028em; /* display type                                  */

  /* ---- motion: durations describe intent, not taste --------------------- */
  --m-tap: 90ms;
  --m-quick: 170ms;
  --m-move: 280ms;
  --m-settle: 480ms;
  --m-drift: 1200ms;
  --ease-out: cubic-bezier(0.16, 0.84, 0.28, 1);
  --ease-in-out: cubic-bezier(0.62, 0.02, 0.2, 1);
  --ease-spring: cubic-bezier(0.2, 1.24, 0.36, 1);

  /* ---- elevation: shadows are cast away from the lamp ------------------- */
  --lift-1: 0 1px 0 color-mix(in oklab, #fff 4%, transparent) inset,
            0 2px 10px -4px var(--ink-000);
  --lift-2: 0 18px 44px -26px var(--ink-000), 0 2px 0 var(--kerf);
  --lift-3: 0 44px 90px -50px var(--ink-000), 0 8px 26px -18px var(--ink-000);

  --z-substrate: 0;
  --z-field: 10;
  --z-motes: 20;
  --z-plate: 30;
  --z-chrome: 40;
  --z-overlay: 70;
  --z-modal: 90;
}

/* A daylight instrument variant — same language, inverted ground. Operators
   working from a lit desk switch to this from the shell. */
:root[data-chassis="day"] {
  --ink-000: #f6f6f4;
  --ink-050: #f0f0ee;
  --ink-100: #e9e9e6;
  --ink-150: #e2e2de;
  --ink-200: #d8d9d4;
  --ink-250: #cbccc7;
  --ink-300: #b9bab4;
  --ink-400: #9c9e98;
  --ink-500: #7d807a;
  --ink-600: #5f635e;
  --ink-700: #474b47;
  --ink-800: #2e3230;
  --ink-900: #171a19;
  --ink-999: #0a0c0b;
  --sig-gain: #10876a;
  --sig-loss: #b8402a;
  --sig-warn: #8a7a10;
  --sig-mind: #514ab0;
  --sig-brand: #a25f14;
  --sig-cool: #2c6f80;
  --plate: color-mix(in oklab, #ffffff 70%, var(--ink-100));
  --plate-raised: #ffffff;
  --plate-sunken: var(--ink-100);
  --plate-line: color-mix(in oklab, var(--ink-400) 48%, transparent);
  --plate-line-bright: color-mix(in oklab, var(--ink-500) 40%, transparent);
  --kerf: color-mix(in oklab, var(--ink-300) 60%, transparent);
  --sheen: color-mix(in oklab, #ffffff 55%, transparent);
  --lift-2: 0 18px 40px -30px rgba(20, 22, 20, 0.5), 0 1px 0 var(--kerf);
  --lift-3: 0 40px 80px -52px rgba(20, 22, 20, 0.55);
}
