/* =========================================================
   iZone Driver Performance: shared styles
   Order: fonts → tokens → reset/base → layout → components → utilities
   Palette from the 2027 programme deck (see CLAUDE.md).
   ========================================================= */

/* ---------- Fonts (self-hosted, SIL Open Font Licence) ---------- */
@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Raw palette (deck) */
  --charcoal-900: #141414;
  --charcoal-800: #1E1E1E;
  --charcoal-700: #2E2E2E;
  --red-500: #E53935;      /* deck red: large text, rules, graphics only */
  --red-700: #B71C1C;      /* deck dark red: buttons, links on light */
  --red-300: #FF6F6B;      /* derived tint: red text on charcoal (AA) */
  --offwhite: #F3F2EE;
  --white: #FFFFFF;
  --grey-600: #5C5C5C;
  --grey-300: #BDBDBD;
  --grey-100: #E6E6E6;

  /* Semantic: light (default) */
  --c-bg: var(--offwhite);
  --c-surface: var(--white);
  --c-surface-2: var(--grey-100);
  --c-text: var(--charcoal-900);
  --c-text-muted: var(--grey-600);
  --c-border: var(--grey-300);
  --c-accent: var(--red-700);
  --c-accent-strong: var(--red-500);
  --c-btn-bg: var(--red-700);
  --c-btn-text: var(--white);
  --c-focus: var(--red-700);

  /* Band: always charcoal, in both modes */
  --band-bg: var(--charcoal-900);
  --band-surface: var(--charcoal-800);
  --band-border: var(--charcoal-700);
  --band-text: var(--offwhite);
  --band-muted: var(--grey-300);
  --band-accent: var(--red-300);

  /* Type */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-sm: 0.875rem;
  --fs-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-1: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --fs-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.563rem);
  --fs-3: clamp(1.625rem, 1.4rem + 1vw, 1.953rem);
  --fs-4: clamp(2.25rem, 1.8rem + 2vw, 3rem);
  --fs-5: clamp(2.75rem, 2rem + 3.5vw, 4.5rem);
  --fs-6: clamp(3.25rem, 2rem + 6vw, 6rem);
  --lh-body: 1.6;
  --lh-heading: 1.05;
  --measure: 68ch;

  /* Spacing (4px base) */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;   --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;    --sp-10: 8rem;
  --section-pad: clamp(4rem, 10vw, 8rem);

  /* Layout */
  --container: 75rem;      /* 1200px */
  --container-narrow: 45rem; /* 720px */
  --gutter: clamp(1rem, 4vw, 2rem);

  /* Shape and motion */
  --radius: 2px;
  --radius-card: 6px;
  --dur: 200ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: var(--charcoal-900);
    --c-surface: var(--charcoal-800);
    --c-surface-2: var(--charcoal-700);
    --c-text: var(--offwhite);
    --c-text-muted: var(--grey-300);
    --c-border: var(--charcoal-700);
    --c-accent: var(--red-300);
    --c-accent-strong: var(--red-500);
    --c-btn-bg: var(--red-700);
    --c-btn-text: var(--white);
    --c-focus: var(--red-300);

    --band-bg: #0D0D0D; /* a step darker so bands still read as a band */
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-0);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, li, dd { max-width: var(--measure); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-5); }
h2 { font-size: var(--fs-4); }
h3 { font-size: var(--fs-3); font-weight: 600; }
h4 { font-size: var(--fs-2); font-weight: 600; }

a { color: var(--c-accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius);
}

::selection { background: var(--red-700); color: var(--white); }

/* ---------- Layout ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2 * var(--gutter), var(--container-narrow)); margin-inline: auto; }
.section { padding-block: var(--section-pad); }
.stack > * + * { margin-top: var(--stack-space, var(--sp-4)); }
.stack-lg { --stack-space: var(--sp-6); }
.grid { display: grid; gap: var(--sp-5); }
@media (min-width: 40rem) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 40rem) and (max-width: 59.99rem) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Driver testimonial images (text is baked into each image).
   Three across, in a row wider than the normal container (up to 1600px) so the text is readable.
   A 6-column grid with each image spanning 2, so a shorter last row (e.g. 5 images: 3 + 2) sits centred. */
.testimonials { display: grid; gap: var(--sp-3); }
@media (min-width: 48rem) {
  .testimonials {
    grid-template-columns: repeat(6, 1fr);
    margin-inline: calc(50% - min(50vw - var(--gutter), 50rem));
  }
  .testimonial { grid-column: span 2; }
  /* Last row has two images: start the first of them one column in, so the pair is centred. */
  .testimonial:nth-child(3n + 1):nth-last-child(2) { grid-column: 2 / span 2; }
}
.testimonial { margin: 0; }
.testimonial a { display: block; overflow: hidden; border-radius: var(--radius-card); }
.testimonial img { display: block; width: 100%; height: auto; transition: transform 400ms var(--ease); }
.testimonial a { transition: transform 300ms var(--ease), box-shadow 300ms var(--ease); }
.testimonial a:hover, .testimonial a:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.25), 0 0 0 2px var(--red-500);
}
.testimonial a:hover img { transform: scale(1.03); }

