/* Gym design tokens v1: Ultrahuman look, Inter only.
   Thu 26 Nov 2026, Maverick. Source: the Ultrahuman iOS app on Mobbin (home, sleep, recovery,
   movement and workout screens). Colours are read from screenshots, so each hex is LIKELY, not CERTAIN.
   Every text colour below is checked at 4.5:1 or more on every surface it is meant for (see review/FIT-M0-design.md).

   How to use: link this file, put class="gym" on <body> (or copy :root into your app), then build with the
   custom properties. The component classes at the bottom (.gym-card, .gym-btn, ...) are reference
   implementations for the mockup; the real build may re-express them as React components. Dark only. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  color-scheme: dark;

  /* ================= The names the app reads (contract with Donna's build, 11:50). Keep every name. ================= */
  --bg: #000000;                         /* pure black page, as Ultrahuman */
  --surface: #121214;                    /* card */
  --surface2: #1C1C1F;                   /* tile inside a card, input, stepper, secondary button */
  --line: rgba(255, 255, 255, 0.10);     /* card hairline */
  --line2: rgba(255, 255, 255, 0.18);    /* stronger hairline: inputs, outline buttons */
  --fg: #FFFFFF;                         /* primary text, numerals                     17.0:1 on --surface2 */
  --muted: #B4B4BA;                      /* secondary text, body copy                   8.2:1 */
  --dim: #9A9AA1;                        /* captions, units, axis labels: the floor     6.1:1 (5.1:1 on --surface-3, 4.8:1 at worst on a glow peak: the sleep teal) */
  --cream: #FFFFFF;                      /* primary button fill: Ultrahuman's white pill (name kept from the Open look) */
  --ink: #000000;                        /* text on the primary button                  21:1 */
  --done: #3DDC84;                       /* ticked set, optimal, PR                     9.5:1 on --surface2 */
  --warn: #F5C04A;                       /* "good, could be better", moderate          10.1:1 */
  --low: #FF6B5E;                        /* out of range, destructive                   6.1:1 */
  /* Four workout hues, one per template: accent and glow. The -deep values are glow peaks (--dim stays 4.5:1+ on them). */
  --ember: #F5B53D;  --ember-deep: #3A2404;   /* Upper A: amber, Ultrahuman's workout timer colour */
  --slate: #6FA8FF;  --slate-deep: #0E2142;   /* Lower A: blue, Ultrahuman's heart zone 1 */
  --plum: #F07FA8;   --plum-deep: #3A0F22;    /* Upper B: rose */
  --moss: #A6D96A;   --moss-deep: #1D2E0E;    /* Lower B: green */
  --font: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r-s: 8px;                            /* chips, bars */
  --r-m: 12px;                           /* tiles, inputs, steppers, set rows */
  --r-l: 18px;                           /* cards and sheets (Ultrahuman is about 18 to 20) */

  /* ================= Additions (new names; the mockup uses these, the build may adopt them) ================= */
  --surface-2: var(--surface2);
  --surface-3: #2A2A2E;                  /* selected segment, pressed state */
  --line-2: var(--line2);
  --scrim: rgba(0, 0, 0, 0.64);          /* behind sheets */
  --fg-2: var(--muted);
  --fg-3: var(--dim);
  --on-light: var(--ink);

  /* ---------- Status (chips, contributor bars, the score numeral) ---------- */
  --optimal: var(--done);   --optimal-bg: rgba(61, 220, 132, 0.16);
  --good: var(--warn);      --good-bg: rgba(245, 192, 74, 0.16);
  --attention: var(--low);  --attention-bg: rgba(255, 107, 94, 0.16);

  /* ---------- Metric hues: each area of the app owns one, used for its glow and its accents.
     The -deep values are the glow peaks, kept dark enough that --fg-3 captions stay at 4.5:1 on them. ---------- */
  --hue-sleep: #5EE6D0;     --hue-sleep-deep: #0B3436;      /* teal, as Ultrahuman's Sleep Index */
  --hue-recovery: #3DDC84;  --hue-recovery-deep: #0A2E1B;   /* green, as Dynamic Recovery */
  --hue-move: #9BE15D;      --hue-move-deep: #1B2D0C;       /* lime, steps and movement */
  --hue-strength: var(--ember); --hue-strength-deep: var(--ember-deep); /* default workout hue; each template uses its own (above) */
  --hue-heart: #FF3B7F;                                      /* heart rate lines (Garmin activity link, M2) */

  /* Sleep stages, light to deep */
  --stage-awake: #FFFFFF;
  --stage-rem: #5EE6D0;
  --stage-light: #2FA39A;
  --stage-deep: #145E5A;

  /* ---------- Type: Inter only, never mono (--font is in the contract block) ---------- */
  --fw-light: 300; --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;

  /* size / line height pairs */
  --t-score: 64px;     --lh-score: 1;       /* the one big numeral on a metric card (84, 87) */
  --t-timer: 96px;     --lh-timer: 1;       /* rest and walk timers, light weight */
  --t-title: 30px;     --lh-title: 1.15;    /* screen title, sentence case, semibold */
  --t-section: 20px;   --lh-section: 1.25;  /* "Timeline", "Contributors" */
  --t-card: 17px;      --lh-card: 1.3;      /* card titles, list rows */
  --t-body: 15px;      --lh-body: 1.45;
  --t-small: 13px;     --lh-small: 1.4;     /* captions, "Last time" */
  --t-label: 11px;     --lh-label: 1.2;     /* tag pills and tab labels: UPPERCASE, semibold, tracked. The floor */
  --track-label: 0.08em;
  --track-tight: -0.02em;                   /* titles and numerals */

  /* ---------- Space: 4 px steps ---------- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --gutter: 16px;           /* page side margin, at 375 and 393 wide */
  --card-pad: 16px;
  --stack: 12px;            /* gap between cards */

  /* ---------- Radius (--r-s, --r-m, --r-l are in the contract block) ---------- */
  --r-sm: var(--r-s); --r-md: var(--r-m); --r-lg: var(--r-l);
  --r-pill: 999px;          /* buttons, tag pills, segmented control */

  /* ---------- Targets ---------- */
  --tap: 44px;              /* every control, minimum */
  --tap-set: 56px;          /* set row steppers and tick, primary buttons */

  /* ---------- Glow: the coloured wash at the top of a metric card or detail screen ---------- */
  --glow-sleep: radial-gradient(120% 90% at 50% 0%, var(--hue-sleep-deep) 0%, transparent 70%);
  --glow-recovery: radial-gradient(120% 90% at 50% 0%, var(--hue-recovery-deep) 0%, transparent 70%);
  --glow-move: radial-gradient(120% 90% at 50% 0%, var(--hue-move-deep) 0%, transparent 70%);
  --glow-strength: radial-gradient(120% 90% at 50% 0%, var(--hue-strength-deep) 0%, transparent 70%);

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms; --dur: 220ms;
}

