/* Lane Lines — the TrackLife marketing design system.
 *
 * Implements marketing/design-philosophy.md. Shared by index.html, features.html
 * and the gated demos page so the three read as one product.
 *
 * The governing rule is restraint: ONE warm pigment against cool neutrals. Adding a
 * second accent is what made the previous site read as generic SaaS. If you are about
 * to introduce a color, don't — use weight, rule, or space instead.
 *
 * Contrast ratios here are enforced by test/tokens.test.mjs. Changing a color without
 * running the tests can silently break readability.
 */

:root {
  /* Ink */
  --ink: #13233F;          /* Stadium Navy — headings and body copy */
  --ink-soft: #3a4658;     /* secondary prose */
  --muted: #5c6773;        /* labels and captions. 5.35:1 on chalk */

  /* Fields */
  --chalk: #FAF6EF;        /* the page */
  --chalk-soft: #F1EADD;   /* banded sections */
  --deep: #080B12;         /* the video band */
  --deep-soft: #0d1320;    /* raised surfaces inside the band */
  --deep-glow: #1a2740;    /* the .band and .demos-body gradients' lighter stop — the
                               "lights going down" glow itself. Round 2 of the demos-
                               page fix-round darkened this to #101827 to rescue
                               --accent's contrast, which quietly deleted the glow
                               (1.11:1 against --deep — imperceptible). Restored to
                               its original brightness (1.32:1 against --deep); the
                               correct fix for small red text on a bright background
                               is a lighter text color, not a darker background — see
                               --accent-light below. */
  --muted-dark: #93a1b5;   /* muted text on the deep field. 7.5:1 */

  /* The single pigment */
  --accent: #E8492B;       /* Track Red. Large display type, rules, ticks, marks */
  --accent-dark: #C23A20;  /* text-sized red: links and button fields */
  --accent-light: #ED7059; /* Track Red, lifted in lightness only (same hue/saturation,
                               9.5°/80%) for small accent TEXT on dark surfaces — .ref
                               labels sitting on .band/.demos-body's gradient. --accent
                               itself is only 3.85:1 against --deep-glow, below the
                               4.5:1 AA floor for 11px text; --accent-light clears
                               5.02:1 against --deep-glow and 6.62:1 against --deep.
                               Not used as a background or for large/display type —
                               --accent stays the pigment everywhere else. See
                               test/system.test.mjs. */

  /* Structure */
  --line: rgba(19, 35, 63, .15);      /* hairline on chalk */
  --line-heavy: rgba(19, 35, 63, .55); /* section divider */
  --line-dark: rgba(255, 255, 255, .12);
  --radius: 2px;

  /* Type */
  --display: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Rhythm */
  --gutter: 24px;
  --measure: 1180px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-dark); }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* The lane-tick strip. The recurring motif of the whole system: five lanes, the
 * first one live. Used at the top of the page and to open major sections. */
.ticks { display: flex; gap: 3px; height: 8px; }
.ticks i { flex: 1; background: var(--line); }
.ticks i:first-child { background: var(--accent); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-heavy { height: 2px; background: var(--line-heavy); border: 0; margin: 0; }

/* ----------------------------------------------------------- typography ---- */
.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .94;
  letter-spacing: -.005em;
  margin: 0;
}

.eyebrow, .ref, .label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.ref { color: var(--accent-dark); }

.lede { font-size: 18px; color: var(--ink-soft); max-width: 58ch; margin: 0; }

/* Numerals are mechanical, aligned, and never proportional — the philosophy's
 * "struck onto a duplicating sheet" register. */
.datum {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.data-panel { border-left: 1px solid var(--line); padding-left: 22px; }
.data-panel .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.data-panel .row:last-child { border-bottom: 0; }
.data-panel .row .datum { font-size: 26px; }
.data-panel .row .k { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--muted); }

/* --------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-dark); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-heavy); }
.btn-quiet:hover { border-color: var(--ink); }

/* Store badges under the hero button row. Quieter than a .btn on purpose — they sit below two
   pills and must not compete with them — but they still need to be spaced links, not a run-on
   line of coloured words. */
.store-links { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 0; font-size: 14px; }