/* Driver's Instagram link: fades in over the photo on hover or keyboard focus. */
.testimonial { position: relative; }
.testimonial a.testimonial__social {
  position: absolute; left: 50%; bottom: var(--sp-3);
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.5em 1em; border-radius: 999px;
  background: rgb(20 20 20 / 0.85); color: var(--white);
  font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  opacity: 0; transform: translate(-50%, 8px);
  transition: opacity 250ms var(--ease), transform 250ms var(--ease), background 200ms var(--ease);
  box-shadow: none; overflow: visible;
}
.testimonial:hover a.testimonial__social,
.testimonial:focus-within a.testimonial__social { opacity: 1; transform: translate(-50%, -6px); }
.testimonial a.testimonial__social:hover,
.testimonial a.testimonial__social:focus-visible { background: var(--red-700); }
/* Touch screens have no hover, so always show it. */
@media (hover: none) {
  .testimonial a.testimonial__social { opacity: 1; transform: translate(-50%, 0); }
}

/* Scroll reveal (class added by js/main.js, removed again once finished).
   Doubled class so it beats component transitions such as .card's. */
.reveal.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease), border-color var(--dur) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.reveal.is-visible { opacity: 1; transform: none; }

/* Page-specific scroll effects */
/* Photos in mosaics and photo bands: subtle zoom as the whole group appears */
.mosaic.reveal > *, .photo-band.reveal { overflow: hidden; }
.mosaic.reveal img, .photo-band.reveal img { transform: scale(1.08); transition: transform 1.2s var(--ease); }
.mosaic.reveal.is-visible img, .photo-band.reveal.is-visible img { transform: none; }
/* Train anywhere: gauges fill up when the card appears */
.reveal .mode__gauge span { width: 0; transition: width 1s var(--ease) 400ms; }
.reveal.is-visible .mode__gauge span { width: var(--fill); }
/* A day at iZone: timeline dots pop in */
.timeline li.reveal::before { transform: scale(0); transition: transform 400ms var(--ease) 200ms; }
.timeline li.reveal.is-visible::before { transform: none; }
/* Results: red rule draws across */
.result.reveal { border-top-color: transparent; position: relative; }
.result.reveal::before {
  content: ""; position: absolute; top: -3px; left: 0; right: 0;
  border-top: 3px solid var(--red-500); transform: scaleX(0); transform-origin: left;
  transition: transform 800ms var(--ease) 200ms;
}
.result--pending.reveal::before { border-top-style: dashed; border-top-color: var(--c-border); }
.result.reveal.is-visible::before { transform: scaleX(1); }

/* Pop-up viewer for driver photos (built by js/main.js) */
.lightbox {
  /* Centre in the viewport (the global reset removes the dialog's default auto margins) */
  position: fixed; inset: 0; margin: auto; height: fit-content;
  width: min(92vw, 88vh); max-width: none; max-height: 92vh; padding: 0;
  border: 0; background: transparent; overflow: visible;
}
.lightbox::backdrop { background: rgb(10 10 10 / 0.88); }
.lightbox[open] { animation: pop-in 250ms var(--ease); }
.lightbox img { display: block; width: 100%; height: auto; border-radius: var(--radius-card); }
.lightbox__btn {
  position: absolute; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--red-700); color: var(--white); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lightbox__btn:hover { background: var(--red-500); }
.lightbox__close { top: -22px; right: -22px; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: -22px; }
.lightbox__next { right: -22px; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* Charcoal band: same in light and dark mode */
.band {
  background: var(--band-bg);
  color: var(--band-text);
  --c-text: var(--band-text);
  --c-text-muted: var(--band-muted);
  --c-accent: var(--band-accent);
  --c-border: var(--band-border);
  --c-surface: var(--band-surface);
  --c-focus: var(--band-accent);
}

/* ---------- Components ---------- */

/* Eyebrow label: the only uppercase text */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.eyebrow::before {
  content: ""; width: 1.5rem; height: 2px; background: var(--red-500);
}

.lead { font-size: var(--fs-1); color: var(--c-text-muted); }
.display { font-family: var(--font-display); font-size: var(--fs-6); font-weight: 700; line-height: 0.95; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-3) var(--sp-5);
  border: 2px solid transparent; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-0); line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn--primary { background: var(--c-btn-bg); color: var(--c-btn-text); }
.btn--primary:hover { background: #8E1515; }            /* darker on hover keeps AA */
.btn--secondary { border-color: currentColor; color: var(--c-text); background: transparent; }
.btn--secondary:hover { background: var(--c-text); color: var(--c-bg); }
.band .btn--secondary:hover { color: var(--band-bg); }
.btn-link {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; font-weight: 600; text-decoration: none; color: var(--c-accent);
}
.btn-link::after { content: "→"; transition: transform var(--dur) var(--ease); }
.btn-link:hover::after { transform: translateX(4px); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* Cards */
.card {
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-6);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-card);
  transition: border-color var(--dur) var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: -1px -1px auto; height: 3px;
  background: var(--red-500); border-radius: var(--radius-card) var(--radius-card) 0 0;
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease);
}
.card:hover::before, .card:focus-within::before { transform: scaleX(1); }
.card__title { font-size: var(--fs-2); }
.card__text { color: var(--c-text-muted); }
/* Make the whole card clickable through its one link */
.card__link { text-decoration: none; color: inherit; }
.card__link::after { content: ""; position: absolute; inset: 0; }

