/* The one token file: every colour, size, weight and timing the shell, the HUD and the screens
   use. Nothing else in web/ names a colour, a font or a duration.

   Scale: 1rem is 16px on a 1080-line screen and follows the viewport's height between 720 and
   1440 lines, so a layout drawn once reads the same on every screen. All sizes are rem. The
   player's interface size (`--ui-scale`, set by the shell) multiplies it. */

@font-face { font-family: "Barlow Condensed"; font-weight: 400; font-display: block; src: url("assets/fonts/barlow-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: block; src: url("assets/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: block; src: url("assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: block; src: url("assets/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: block; src: url("assets/fonts/barlow-latin-500-normal.woff2") format("woff2"); }

:root {
  /* By the window's height, or its width when it is narrower than 16:9: a small window
     gets the whole interface smaller, never a cropped one. */
  font-size: calc(clamp(5px, min(1.4815vh, 0.8333vw), 22px) * var(--ui-scale, 1));

  /* Palette: white ink in four strengths, one accent (own, friendly, selected), one damage
     colour (hurt, hostile, overheated), and the dark glass everything sits on. */
  --ink: #f4f7fa;
  --ink-2: rgb(244 247 250 / 0.72);
  --ink-3: rgb(244 247 250 / 0.46);
  --ink-4: rgb(244 247 250 / 0.2);
  --accent: #6cc9ff;
  --accent-soft: rgb(108 201 255 / 0.22);
  --damage: #ff5947;
  --damage-soft: rgb(255 89 71 / 0.24);
  --void: #07090c;
  --glass: rgb(9 12 17 / 0.58);
  --glass-heavy: rgb(9 12 17 / 0.84);
  --glass-light: rgb(244 247 250 / 0.06);
  --scrim: rgb(5 7 10 / 0.66);
  --line: rgb(244 247 250 / 0.16);
  --line-strong: rgb(244 247 250 / 0.38);
  --blur: blur(1.25rem) saturate(1.15);
  /* What keeps ink readable over a bright sky without a box behind it: a tight dark edge
     (small red text over cloud needs the edge, not the glow), then the soft glow. */
  --halo: 0 0 0.0625rem rgb(0 0 0 / 0.95), 0 0 0.125rem rgb(0 0 0 / 0.8), 0 0 0.75rem rgb(0 0 0 / 0.45);
  --halo-filter: drop-shadow(0 0 0.0625rem rgb(0 0 0 / 0.85)) drop-shadow(0 0 0.1875rem rgb(0 0 0 / 0.5));

  /* Type: a condensed display face in capitals for everything the eye scans, a text face for
     everything it reads. Seven sizes. */
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* The three small sizes never go below what reads on a 720-line or a narrow window. */
  --t-micro: max(0.75rem, calc(11px * var(--ui-scale, 1)));
  --t-label: max(0.875rem, calc(12px * var(--ui-scale, 1)));
  --t-body: max(1rem, calc(13px * var(--ui-scale, 1)));
  --t-title: 1.375rem;
  --t-number: 2.25rem;
  --t-hero: 3.5rem;
  --t-mega: 6.5rem;
  --track: 0.14em;
  --track-wide: 0.32em;

  /* Spacing: one scale. */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  /* The margin every anchored HUD region keeps from the screen's edge. */
  --edge: 3rem;

  /* Lines and corners. */
  --hair: max(1px, 0.0625rem);
  --stroke: max(1.5px, 0.125rem);
  --radius: 0.125rem;
  --bar: 0.375rem;

  /* Motion: things arrive quickly and leave slowly. */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in: cubic-bezier(0.6, 0, 0.9, 0.4);
  --fast: 120ms;
  --normal: 240ms;
  --slow: 600ms;
  --idle-fade: 1400ms;
  --toast: 5s;
}