/* ------------------------------------------------------------------- nav --- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand-logo { height: 68px; width: auto; }
.navlinks { display: flex; align-items: center; gap: 22px; }
.navlinks a {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none;
  white-space: nowrap;
}
.navlinks a:hover { color: var(--ink); }

/* -------------------------------------------------------------- sections --- */
/* padding-BLOCK only, deliberately longhand: .section shares its element with
 * .wrap (`<section class="section wrap">`), which supplies the horizontal page
 * gutter via `padding: 0 var(--gutter)`. The shorthand `padding: 72px 0` here has
 * the same specificity but comes later, so it silently zeroed that gutter —
 * invisible on desktop (max-width + auto margins leave space anyway), but every
 * section sat flush against the screen edge on phones/tablets. Same trap as the
 * .acc-list margin shorthand below: never use the padding/margin shorthand on a
 * class that rides along with .wrap. */
.section { padding-block: 72px; }
.section-head { display: grid; gap: 14px; margin-bottom: 40px; max-width: 62ch; }
.section-head .display { font-size: clamp(30px, 4vw, 46px); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
/* Lanes, not cards: separated by rules rather than boxed in borders and shadows. */
.lane { padding: 0 26px; border-left: 1px solid var(--line); }
.lane:first-child { padding-left: 0; border-left: 0; }
.lane h3 { font-family: var(--display); text-transform: uppercase; font-size: 21px; margin: 14px 0 8px; }
.lane p { color: var(--ink-soft); margin: 0; }

.step .n {
  font-family: var(--mono); font-size: 34px; font-weight: 600;
  color: var(--accent); line-height: 1;
}

/* ---------------------------------------------------------- screenshots --- */
.shot { margin: 0; }
.shot-frame { display: block; border: 1px solid var(--line); background: #fff; }
.shot-frame img { width: 100%; height: auto; }
.shot-cap { padding: 12px 0 0; }
.shot-cap h3 { font-family: var(--display); text-transform: uppercase; font-size: 17px; margin: 0 0 4px; }
.shot-cap p { color: var(--muted); font-size: 14px; margin: 0; }

.quote { max-width: 40ch; }
.quote p { font-family: var(--display); text-transform: uppercase; font-size: clamp(22px, 3vw, 34px); line-height: 1.1; margin: 0; }
.quote .who { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--muted); margin-top: 18px; }

.strip-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; border-top: 2px solid var(--line-heavy); padding: 34px 0;
}

.foot { border-top: 1px solid var(--line); padding: 30px 0 50px; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ------------------------------------------------------- the dark band ---- */
/* The one place the system permits depth and glow: the lights going down. */
.band {
  background: radial-gradient(120% 100% at 70% -20%, var(--deep-glow) 0%, var(--deep) 62%);
  color: var(--chalk);
  padding: 76px 0;
}
.band .eyebrow, .band .label { color: var(--muted-dark); }
.band .lede { color: var(--muted-dark); }
.band .rule { background: var(--line-dark); }
/* .ref and .quote .who inherit light-field colors (--accent-dark, --muted) that fall
 * below 4.5:1 against --deep — 3.67:1 and 3.4-3.7:1 respectively. Give the dark field
 * its own values: --accent-light (the text-lifted red, not --accent — see its comment
 * in :root for why) clears 6.62:1 on --deep and 5.02:1 on --deep-glow (the gradient's
 * lighter stop, near the top of the band where .ref actually sits), and --muted-dark
 * is the established dark-field muted token at 7.5:1 on --deep / 5.69:1 on
 * --deep-glow. See test/system.test.mjs. */
.band .ref { color: var(--accent-light); }
.band .quote .who { color: var(--muted-dark); }
.band-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }

/* Posters are scoped under .band deliberately: they are the only elements allowed a
 * shadow, and system.test.mjs enforces that by requiring every box-shadow to live in
 * a selector naming the band. Unscoping these would fail that test — correctly. */