/* Stat */
.stat { display: flex; flex-direction: column; gap: var(--sp-1); }
.stat__value {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-5); line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--c-text);
}
.stat__value em { font-style: normal; color: var(--red-500); }
.stat__label { color: var(--c-text-muted); font-size: var(--fs-sm); }

/* Quote (only with permission) */
.quote { border-left: 3px solid var(--red-500); padding-left: var(--sp-5); }
.quote p { font-family: var(--font-display); font-size: var(--fs-3); font-weight: 600; line-height: 1.15; }
.quote footer { margin-top: var(--sp-3); color: var(--c-text-muted); font-size: var(--fs-sm); }

/* Timeline */
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--c-border); }
.timeline li { position: relative; padding: 0 0 var(--sp-5) var(--sp-5); }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.45em;
  width: 12px; height: 12px; background: var(--red-500); border-radius: 50%;
}
.timeline time { display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2); font-variant-numeric: tabular-nums; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field label, .field legend { font-weight: 600; }
.field .hint { color: var(--c-text-muted); font-size: var(--fs-sm); }
.input, .select, .textarea {
  min-height: 44px; padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--grey-600); border-radius: var(--radius);
}
.textarea { min-height: 8rem; resize: vertical; }
.field--error .input, .field--error .select, .field--error .textarea { border: 2px solid var(--c-accent); }
.field .error { color: var(--c-accent); font-size: var(--fs-sm); font-weight: 600; }
.field .error::before { content: "⚠ "; }

/* Notice (used for TODO-LAUNCH placeholders visible on the page) */
.notice {
  padding: var(--sp-4) var(--sp-5);
  border: 1px dashed var(--c-accent); border-radius: var(--radius);
  color: var(--c-text); background: var(--c-surface);
  font-size: var(--fs-sm);
}

/* Skip link */
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  padding: var(--sp-3) var(--sp-4); background: var(--c-btn-bg); color: var(--c-btn-text);
  font-weight: 600; border-radius: var(--radius);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--band-bg); color: var(--band-text);
  border-bottom: 1px solid var(--band-border);
  --c-text: var(--band-text);
  --c-text-muted: var(--band-muted);
  --c-accent: var(--band-accent);
  --c-focus: var(--band-accent);
}
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-3) var(--sp-5);
  min-height: 4rem; padding-block: var(--sp-2);
}

/* Logo (PNG for now; SVG preferred before launch) */
.wordmark {
  display: inline-flex; flex-direction: column; line-height: 1;
  color: inherit; text-decoration: none;
}
.wordmark__main { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; letter-spacing: 0.01em; }
.wordmark__logo { display: block; height: 2.5rem; width: auto; max-width: 100%; }
.wordmark__sub { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--band-muted); }

/* Nav: without JavaScript, links simply wrap below the wordmark */
.nav-toggle { display: none; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); width: 100%; }
.site-nav__list { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); list-style: none; padding: 0; }
.site-nav__list a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--band-text); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  border-bottom: 2px solid transparent;
}
.site-nav__list a:hover { border-bottom-color: var(--band-muted); }
.site-nav__list a[aria-current="page"] { border-bottom-color: var(--red-500); }

