/* Design tokens: the ONE place colours, fonts, blur, radii, opacities and spacing are defined.
   CSS uses them as var(--…). JavaScript reads the same values at runtime:
   - 3D scene + post-processing: web/style/tokens.js  (token('accent'), tokenColor('lift'), …)
   - page canvases (minimap, charts) in index.html: the TK() helper
   Look: near-black base, soft blurred grey-blue light blobs, monochrome greys,
   ONE warm red accent used only for braking zones and live alerts. */

@font-face { font-family: 'Departure Mono'; src: url('../assets/fonts/DepartureMono-Regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../assets/fonts/Inter-latin-wght.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* ---- base + greys ---- */
  --bg:          #0b0c0e;
  --bg-2:        #111317;
  --blob-1:      #5c6b80;     /* out-of-focus light blobs behind the page */
  --blob-2:      #2b3340;
  --blob-3:      #8a96a8;
  --ink:         #f2f3f5;     /* primary text, active items */
  --ink-2:       #b7bcc5;     /* secondary values */
  --mut:         #7c838f;     /* labels */
  --grey-1:      #d9dce1;
  --grey-2:      #9aa1ab;
  --grey-3:      #5d636d;
  --grey-4:      #2c3038;

  /* ---- the one accent ---- */
  --accent:      #e5352b;     /* braking zones + live alerts ONLY */
  --accent-glow: rgba(229, 53, 43, 0.55);
  --accent-soft: rgba(229, 53, 43, 0.18);

  /* ---- semantic (all greyscale except the accent) ---- */
  --lift:        #eef1f5;     /* lift-and-coast zones on track */
  --lift-alpha:  0.7;
  --brake:       var(--accent);
  --ghost:       #aeb6c2;     /* ghost car body */
  --ghost-rim:   #e6ebf2;     /* ghost fresnel edge */
  --ghost-alpha: 0.28;
  --marker:      #ffffff;     /* live car dot on the minimap */
  --marker-halo: rgba(255, 255, 255, 0.6);
  --text-shadow: rgba(0, 0, 0, 0.5);   /* keeps light type legible over the bright 3D view */
  --caution:     #ffffff;     /* "watch this" values: bright white, bold */
  --ok:          #8c939d;     /* calm status lamps */
  --car-tones:   #ffffff, #8f97a3, #5f6670, #c4c9d0;   /* per-car line/dot tones, active (last) car first */

  /* ---- surfaces ---- */
  --glass:        rgba(255, 255, 255, 0.04);
  --glass-card:   rgba(255, 255, 255, 0.045);   /* page cards: no backdrop blur (the 3D card re-blurred every frame) */
  --glass-strong: rgba(14, 16, 20, 0.55);   /* panels over the bright 3D view need a darker base to stay legible */
  --glass-blur:   18px;
  --glass-map:    rgba(11, 12, 14, 0.74);   /* minimap: opaque enough that 3D props never read through it */
  --hairline:     rgba(255, 255, 255, 0.12);
  --hairline-2:   rgba(255, 255, 255, 0.06);
  --dim:          0.32;       /* inactive tabs / items */
  --radius:       10px;
  --radius-sm:    8px;
  --radius-pill:  999px;

  /* ---- type ---- */
  --font-display: 'Departure Mono', ui-monospace, 'SF Mono', Menlo, monospace;   /* headings + every number */
  --font-ui:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;       /* small uppercase labels */
  --label-size:   10px;
  --label-track:  0.16em;
  --num-size:     22px;

  /* ---- spacing ---- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;

  /* ---- 3D scene grading (read by web/style/tokens.js) ---- */
  --sky-zenith:   #2f3844;
  --sky-horizon:  #66707c;
  --fog:          #3d444d;    /* dark blue-grey the horizon melts into */
  --fog-near:     70;
  --fog-far:      520;
  --sun:          #dfe6ee;
  --hemi-sky:     #8e9aab;
  --hemi-ground:  #3a3f45;
  --scene-sat:    0.28;       /* how much colour survives the scene grade (0 = greyscale) */
  --car-sat:      0.85;       /* the car keeps most of its own colour */
  --brake-glow:   12;         /* HDR boost on the RED channel only: blooms, and stays red (not orange) under ACES */        /* emissive multiplier so braking zones are the brightest thing in frame */
  --grain:        0.03;

  /* ---- 3D materials (base colours; the GRADE_SAT shader define then pulls most of them toward grey) ---- */
  --neutral:        #ffffff;   /* untinted multiplier for textured / instance-coloured materials */
  --shadow-ink:     0, 0, 0;   /* rgb for soft contact-shadow gradients */
  --m-paddock:      #9c9a95;
  --m-grass:        #5f7a4c;
  --m-grass-dry:    #7d846a;
  --m-grass-tip:    #87957a;
  --m-grass-root:   #303b2a;
  --m-line:         #f4f4f0;
  --m-kerb-a:       #7a7f86;   /* kerbs are white/grey: red is reserved for braking + alerts */
  --m-kerb-b:       #cfcfcb;
  --m-rubber:       #000000;
  --m-cone-left:    #1f5fff;   /* FS rule colours, kept (desaturated) so left/right stays readable */
  --m-cone-right:   #ffd21f;
  --m-cone-start:   #b8b8b8;   /* start cones were orange: now neutral */
  --m-cone-band:    #f6f6f6;
  --m-cone-foot:    #202226;
  --m-steel:        #c3c8cf;
  --m-concrete:     #7f7e7a;
  --m-stand:        #8e8c88;
  --m-asphalt-dark: #3a3c40;
  --m-glass:        #24313f;
  --m-pylon:        #9a9a9a;
  --m-tent:         #c4c4c1;
  --m-fence:        #8d949c;
  --m-tower:        #1a1d22;
  --m-gantry:       #c9ccd2;
  --m-trunk:        #4a4038;
  --m-leaf:         #3c4a3a, #45543f, #505e48, #374236;
  --m-teams:        #e9e9e6, #9aa1ab, #5d636d, #c9ccd2, #7c838f, #3a3f47;   /* tents / rail banners: greys */
  --m-placeholder:  #4a4f57;   /* box shown until the EV1 model loads */
  --sat-scene:      0.28;
  --sat-cones:      0.6;
}