.band .poster {
  position: relative; display: block; text-decoration: none;
  border: 1px solid var(--line-dark); background: var(--deep-soft);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.band .poster img { width: 100%; height: auto; opacity: .82; }
.band .poster:hover img { opacity: 1; }
.band .poster .meta {
  position: absolute; left: 12px; bottom: 10px; right: 12px;
  display: flex; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--chalk);
}
.band .poster .play {
  position: absolute; inset: 0; margin: auto; width: 54px; height: 54px;
  border-radius: 50%; background: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px rgba(232, 73, 43, .16);
}
.band .poster .play::after {
  content: ''; border-left: 15px solid #fff;
  border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px;
}
.band .poster-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 26px; }
.band .poster-strip .poster .play { width: 34px; height: 34px; box-shadow: 0 0 0 6px rgba(232, 73, 43, .14); }
.band .poster-strip .poster .play::after { border-left-width: 10px; border-top-width: 6px; border-bottom-width: 6px; }

/* ---------------------------------------------------------- responsive ---- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; gap: 26px; }
  .lane { padding: 0 0 0 18px; border-left: 1px solid var(--line); }
  .lane:first-child { padding-left: 18px; border-left: 1px solid var(--line); }
  .band-inner { grid-template-columns: 1fr; }
  .data-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
}

@media (max-width: 620px) {
  .section { padding-block: 48px; }
  .brand-logo { height: 52px; }
  /* The nav's three items no longer fit on one line beside the logo at phone
   * widths, and were wrapping mid-word inside the button and links — stack
   * the nav onto its own full-width row instead of letting text break. */
  .nav { flex-wrap: wrap; row-gap: 12px; }
  /* A three-item navlinks row (a features page adds "Home" alongside "Features"
   * and the CTA) can still be wider than very narrow phones even on its own
   * row — wrap it too rather than letting the trailing item run off-screen. */
  .navlinks { width: 100%; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
  .band .poster-strip { grid-template-columns: repeat(2, 1fr); }
  .strip-cta { flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------------------- layout --- */
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: start; }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .proof-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------ the demo library --- */
/* The library is the dark room: same system as the homepage band, applied to a
 * whole page. Shadows are permitted here for the same reason they are in .band. */
.demos-body {
  background: radial-gradient(120% 60% at 70% -10%, var(--deep-glow) 0%, var(--deep) 60%);
  color: var(--chalk);
  min-height: 100vh;
}
.demos-body .lede { color: var(--muted-dark); }
/* --accent-light, not --accent — see its comment in :root. --accent is only
 * 3.85:1 against --deep-glow; --accent-light clears 5.02:1. */
.demos-body .ref { color: var(--accent-light); }
/* padding-block, not the shorthand — .demos-head rides on the same element as
 * .wrap (`<header class="wrap demos-head">`); see the .section comment. */
.demos-head { padding-block: 18px 44px; }
.demos-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; }
.demos-bar .brand-logo { height: 56px; }

.lang-toggle { display: flex; gap: 8px; }
.lang-toggle .btn { color: var(--muted-dark); border-color: var(--line-dark); }
.lang-toggle .btn.is-on { color: var(--chalk); border-color: var(--accent); }

.demo-group { margin: 0 0 54px; }
.demo-group h2 { font-size: clamp(20px, 2.4vw, 28px); margin: 0 0 6px; }
.demo-group > h2 + .demo-grid { margin-top: 18px; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.demo h3 {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--chalk); margin: 10px 0 0;
}
.demo iframe { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line-dark); display: block; }

.demo-play {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--line-dark); border-radius: var(--radius);
  background: var(--deep-soft); cursor: pointer; padding: 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}
.demo-play:hover { border-color: var(--accent); }
.demo-play img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .72;
}
.demo-play:hover img { opacity: 1; }
.demo-play .play {
  position: absolute; inset: 0; margin: auto; width: 46px; height: 46px;
  border-radius: 50%; background: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
}
.demo-play .play::after {
  content: ''; border-left: 13px solid #fff;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px;
}

/* Which demo is playing. Only one can be (see the page's inline script), and it has
 * to be findable at a glance: a visitor once had an English and a Spanish demo
 * talking over each other, could not work out which card to pause, and reloaded the
 * page to stop the noise. Three signals — the embed is ringed in Track Red, its
 * caption is badged, and every other poster steps back. */
