/* ==========================================================================
   Half Wheel. The Instrument design system, translated from the extracted
   Claude Design source (tokens/ and the three approved frames).
   Near-black ground. Light comes from data and photography only.
   ========================================================================== */

/* ---- Tokens: color (tokens/colors.css) ---- */
:root {
  /* Ground */
  --hw-bg: #0a0b0d;                    /* page ground, the only background color */
  --hw-scrim: rgba(10, 11, 13, 0.72);  /* caption plate over photography */

  /* Text hierarchy */
  --hw-text: #e8eaed;                  /* primary: headlines, data values, wins */
  --hw-text-secondary: #c6cad1;        /* long-form narrative paragraphs */
  --hw-text-soft: #8b929c;             /* labels, margin notes, supporting copy */
  --hw-text-muted: #565c66;            /* folio lines, subordinate metadata only */

  /* Hairline rules (never boxes) */
  --hw-rule: #23262b;                  /* major section rule */
  --hw-rule-minor: #16181c;            /* row separators, margin-note rules */

  /* Data marks */
  --hw-mark: #3d434c;                  /* base mark: a race start, a dashed placeholder border */
  --hw-mark-win: var(--hw-text);       /* a win: brightest neutral */
  --hw-accent: #d9a441;                /* the single data accent: championships, active nav, CTA, annotation */
}

/* ---- Tokens: type (tokens/typography.css) ----
   Caption is 12px here, not the source's 11px: the implementation brief sets a
   12px floor with zero exceptions, and that constraint governs. */
:root {
  --hw-font-grotesque: 'Archivo', Helvetica, Arial, sans-serif;
  --hw-font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --hw-size-hero: 56px;
  --hw-size-display: 52px;
  --hw-size-title: 44px;
  --hw-size-cta: 34px;
  --hw-size-stat: 34px;
  --hw-size-stat-sm: 30px;
  --hw-size-lede: 27px;
  --hw-size-body-lg: 21px;
  --hw-size-body: 18px;
  --hw-size-nav: 15px;
  --hw-size-data: 13px;
  --hw-size-label: 12px;
  --hw-size-caption: 12px;
}

/* ---- Tokens: spacing (tokens/spacing.css) ---- */
:root {
  --hw-gutter: 48px;
  --hw-section: 96px;
  --hw-section-sm: 88px;
  --hw-col-gap: 64px;
  --hw-col-label: 260px;
  --hw-col-margin: 320px;
  --hw-row-pad: 20px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--hw-bg);
  color: var(--hw-text);
  font-family: var(--hw-font-grotesque);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--hw-accent); }

h1, p, figure { margin: 0; }

/* ---- Header bar ---- */
.hw-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 20px var(--hw-gutter);
  border-bottom: 1px solid var(--hw-rule);
}

.hw-wordmark {
  font-size: var(--hw-size-nav);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hw-nav {
  display: flex;
  gap: 36px;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-soft);
}

.hw-nav a.active { color: var(--hw-accent); }

.hw-context {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-muted);
  white-space: nowrap;
}

/* ---- Statement blocks ---- */
.hw-statement { padding: var(--hw-section) var(--hw-gutter) 72px; max-width: 980px; }

.hw-kicker {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-accent);
  margin-bottom: 20px;
}

.hw-hero {
  font-size: var(--hw-size-hero);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.hw-title {
  font-size: var(--hw-size-title);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.015em;
  max-width: 760px;
  text-wrap: pretty;
}

.hw-display {
  font-size: var(--hw-size-display);
  line-height: 1.14;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 820px;
  text-wrap: pretty;
}

/* ---- Instrument sections ---- */
.hw-instrument { padding: 0 var(--hw-gutter) 24px; }
.hw-instrument--spaced { padding-top: var(--hw-section); padding-bottom: 0; }

.hw-instrument-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  border-top: 1px solid var(--hw-rule);
  padding: 14px 0 28px;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-soft);
}