/* Mobile menu with JavaScript */
@media (max-width: 59.99rem) {
  .has-js-menu .nav-toggle {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    min-height: 44px; padding: var(--sp-2) var(--sp-3);
    background: transparent; color: var(--band-text);
    border: 1px solid var(--band-border); border-radius: var(--radius);
    font-weight: 600; cursor: pointer;
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 18px; height: 2px; background: currentColor;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after { top: 6px; }
  .is-open .nav-toggle__bars { background: transparent; }
  .is-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
  .is-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

  .has-js-menu .site-nav { display: none; }
  .has-js-menu.is-open .site-nav {
    display: flex; flex-direction: column; align-items: stretch;
    padding-block: var(--sp-3) var(--sp-5);
  }
  .has-js-menu .site-nav__list { flex-direction: column; }
  .has-js-menu .site-nav__list a { width: 100%; border-bottom: 1px solid var(--band-border); font-size: var(--fs-0); }
  .has-js-menu .site-nav__list a[aria-current="page"] { border-bottom-color: var(--red-500); }
}

@media (min-width: 60rem) {
  .site-header__inner { flex-wrap: nowrap; }
  .site-nav { width: auto; flex-wrap: nowrap; }
  .site-nav__list { flex-wrap: nowrap; gap: var(--sp-5); }
}

/* ---------- Site footer ---------- */
.site-footer {
  background: var(--band-bg); color: var(--band-text);
  border-top: 3px solid var(--red-500);
  --c-text: var(--band-text);
  --c-text-muted: var(--band-muted);
  --c-accent: var(--band-accent);
  --c-focus: var(--band-accent);
}
.site-footer__inner {
  display: grid; gap: var(--sp-7);
  padding-block: var(--sp-8) var(--sp-6);
}
.site-footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-5); }
.site-footer__nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--sp-6); }
.site-footer__heading {
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--band-muted);
  margin-bottom: var(--sp-3);
}
.site-footer ul { list-style: none; padding: 0; }
.site-footer ul a, .site-footer address a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--band-text); text-decoration: none;
}
.site-footer ul a:hover, .site-footer address a:hover { text-decoration: underline; }
.site-footer a[aria-current="page"] { color: var(--band-accent); }
.site-footer address { font-style: normal; line-height: 1.8; }
/* Social media icons in the footer */
.site-footer__contact .site-footer__heading + .socials { margin-top: 0; }
.site-footer address + .site-footer__heading { margin-top: var(--sp-6); }
.socials { display: flex; gap: var(--sp-2); }
.site-footer .socials a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--band-border); border-radius: 50%; color: var(--band-text);
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}
.site-footer .socials a:hover, .site-footer .socials a:focus-visible {
  background: var(--red-700); border-color: var(--red-700); color: var(--white); text-decoration: none;
}
.site-footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3);
  padding-top: var(--sp-5); border-top: 1px solid var(--band-border);
  font-size: var(--fs-sm); color: var(--band-muted);
}
.site-footer__legal a { color: var(--band-muted); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__legal p { display: flex; align-items: center; }

@media (min-width: 60rem) {
  .site-footer__inner { grid-template-columns: 1fr 2fr 1fr; }
  .site-footer__legal { grid-column: 1 / -1; }
}

/* ---------- 404 ---------- */
.error-page { min-height: 60vh; display: flex; align-items: center; }
.error-page .display { color: var(--red-500); }

/* ---------- Home ---------- */
.hero { padding-block: clamp(5rem, 14vw, 10rem); position: relative; overflow: hidden; }
.hero::after {
  /* thin racing-line accent, drawn in from the left on load */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 1;
  background: linear-gradient(90deg, var(--red-500) 0 30%, transparent 30%);
  transform-origin: left; animation: line-draw 1.4s var(--ease) 0.3s both;
}
.hero--photo { background: var(--band-bg); }
.hero--photo::before {
  /* photo on its own layer so it can slowly zoom without moving the text */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(20,20,20,.92) 0%, rgba(20,20,20,.75) 55%, rgba(20,20,20,.45) 100%), url("../assets/img/facility/simulator-wide.jpg");
  background-size: cover; background-position: center;
  animation: hero-zoom 20s ease-out both;
}
.hero__inner { position: relative; z-index: 1; }
.hero__title::after {
  /* red racing line under the main heading */
  content: ""; display: block; width: 4.5rem; height: 4px; margin-top: var(--sp-4);
  background: var(--red-500); transform-origin: left;
  animation: line-draw 900ms var(--ease) 0.6s both;
}
@keyframes hero-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes line-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.photo-row { display: grid; gap: var(--sp-4); }
@media (min-width: 48rem) { .photo-row { grid-template-columns: repeat(3, 1fr); } }
.photo { margin: 0; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; }
.photo figcaption { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--c-text-muted); }
.hero__title { font-size: var(--fs-6); line-height: 0.95; max-width: 14ch; }
.hero__lead { color: var(--band-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.who { margin-bottom: var(--sp-8); align-items: end; }
.stats { gap: var(--sp-6); }
.stats .stat { flex-direction: column-reverse; justify-content: flex-end; border-top: 2px solid var(--c-border); padding-top: var(--sp-4); }
.stats dd { margin: 0; }
.stat__pending { font-size: var(--fs-2); color: var(--c-text-muted); }

/* Signature: small-improvements counter */
.advantage__inner { gap: var(--sp-8); align-items: center; }
.counter {
  margin: 0; padding: var(--sp-6);
  border: 1px solid var(--band-border); border-radius: var(--radius-card);
  background: var(--band-surface);
}
.counter__caption { color: var(--band-muted); }
.counter__caption strong { color: var(--band-text); }
.counter__value {
  display: flex; align-items: baseline;
  font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums;
  font-size: clamp(4rem, 3rem + 7vw, 8.5rem); line-height: 1; color: var(--red-500);
  margin-top: var(--sp-4);
}
.counter__unit { font-size: 0.4em; margin-left: 0.1em; color: var(--band-text); }
.counter__label { font-family: var(--font-display); font-size: var(--fs-2); font-weight: 600; }
.counter__switch {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-5); padding: 0; border: 0;
}
.counter__switch label {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--band-border); border-radius: var(--radius);
  cursor: pointer; font-weight: 600; font-size: var(--fs-sm);
}
.counter__switch label:has(input:checked) { border-color: var(--red-500); }
.counter__switch input { accent-color: var(--red-500); }