.demo.is-playing iframe {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 73, 43, .45), 0 18px 44px rgba(0, 0, 0, .5);
}
.demo.is-playing h3 { color: var(--accent-light); }
.demo.is-playing h3::after {
  content: 'Now playing'; display: inline-block; margin-left: 10px; padding: 1px 6px;
  border: 1px solid var(--accent); color: var(--accent-light);
  font-size: 10px; letter-spacing: .1em; white-space: nowrap; vertical-align: 1px;
}
/* Dim the other POSTERS, never their captions: at 12px they are already the page's
 * smallest text, and dimming --chalk on this gradient would drop it under the AA
 * floor. --accent is likewise never used as a background here (see :root). */
body.has-playing .demo:not(.is-playing) .demo-play img { opacity: .3; }
body.has-playing .demo:not(.is-playing) .demo-play .play { opacity: .55; }

/* The now-playing bar: one control that is on screen no matter how far the visitor
 * has scrolled away from the card that is playing. Fixed rather than sticky for
 * exactly that reason — a sticky element only pins within its own scroll container. */
.now-playing {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  /* The extra bottom padding is the iOS home-indicator inset: a fixed bottom bar
   * otherwise puts Stop underneath it. Falls back to 0 everywhere else. */
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--deep-soft); border-top: 2px solid var(--accent);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .55);
}
/* `hidden` is only a `display: none` UA rule, so it loses to the `display: flex`
 * above on specificity alone. Without this the bar is permanently on screen. */
.now-playing[hidden] { display: none; }
.now-playing-label {
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-light); margin: 0; flex: 0 0 auto;
}
.now-playing-jump {
  flex: 1 1 200px; min-width: 0; text-align: left;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--chalk);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now-playing-jump:hover { color: var(--accent-light); text-decoration: underline; }
.now-playing-stop { flex: 0 0 auto; padding: 10px 18px; }
/* The bar is fixed, so it would otherwise sit on top of the last row of cards. */
body.has-playing { padding-bottom: 88px; }

@media (max-width: 900px) { .demo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .demo-grid { grid-template-columns: 1fr; }
  /* The caption badge and a long demo title cannot share one 12px mono line on a
   * phone, and .demo h3 does not wrap mid-word — give the badge its own line. */
  .demo.is-playing h3::after { display: block; margin: 6px 0 0; width: fit-content; }
  /* The bar wraps onto two rows at this width (measured 93px at 375px), so the
   * desktop reserve would leave the last card sitting under it. */
  body.has-playing { padding-bottom: 124px; }
  /* Same trap as the homepage nav (4f385145): "English"/"Español" are un-wrappable
   * (.btn sets white-space: nowrap) and don't fit beside a 56px logo at phone
   * widths — stack the bar onto its own row instead of letting it overflow.
   * The .brand-logo override must be re-declared at this same specificity
   * (.demos-bar .brand-logo, not .brand-logo) — the base .brand-logo mobile
   * rule above is a single-class selector and can never win against the
   * two-class .demos-bar .brand-logo rule regardless of source order. */
  .demos-bar { flex-wrap: wrap; row-gap: 12px; }
  .demos-bar .brand-logo { height: 52px; }
  .lang-toggle { width: 100%; justify-content: space-between; }
}

/* ------------------------------------------------- feature index (features.html only) ---- */
/* features.html is a long, filterable index rather than a narrative scroll, so it needs a
 * few components the homepage never did: quick-jump chips, a persona-filter bar, and a
 * collapsed accordion list. All of them reuse the existing tokens (--accent-dark for the
 * one place a chip needs emphasis, --line-heavy for borders, var(--radius) for corners)
 * rather than introducing new color or radius values — see design-philosophy.md. */

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; }
.jump a {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  border: 1px solid var(--line-heavy); border-radius: var(--radius); padding: 8px 12px;
}
.jump a:hover { border-color: var(--accent-dark); color: var(--accent-dark); }