/* Career strip: one row per season, marks positioned by date within the year.
   Generated per-row inline SVG plus HTML annotation plates. */
.hw-strip-scroll { overflow-x: auto; }
.hw-strip { min-width: 700px; }

.hw-strip-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 3px 0;
}

.hw-strip-year {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-soft);
}

.hw-strip-timeline { position: relative; }
.hw-strip-timeline svg { display: block; width: 100%; height: 26px; }

.hw-strip-note {
  position: absolute;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-accent);
  white-space: nowrap;
  border-left: 1px solid var(--hw-accent);
  padding: 2px 8px 2px 6px;
  line-height: 14px;
  background: var(--hw-bg);
  margin-left: 3px;
  z-index: 1;
}

/* Year-precision annotation: a founder-attested fact with no date in the data.
   Sits at the row edge with no leader line, so no date position is implied. */
.hw-strip-note--year {
  left: auto;
  right: 0;
  border-left: none;
  margin-left: 0;
  padding: 2px 0 2px 8px;
}

.hw-legend {
  display: flex;
  gap: 32px;
  margin-top: 20px;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-caption);
  color: var(--hw-text-soft);
}

.hw-legend span { display: flex; align-items: center; gap: 8px; }

.hw-swatch { width: 2px; display: inline-block; }
.hw-swatch--start { height: 10px; background: var(--hw-mark); }
.hw-swatch--win { height: 10px; background: var(--hw-mark-win); }
.hw-swatch--champ { height: 16px; background: var(--hw-accent); }

.hw-caption-line {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-caption);
  color: var(--hw-text-muted);
  margin-top: 14px;
}

/* ---- Readout row (stat block) ---- */
.hw-readouts {
  margin: 56px var(--hw-gutter) 0;
  border-top: 1px solid var(--hw-rule);
  border-bottom: 1px solid var(--hw-rule);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.hw-readout {
  padding: 26px 28px;
  border-left: 1px solid var(--hw-rule-minor);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-readout:first-child { border-left: none; padding-left: 0; }

.hw-readout-value {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-stat);
  color: var(--hw-text);
  line-height: 1;
}

.hw-readout-label {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-caption);
  color: var(--hw-text-soft);
  letter-spacing: 0.08em;
}

.hw-readout-label .hw-flag { color: var(--hw-text-muted); letter-spacing: 0.02em; }

/* Coaching honest-data line: three readouts, smaller values */
.hw-statline { margin: 72px 0 0; grid-template-columns: repeat(3, 1fr); }
.hw-statline .hw-readout-value { font-size: var(--hw-size-stat-sm); }

/* ---- Seasons instrument ---- */
.hw-season-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px 70px 80px;
  gap: 24px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hw-rule-minor);
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-data);
}

.hw-season-year { color: var(--hw-text-soft); }
.hw-season-bar { display: block; height: 4px; background: var(--hw-rule); position: relative; }
.hw-season-bar span { position: absolute; inset: 0 auto 0 0; background: var(--hw-accent); }
.hw-season-races, .hw-season-wins { text-align: right; color: var(--hw-text); }
.hw-season-rate { text-align: right; color: var(--hw-text-muted); }

/* ---- Full-bleed photo bands ---- */
.hw-band { position: relative; margin-top: var(--hw-section); }

.hw-band img {
  width: 100%;
  height: 640px;
  object-fit: cover;
  display: block;
}

.hw-band--mid img { height: 560px; }

/* Contained portrait: honest sizing on the ground, caption adjacent (never a
   full-bleed upscale of a portrait source) */
.hw-portrait-band { margin-top: var(--hw-section); padding: 0 var(--hw-gutter); }

.hw-portrait-band figure { width: fit-content; }

.hw-portrait-band img {
  display: block;
  height: 640px;
  width: auto;
  max-width: 100%;
}

