/* ==========================================================
   Trackio design tokens for the website.
   Colours, type, radii and the app's spacing come from the app's
   own tokens (BRAND.md: design/tokens.ts in the trackio repository).
   The scale shapes (fixed and fluid steps, -rgb triplets) follow
   CONVENTIONS.md, "Styles".

   Every stylesheet takes its values from here (tools/check-css.mjs).
   Strengths allowed in rgb(var(--x-rgb) / n):
   0 .03 .05 .08 .1 .12 .16 .2 .25, then every .05 up to .95
   Breakpoints: 1240 desktop, 1100 narrow desktop, 960 tablet,
   760 large phone, 560 phone, 420 small phone
   ========================================================== */
@font-face { font-family: "Lexend"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/Lexend_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Lexend"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/Lexend_500Medium.ttf") format("truetype"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/Lexend_600SemiBold.ttf") format("truetype"); }

:root {
  color-scheme: light dark;

  /* ---- Colour (light) ---- */
  --ground: #F1F2F4;        --ground-rgb: 241 242 244;   /* page background */
  --surface: #FFFFFF;       --surface-rgb: 255 255 255;  /* cards, bands */
  --fill: #E6E8EC;          --fill-rgb: 230 232 236;     /* tracks, secondary buttons, the athlete's chat bubble */
  --line: #E3E5E9;          --line-rgb: 227 229 233;     /* dividers */
  --mid: #A9AEB8;           --mid-rgb: 169 174 184;      /* planned markers, outlines */
  --muted: #5E636E;         --muted-rgb: 94 99 110;      /* labels, secondary text */
  --ink: #15171C;           --ink-rgb: 21 23 28;         /* text, icons, selected states */
  --on-ink: #FFFFFF;        --on-ink-rgb: 255 255 255;   /* text on an ink-filled control */
  --blue: #2F6BEA;          --blue-rgb: 47 107 234;      /* the main action, on target, one chart line */
  --on-blue: #FFFFFF;       --on-blue-rgb: 255 255 255;
  --tint: #EDF2FD;          --tint-rgb: 237 242 253;     /* the coach's bands */
  --tint-track: #D3DCF0;    --tint-track-rgb: 211 220 240;
  --amber: #D9A441;         --amber-rgb: 217 164 65;     /* slightly off */
  --amber-text: #8A6116;    --amber-text-rgb: 138 97 22;
  --amber-tint: #FBF3DF;    --amber-tint-rgb: 251 243 223;
  --red: #C2524A;           --red-rgb: 194 82 74;        /* far off, missed */
  --red-text: #A63D36;      --red-text-rgb: 166 61 54;
  --plum: #9B6BB3;          --plum-rgb: 155 107 179;     /* fatigue and heart rate in charts */
  --slate: #7C8594;         --slate-rgb: 124 133 148;    /* form in charts */
  --shadow-rgb: 21 23 28;                                /* the colour shadows are mixed from */
  --device: #15171C;        --device-rgb: 21 23 28;      /* the drawn phone's body, the same in light and dark */
  --device-edge: #3A3E47;   --device-edge-rgb: 58 62 71;

  /* Glass: only for controls that float over content */
  --glass-fill: rgb(255 255 255 / .62);
  --glass-border: rgb(255 255 255 / .95);
  --glass-shadow: 0 8px 24px rgb(21 23 28 / .12);
  --glass-filter: blur(20px) saturate(1.6);

  /* ---- Type ---- */
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-10: 10px; --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 15px; --fs-16: 16px; --fs-17: 17px; --fs-18: 18px;
  --fs-20: 20px; --fs-22: 22px; --fs-24: 24px; --fs-26: 26px; --fs-28: 28px; --fs-30: 30px; --fs-32: 32px; --fs-40: 40px; --fs-48: 48px; --fs-64: 64px;
  --fs-display: clamp(40px, 5.4vw, 76px);   /* the hero heading */
  --fs-title: clamp(36px, 4.4vw, 60px);     /* a feature page's hero heading */
  --fs-h2: clamp(30px, 3.6vw, 46px);
  --fs-h3: clamp(22px, 2.2vw, 28px);
  --fs-h4: clamp(18px, 1.6vw, 20px);
  --fs-lede: clamp(17px, 1.4vw, 20px);
  --fs-figure: clamp(40px, 4.6vw, 60px);
  --track-tight: -0.03em;   /* headings */
  --track-snug: -0.02em;    /* small headings */
  --track-label: 0.08em;    /* capital labels */

  /* ---- Space ---- */
  --space-2: 2px; --space-4: 4px; --space-6: 6px; --space-8: 8px; --space-10: 10px; --space-12: 12px; --space-14: 14px; --space-16: 16px;
  --space-18: 18px; --space-20: 20px; --space-22: 22px; --space-24: 24px; --space-28: 28px; --space-32: 32px; --space-36: 36px; --space-40: 40px;
  --space-48: 48px; --space-56: 56px; --space-64: 64px; --space-72: 72px; --space-80: 80px; --space-96: 96px; --space-112: 112px; --space-128: 128px;
  --space-fluid-1: clamp(16px, 2.4vw, 32px);
  --space-fluid-2: clamp(20px, 3vw, 40px);
  --space-fluid-3: clamp(28px, 4vw, 56px);
  --space-fluid-4: clamp(40px, 5vw, 64px);
  --space-fluid-5: clamp(56px, 7vw, 96px);
  --space-fluid-6: clamp(72px, 10vw, 128px);   /* section padding */

  /* ---- Radii (the app's: card 22, sheet 28, button 14, tile 10) ---- */
  --radius-4: 4px; --radius-6: 6px; --radius-8: 8px; --radius-10: 10px; --radius-14: 14px; --radius-18: 18px; --radius-22: 22px; --radius-28: 28px; --radius-36: 36px;
  --radius-tile: var(--radius-10);
  --radius-button: var(--radius-14);
  --radius-card: var(--radius-22);
  --radius-sheet: var(--radius-28);
  --radius-pill: 999px;
  --radius-round: 50%;

  /* ---- Layout ---- */
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --touch: 44px;            /* the smallest tappable control */
  --ease: cubic-bezier(.2, .7, .1, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0E0F12;        --ground-rgb: 14 15 18;
    --surface: #1A1C20;       --surface-rgb: 26 28 32;
    --fill: #2B2E35;          --fill-rgb: 43 46 53;
    --line: #2A2D33;          --line-rgb: 42 45 51;
    --mid: #6B717C;           --mid-rgb: 107 113 124;
    --muted: #A0A6B1;         --muted-rgb: 160 166 177;
    --ink: #F2F3F5;           --ink-rgb: 242 243 245;
    --on-ink: #0E0F12;        --on-ink-rgb: 14 15 18;
    --tint: #172238;          --tint-rgb: 23 34 56;
    --tint-track: #2B3855;    --tint-track-rgb: 43 56 85;
    --amber-text: #E3B861;    --amber-text-rgb: 227 184 97;
    --amber-tint: #2E2716;    --amber-tint-rgb: 46 39 22;
    --red-text: #E58078;      --red-text-rgb: 229 128 120;
    --plum: #B58FD0;          --plum-rgb: 181 143 208;
    --slate: #8E96A4;         --slate-rgb: 142 150 164;
    --shadow-rgb: 0 0 0;
    --device: #2B2E35;        --device-rgb: 43 46 53;
    --device-edge: #4A4F5A;   --device-edge-rgb: 74 79 90;
    --glass-fill: rgb(44 47 54 / .62);
    --glass-border: rgb(255 255 255 / .14);
    --glass-shadow: 0 8px 24px rgb(0 0 0 / .5);
  }
}