.index-bar {
  display: flex; flex-direction: column; gap: 14px; margin: 28px 0 6px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--chalk-soft);
}
.index-bar-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.legend-row {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 0; letter-spacing: .04em;
}
.legend-row .legend-label { font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .14em; }
.legend-row .tag {
  font-family: var(--mono); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border: 1px solid var(--line-heavy); border-radius: var(--radius); font-size: 10px; color: var(--ink-soft);
  /* Chips sit on --chalk, not the --chalk-soft panel behind them. At 10px the
   * accent variant needs the lighter field: --accent-dark is 4.48:1 on
   * --chalk-soft (under AA) but 4.97:1 on --chalk. Enforced by system.test.mjs. */
  background: var(--chalk);
}
/* Coach/Director is the one persona worth the single warm pigment; the rest stay neutral
 * so the legend doesn't turn back into the old four-hue tag system. */
.tag.coach { color: var(--accent-dark); border-color: var(--accent-dark); }

.index-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.index-stat {
  font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}

.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-group-label {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; white-space: nowrap;
}
.filter-pill { position: relative; display: inline-flex; }
.filter-pill input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0;
}
.filter-pill span {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); background: var(--chalk);
  border: 1px solid var(--line-heavy); border-radius: var(--radius); padding: 8px 14px;
  cursor: pointer; user-select: none;
}
.filter-pill:hover span { border-color: var(--accent-dark); }
.filter-pill input:checked + span { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.filter-pill input:focus-visible + span { outline: 2px solid var(--accent-dark); outline-offset: 2px; }

/* Sections as a collapsed index */
/* margin-TOP only, deliberately longhand. `.acc-list` is always used together with
 * `.wrap` (features.html), and `.wrap` centres itself with `margin: 0 auto`. The
 * shorthand `margin: 8px 0 0` here silently reset those auto side margins to 0, so
 * the whole accordion list hugged the left edge while every other section on the
 * page stayed centred — a visible mis-alignment at any viewport wider than
 * --measure. Same specificity, but this rule comes later, so it won. Never use the
 * margin shorthand on a class that rides along with .wrap. */
.acc-list { margin-top: 8px; }
details.acc { border-bottom: 1px solid var(--line); scroll-margin-top: 18px; }
details.acc:first-of-type { border-top: 1px solid var(--line); }
details.acc > summary {
  list-style: none; cursor: pointer; padding: 26px 4px 26px 40px; position: relative; display: block;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::marker { content: ""; }
details.acc > summary:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 4px; }

/* Custom chevron, independent of browser UA marker */
details.acc > summary::before {
  content: ""; position: absolute; left: 4px; top: 34px;
  width: 9px; height: 9px; border-right: 2px solid var(--accent-dark); border-bottom: 2px solid var(--accent-dark);
  transform: rotate(-45deg);
}
@media (prefers-reduced-motion: no-preference) {
  details.acc > summary::before { transition: transform .2s ease; }
}
details.acc[open] > summary::before { transform: rotate(45deg); top: 30px; }

.summary-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--ink-soft); border: 1px solid var(--line-heavy); border-radius: var(--radius);
  padding: 3px 9px; white-space: nowrap;
}
details.acc h2 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: .94;
  letter-spacing: -.005em; font-size: clamp(20px, 2.4vw, 27px); margin: 7px 0 6px;
}
.summary-promise { color: var(--ink-soft); max-width: 74ch; margin: 0; font-size: 15px; }

/* Cross-links from a feature section into the matching demo (phase 3). Sits at the
 * top of an opened panel, so the first thing a section offers is "watch it instead".
 *
 * These can land on the /demos gate, because the library is private. That is
 * deliberate rather than a broken link: the gate offers a signup path, so a curious
 * visitor becomes a lead instead of hitting a dead end. The hero says so ONCE
 * (.watch-note) rather than repeating a disclaimer on every link.
 *
 * --accent-dark, not --accent: this is small uppercase mono, and only the dark
 * variant clears AA on chalk (5.0:1 vs 3.9:1). */
.watch-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px;
  margin: 0; padding: 0 0 16px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
}
/* One lead covers the whole row, so a section with three demos reads as one offer
 * rather than three sentences, and the links stay short enough to sit on one line. */
.watch-row .watch-lead { color: var(--muted); }
.watch-row a {
  color: var(--accent-dark); text-decoration: none;
  border-bottom: 1px solid rgba(194, 58, 32, .35);
}
.watch-row a:hover { border-bottom-color: var(--accent-dark); }
.watch-row a:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }

.watch-note {
  margin: 14px 0 0; max-width: 62ch;
  font-size: 14px; line-height: 1.6; color: var(--muted);
}
.watch-note a { color: var(--accent-dark); }

.panel { padding: 0 4px 34px 40px; }
@media (prefers-reduced-motion: no-preference) {
  details.acc[open] > .panel { animation: revealPanel .22s ease; }
}
@keyframes revealPanel {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lines { display: flex; flex-direction: column; }
.line { padding: 16px 0; border-top: 1px solid var(--line); }
.line.is-first { border-top: none; padding-top: 4px; }
.line[hidden] { display: none; }
.line h3 { margin: 0 0 4px; font-size: 15.5px; line-height: 1.3; display: inline; font-weight: 600; }
.line p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.line .who {
  display: inline-block; margin: 0 9px 4px 0; font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line-heavy);
  border-radius: var(--radius); padding: 3px 8px; vertical-align: middle;
}
.line .who.coach { color: var(--accent-dark); border-color: var(--accent-dark); }

/* Sub-groups inside a large section (currently just Grandstand), so a 17-plus item
 * list reads as clear runs instead of a single dumping ground. */
.line-cluster[hidden] { display: none; }
.line-cluster + .line-cluster { margin-top: 24px; }
.line-group-label {
  font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent-dark); margin: 0 0 2px;
}

@media (max-width: 640px) {
  details.acc > summary { padding-left: 30px; }
  details.acc > summary::before { left: 0; }
  .panel { padding-left: 30px; }
}

/* :target: belt-and-suspenders highlight, plus a no-JS fallback affordance */
details.acc:target > summary { background: linear-gradient(90deg, var(--chalk-soft), transparent 70%); }

/* Signup form (/demos/signup) */
.field {
  width: 100%; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-heavy); background: #fff; color: var(--ink);
  font: 15px/1.4 var(--body);
}
.field:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
form label { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
form label span { font-family: var(--body); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink-soft); }

/* ------------------------------------------------- pricing (pricing.html only) ---- */
/* The rate card in the Lane Lines register: tiers are lanes separated by rules, prices
 * are mechanical numerals, and the pigment marks only the flagship lane, the founding
 * offer, and the tick in front of each included item. Every color pair below is an
 * established one (tokens on --chalk / --chalk-soft / the band) — nothing new to test.
 * No shadows: this page never leaves the light field except the shared .band. */

.founding-offer {
  display: grid; grid-template-columns: 1fr auto; gap: 18px 32px; align-items: center;
  border: 1px solid var(--line-heavy); border-left: 4px solid var(--accent);
  background: var(--chalk-soft); border-radius: var(--radius); padding: 28px 30px;
}
.founding-offer h2 {
  font-family: var(--display); text-transform: uppercase; line-height: 1;
  font-size: clamp(22px, 2.8vw, 32px); margin: 8px 0 10px;
}
.founding-offer > div > p { margin: 0; color: var(--ink-soft); max-width: 66ch; }
.founding-terms { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 16px 0 0; padding: 0; }
.founding-terms li {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft);
}
.founding-terms li strong { color: var(--accent-dark); font-weight: 700; }

/* Annually / Per season (prepaid) / Monthly. Pure CSS state via :has(), so the card
 * works with scripts off; a browser without :has() simply shows the annual rate card,
 * which is the default sale anyway. Reuses the .filter-pill control from the feature
 * index. */