.hw-portrait-band figcaption {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-caption);
  color: var(--hw-text-soft);
  margin-top: 12px;
  border-top: 1px solid var(--hw-rule);
  padding-top: 10px;
}

.hw-band-caption {
  position: absolute;
  left: var(--hw-gutter);
  bottom: 28px;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text);
  background: var(--hw-scrim);
  padding: 8px 14px;
}

/* ---- Three-column instrument grid: label / content / margin note ---- */
.hw-section3 {
  padding: var(--hw-section) var(--hw-gutter) 0;
  display: grid;
  grid-template-columns: var(--hw-col-label) 1fr var(--hw-col-margin);
  gap: var(--hw-col-gap);
  align-items: start;
}

.hw-section3--sm { padding-top: var(--hw-section-sm); }

.hw-section-label {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-soft);
  border-top: 1px solid var(--hw-rule);
  padding-top: 14px;
}

.hw-section-content { border-top: 1px solid var(--hw-rule); padding-top: 28px; }

.hw-margin-note {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  line-height: 1.9;
  color: var(--hw-text-soft);
  border-top: 1px solid var(--hw-rule-minor);
  padding-top: 14px;
}

/* ---- Narrative type ---- */
.hw-lede { font-size: var(--hw-size-lede); line-height: 1.45; font-weight: 400; text-wrap: pretty; }
.hw-body-lg { font-size: var(--hw-size-body-lg); line-height: 1.55; color: var(--hw-text-secondary); text-wrap: pretty; }
.hw-body { font-size: var(--hw-size-body); line-height: 1.6; color: var(--hw-text-secondary); text-wrap: pretty; }

/* ---- Numbered method rows (coaching) ---- */
.hw-method-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 28px;
  padding: var(--hw-row-pad) 0;
  border-bottom: 1px solid var(--hw-rule-minor);
}

.hw-method-row .hw-num {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-accent);
}

/* ---- Case study title grid ---- */
.hw-title-grid {
  padding: var(--hw-section-sm) var(--hw-gutter) 0;
  display: grid;
  grid-template-columns: 1fr var(--hw-col-margin);
  gap: var(--hw-col-gap);
  align-items: end;
}

.hw-title-aside {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  line-height: 1.9;
  color: var(--hw-text-soft);
  padding-bottom: 6px;
}

/* ---- Coaching page hero: statement plus portrait ---- */
.hw-page-hero {
  padding: var(--hw-section) var(--hw-gutter) 0;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 72px;
  align-items: start;
}

.hw-portrait img { width: 100%; display: block; }

.hw-portrait figcaption {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-caption);
  color: var(--hw-text-soft);
  margin-top: 12px;
  border-top: 1px solid var(--hw-rule);
  padding-top: 10px;
}

/* ---- Exhibit: placeholder panel ---- */
.hw-exhibit { padding: 72px var(--hw-gutter) 0; }

.hw-exhibit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-soft);
  padding-bottom: 16px;
}

.hw-exhibit-head .hw-meta { color: var(--hw-text-muted); }

.hw-exhibit-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: stretch;
}

.hw-exhibit-img { width: 100%; display: block; }

.hw-exhibit-notes {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  line-height: 1.8;
  color: var(--hw-text-soft);
}

.hw-exhibit-note { border-left: 1px solid var(--hw-mark); padding-left: 14px; }
.hw-exhibit-note--lead { border-left-color: var(--hw-accent); }
.hw-note-key { color: var(--hw-text); }
.hw-note-key--lead { color: var(--hw-accent); }

/* ---- Specimen table ---- */
.hw-specimen { margin: var(--hw-section-sm) var(--hw-gutter) 0; border-top: 1px solid var(--hw-rule); }

.hw-specimen-row {
  display: grid;
  grid-template-columns: var(--hw-col-label) 1fr;
  gap: var(--hw-col-gap);
  padding: 18px 0;
  border-bottom: 1px solid var(--hw-rule-minor);
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-data);
}

