/* Zonor design tokens. Dark only. v3 (Stripes) block first, v5 additions at the end of :root (Zonor/tech/v5-contract.md §3.1).
   v1 colour means heart-rate zone (Z1..Z5). v5 adds aura/energy colours for the coach only, glass for sheets only. */
:root {
  color-scheme: dark;

  /* Neutrals */
  --ground: #090c11;
  --surface-1: #11151b;
  --surface-2: #181d24;
  --surface-3: #222830;
  --line: #262c34;
  --edge: #6b7480;
  --line-strong: var(--edge);
  /* Control borders (WCAG 1.4.11): the canvas value #5a626d is 2.97:1 on surface-1, nudged to 3.11:1. */
  --line-ctl: #5d6571;
  --text: #f2f5f9;
  --text-2: #c2c8cf;
  --muted: #9099a5;
  --ink: #090c11;
  --scrim: rgb(5 7 10 / 0.62);

  /* Primary action: off-white with ink text */
  --primary: #f2f5f9;
  --primary-hover: #ffffff;
  --primary-pressed: #d9dee5;

  /* Zones: the data palette, always Z1 -> Z5 */
  --z1: #9ca5b1;
  --z2: #53a0ff;
  --z3: #43d066;
  --z4: #fa8838;
  --z5: #f84c45;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-cloud: 20px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Spacing, 4px grid */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-xxl: 32px;
  --hit: 44px;
  --control: 48px;

  /* Motion: transform and opacity only, ease-out, no spring */
  --dur-press: 100ms;
  --dur-fast: 160ms;
  --dur-sheet: 240ms;
  --dur-sheet-out: 180ms;
  --dur-reveal: 360ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* Layout */
  --column-max: 440px;
  --tabbar-h: calc(65px + env(safe-area-inset-bottom));
  --actionbar-h: 60px;

  /* Type (families come from next/font, see src/ui/fonts.ts). Manrope only; mono for numeric tables only. */
  --font-ui: var(--font-manrope), system-ui, sans-serif;
  --font-meta: var(--font-ui);
  --type-display: 800 56px/56px var(--font-ui);
  --type-h1: 800 28px/32px var(--font-ui);
  --type-h2: 700 20px/26px var(--font-ui);
  --type-title: 600 17px/24px var(--font-ui);
  --type-body: 400 15px/22px var(--font-ui);
  --type-body-sm: 400 13px/18px var(--font-ui);
  --type-label: 600 13px/18px var(--font-ui);
  --type-caption: 500 12px/16px var(--font-ui);
  --type-num-lg: 800 32px/36px var(--font-ui);
  --type-num-md: 700 17px/24px var(--font-ui);
  --type-display-s: 800 34px/40px var(--font-ui);
  --type-h3: 800 24px/28px var(--font-ui);

  /* v5 (Zonor/tech/v5-contract.md §3.1). Glass is for bottom sheets only (V5-D16); opacity floor 0.94 (V5-D2). */
  --glass-edge: rgb(242 245 249 / 0.14);
  --glass-sheet: rgb(24 29 36 / 0.94);
  /* Aura and energy word only, never on body data. */
  --energy-charged: #7cefc0;
  --energy-steady: #f2e27a;
  --energy-easy: #c3a6ff;
  --aura-spark: #7cefc0;
  --aura-breeze: #c3a6ff;
  --aura-beat: #f2e27a;
  --aura-flow: #f2a7c3;
  /* Destructive actions only (V5-D22). */
  --danger: #ff8a80;
  --danger-bg: #3a1f22;
  --danger-line: #5a2a2c;
  --warm: #f2b26b;
  --nav-h: 64px;
  --nav-bottom: max(20px, env(safe-area-inset-bottom));
  --foot-h: calc(60px + max(12px, env(safe-area-inset-bottom)));
  /* v5 only (guards.test: --spring and @keyframes live under src/ui/v5). */
  --spring: linear(0, 0.101, 0.319, 0.561, 0.771, 0.926, 1.023, 1.071, 1.084, 1.075, 1.057, 1.037, 1.019, 1.006, 0.998, 0.994, 0.993, 0.994, 0.995, 0.997, 1);
}

/* Readiness band -> zone colour: high = Z3, moderate = Z4, low = Z5, no data = Z1. */
[data-readiness] { --rd: var(--z1); }
[data-readiness='high'] { --rd: var(--z3); }
[data-readiness='moderate'] { --rd: var(--z4); }
[data-readiness='low'] { --rd: var(--z5); }

/* Zone -> colour variable, consumed by chips and stripes. */
[data-zone='Z1'] { --zone: var(--z1); }
[data-zone='Z2'] { --zone: var(--z2); }
[data-zone='Z3'] { --zone: var(--z3); }
[data-zone='Z4'] { --zone: var(--z4); }
[data-zone='Z5'] { --zone: var(--z5); }
