/* RunStride website. Matches the app: deep purple, the orange-to-pink logo gradient,
   Plus Jakarta Sans. One dark look by design. */
:root {
  --bg: #2e0444;
  --bg-deep: #1f022e;
  --surface: #43105c;
  --border: #5c2378;
  --text: #eadff1;
  --muted: #cdb6dc;
  --faint: #a88bbd;
  --heading: #ffffff;
  --orange: #f47c4f;
  --pink: #e0489e;
  --gradient: linear-gradient(120deg, #d63c97, #f0605a 55%, #f47c4f);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--orange); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
h1, h2, h3 { color: var(--heading); line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { max-width: 72rem; margin: 0 auto; padding-inline: 1.25rem; }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(46, 4, 68, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(92, 35, 120, 0.6); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--heading); font-weight: 800; text-decoration: none; font-size: 1.1rem; }
.brand img { width: 36px; height: auto; }
.top nav { display: flex; gap: 1.25rem; align-items: center; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.top nav a:hover { color: var(--heading); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--gradient); color: #fff; font-weight: 700; text-decoration: none;
  border: 0; border-radius: 999px; padding: 0.85rem 1.4rem; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 30px rgba(224, 72, 158, 0.25);
}
.button:hover { filter: brightness(1.05); }
.top .button { padding: 0.55rem 1.1rem; font-size: 0.9rem; }
@media (max-width: 640px) { .top nav a:not(.button) { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: 4rem 5rem; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 60rem; height: 60rem;
  background: radial-gradient(closest-side, rgba(224, 72, 158, 0.28), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; align-items: center; }
.eyebrow { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.03em; margin-top: 0.6rem; }
.hero h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.2rem; color: var(--muted); margin-top: 1.2rem; max-width: 34rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin-top: 2rem; }
.hero .note { color: var(--faint); font-size: 0.9rem; }

/* The phone in the hero: a RunStride runner card, drawn in HTML */
.phone {
  justify-self: center; width: min(19rem, 100%); aspect-ratio: 9 / 18.5;
  border-radius: 2.6rem; padding: 0.7rem; background: #12001c;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 0 0 2px #3a0b52;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-10px); } }
.screen { height: 100%; border-radius: 2rem; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.runner {
  flex: 1; border-radius: 1.3rem; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #f0605a, #d63c97 55%, #6a1a8c);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem;
}
.runner .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 4rem 1rem 1rem; background: linear-gradient(transparent, rgba(16, 0, 24, 0.92) 55%); }
.runner strong { display: block; color: #fff; font-size: 1.35rem; font-weight: 800; }
.chip { display: inline-block; background: var(--orange); color: #fff; font-size: 0.7rem; font-weight: 800; border-radius: 999px; padding: 0.15rem 0.55rem; margin: 0.35rem 0; }
.runner small { display: block; color: #f6f0fa; font-size: 0.75rem; }
.runner .race { color: #ffd1ea; font-weight: 700; }
.buttons { display: flex; justify-content: center; gap: 1.4rem; }
.buttons span { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: #fff; }
.buttons .pass { background: var(--surface); }
.buttons .like { background: var(--gradient); width: 3.7rem; height: 3.7rem; }

/* Sections */
section { padding-block: 4.5rem; }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 0.5rem; }
.section-head p { color: var(--muted); margin-top: 0.8rem; font-size: 1.05rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--border); }
.feature .icon { width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--gradient); display: grid; place-items: center; margin-bottom: 1rem; }
.feature .icon svg { width: 1.3rem; height: 1.3rem; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 1.1rem; font-weight: 700; }
.feature p { color: var(--muted); margin-top: 0.4rem; font-size: 0.95rem; }

.races { background: var(--bg-deep); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; counter-reset: step; }
.step { position: relative; padding-left: 3.4rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 2px solid var(--orange); color: var(--orange); font-weight: 800; display: grid; place-items: center;
}
.step h3 { font-size: 1.05rem; font-weight: 700; }
.step p { color: var(--muted); font-size: 0.95rem; margin-top: 0.3rem; }
.callout { margin-top: 2.5rem; border-left: 3px solid var(--pink); padding: 0.4rem 0 0.4rem 1rem; color: var(--muted); max-width: 46rem; }

.safety-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 2rem; list-style: none; padding: 0; margin: 0; }
.safety-list li { display: flex; gap: 0.8rem; align-items: flex-start; }
.safety-list li::before { content: "✓"; color: var(--orange); font-weight: 800; flex: none; margin-top: 0.05rem; }
.safety-list strong { color: var(--heading); }

/* Beta sign-up */
.join { background: var(--bg-deep); }
.join .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 3rem; align-items: start; }
form { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 1.75rem; display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label, fieldset legend { font-size: 0.9rem; font-weight: 700; color: var(--heading); }
input[type="text"], input[type="email"], select {
  width: 100%; font: inherit; color: var(--heading); background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.75rem 0.9rem;
}
input::placeholder { color: var(--faint); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.options { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.options label { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.9rem; cursor: pointer; font-weight: 500; color: var(--text); }
.options input { accent-color: var(--orange); }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.85rem; color: var(--muted); }
.check input { margin-top: 0.25rem; accent-color: var(--orange); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: 0.95rem; min-height: 1.4rem; }
.status.ok { color: #6fd3a3; }
.status.error { color: #f87171; }
.join .points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.7rem; color: var(--muted); }
.join .points li::before { content: "→ "; color: var(--orange); font-weight: 800; }
@media (max-width: 860px) {
  .hero .wrap, .join .wrap { grid-template-columns: minmax(0, 1fr); }
  .phone { width: min(16rem, 80%); }
}
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } form { padding: 1.25rem; } }

/* Footer */
footer { border-top: 1px solid var(--border); padding-block: 2rem 3rem; color: var(--faint); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--heading); }

/* Policy pages */
.doc { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 5rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; }
.doc .updated { color: var(--faint); margin-top: 0.5rem; }
.doc .summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-top: 2rem; }
.doc .summary h2 { margin-top: 0; font-size: 1.1rem; }
.doc h2 { font-size: 1.35rem; font-weight: 800; margin-top: 2.5rem; }
.doc h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.5rem; }
.doc p, .doc ul, .doc table { margin-top: 0.8rem; }
.doc ul { padding-left: 1.2rem; }
.doc li + li { margin-top: 0.35rem; }
.doc strong { color: var(--heading); }
.table-wrap { overflow-x: auto; margin-top: 0.8rem; border: 1px solid var(--border); border-radius: 12px; }
.doc table { border-collapse: collapse; width: 100%; min-width: 34rem; margin: 0; font-size: 0.92rem; }
.doc th, .doc td { text-align: left; padding: 0.65rem 0.85rem; border-top: 1px solid var(--border); vertical-align: top; }
.doc thead th { border-top: 0; color: var(--heading); background: var(--surface); }

.join-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 0.5rem; }

/* 404 */
.lost { text-align: center; padding-top: 6rem; }
.lost img { margin: 0 auto 1.5rem; }
.lost-text { color: var(--muted); margin-top: 0.8rem; }
.lost-action { margin-top: 2rem; }

/* 2026 visual refresh: a confident, warm editorial look with the brand's
   plum and coral retained as accents. */
:root {
  --bg: #fbf8f4;
  --bg-deep: #f1e9e1;
  --surface: #fff;
  --border: #e8ded6;
  --text: #56505a;
  --muted: #716a73;
  --faint: #887e88;
  --heading: #24172b;
  --orange: #e86f4e;
  --pink: #a33d74;
  --gradient: linear-gradient(120deg, #a33d74, #df604f 72%, #ee8050);
  --radius: 22px;
  color-scheme: light;

  /* Surfaces and ink, so the dark theme can swap them in one place */
  --hero-bg: radial-gradient(ellipse at 80% 20%, #f4dce0 0, transparent 36%), linear-gradient(180deg, #fbf8f4, #f8f2ec);
  --header-bg: rgba(251, 248, 244, 0.9);
  --panel: #fff;
  --panel-soft: rgba(255, 255, 255, 0.86);
  --panel-alt: #fffdfb;
  --line: #e4d9d2;
  --line-soft: rgba(69, 39, 65, 0.1);
  --nav-ink: #5f5661;
  --icon-bg: #f7e7e5;
  --icon-ink: #a33d74;
  --input-bg: #fcfaf8;
  --input-line: #e7ded9;
  --option-on-bg: #f8e9ee;
  --option-on-line: #c56b8e;
  --option-on-ink: #783354;
  --pass-bg: #eee5e2;
  --pass-ink: #725f6e;
  --phone-frame: #24172b;
  --screen-bg: #fffaf7;
  --join-bg: #2b1b30;
  --band-image: url("/race-band.jpg");
  --band-opacity: 0.95;
  --band-wash: rgba(241, 233, 225, 0.88);
  --band-wash-mid: rgba(241, 233, 225, 0.66);
  --shadow-card: 0 8px 28px rgba(50, 34, 45, 0.035);
  --shadow-card-hover: 0 18px 38px rgba(50, 34, 45, 0.08);
}
body { line-height: 1.7; }
.wrap { max-width: 76rem; padding-inline: clamp(1.25rem, 5vw, 4rem); }
.top { background: var(--header-bg); border-bottom-color: var(--line-soft); }
.top .wrap { min-height: 76px; }
.brand { color: var(--heading); font-size: 1.15rem; letter-spacing: -.04em; }
.brand img { width: 40px; }
.top nav { gap: clamp(1rem, 3vw, 2.3rem); }
.top nav a { color: var(--nav-ink); }
.top nav a.button { color: #fff; }
.button { border-radius: 12px; box-shadow: 0 10px 24px rgba(163,61,116,.18); transition: transform .2s ease, box-shadow .2s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(163,61,116,.25); }
.hero { min-height: 650px; padding-block: clamp(4.5rem, 10vw, 8rem); background: var(--hero-bg); }
.hero::before { width: 44rem; height: 44rem; background: radial-gradient(closest-side,rgba(232,111,78,.13),transparent 72%); }
.hero .wrap { grid-template-columns: minmax(0,1.08fr) minmax(20rem,.92fr); gap: clamp(2rem,8vw,7rem); }
.eyebrow { color: #a33d74; font-size: .75rem; letter-spacing: .16em; }
.hero h1 { max-width: 12ch; font-size: clamp(3rem,6.5vw,5.4rem); line-height: 1.02; letter-spacing: -.065em; margin-top: 1rem; }
.hero h1 em { background: linear-gradient(120deg,#a33d74,#e86f4e); -webkit-background-clip: text; background-clip: text; }
.hero .lead { color: var(--muted); font-size: clamp(1.05rem,1.6vw,1.2rem); max-width: 38rem; margin-top: 1.5rem; }
.hero .actions { margin-top: 2.2rem; }
.hero .actions .button { padding: .95rem 1.5rem; }
.hero .note { color: var(--faint); }
.phone { width: min(18rem,100%); border-radius: 2.2rem; padding: .55rem; background: var(--phone-frame); box-shadow: 0 36px 90px rgba(51,25,48,.24), inset 0 0 0 1px rgba(255,255,255,.22); }
.screen { border-radius: 1.75rem; background: var(--screen-bg); padding: .75rem; }
.runner { background: linear-gradient(150deg,#f19a71 0,#cb5681 52%,#502c65 100%); }
.runner .info { background: linear-gradient(transparent,rgba(36,23,43,.92)); }
.runner .chip { background: #fff; color: #87365f; }
.buttons .pass { background: var(--pass-bg); color: var(--pass-ink); }
section { padding-block: clamp(4rem,8vw,6.5rem); }
.section-head { margin-bottom: 2.7rem; }
.section-head h2 { max-width: 17ch; font-size: clamp(2rem,4.5vw,3.3rem); letter-spacing: -.05em; }
.section-head p { color: var(--muted); }
.features { gap: 1rem; }
.feature { background: var(--panel-soft); border-color: var(--line-soft); border-radius: 18px; padding: 1.6rem; box-shadow: var(--shadow-card); transition: transform .2s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.feature .icon { border-radius: 13px; background: var(--icon-bg); }
.feature .icon svg { stroke: var(--icon-ink); }
.feature h3 { color: var(--heading); }
.feature p,.step p { color: var(--muted); }
.races { background: #f1e9e1; }
.steps { gap: 2rem; }
.step { padding: 1.4rem 1rem 1.3rem 4rem; border-top: 1px solid var(--line); }
.step::before { top: 1.2rem; border: 0; background: var(--panel); color: var(--icon-ink); box-shadow: 0 3px 12px rgba(42,20,40,.08); }
.step h3 { color: var(--heading); }
.callout { border-color: var(--orange); color: var(--muted); }
.safety-list { gap: 1.2rem 2.5rem; }
.safety-list li { padding: 1rem; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 15px; box-shadow: var(--shadow-card); }
.safety-list li::before { content: "✓"; color: var(--icon-ink); }
.safety-list strong { color: var(--heading); }
.join { background: var(--join-bg); color: #eee5ed; }
.join .eyebrow { color: #f29a78; }
.join-title { color: white; max-width: 13ch; font-size: clamp(2.2rem,4.5vw,3.4rem); letter-spacing: -.05em; }
.join .points { color: #ded1df; }
.join .points li::before { color: #f29a78; }
form { background: var(--panel); border: 0; border-radius: 20px; padding: clamp(1.25rem,4vw,2rem); box-shadow: 0 22px 60px rgba(0,0,0,.16); }
.field label, fieldset legend { color: var(--heading); }
input[type="text"],input[type="email"],select { color: var(--heading); background: var(--input-bg); border-color: var(--input-line); }
input[type="text"]:focus,input[type="email"]:focus,select:focus { border-color: #a33d74; outline: 3px solid rgba(163,61,116,.12); }
.options label { color: var(--text); background: var(--input-bg); border-color: var(--input-line); }
.options label:has(input:checked) { background: var(--option-on-bg); border-color: var(--option-on-line); color: var(--option-on-ink); }
.check { color: var(--muted); }
.join a { color: #a33d74; }
footer { color: var(--faint); border-color: var(--line); }
footer a { color: var(--nav-ink); }
.doc { color: var(--text); }
.doc .summary,.table-wrap { background: var(--panel); border-color: var(--line); }
.doc thead th { color: var(--heading); background: var(--bg-deep); }
.doc th,.doc td { border-color: var(--line); }
@media (max-width: 860px) {
  .hero { min-height: auto; }
  .hero .wrap,.join .wrap { grid-template-columns: 1fr; }
  .hero .wrap { text-align: center; }
  .hero h1,.hero .lead { margin-inline: auto; }
  .hero .actions { justify-content: center; }
  .phone { margin-top: 1rem; }
  .join-title { max-width: 18ch; }
}
@media (max-width: 480px) {
  .top .wrap { min-height: 66px; }
  .top .button { padding: .55rem .85rem; }
  .hero { padding-block: 4rem 3.5rem; }
  .hero h1 { font-size: clamp(2.65rem,13vw,3.5rem); }
  .hero .actions { flex-direction: column; }
  .phone { width: min(15rem,80%); }
  .safety-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .feature,.button { transition: none; } }

/* Clear visual breaks between the main page sections. */
.hero { min-height: 0; padding-block: 4.5rem; border-bottom: 1px solid var(--line); }
.hero .wrap { gap: clamp(2rem,6vw,5rem); }
.phone { width: min(16rem,100%); }
#how { background: var(--panel-alt); }
.races { background: var(--bg-deep); border-block: 1px solid var(--line); }
#safety { background: var(--panel-alt); }
.join { background: var(--join-bg); border-top: 1px solid rgba(255,255,255,.1); }
#how .wrap, #races .wrap, #safety .wrap, #join .wrap { padding-block: .5rem; }
#how .section-head, #races .section-head, #safety .section-head { margin-bottom: 2rem; }
.features, .steps, .safety-list { row-gap: 1.5rem; }
.feature { min-height: 100%; }
.safety-list li { min-height: 100%; }
@media (min-width: 861px) { #how, #safety { padding-block: 4.5rem; } }

/* ---------- Phone status bar ---------- */
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.95rem 0.45rem; color: var(--heading); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.01em; flex: none;
}
.sb-right { display: inline-flex; align-items: center; gap: 0.3rem; }
.sb-icon { height: 0.7rem; width: auto; fill: var(--heading); opacity: 0.85; }
.sb-battery {
  position: relative; width: 1.4rem; height: 0.72rem; border: 1.5px solid rgba(36, 23, 43, 0.5);
  border-radius: 0.22rem; padding: 1.5px; display: inline-block;
}
.sb-battery::after {
  content: ""; position: absolute; right: -3.5px; top: 50%; translate: 0 -50%;
  width: 2px; height: 36%; border-radius: 0 1px 1px 0; background: rgba(255, 255, 255, 0.85);
}
.sb-battery i { display: block; width: 87%; height: 100%; border-radius: 1px; background: var(--heading); }
.sb-pct { font-size: 0.68rem; font-weight: 700; }

/* ---------- The photo on the card ---------- */
.runner { flex: 1; }
.runner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.buttons { padding: 0.85rem 0 1rem; }
/* The photo fills the card edge to edge, and the details stay on one line each */
.runner { padding: 0; }
.runner strong { font-size: 1.2rem; }
.runner small { font-size: 0.68rem; line-height: 1.45; }
.runner .chip { font-size: 0.64rem; }

/* ---------- Soft photo bands behind the sections ----------
   Each band uses a different part of the photo, blurred hard so it reads as texture.
   A wash of the section's own colour sits over it, so text contrast is unaffected. */
.races, #how, #safety { position: relative; overflow: hidden; }
.races::before, #how::before, #safety::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--band-image) center / cover no-repeat;
  opacity: var(--band-opacity);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
}
/* A cream wash over the photo keeps the headings and cards easy to read */
.races::after, #how::after, #safety::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--band-wash) 0%, var(--band-wash) 34%, var(--band-wash-mid) 68%, var(--band-wash-mid) 100%);
}
.races .wrap, #how .wrap, #safety .wrap { position: relative; z-index: 1; }
/* The step cards lift off the photo */
.races .step::before { box-shadow: 0 4px 16px rgba(42, 20, 40, 0.14); }

/* ---------- A little more air between the bands ---------- */
section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.section-head { margin-bottom: 3rem; }

/* ---------- Dark mode ----------
   Follows the device by default; the header button overrides it and the choice is remembered. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #1b0f24;
  --bg-deep: #150b1d;
  --surface: #241633;
  --border: #3a2a47;
  --text: #d6cadd;
  --muted: #a99cb4;
  --faint: #8d8097;
  --heading: #ffffff;
  --orange: #f1875f;
  --pink: #e07aa8;
  --gradient: linear-gradient(120deg, #c0538c, #e5724f 72%, #f1935f);
  color-scheme: dark;

  --hero-bg: radial-gradient(ellipse at 80% 20%, #3b1e42 0, transparent 42%), linear-gradient(180deg, #1b0f24, #170c20);
  --header-bg: rgba(21, 11, 29, 0.84);
  --panel: #241633;
  --panel-soft: rgba(36, 22, 51, 0.82);
  --panel-alt: #1f1229;
  --line: #342542;
  --line-soft: rgba(255, 255, 255, 0.09);
  --nav-ink: #b8abc2;
  --icon-bg: rgba(224, 122, 168, 0.16);
  --icon-ink: #e993bb;
  --input-bg: #1a0f25;
  --input-line: #3a2a47;
  --option-on-bg: rgba(224, 122, 168, 0.18);
  --option-on-line: #c0538c;
  --option-on-ink: #f3dbe7;
  --pass-bg: #32243f;
  --pass-ink: #cbbcd6;
  --phone-frame: #0e0715;
  --screen-bg: #1b0f24;
  --join-bg: #140a1c;
  --band-image: url("/race-band-dark.jpg");
  --band-opacity: 0.95;
  --band-wash: rgba(21, 11, 29, 0.86);
  --band-wash-mid: rgba(21, 11, 29, 0.6);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 18px 38px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #1b0f24;
  --bg-deep: #150b1d;
  --surface: #241633;
  --border: #3a2a47;
  --text: #d6cadd;
  --muted: #a99cb4;
  --faint: #8d8097;
  --heading: #ffffff;
  --orange: #f1875f;
  --pink: #e07aa8;
  --gradient: linear-gradient(120deg, #c0538c, #e5724f 72%, #f1935f);
  color-scheme: dark;

  --hero-bg: radial-gradient(ellipse at 80% 20%, #3b1e42 0, transparent 42%), linear-gradient(180deg, #1b0f24, #170c20);
  --header-bg: rgba(21, 11, 29, 0.84);
  --panel: #241633;
  --panel-soft: rgba(36, 22, 51, 0.82);
  --panel-alt: #1f1229;
  --line: #342542;
  --line-soft: rgba(255, 255, 255, 0.09);
  --nav-ink: #b8abc2;
  --icon-bg: rgba(224, 122, 168, 0.16);
  --icon-ink: #e993bb;
  --input-bg: #1a0f25;
  --input-line: #3a2a47;
  --option-on-bg: rgba(224, 122, 168, 0.18);
  --option-on-line: #c0538c;
  --option-on-ink: #f3dbe7;
  --pass-bg: #32243f;
  --pass-ink: #cbbcd6;
  --phone-frame: #0e0715;
  --screen-bg: #1b0f24;
  --join-bg: #140a1c;
  --band-image: url("/race-band-dark.jpg");
  --band-opacity: 0.95;
  --band-wash: rgba(21, 11, 29, 0.93);
  --band-wash-mid: rgba(21, 11, 29, 0.62);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 18px 38px rgba(0, 0, 0, 0.5);
}

/* Pieces that need more than a colour swap in the dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero h1 em,
  :root:not([data-theme="light"]) .eyebrow { color: var(--pink); }
  :root:not([data-theme="light"]) .join { border-top-color: var(--line); }
  :root:not([data-theme="light"]) .join-title { color: #fff; }
}
:root[data-theme="dark"] .hero h1 em,
:root[data-theme="dark"] .eyebrow { color: var(--pink); }
:root[data-theme="dark"] .join { border-top-color: var(--line); }
:root[data-theme="dark"] .join-title { color: #fff; }

/* ---------- The light / dark button ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none;
  border: 1px solid var(--line-soft); border-radius: 11px; background: transparent;
  color: var(--nav-ink); cursor: pointer; padding: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle:hover { color: var(--heading); border-color: var(--border); background: var(--panel-soft); }
.theme-toggle svg {
  grid-area: 1 / 1; width: 1.1rem; height: 1.1rem;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
/* One icon at a time: the sun in the dark, the moon in the light */
.t-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-sun { display: block; }
  :root:not([data-theme="light"]) .t-moon { display: none; }
}
:root[data-theme="dark"] .t-sun { display: block; }
:root[data-theme="dark"] .t-moon { display: none; }
:root[data-theme="light"] .t-sun { display: none; }
:root[data-theme="light"] .t-moon { display: block; }
@media (max-width: 480px) { .theme-toggle { width: 2.15rem; height: 2.15rem; } }

/* Which part of the photo each band uses, and the wash that keeps text readable.
   #how and #safety sit on the pale panel colour, so their wash is lighter still. */
#how { --band-image: url("/band-how.jpg"); --band-opacity: 0.95; --band-wash: rgba(255, 253, 251, 0.86); --band-wash-mid: rgba(255, 253, 251, 0.5); }
#safety { --band-image: url("/band-safety.jpg"); --band-opacity: 0.95; --band-wash: rgba(255, 253, 251, 0.86); --band-wash-mid: rgba(255, 253, 251, 0.34); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #how { --band-image: url("/band-how-dark.jpg"); --band-opacity: 0.95; --band-wash: rgba(31, 18, 41, 0.84); --band-wash-mid: rgba(31, 18, 41, 0.36); }
  :root:not([data-theme="light"]) #safety { --band-image: url("/band-safety-dark.jpg"); --band-opacity: 0.95; --band-wash: rgba(31, 18, 41, 0.84); --band-wash-mid: rgba(31, 18, 41, 0.36); }
}
:root[data-theme="dark"] #how { --band-image: url("/band-how-dark.jpg"); --band-opacity: 0.95; --band-wash: rgba(31, 18, 41, 0.84); --band-wash-mid: rgba(31, 18, 41, 0.36); }
:root[data-theme="dark"] #safety { --band-image: url("/band-safety-dark.jpg"); --band-opacity: 0.95; --band-wash: rgba(31, 18, 41, 0.84); --band-wash-mid: rgba(31, 18, 41, 0.36); }

/* ---------- Photo bands on the hero and the sign-up ----------
   The hero already uses ::before for its glow, so the photo goes on ::after,
   behind the content and under a wash that protects the headline. */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--band-wash) 0%, var(--band-wash) 30%, var(--band-wash-mid) 72%, var(--band-wash-mid) 100%),
    var(--band-image) center / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent);
  mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent);
}
.hero .wrap { position: relative; z-index: 1; }

.join { position: relative; overflow: hidden; }
.join::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--band-wash) 0%, var(--band-wash) 34%, var(--band-wash-mid) 74%, var(--band-wash-mid) 100%),
    var(--band-image) center / cover no-repeat;
}
.join .wrap { position: relative; z-index: 1; }

/* The hero keeps its warm tint, the sign-up stays dark in both themes */
.hero { --band-image: url("/band-hero.jpg"); --band-wash: rgba(251, 248, 244, 0.88); --band-wash-mid: rgba(251, 248, 244, 0.34); }
.join { --band-image: url("/band-join-dark.jpg"); --band-wash: rgba(20, 10, 28, 0.88); --band-wash-mid: rgba(20, 10, 28, 0.38); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { --band-image: url("/band-hero-dark.jpg"); --band-wash: rgba(27, 15, 36, 0.86); --band-wash-mid: rgba(27, 15, 36, 0.34); }
}
:root[data-theme="dark"] .hero { --band-image: url("/band-hero-dark.jpg"); --band-wash: rgba(27, 15, 36, 0.86); --band-wash-mid: rgba(27, 15, 36, 0.34); }

/* ---------- Contact ---------- */
.contact { background: var(--panel-alt); border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.contact::before, .contact::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.contact::before { background: var(--band-image) center / cover no-repeat; opacity: var(--band-opacity); }
.contact::after { background: linear-gradient(90deg, var(--band-wash) 0%, var(--band-wash) 34%, var(--band-wash-mid) 68%, var(--band-wash-mid) 100%); }
.contact .wrap { position: relative; z-index: 1; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.1rem; }
.contact-card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 18px;
  padding: 1.5rem; box-shadow: var(--shadow-card);
}
.contact-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--heading); }
.contact-card p { color: var(--muted); font-size: 0.95rem; margin-top: 0.4rem; }
.contact-link {
  display: inline-block; margin-top: 0.9rem; font-weight: 700; color: var(--icon-ink);
  text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px;
  overflow-wrap: anywhere;
}
.contact-link:hover { color: var(--heading); }
.contact-urgent {
  margin-top: 1.6rem; padding: 1rem 1.2rem; border-radius: 14px;
  background: var(--icon-bg); color: var(--muted); font-size: 0.95rem;
}
.contact-urgent strong { color: var(--heading); }

.contact { --band-image: url("/band-contact.jpg"); --band-opacity: 0.95; --band-wash: rgba(255, 253, 251, 0.86); --band-wash-mid: rgba(255, 253, 251, 0.34); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .contact { --band-image: url("/band-contact-dark.jpg"); --band-wash: rgba(31, 18, 41, 0.84); --band-wash-mid: rgba(31, 18, 41, 0.36); } }
:root[data-theme="dark"] .contact { --band-image: url("/band-contact-dark.jpg"); --band-wash: rgba(31, 18, 41, 0.84); --band-wash-mid: rgba(31, 18, 41, 0.36); }

/* ---------- Phones ----------
   A wide photo under "cover" on a narrow, tall section is zoomed until it's just a smear,
   so phones load a portrait crop of the same photo instead. */
@media (max-width: 700px) {
  #how { --band-image: url("/band-how-m.jpg"); }
  .races { --band-image: url("/race-band-m.jpg"); }
  #safety { --band-image: url("/band-safety-m.jpg"); }
  .hero { --band-image: url("/band-hero-m.jpg"); }
  .join { --band-image: url("/band-join-m.jpg"); }
  .contact { --band-image: url("/band-contact-m.jpg"); }
}
@media (max-width: 700px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #how { --band-image: url("/band-how-m-dark.jpg"); }
  :root:not([data-theme="light"]) .races { --band-image: url("/race-band-m-dark.jpg"); }
  :root:not([data-theme="light"]) #safety { --band-image: url("/band-safety-m-dark.jpg"); }
  :root:not([data-theme="light"]) .hero { --band-image: url("/band-hero-m-dark.jpg"); }
  :root:not([data-theme="light"]) .join { --band-image: url("/band-join-m-dark.jpg"); }
  :root:not([data-theme="light"]) .contact { --band-image: url("/band-contact-m-dark.jpg"); }
}
@media (max-width: 700px) {
  :root[data-theme="dark"] #how { --band-image: url("/band-how-m-dark.jpg"); }
  :root[data-theme="dark"] .races { --band-image: url("/race-band-m-dark.jpg"); }
  :root[data-theme="dark"] #safety { --band-image: url("/band-safety-m-dark.jpg"); }
  :root[data-theme="dark"] .hero { --band-image: url("/band-hero-m-dark.jpg"); }
  :root[data-theme="dark"] .join { --band-image: url("/band-join-m-dark.jpg"); }
  :root[data-theme="dark"] .contact { --band-image: url("/band-contact-m-dark.jpg"); }
}

/* Tighter rhythm: the bands were sitting too far apart, most noticeably on desktop */
section { padding-block: clamp(3rem, 6vw, 5rem); }
.section-head { margin-bottom: clamp(1.5rem, 3vw, 2.2rem); }
.hero { padding-block: clamp(3rem, 6vw, 5rem); }
