/* Signal, the Reprise design system. Values are copied from the app repository's
   docs/design-system/tokens.json: Night by default, Day when the device asks for light. */

@font-face { font-family: Saira; font-weight: 400; font-display: swap; src: url(fonts/saira-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Saira; font-weight: 500; font-display: swap; src: url(fonts/saira-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Saira; font-weight: 600; font-display: swap; src: url(fonts/saira-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-weight: 600; font-display: swap; src: url(fonts/saira-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Saira Condensed'; font-weight: 700; font-display: swap; src: url(fonts/saira-condensed-latin-700-normal.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #151517;
  --raised: #1f2023;
  --line: #2e2f33;
  --line-strong: #6f7178;
  --text: #f4f4f1;
  --text-muted: #a5a6aa;
  --text-subtle: #7b7c81;
  --signal: #ff5b1a;
  --signal-ink: #0b0b0c;
  --signal-text: #ff7a45;
  --signal-tint: #2b1409;
  /* Plates are competition colours and the same in every theme here. */
  --plate-25: #c33429;
  --plate-20: #2a5aa8;
  --plate-15: #c9a227;
  --plate-10: #3d7a49;
  --plate-5: #f2f0ea;
  --plate-1-25: #a9aeb5;
  --plate-label-light: #f2f0ea;
  --plate-label-dark: #17181a;

  --display: 'Saira Condensed', 'Arial Narrow', system-ui, sans-serif;
  --sans: Saira, system-ui, sans-serif;
  --gutter: 20px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ebeae6;
    --surface: #f7f6f3;
    --raised: #ffffff;
    --line: #d3d1cb;
    --line-strong: #85837c;
    --text: #0b0b0c;
    --text-muted: #55565b;
    --text-subtle: #808186;
    --signal: #e8490f;
    --signal-text: #ab3307;
    --signal-tint: #fbe2d5;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p, ul, ol { margin: 0; }
img { display: block; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Type */
.eyebrow {
  font: 600 0.8125rem/1rem var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
h1 {
  font: 700 clamp(2.5rem, 9vw, 4.75rem)/1 var(--display);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
h2 { font: 700 clamp(2rem, 6vw, 3rem)/1.05 var(--display); overflow-wrap: break-word; }
h3 { font: 600 1.25rem/1.5rem var(--sans); }
.lede { font-size: 1.125rem; line-height: 1.6; color: var(--text-muted); max-width: 34em; }

/* Layout */
.site-header, .site-footer, .section {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  text-decoration: none;
  font: 700 1.5rem/1 var(--display);
}
.site-header > a:last-child, .site-footer a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; text-underline-offset: 4px;
}
.section { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.section > * + *, .split > div > * + * { margin-top: 16px; }
.split { display: grid; gap: 40px; }
.split > div { min-width: 0; }
.split > div > * + * { margin-top: 16px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
}

.hero { border-top: 0; padding-top: 32px; }
.hero h1 { margin-top: 12px; }
.hero .lede { margin-top: 20px; }
.hero .cta { margin-top: 32px; }
.hero .cta-note { margin-top: 12px; }

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px;
  background: var(--signal); color: var(--signal-ink);
  border-radius: 2px;
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
}
.cta:hover { filter: brightness(1.08); }
.cta-note { font-size: 0.8125rem; line-height: 1.125rem; color: var(--text-muted); }

.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 24px; padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Mockups: drawn app screens. Square and flat like the app itself, not a photoreal device. */
.phone {
  width: 100%;
  max-width: 340px;
  margin-left: auto; margin-right: auto;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  /* Mockup figures size to the frame, not to the reader's text size: they are aria-hidden art,
     and a rem floor grows with text zoom until the figures spill out of a 340px frame. */
  container-type: inline-size;
}

.points { list-style: none; padding: 0; display: grid; gap: 16px; max-width: 34em; }
.points li { padding-left: 16px; border-left: 2px solid var(--line); color: var(--text-muted); }
.points strong { color: var(--text); font-weight: 600; }
.stack { display: grid; gap: 16px; }
.stack > * + * { margin-top: 0; }

/* Live set: ExerciseCard + SetRow. A rough stand-in until UI phase 3 has approved designs. */
.m-exercise { margin-top: 8px; font: 600 1.5625rem/1.75rem var(--sans); }
.m-target { margin-top: 4px; color: var(--text-muted); font: 600 1rem/1.25rem var(--display); font-variant-numeric: tabular-nums; }
.m-sets { list-style: none; padding: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.m-set {
  display: grid; grid-template-columns: 2ch 1fr 3ch; align-items: baseline; gap: 12px;
  min-height: 48px; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font: 600 1.25rem/1 var(--display); font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.m-set span:last-child { text-align: right; }
.m-set.done { color: var(--text); }
.m-set.live {
  padding: 16px 12px 16px 8px;
  background: var(--signal-tint);
  border-left: 4px solid var(--signal);
  color: var(--text);
  font-size: min(3.0625rem, 14cqi);
}

/* Rest timer: RestTimerBar's clock and rule. Also a rough phase-3 stand-in. */
.m-clock {
  margin-top: 4px;
  font: 700 min(7.5rem, 33cqi)/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.m-rule { margin-top: 12px; height: 2px; background: var(--line); }
.m-rule span { display: block; height: 100%; width: 66%; background: var(--signal); }
.m-next { margin-top: 12px; color: var(--text-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* Plate loader: PlateCalculator, side-on (phase 2, approved). */
.m-readout {
  font: 700 min(4.75rem, 24cqi)/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.m-readout small { margin-left: 6px; font-size: 0.4em; color: var(--text-muted); }
.m-bar { display: flex; align-items: center; height: 120px; margin: 16px 0; }
.m-bar b, .m-bar i { display: block; flex: none; }
.m-shaft { flex: 1 1 auto !important; height: 6px; background: var(--text-subtle); }
.m-collar { width: 10px; height: 28px; background: var(--text-subtle); }
.m-sleeve { width: 28px; height: 12px; background: var(--text-subtle); }
.m-bar i {
  display: flex; align-items: center; justify-content: center;
  height: 100%; margin-left: 2px; border-radius: 2px;
  font: 700 13px/1 var(--display); font-style: normal;
  writing-mode: vertical-rl;
}
.m-bar .p25 { width: 34px; background: var(--plate-25); color: var(--plate-label-light); }
.m-bar .p15 { width: 24px; background: var(--plate-15); color: var(--plate-label-dark); }

/* AI chat. Neutral chat chrome; the Confirm is a secondary button, never a second signal fill. */
.m-chat { display: grid; gap: 12px; }
.m-msg { max-width: 88%; padding: 12px; border-radius: 2px; font-size: 0.9375rem; }
.m-msg.you { justify-self: end; background: var(--raised); }
.m-msg.ai { justify-self: start; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 12px; }
.m-preview { padding: 12px; background: var(--surface); border: 1px solid var(--line-strong); }
.m-exercise-sm { margin-top: 6px; font-weight: 600; }
.m-fig { margin-top: 2px; font: 700 1.9375rem/1 var(--display); font-variant-numeric: tabular-nums; }
.m-confirm {
  justify-self: start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 2px; font-weight: 600;
}

/* Roadmap: a dashed border is Signal's own mark for "not there yet". */
.cards { display: grid; gap: 16px; }
.section > .cards { margin-top: 32px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { padding: 20px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.card p { color: var(--text-muted); }
.tag {
  justify-self: start;
  padding: 2px 6px;
  border: 1px dashed var(--text-subtle);
  border-radius: 2px;
  font: 600 0.8125rem/1rem var(--display);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
#data .points { margin-top: 32px; }
