/* shared/tokens.css — Chalk Line design tokens (OPS-101).
 *
 * One palette, type scale and shape system for athlete, coach and public
 * pages. Approved by Steve 2026-10-22; see the polish plan linked on OPS-101.
 *
 * Every token is namespaced --pt-* so linking this file changes nothing on its
 * own. Pages adopt it screen by screen (P1 athlete, P3 coach) by mapping their
 * local names (--bg, --tc-bg, …) onto these, then deleting their literals.
 *
 * Dark mode follows the OS unless the root carries data-pt-theme="light" or
 * "dark" (the Appearance setting in P1 sets it).
 */

/* Fonts are self-hosted (SIL OFL 1.1, see shared/fonts/LICENSE.md) so the
   native app never waits on Google Fonts. Latin subset only. */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('/shared/fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('/shared/fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('/shared/fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('/shared/fonts/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/shared/fonts/barlow-condensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/shared/fonts/barlow-condensed-700.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/shared/fonts/ibm-plex-mono-500.woff2') format('woff2'); }

:root {
  /* Color: chalk, paper, ink; forest is the brand and primary action; signal
     is the one orange element per screen (main CTA on Today, PR markers). */
  --pt-bg: #F2F3F0;
  --pt-surface: #FFFFFF;
  --pt-sunken: #E6E8E3;
  --pt-ink: #141614;
  --pt-muted: #565B55;          /* 6.2:1 on --pt-bg */
  --pt-line: #D3D7D0;
  --pt-line-strong: #B9BEB6;
  --pt-forest: #0E5A36;
  --pt-forest-hover: #0B4A2C;
  --pt-forest-tint: #E1ECE4;
  --pt-on-forest: #FFFFFF;
  --pt-signal: #C9481A;         /* 4.75:1 with white text */
  --pt-signal-tint: #FBE7DE;
  --pt-on-signal: #FFFFFF;
  --pt-success: #2E7D4F;
  --pt-warning: #8A5A10;
  --pt-warning-tint: #F7ECD6;
  --pt-danger: #B3261E;
  --pt-danger-tint: #F9E3E1;
  --pt-info: #2F5F8F;
  --pt-focus: #0E5A36;
  --pt-scrim: rgba(20, 22, 20, 0.48);

  /* Type: Barlow Condensed for page titles and workout names only; Barlow for
     everything else; Plex Mono for sets, reps, loads, RPE, timers. */
  --pt-font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --pt-font-ui: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pt-font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --pt-text-xs: 12px;           /* floor; caps labels only, tracked */
  --pt-text-sm: 14px;
  --pt-text-md: 16px;
  --pt-text-lg: 20px;
  --pt-text-xl: 28px;
  --pt-text-2xl: 40px;
  --pt-caps-tracking: 0.08em;

  /* Shape and space: 8pt grid. Controls 10, cards 14, tags 4, rows 0.
     Full pills only for avatars. Cards get a line, not a shadow. */
  --pt-space-1: 4px;
  --pt-space-2: 8px;
  --pt-space-3: 12px;
  --pt-space-4: 16px;
  --pt-space-5: 20px;
  --pt-space-6: 24px;
  --pt-space-8: 32px;
  --pt-radius-tag: 4px;
  --pt-radius-control: 10px;
  --pt-radius-card: 14px;
  --pt-tap: 44px;
  --pt-control-h: 52px;
  --pt-shadow-float: 0 12px 32px rgba(20, 22, 20, 0.16), 0 2px 6px rgba(20, 22, 20, 0.08);
  --pt-ease: cubic-bezier(.2, .7, .2, 1);
  --pt-duration: 160ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-pt-theme="light"]) {
    --pt-bg: #121311;
    --pt-surface: #1A1C19;
    --pt-sunken: #23261F;
    --pt-ink: #F1EEE6;
    --pt-muted: #A6A398;
    --pt-line: #2E322B;
    --pt-line-strong: #41463D;
    --pt-forest: #4CB878;
    --pt-forest-hover: #5CC687;
    --pt-forest-tint: #1D2D22;
    --pt-on-forest: #0B1A11;
    --pt-signal: #FF7A4D;
    --pt-signal-tint: #2F1D15;
    --pt-on-signal: #1A0C05;
    --pt-success: #4CAF72;
    --pt-warning: #E0A84A;
    --pt-warning-tint: #2C2416;
    --pt-danger: #E9776E;
    --pt-danger-tint: #301A18;
    --pt-info: #7FAEDB;
    --pt-focus: #4CB878;
    --pt-scrim: rgba(0, 0, 0, 0.6);
    --pt-shadow-float: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}
:root[data-pt-theme="dark"] {
  --pt-bg: #121311;
  --pt-surface: #1A1C19;
  --pt-sunken: #23261F;
  --pt-ink: #F1EEE6;
  --pt-muted: #A6A398;
  --pt-line: #2E322B;
  --pt-line-strong: #41463D;
  --pt-forest: #4CB878;
  --pt-forest-hover: #5CC687;
  --pt-forest-tint: #1D2D22;
  --pt-on-forest: #0B1A11;
  --pt-signal: #FF7A4D;
  --pt-signal-tint: #2F1D15;
  --pt-on-signal: #1A0C05;
  --pt-success: #4CAF72;
  --pt-warning: #E0A84A;
  --pt-warning-tint: #2C2416;
  --pt-danger: #E9776E;
  --pt-danger-tint: #301A18;
  --pt-info: #7FAEDB;
  --pt-focus: #4CB878;
  --pt-scrim: rgba(0, 0, 0, 0.6);
  --pt-shadow-float: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  :root { --pt-duration: 0ms; }
}

/* OPS-168: iOS zooms the whole page when a text box under 16px gets focus,
   and nothing zooms it back, so Send and the tab bar end up off screen.
   Phones only (touch, no hover): every text box, text area and dropdown is
   at least 16px. The iPhone app also blocks the zoom natively (PR #280);
   this covers Safari and the home-screen web app too. #protein-input is the
   one box designed larger (20px), so it keeps its own size. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not(#protein-input),
  textarea,
  select {
    font-size: 16px !important;
  }
}