/* ================= Reference components ================= */

.gym { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--t-body);
  line-height: var(--lh-body); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }

/* Card: dark surface, hairline, optional glow by metric (add .glow-sleep etc.) */
.gym-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--card-pad); }
.gym-card.glow-sleep { background: var(--glow-sleep), var(--surface); }
.gym-card.glow-recovery { background: var(--glow-recovery), var(--surface); }
.gym-card.glow-move { background: var(--glow-move), var(--surface); }
.gym-card.glow-strength { background: var(--glow-strength), var(--surface); }
/* A workout card takes its template's hue: style="--wk: var(--slate); --wk-deep: var(--slate-deep)" */
.gym-card.glow-workout { background: radial-gradient(120% 90% at 50% 0%, var(--wk-deep, var(--ember-deep)) 0%, transparent 70%), var(--surface); }
.gym-tile { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-3); }

/* Tag pill in a card's top left corner ("SLEEP", "RECOVERY") */
.gym-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.08); color: var(--fg);
  font-size: var(--t-label); font-weight: var(--fw-semibold); letter-spacing: var(--track-label); text-transform: uppercase; }

/* Status chip at the end of a contributor row */
.gym-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: var(--fw-medium); }
.gym-chip.optimal { background: var(--optimal-bg); color: var(--optimal); }
.gym-chip.good { background: var(--good-bg); color: var(--good); }
.gym-chip.attention { background: var(--attention-bg); color: var(--attention); }

/* Buttons: one white primary per screen; dark secondary; red-tinted destructive */
.gym-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap-set);
  padding: 0 var(--s-6); border-radius: var(--r-pill); font: inherit; font-weight: var(--fw-semibold);
  border: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gym-btn.primary { background: var(--fg); color: var(--on-light); }
.gym-btn.secondary { background: var(--surface-2); color: var(--fg); }
.gym-btn.outline { background: transparent; color: var(--fg); border: 1px solid var(--line-2); }
.gym-btn.danger { background: var(--attention-bg); color: var(--attention); }
.gym-btn.small { min-height: var(--tap); padding: 0 var(--s-4); }
.gym-btn:active { transform: scale(0.98); }

/* Segmented control (Daily / Weekly / Monthly) */
.gym-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px;
  background: var(--surface-2); border-radius: var(--r-pill); }
.gym-seg button { font: inherit; background: transparent; border: 0; cursor: pointer; touch-action: manipulation; min-height: var(--tap); border-radius: var(--r-pill); color: var(--fg-3); font-weight: var(--fw-medium); }
.gym-seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--fg); }

/* Contributor row: label, chip, thin bar under it */
.gym-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.gym-bar > i { display: block; height: 100%; background: var(--fg); border-radius: 2px; }

/* Type helpers */
.gym-title { font-size: var(--t-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); letter-spacing: var(--track-tight); }
.gym-section { font-size: var(--t-section); line-height: var(--lh-section); font-weight: var(--fw-semibold); }
.gym-score { font-size: var(--t-score); line-height: var(--lh-score); font-weight: var(--fw-medium); letter-spacing: var(--track-tight); }
.gym-label { font-size: var(--t-label); font-weight: var(--fw-semibold); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--fg-3); }
.gym-caption { font-size: var(--t-small); color: var(--fg-3); }
