/* Race Lab marketing site — Heavy Weather (Daybreak tokens, Bricolage Grotesque + Manrope). */

:root {
  --bg: #faf7f4;
  --surface: #ffffff;
  --ink: #241b21;
  --sub: #7a6b72;
  --sub-on-soft: #6b5c63;
  --accent: #9b2f53;
  --accent-strong: #75213d;
  --accent-on-dark: #d46d95;
  --on-accent: #ffffff;
  --soft: #f0dde4;
  --line: #ede4e7;
  --line-strong: #dccdd3;
  --hero-bg: #241b21;
  --hero-ink: #faf7f4;
  --hero-sub: #b9a4ad;
  --band-card: #2f242b;
  --lane: #e8d3da;
  --success-bg: #dde9e0;
  --success-ink: #34543f;
  --phase-base: #8fbf9e;
  --phase-build: #e0a96d;
  --phase-peak: #9b2f53;
  --phase-taper: #a99ac9;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  /* Section side padding: the gutter, or whatever centres a 1328px column. */
  --pad-x: max(var(--gutter), (100% - 1328px) / 2);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3 { font-family: var(--display); font-weight: 800; }
h1, h2 { line-height: 1.04; letter-spacing: -0.035em; }
h3 { font-size: 19px; letter-spacing: -0.02em; line-height: 1.25; }

/* The sticky header must not cover a section an in-page link jumps to. */
[id] { scroll-margin-top: 84px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Lanes lockup: inline mark + live wordmark. */
.wordmark-link { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; min-height: 44px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; white-space: nowrap; }
.mark { flex: none; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 34px;
  padding: 14px var(--pad-x);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topnav { display: flex; align-items: center; gap: 34px; margin-left: auto; }
/* Every nav and footer link is a 44px tap target, not just on phones. */
.topnav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.topnav a:hover { color: var(--accent); }
.nav-cta {
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  background: var(--ink);
  color: var(--hero-ink);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent); color: var(--on-accent); }

/* Buttons */
.btn, .btn-ghost {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 30px;
  border-radius: 12px;
}
.btn { background: var(--accent); color: var(--on-accent); }
.btn:hover { background: var(--accent-strong); }
.btn-ghost { color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-dark { background: var(--ink); color: var(--hero-ink); }
.btn-dark:hover { background: var(--accent); color: var(--on-accent); }
.btn-light { background: var(--hero-ink); color: var(--ink); }
.btn-light:hover { background: var(--surface); }

/* Shared section rhythm */
section { padding: clamp(48px, 7vw, 64px) var(--pad-x); }
h2 { font-size: clamp(30px, 3.6vw, 40px); margin-bottom: 14px; }
.section-lede { color: var(--sub); font-size: clamp(16px, 1.3vw, 16.5px); max-width: 660px; }

/* Hero */
.hero {
  padding-top: clamp(40px, 6vw, 76px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 64px;
}
.hero-copy { flex: 1.15 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 0.98; letter-spacing: -0.045em; }
.lede { max-width: 560px; font-size: clamp(16px, 1.4vw, 18px); color: var(--sub); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 40px;
  margin-top: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats dt { font-size: 13.5px; color: var(--sub); }
.stats dd { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; line-height: 1.2; }

/* Hero phone: an illustration of the Today screen, hidden from assistive tech. */
.phone-wrap { flex: 0 1 380px; display: flex; justify-content: center; margin: 0 auto; }
.phone {
  width: min(300px, 100%);
  border-radius: 34px;
  background: var(--ink);
  padding: 12px;
  box-shadow: 0 24px 60px rgba(36, 27, 33, 0.22);
}
.phone-screen { background: var(--bg); border-radius: 26px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; line-height: 1.4; }
.phone-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.phone-hello { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: -0.03em; }
.phone-race { background: var(--hero-bg); border-radius: 18px; padding: 17px; display: flex; flex-direction: column; gap: 4px; }
.phone-race-name { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--hero-sub); }
.phone-race-days { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: -0.04em; color: var(--hero-ink); }
.phone-race-phase { font-size: 11.5px; color: var(--hero-sub); }
.phone-session { background: var(--surface); border-radius: 18px; padding: 15px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 2px 10px rgba(36, 27, 33, 0.05); }
.phone-session-name { font-family: var(--display); font-weight: 800; font-size: 15.5px; letter-spacing: -0.02em; }
.phone-session-meta, .phone-crew { font-size: 11.5px; color: var(--sub); }
.phone-bars { display: flex; gap: 4px; }
.phone-bars span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.phone-bars .done { background: var(--accent); }
.phone-row { display: flex; justify-content: space-between; align-items: center; }
.phone-start { background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700; padding: 7px 15px; border-radius: 8px; }
.phone-note { background: var(--success-bg); border-radius: 14px; padding: 12px; font-size: 11.5px; color: var(--success-ink); }

/* Course strip divider — the race itself */
.course-strip {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.course-strip span {
  flex: 1 1 auto;
  padding: 10px 12px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sub);
  border-right: 1px solid var(--line);
  white-space: nowrap;
  text-align: center;
}
.course-strip .run { background: var(--soft); color: var(--ink); flex-grow: 0.6; }

/* The cycle — dark band: phase strip, then a card per phase */
.cycle { background: var(--hero-bg); color: var(--hero-ink); display: flex; flex-direction: column; gap: 34px; }
.cycle-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 40px; }
.cycle h2 { margin: 0; }
.cycle-head p { font-size: 15.5px; color: var(--hero-sub); max-width: 380px; }

.phase-strip { margin: 0; }
.phase-track {
  display: grid;
  grid-template-columns: 4fr 4fr 3fr 1.2fr 76px;
  gap: 6px;
  align-items: stretch;
}
.phase {
  border-radius: 12px;
  padding: 12px 14px 10px;
  color: var(--ink);
  min-height: 72px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.phase-name { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }
.phase-weeks { font-size: 13px; white-space: nowrap; }
.base { background: var(--phase-base); }
.build { background: var(--phase-build); }
.peak { background: var(--phase-peak); color: var(--on-accent); }
.taper { background: var(--phase-taper); }
.race-day {
  background: var(--hero-ink);
  color: var(--ink);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.15;
}
.race-day span { width: min-content; }
.phase-strip figcaption { margin-top: 12px; font-size: 14px; color: var(--hero-sub); }

.phase-cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.phase-card { background: var(--band-card); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.phase-card-weeks { font-family: var(--display); font-weight: 800; font-size: 15px; text-transform: uppercase; }
.phase-card h3 { font-size: 25px; letter-spacing: -0.03em; color: var(--hero-ink); }
.phase-card p { font-size: 14.5px; color: var(--hero-sub); line-height: 1.55; }
.phase-card.base-card .phase-card-weeks { color: var(--phase-base); }
.phase-card.build-card .phase-card-weeks { color: var(--phase-build); }
.phase-card.peak-card .phase-card-weeks { color: var(--accent-on-dark); }
.phase-card.taper-card .phase-card-weeks { color: var(--phase-taper); }

/* Card grids */
.steps, .way-grid, .track-grid {
  list-style: none;
  padding: 0;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 14px;
}
.steps li, .way, .track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.steps li, .way { box-shadow: 0 2px 12px rgba(36, 27, 33, 0.05); }
.steps p, .way p, .track p { color: var(--sub); font-size: 14.5px; line-height: 1.55; margin-top: 6px; }

/* How it works — a genuine sequence */
.steps { counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: "Q" counter(step);
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

/* Three ways in — the athlete's doors (X-22) */
.ways { padding-top: 0; }
.ways .btn-ghost { margin-top: 26px; }

/* Focus tracks — Hybrid Standard is the dark, shared tile */
.tracks { padding-top: 0; }
/* Three across at full width, as designed; auto-fit drops to two, then one. */
.track-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.track.shared { background: var(--hero-bg); border-color: var(--hero-bg); }
.track.shared h3 { color: var(--hero-ink); }
.track.shared p { color: var(--hero-sub); }
.track-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--on-accent);
  padding: 4px 9px;
  border-radius: 6px;
}
.badge {
  display: inline-block;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 3px 8px;
  margin-bottom: 10px;
}

/* Coaches & creators — the soft band (X-22) */
.coaches { background: var(--soft); }
.coaches-top { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: center; margin-bottom: 40px; }
.coaches-copy { flex: 1 1 420px; min-width: 0; }
.coaches h2 { line-height: 1.06; margin-bottom: 18px; }
.coaches .section-lede { color: var(--sub-on-soft); max-width: 520px; }
.coach-grid {
  flex: 0 1 460px;
  min-width: 0;
  list-style: none;
  padding: 0;
  counter-reset: point;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coach-point {
  counter-increment: point;
  background: var(--bg);
  border-radius: 16px;
  padding: 20px 20px 20px 62px;
  position: relative;
}
.coach-point::before {
  content: counter(point);
  position: absolute;
  left: 20px;
  top: 16px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
}
.coach-point h3 { font-family: 'Manrope', system-ui, sans-serif; font-size: 16px; font-weight: 700; letter-spacing: 0; }
.coach-point p { color: var(--sub); font-size: 14.5px; line-height: 1.5; margin-top: 3px; }
.pricing-head { font-weight: 700; margin-bottom: 14px; }
.price-note { color: var(--sub-on-soft); font-size: 14px; margin-top: 16px; max-width: 38rem; }

/* Pricing cards. The contents are replaced at runtime from the API's plan
   catalog (plans.js), so this has to fit whatever the catalog sells — and the
   whole group (heading, cards, CTA, footnote) is hidden if that catalog ever
   stops selling to this audience, rather than advertising a retired plan. */
.pricing-group[hidden] { display: none; }
.pricing { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.price-card {
  flex: 1 1 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}
.price-card.featured { border: 1.5px solid var(--accent); }
.price-card h3 { font-size: 17px; }
.price-card .price { margin: 6px 0 2px; }
.price-card .price strong { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.price-card .seats { font-size: 14px; color: var(--sub); }

/* On the coaches band there are only two plans, so the cards sit at their own
   width instead of stretching across the page. */
.coaches .price-card { flex: 0 1 240px; }

/* Gyms / licensing — the second dark band. */
.gyms { background: var(--hero-bg); color: var(--hero-ink); }
.gyms p { color: var(--hero-sub); max-width: 660px; }
.gym-points { list-style: none; padding: 0; margin: 24px 0 30px; }
.gym-points li { padding-left: 26px; position: relative; margin-bottom: 10px; color: var(--hero-ink); }
.gym-points li::before { content: "→"; position: absolute; left: 0; color: var(--accent-on-dark); }
.gyms .price-card { background: var(--band-card); border-color: var(--band-card); }
.gyms .price-card.featured { border-color: var(--accent-on-dark); }
.gyms .price-card h3, .gyms .price-card .price { color: var(--hero-ink); }
.gyms .price-card .seats { color: var(--hero-sub); }

/* Sign up */
.download { text-align: center; padding-block: clamp(64px, 10vw, 112px); }
.download .section-lede { margin: 0 auto 26px; }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  padding: 52px var(--pad-x) 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand p { color: var(--sub); font-size: 14.5px; margin-top: 8px; max-width: 20rem; }
.footer-head {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 4px;
}
.footer-col { display: flex; flex-direction: column; }
.footer-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--sub);
  text-decoration: none;
  font-size: 14.5px;
}
.footer-col a:hover { color: var(--accent); }
.footer-fineprint {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 13px;
}

/* Mobile */
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  /* Section links drop to their own scrollable row under the logo + CTA. */
  .topbar { flex-wrap: wrap; row-gap: 0; padding-block: 8px 0; }
  .topnav { order: 3; flex-basis: 100%; margin-left: -6px; gap: 8px; overflow-x: auto; white-space: nowrap; }
  .topnav a { padding: 0 6px; flex: none; }
  .topnav a:focus-visible { outline-offset: -2px; }
  [id] { scroll-margin-top: 120px; }
  /* Phases keep their 4:4:3:1.2 proportions; the labels shrink to fit. */
  .phase-track { grid-template-columns: 4fr 4fr 3fr 1.2fr; gap: 4px; }
  .phase { padding: 10px 6px 8px; min-height: 64px; border-radius: 8px; }
  .phase-name { font-size: 13px; }
  .phase-weeks { font-size: 12px; }
  /* Taper's 1.2fr is ~27px wide at 320px: its label runs up the bar instead. */
  .taper { writing-mode: vertical-rl; transform: rotate(180deg); flex-direction: row; justify-content: flex-start; align-items: center; gap: 6px; padding: 8px 0; }
  .race-day { grid-column: 1 / -1; min-height: 44px; margin-top: 2px; border-radius: 8px; }
  .race-day span { width: auto; }
  .course-strip span { border-bottom: 1px solid var(--line); }
  .coach-grid { flex-basis: 100%; }
}