/* Five steps */
.how { background: var(--c-surface-2); }
.steps { list-style: none; padding: 0; display: grid; gap: var(--sp-5); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: var(--sp-7); border-top: 2px solid var(--c-border); }
.steps li::before {
  content: "0" counter(step); position: absolute; top: var(--sp-3); left: 0;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2); color: var(--red-500);
}
.steps h3 { font-size: var(--fs-2); margin-bottom: var(--sp-2); }
.steps p { color: var(--c-text-muted); font-size: var(--fs-sm); }
/* Red progress line fills each step's top border in turn as it scrolls into view */
.steps li::after {
  content: ""; position: absolute; top: -2px; left: 0; right: 0; height: 2px;
  background: var(--red-500); transform: scaleX(0); transform-origin: left;
  transition: transform 600ms var(--ease);
  transition-delay: calc(var(--reveal-delay, 0ms) * 2 + 300ms);
}
.steps li.is-visible::after, .steps li:not(.reveal)::after { transform: scaleX(1); }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .steps { grid-template-columns: repeat(5, 1fr); } }

.cta__inner { text-align: center; }
.cta__inner p { margin-inline: auto; }
.cta .lead { color: var(--band-muted); }

/* ---------- Inner page intro ---------- */
.page-hero { padding-block: clamp(4rem, 10vw, 7rem); position: relative; overflow: hidden; }
.page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 1;
  background: linear-gradient(90deg, var(--red-500) 0 30%, transparent 30%);
  transform-origin: left; animation: line-draw 1.4s var(--ease) 0.3s both;
}
.page-hero > * { position: relative; z-index: 1; }
/* Heading and intro text rise in on page load */
.page-hero .eyebrow, .page-hero h1, .page-hero__lead { animation: rise-in 800ms var(--ease) both; }
.page-hero h1 { animation-delay: 120ms; }
.page-hero__lead { animation-delay: 260ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.page-hero h1 { max-width: 18ch; }
.page-hero__lead { color: var(--band-muted); }

/* ---------- Photos ---------- */
/* Page heroes with a photo behind a dark overlay (keeps text AA-readable) */
/* Overlay: dark behind the text on the left, photo shows clearly on the right */
.page-hero--photo {
  --shade: linear-gradient(90deg, rgba(20,20,20,.88) 0%, rgba(20,20,20,.6) 45%, rgba(20,20,20,.15) 100%);
  background-size: cover; background-position: center;
  padding-block: clamp(6rem, 16vw, 11rem);
}
@media (max-width: 47.99rem) {
  /* On phones the text covers the full width, so shade evenly */
  .page-hero--photo { --shade: linear-gradient(rgba(20,20,20,.72), rgba(20,20,20,.72)); }
}
/* Slow zoom-out on the hero photo: a copy of the background on its own layer */
.page-hero--photo::before {
  content: ""; position: absolute; inset: 0;
  background: inherit; background-size: cover; background-position: center;
  animation: hero-zoom 20s ease-out both;
}
.page-hero--programme { background-image: var(--shade), url("../assets/img/coaching/data-and-driving.jpg"); }
.page-hero--day { background-image: var(--shade), url("../assets/img/facility/simulator-from-behind.jpg"); }
.page-hero--method { background-image: var(--shade), url("../assets/img/coaching/data-on-screen.jpg"); }
.page-hero--mindset { background-image: var(--shade), url("../assets/img/gym/boxing-2.jpg"); }
.page-hero--pressure { background-image: var(--shade), url("../assets/img/coaching/esports-simulator.jpg"); }
.page-hero--offseason { background-image: var(--shade), url("../assets/img/gym/grip-strength-2.jpg"); }
.page-hero--anywhere { background-image: var(--shade), url("../assets/img/facility/training-app.jpg"); }
.page-hero--families { background-image: var(--shade), url("../assets/img/coaching/coaching-at-simulator.jpg"); }
.page-hero--results { background-image: var(--shade), url("../assets/img/facility/simulator-side.jpg"); }

/* Full-width cinematic strip between sections */
.photo-band { margin: 0; }
.photo-band img { display: block; width: 100%; height: clamp(14rem, 38vw, 30rem); object-fit: cover; }

/* Mosaic: one large landscape plus two tall crops */
.section--tight { padding-block: var(--sp-5); }
.mosaic { display: grid; gap: var(--sp-3); grid-template-columns: 1fr 1fr; }
.mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.mosaic__big { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.mosaic__a, .mosaic__b { aspect-ratio: 4 / 5; }
@media (min-width: 48rem) {
  .mosaic { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: clamp(26rem, 45vw, 36rem); }
  .mosaic__big { grid-column: 1; grid-row: 1 / span 2; aspect-ratio: auto; }
  .mosaic__a, .mosaic__b { aspect-ratio: auto; }
}
@media (min-width: 48rem) {
  .mosaic--flip { grid-template-columns: 1fr 2fr; }
  .mosaic--flip .mosaic__big { grid-column: 2; grid-row: 1 / span 2; }
  .mosaic--flip .mosaic__a { grid-column: 1; grid-row: 1; }
  .mosaic--flip .mosaic__b { grid-column: 1; grid-row: 2; }
}

/* ---------- Pressure Days: head-to-head board ---------- */
.pressure { gap: var(--sp-8); align-items: center; }
.board {
  margin: 0; border: 1px solid var(--band-border); border-radius: var(--radius-card);
  background: var(--band-surface); overflow: hidden;
}
.board__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-4) var(--sp-5); border-bottom: 2px solid var(--red-500);
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2);
}
.board__badge {
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--band-muted);
}
.board__rows { list-style: none; padding: 0; }
.board__rows li {
  display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--band-border);
  font-variant-numeric: tabular-nums; max-width: none;
}
.board__rows li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.board__pos { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2); color: var(--red-500); }
.board__tag { font-size: var(--fs-sm); color: var(--band-muted); }
.board__extra { border-bottom: 0; }