.hw-specimen-key { color: var(--hw-text-soft); }
.hw-specimen-value { color: var(--hw-text); }

/* ---- CTA block ---- */
.hw-cta {
  border-top: 1px solid var(--hw-rule);
  margin-top: 112px;
  padding: var(--hw-section-sm) var(--hw-gutter) var(--hw-section);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.hw-cta p {
  font-size: var(--hw-size-cta);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 720px;
  text-wrap: pretty;
}

.hw-cta a, .hw-email {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-data);
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--hw-accent);
  padding-bottom: 4px;
  color: var(--hw-accent);
}

/* ---- Homepage method statement ---- */
.hw-method-statement {
  border-top: 1px solid var(--hw-rule);
  margin: var(--hw-section) var(--hw-gutter) 0;
  padding-top: var(--hw-section-sm);
}

.hw-method-statement p {
  font-size: 26px;
  line-height: 1.4;
  font-weight: 400;
  max-width: 640px;
  text-wrap: pretty;
}

/* ---- Footer (all pages) ---- */
.hw-footer {
  border-top: 1px solid var(--hw-rule);
  margin-top: var(--hw-section);
  padding: 40px var(--hw-gutter) 56px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}

.hw-footer-name { font-size: var(--hw-size-body); color: var(--hw-text-soft); }

.hw-footer-meta {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-size-label);
  color: var(--hw-text-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  text-align: right;
}

/* ==========================================================================
   Mobile. Single column at a sensible breakpoint; the career strip scrolls
   horizontally and stays legible. All type stays at or above 12px.
   ========================================================================== */
@media (max-width: 900px) {
  :root {
    --hw-gutter: 24px;
    --hw-section: 64px;
    --hw-section-sm: 56px;
    --hw-size-hero: 34px;
    --hw-size-display: 32px;
    --hw-size-title: 30px;
    --hw-size-cta: 26px;
    --hw-size-stat: 28px;
    --hw-size-stat-sm: 24px;
    --hw-size-lede: 22px;
    --hw-size-body-lg: 19px;
    --hw-size-body: 17px;
  }

  .hw-header { flex-wrap: wrap; row-gap: 12px; }
  .hw-nav { gap: 20px; flex-wrap: wrap; }
  .hw-context { display: none; }

  .hw-statement { padding-bottom: 48px; }

  .hw-readouts { grid-template-columns: 1fr 1fr; }
  .hw-readout { padding: 18px 20px; }
  .hw-readout:nth-child(odd) { border-left: none; padding-left: 0; }
  .hw-readouts > .hw-readout:nth-child(n+3) { border-top: 1px solid var(--hw-rule-minor); }

  .hw-statline { grid-template-columns: 1fr; margin-top: 48px; }
  .hw-statline .hw-readout { border-left: none; padding: 16px 0; }
  .hw-statline > .hw-readout + .hw-readout { border-top: 1px solid var(--hw-rule-minor); }

  .hw-season-row { grid-template-columns: 52px 1fr 60px 44px 52px; gap: 12px; font-size: var(--hw-size-label); }

  .hw-band img, .hw-band--mid img { height: 320px; }
  .hw-band-caption { bottom: 16px; }

  .hw-portrait-band img { height: 400px; }
  .hw-strip-row { grid-template-columns: 44px 1fr; gap: 8px; }

  .hw-section3, .hw-title-grid, .hw-page-hero { grid-template-columns: 1fr; gap: 32px; }
  .hw-title-grid { align-items: start; }
  .hw-page-hero { gap: 48px; }
  .hw-portrait { max-width: 420px; }

  .hw-specimen-row { grid-template-columns: 1fr; gap: 4px; }

  .hw-exhibit-grid { grid-template-columns: 1fr; gap: 24px; }
  .hw-exhibit-notes { gap: 16px; }

  .hw-cta { margin-top: 72px; }

  .hw-footer { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hw-footer-meta { align-items: flex-start; text-align: left; }
}