.billing-toggle { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 8px; }
.price-view-prepaid, .price-view-season { display: none; }
body:has(#bill-prepaid:checked) .price-view-prepaid { display: block; }
body:has(#bill-prepaid:checked) .price-view-annual { display: none; }
body:has(#bill-season:checked) .price-view-season { display: block; }
body:has(#bill-season:checked) .price-view-annual { display: none; }

.price-lane { padding-top: 20px; border-top: 2px solid var(--line-heavy); }
.price-lane.is-flagship { border-top-color: var(--accent); }
.price-lane h3 { margin-top: 10px; font-size: 24px; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 6px; }
.price-row .datum { font-size: 46px; line-height: 1; }
.price-row .per { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.price-sub { font-size: 14px; color: var(--muted); margin: 0; }
.tier-list { list-style: none; margin: 18px 0 0; padding: 0; }
.tier-list li {
  position: relative; padding: 9px 0 9px 22px; border-top: 1px solid var(--line);
  font-size: 14.5px; color: var(--ink-soft);
}
.tier-list li::before {
  content: ''; position: absolute; left: 2px; top: 17px;
  width: 9px; height: 2px; background: var(--accent);
}

/* Everything-included checklist inside the shared .band */
.inc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; list-style: none; margin: 30px 0 0; padding: 0; }
.inc-grid li {
  position: relative; padding: 10px 0 10px 20px; border-bottom: 1px solid var(--line-dark);
  color: var(--chalk); font-size: 14.5px;
}
.inc-grid li::before {
  content: ''; position: absolute; left: 0; top: 18px;
  width: 9px; height: 2px; background: var(--accent);
}

/* The scale table. Wide content scrolls inside its own container, never the page. */
.compare-wrap { overflow-x: auto; }
table.compare { width: 100%; min-width: 680px; border-collapse: collapse; }
.compare th, .compare td { text-align: left; padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.compare thead th {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line-heavy);
}
.compare tbody th { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.compare td { color: var(--ink-soft); font-size: 14.5px; }
.compare td .datum { font-size: 14.5px; }
.compare .yes { color: var(--accent-dark); font-weight: 700; }
.compare .no { color: var(--muted); }
.compare-note { margin: 14px 0 0; max-width: 62ch; font-size: 13px; color: var(--muted); }

/* The founding tally: the savings math stays folded behind "see the math"; opening it
 * lays the seasons down row by row (the philosophy's mark-by-mark register) while the
 * page script counts the total up. Rows use animation-fill backwards so they hold
 * invisible through their stagger delay; reduced-motion readers get the rows and the
 * final figure instantly. */
.founding-math { margin-top: 14px; max-width: 36ch; font-size: 13px; color: var(--muted); }
/* The trigger is a real button, not a caption: pill-styled like .filter-pill, chalk
 * field (accent-dark needs --chalk, not --chalk-soft, to clear AA at this size — same
 * fix as the legend chips), Track-Red text so the eye finds it without it outranking
 * the primary CTA below. */
.founding-math > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-dark);
  background: var(--chalk); border: 1px solid var(--line-heavy); border-radius: var(--radius);
  padding: 11px 16px; user-select: none;
}
.founding-math > summary:hover { border-color: var(--accent-dark); }
.founding-math[open] > summary { border-color: var(--accent-dark); }
.founding-math > summary::-webkit-details-marker { display: none; }
.founding-math > summary::marker { content: ""; }
.founding-math > summary .sum-open { display: none; }
.founding-math[open] > summary .sum-closed { display: none; }
.founding-math[open] > summary .sum-open { display: inline; }
.founding-math .mrow {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.founding-math .mrow:first-of-type { margin-top: 10px; }
.founding-math .mrow .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.founding-math .mrow .datum { font-size: 14px; color: var(--ink); }
.founding-math .mrow.total { border-bottom: 0; border-top: 2px solid var(--line-heavy); margin-top: 2px; padding-top: 9px; }
.founding-math .mrow.total .datum { font-size: 19px; color: var(--accent-dark); }
@media (prefers-reduced-motion: no-preference) {
  .founding-math[open] .mrow { animation: tallyRow .38s ease backwards; }
  .founding-math[open] .mrow:nth-of-type(1) { animation-delay: .05s; }
  .founding-math[open] .mrow:nth-of-type(2) { animation-delay: .2s; }
  .founding-math[open] .mrow:nth-of-type(3) { animation-delay: .35s; }
  .founding-math[open] .mrow:nth-of-type(4) { animation-delay: .5s; }
  .founding-math[open] .mrow:nth-of-type(5) { animation-delay: .68s; }
  .founding-math[open] .mrow:nth-of-type(6) { animation-delay: .85s; }
}
@keyframes tallyRow {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .founding-offer { grid-template-columns: 1fr; }
  .inc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .inc-grid { grid-template-columns: 1fr; }
  .founding-offer { padding: 22px 20px; }
}