/* ---------- A day at iZone ---------- */
.day { gap: var(--sp-8); align-items: start; }
@media (min-width: 40rem) { .day__intro { position: sticky; top: 6rem; } }
.day__timeline li { padding-bottom: var(--sp-6); }
.day__timeline time { color: var(--c-accent); }
.day__timeline h3 { font-size: var(--fs-2); }
.rooms { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.rooms li {
  max-width: none; padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--band-border); border-left: 3px solid var(--red-500); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-2);
}

/* ---------- Method ---------- */
.figure { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-5); line-height: 1; color: var(--red-500); font-variant-numeric: tabular-nums; }
.window { gap: var(--sp-8); align-items: center; }
.window__fig { margin: 0; }
.window__track {
  position: relative; height: 7rem;
  border-bottom: 2px solid var(--band-border);
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--band-border) calc(10% - 1px) 10%);
}
.window__zone {
  position: absolute; inset: 0 10%;
  background: rgba(229, 57, 53, 0.15); border-inline: 2px solid var(--red-500);
}
.window__lap {
  position: absolute; left: var(--x); top: 50%;
  width: 0.9rem; height: 0.9rem; margin: -0.45rem 0 0 -0.45rem;
  border-radius: 50%; background: var(--band-text);
  animation: lap-in 600ms var(--ease) both;
}
.window__lap:nth-child(3) { animation-delay: 150ms; }
.window__lap:nth-child(4) { animation-delay: 300ms; }
.window__lap:nth-child(5) { animation-delay: 450ms; }
.window__lap:nth-child(6) { animation-delay: 600ms; }
@keyframes lap-in { from { opacity: 0; transform: translateY(-1rem); } }
.window__scale {
  display: flex; justify-content: space-between; padding-inline: 10%;
  margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--band-muted); font-variant-numeric: tabular-nums;
}
.window__scale span:first-child { transform: translateX(-50%); }
.window__scale span:last-child { transform: translateX(50%); }
.window__caption { margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--band-muted); }

/* ---------- Mindset ---------- */
.split { display: grid; gap: var(--sp-5); align-items: center; }
.split__side { padding: var(--sp-6); border-radius: var(--radius-card); border: 1px solid var(--band-border); display: grid; gap: var(--sp-3); }
.split__side--threat { opacity: 0.75; border-style: dashed; }
.split__side--challenge { border: 2px solid var(--red-500); background: var(--band-surface); }
.split__label { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--band-muted); }
.split__voice { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3); line-height: 1.1; }
.split__arrow { font-size: var(--fs-4); color: var(--red-500); text-align: center; transform: rotate(90deg); }
@media (min-width: 48rem) {
  .split { grid-template-columns: 1fr auto 1fr; }
  .split__arrow { transform: none; }
}
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tags li { max-width: none; padding: var(--sp-2) var(--sp-4); border: 1px solid var(--band-border); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; }

/* ---------- Off-season ---------- */
.phases { list-style: none; padding: 0; display: grid; gap: var(--sp-5); }
@media (min-width: 48rem) { .phases { grid-template-columns: 1fr 1fr; gap: 0; } }
.phases__item { padding: var(--sp-6); border: 1px solid var(--c-border); background: var(--c-surface); display: grid; gap: var(--sp-3); align-content: start; }
.phases__item + .phases__item { border-top: 3px solid var(--red-500); }
@media (min-width: 48rem) {
  .phases__item:first-child { border-radius: var(--radius-card) 0 0 var(--radius-card); }
  .phases__item + .phases__item { border-top: 1px solid var(--c-border); border-left: 0; border-radius: 0 var(--radius-card) var(--radius-card) 0; }
}
.phases__months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.phases__months span {
  padding: var(--sp-2); text-align: center; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2);
  background: var(--c-surface-2);
}
.phases__item:last-child .phases__months span { background: var(--charcoal-800); color: var(--offwhite); }
.phases__num { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-accent); }
.phases__item h3 { font-size: var(--fs-3); }

/* ---------- Train anywhere ---------- */
.mode__gauge { height: 6px; background: var(--c-surface-2); border-radius: 3px; overflow: hidden; }
.mode__gauge span { display: block; height: 100%; width: var(--fill); background: var(--red-500); }
.mode__where { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-text-muted); }
.mode:target { border-color: var(--red-500); }
.cta-light { text-align: center; }

/* ---------- Results ---------- */
.results { list-style: none; padding: 0; display: grid; gap: var(--sp-5); }
@media (min-width: 48rem) { .results { grid-template-columns: 1fr 1fr; } }
.result { padding: var(--sp-6) 0; border-top: 3px solid var(--red-500); max-width: none; }
.result__headline { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-6); line-height: 0.95; }
.result__who { margin-top: var(--sp-3); color: var(--c-text-muted); }
.result--pending { border-top-style: dashed; border-top-color: var(--c-border); }
.result--pending .result__headline { color: var(--c-text-muted); opacity: 0.6; }

/* ---------- Families ---------- */
.big-questions { list-style: none; padding: 0; display: grid; gap: var(--sp-6); counter-reset: q; }
@media (min-width: 60rem) { .big-questions { grid-template-columns: repeat(3, 1fr); } }
.big-questions li { counter-increment: q; border-top: 3px solid var(--red-500); padding-top: var(--sp-5); }
.big-questions h3 { font-size: var(--fs-5); line-height: 1; margin-bottom: var(--sp-3); }
.big-questions p { color: var(--c-text-muted); }

/* ---------- Contact ---------- */
.contact { display: grid; gap: var(--sp-8); }
@media (min-width: 60rem) { .contact { grid-template-columns: 2fr 1fr; align-items: start; } .contact__aside { position: sticky; top: 6rem; } }
.contact__aside { padding: var(--sp-6); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-card); }
.contact__aside h2 { font-size: var(--fs-3); }
.contact__aside address { font-style: normal; }
.choice { border: 0; padding: 0; display: grid; gap: var(--sp-2); }
.choice legend { margin-bottom: var(--sp-2); }
.choice label, .consent label { display: flex; align-items: flex-start; gap: var(--sp-3); min-height: 44px; align-items: center; font-weight: 400; cursor: pointer; }
.consent label { align-items: flex-start; }
.choice input, .consent input { width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--red-700); margin-top: 0.2em; }
.field--error.choice legend, .field--error.consent label { color: var(--c-accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error-summary { padding: var(--sp-5); border: 3px solid var(--c-accent); border-radius: var(--radius); background: var(--c-surface); }
.error-summary h3 { font-size: var(--fs-2); margin-bottom: var(--sp-2); }
.error-summary a { font-weight: 600; }
.form-status { padding: var(--sp-5); border-radius: var(--radius); background: var(--c-surface); border: 2px solid var(--c-border); }
.form-status--warn { border-color: var(--c-accent); border-style: dashed; }
.form-status--ok { border-color: var(--red-500); border-left-width: 6px; }
.form-status h2 { font-size: var(--fs-3); margin-bottom: var(--sp-2); }

/* ---------- Prose (privacy) ---------- */
.prose h2 { font-size: var(--fs-3); margin-top: var(--sp-6); }

/* ---------- Journal ---------- */
.posts { list-style: none; padding: 0; }
.post--pending { border-style: dashed; }
.post--pending .card__title { color: var(--c-text-muted); }

/* ---------- Programme ---------- */
.element__num { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-4); line-height: 1; color: var(--red-500); }
.bench-intro { gap: var(--sp-6); align-items: end; }
.questions { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.questions li {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-2);
  padding: var(--sp-1) var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--radius);
}
.ticks { list-style: none; padding: 0; display: grid; gap: var(--sp-2); }
.ticks li { position: relative; padding-left: var(--sp-6); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 0.9rem; height: 0.45rem; border-left: 2px solid var(--red-500); border-bottom: 2px solid var(--red-500);
  transform: rotate(-45deg);
}

/* Signature: five-step loop. Mobile: a numbered list with a line that returns to the start. */
.loop { position: relative; }
.loop__centre { display: none; }
.loop__steps { list-style: none; padding: 0; display: grid; gap: var(--sp-5); position: relative; }
.loop__steps li { position: relative; padding-left: var(--sp-8); }
.loop__steps h3 { font-size: var(--fs-2); }
.loop__steps p { color: var(--band-muted); font-size: var(--fs-sm); }
.loop__num {
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 2px solid var(--red-500); border-radius: 50%; background: var(--band-bg);
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2);
}
.loop__steps::before {
  /* vertical track joining the steps */
  content: ""; position: absolute; left: calc(1.375rem - 1px); top: 1.4rem; bottom: 1.4rem;
  width: 2px; background: var(--band-border);
}
.loop__steps::after {
  /* "back to step 1" return arrow */
  content: "↺ Repeat every month"; display: block; margin-top: var(--sp-2);
  padding-left: var(--sp-8); color: var(--band-accent); font-weight: 600; font-size: var(--fs-sm);
}

/* Desktop: steps sit around a circle */
@media (min-width: 60rem) {
  .loop {
    --size: 34rem;
    width: var(--size); height: var(--size); margin: var(--sp-8) auto var(--sp-10);
  }
  .loop::before {
    content: ""; position: absolute; inset: 0;
    border: 2px dashed var(--band-border); border-radius: 50%;
  }
  .loop__centre {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: absolute; inset: 30%; border-radius: 50%;
    border: 2px solid var(--red-500);
    font-family: var(--font-display); font-weight: 600; font-size: var(--fs-2); text-align: center; line-height: 1;
  }
  .loop__centre-big { font-size: var(--fs-4); font-weight: 700; color: var(--red-500); }
  .loop__steps { position: absolute; inset: 0; display: block; }
  .loop__steps::before, .loop__steps::after { display: none; }
  .loop__steps li {
    --angle: calc(var(--i) * 72deg - 90deg);
    position: absolute; left: 50%; top: 50%; width: 13rem; padding: 0;
    transform:
      translate(calc(cos(var(--angle)) * (var(--size) / 2) - 50%),
                calc(sin(var(--angle)) * (var(--size) / 2) - 1.4rem));
    text-align: center;
  }
  .loop__num { position: static; margin: 0 auto var(--sp-2); }
  .loop__steps p { max-width: none; }

  /* Method page: four pillars at 12, 3, 6 and 9 o'clock */
  .loop--pillars .loop__steps li { --angle: calc(var(--i) * 90deg - 90deg); width: 15rem; }
  .loop--pillars .loop__steps li:nth-child(2) { transform: translate(calc(var(--size) / 2 - 1.375rem), -1.4rem); text-align: left; }
  .loop--pillars .loop__steps li:nth-child(4) { transform: translate(calc(var(--size) / -2 - 15rem + 1.375rem), -1.4rem); text-align: right; }
  .loop--pillars .loop__steps li:nth-child(2) .loop__num { margin-left: 0; }
  .loop--pillars .loop__steps li:nth-child(4) .loop__num { margin-right: 0; }
  .loop--pillars .loop__centre-big { font-size: var(--fs-3); }
}

/* Programme page: five steps along a horizontal timeline */
@media (min-width: 60rem) {
  .loop--line { width: auto; height: auto; margin: var(--sp-8) 0; }
  .loop--line::before { display: none; }
  .loop--line .loop__steps {
    position: relative; inset: auto;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-5);
  }
  .loop--line .loop__steps::before {
    /* horizontal track through the number circles */
    display: block; content: ""; position: absolute;
    left: 10%; right: 10%; top: calc(1.375rem - 1px); bottom: auto;
    width: auto; height: 2px; background: var(--band-border);
  }
  .loop--line .loop__steps::after {
    display: block; grid-column: 1 / -1; padding-left: 0; margin-top: 0; text-align: center;
  }
  .loop--line .loop__steps li { position: relative; left: auto; top: auto; width: auto; transform: none; }
  .loop--line .loop__num { position: relative; }
  .loop--line .loop__steps::before { transform-origin: left center; }
}

/* Timeline animation: the line draws through the steps and each one appears as the line reaches it.
   Classes are added by setUpTimeline() in main.js, so without JavaScript everything is simply shown. */
.loop--line.is-pending .loop__steps::before { transform: scaleY(0); transform-origin: center top; }
.loop--line.is-pending .loop__steps li,
.loop--line.is-pending .loop__steps::after { opacity: 0; transform: translateY(0.75rem); }
.loop--line.is-playing .loop__steps::before { transform: none; transition: transform 2.5s linear; }
.loop--line.is-playing .loop__steps li {
  opacity: 1; transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--i) * 0.6s);
}
.loop--line.is-playing .loop__steps::after { opacity: 1; transform: none; transition: opacity 0.5s ease 2.8s, transform 0.5s ease 2.8s; }
@media (min-width: 60rem) {
  .loop--line.is-pending .loop__steps::before { transform: scaleX(0); transform-origin: left center; }
  .loop--line.is-playing .loop__steps::before { transform: none; }
}

/* Pillars circle animation (Method page): the circle draws clockwise from point 1,
   and each pillar appears as the circle reaches it (1 → 2 → 3 → 4). Opacity only,
   because the pillars use transform for their position round the circle. */
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
.loop--pillars.is-pending .loop__centre,
.loop--pillars.is-pending .loop__steps li { opacity: 0; }
.loop--pillars.is-pending .loop__steps::before { transform: scaleY(0); transform-origin: center top; }
.loop--pillars.is-playing .loop__steps::before { transform: none; transition: transform 2.8s linear; }
.loop--pillars.is-playing .loop__centre { opacity: 1; transition: opacity 0.6s ease; }
.loop--pillars.is-playing .loop__steps li {
  opacity: 1;
  transition: opacity 0.6s ease;
  transition-delay: calc(var(--i) * 0.7s); /* matches the circle reaching each quarter */
}
@media (min-width: 60rem) {
  .loop--pillars::before {
    -webkit-mask: conic-gradient(#000 var(--sweep), transparent 0);
    mask: conic-gradient(#000 var(--sweep), transparent 0);
  }
  .loop--pillars.is-pending::before { --sweep: 0deg; }
  .loop--pillars.is-playing::before { --sweep: 360deg; transition: --sweep 2.8s linear; }
}
/* Pillar headings that link down the page */
.loop--pillars h3 a { color: inherit; text-decoration-color: var(--red-500); text-underline-offset: 0.2em; }
.loop--pillars .loop__steps::after { content: "All four trained together"; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--c-text-muted); }
.rule { height: 2px; width: 3rem; background: var(--red-500); border: 0; }
