/* Race for a Cause — one stylesheet, mobile-first.
   Event branding arrives as --brand and --accent from base.html. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.8e433c0592f7.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #192e56;
  --accent: #ff5a36;
  --accent-ink: #14161b;
  --more: var(--accent);
  --less: #0fa39a;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #14161b;
  --ink-2: #3a3f48;
  --muted: #626975;
  --line: #e5e1d7;
  --line-strong: #cfc9bb;
  --ok: #138a4b;
  --danger: #b42318;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgb(20 22 27 / 0.04), 0 6px 24px rgb(20 22 27 / 0.06);
  --shadow-lg: 0 2px 4px rgb(20 22 27 / 0.06), 0 18px 48px rgb(20 22 27 / 0.12);

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--s4); }
.narrow { max-width: 620px; }
.section { padding-top: var(--s7); }
.section-tight { padding-top: var(--s5); }
.center { text-align: center; margin-top: var(--s5); }
.muted { color: var(--muted); }
.link { color: var(--brand); font-weight: 600; text-underline-offset: 3px; }

.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow-on-dark { color: rgb(255 255 255 / 0.72); }
.section-title { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: var(--s4); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.section-head .section-title { margin-bottom: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: var(--s3); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px; padding: 0.65rem 1.15rem;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 0.98rem; line-height: 1.1; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-sm { min-height: 40px; padding: 0.45rem 0.95rem; font-size: 0.9rem; }
.btn-lg { min-height: 56px; padding: 0.9rem 1.5rem; font-size: 1.08rem; }
.btn-block { width: 100%; text-align: center; }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-accent:hover { box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-outline-light { background: transparent; border-color: rgb(255 255 255 / 0.45); color: #fff; }
.btn-outline-light:hover { border-color: #fff; }

/* ---------- Top bar ---------- */

.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; min-height: 44px; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 900; }
.brand-name { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flash-stack { padding-top: var(--s4); }
.flash { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.flash-error { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); background: #fff5f4; }
.flash-success { border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; padding: var(--s7) 0 calc(var(--s8) + var(--s4)); isolation: isolate; }
.hero-compact { padding-bottom: var(--s7); }
.hero-inner { position: relative; z-index: 1; }
.hero-title { font-size: clamp(2.6rem, 12vw, 5.6rem); font-weight: 900; letter-spacing: -0.055em; line-height: 0.95; margin: var(--s3) 0 var(--s4); max-width: 13ch; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lede { font-size: clamp(1.15rem, 4.4vw, 1.5rem); font-weight: 600; letter-spacing: -0.02em; max-width: 34ch; }
.hero-copy { margin-top: var(--s3); color: rgb(255 255 255 / 0.8); max-width: 52ch; }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s4); color: rgb(255 255 255 / 0.85); font-weight: 600; font-size: 0.95rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero-ctas .btn { flex: 1 1 200px; }
/* Track lanes: a quiet nod to the race. */
.hero-lanes {
  position: absolute; inset: auto -10% -30% -10%; height: 70%; z-index: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 2px), rgb(255 255 255 / 0.09) calc(12.5% - 2px) 12.5%);
  transform: perspective(500px) rotateX(58deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
}
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
.back-link-light { color: rgb(255 255 255 / 0.75); }
.back-link-light:hover { color: #fff; }

/* ---------- Team homepage ---------- */

.home-hero { padding-bottom: var(--s8); }
.est { display: flex; gap: var(--s3); margin-top: var(--s5); }
.est-item { display: flex; flex-direction: column; padding: var(--s3) var(--s4); border-radius: var(--r); background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.14); min-width: 120px; }
.est-num { font-size: clamp(2.2rem, 10vw, 3.4rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.est-label { margin-top: var(--s1); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(255 255 255 / 0.75); }
.home-event { grid-template-columns: 1fr auto; align-items: center; }
.home-event + .home-event { margin-top: var(--s3); }

/* ---------- Countdown ---------- */

.countdown { margin-top: var(--s5); }
.countdown-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(255 255 255 / 0.75); }
.countdown-units { display: flex; gap: var(--s2); margin-top: var(--s2); }
.cd { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: var(--s2) var(--s3); border-radius: var(--r); background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.14); }
.cd strong { font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd small { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: rgb(255 255 255 / 0.7); }
.countdown-note { margin-top: var(--s2); font-size: 0.9rem; font-weight: 600; color: rgb(255 255 255 / 0.8); }

.countdown-compact { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--ink); color: #fff; }
.countdown-compact .countdown-units { margin: 0; gap: 4px; }
.countdown-compact .cd { flex-direction: row; align-items: baseline; gap: 1px; min-width: 0; padding: 0 2px; background: none; border: 0; }
.countdown-compact .cd strong { font-size: 1.1rem; }
.countdown-compact .cd small { font-size: 0.75rem; text-transform: none; letter-spacing: 0; }
.countdown-compact .countdown-note { flex-basis: 100%; margin: 0; font-size: 0.82rem; }

/* ---------- Stats ---------- */

.stats-card { margin-top: calc(-1 * var(--s8)); position: relative; z-index: 2; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-hero { grid-column: 1 / -1; }
.stat-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 0.55em; font-weight: 700; color: var(--muted); }
.stat-hero .stat-value { font-size: clamp(2.8rem, 13vw, 4.2rem); letter-spacing: -0.05em; }
.stat-sub { font-size: 0.92rem; color: var(--muted); font-weight: 600; margin-top: var(--s2); }
.updated { margin-top: var(--s4); font-size: 0.82rem; color: var(--muted); }

/* ---------- Progress ---------- */

.progress { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; margin-top: var(--s2); }
.progress-lg { height: 14px; }
.progress-thin { height: 6px; }
.progress-on-dark { background: rgb(255 255 255 / 0.16); }
.progress > span { display: block; height: 100%; width: var(--pct, 0%); border-radius: inherit; background: var(--accent); transform-origin: left; animation: fill 0.9s var(--ease) both; }
.split-less .progress > span { background: var(--less); }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- How it works ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.step { display: flex; gap: var(--s4); align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4) var(--s5); }
.step h3 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
.step p { color: var(--ink-2); margin-top: 2px; }
.step-num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 900; }

/* ---------- ALL bucket ---------- */

.all-card { display: grid; gap: var(--s4); text-decoration: none; color: #fff; background: var(--ink); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.all-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: 0.16; }
.all-card-title { font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 900; letter-spacing: -0.045em; line-height: 1; margin-top: var(--s2); }
.all-card-title em { font-style: normal; color: var(--accent); }
.all-card-copy { color: rgb(255 255 255 / 0.78); margin-top: var(--s2); }
.all-card .btn { justify-self: start; }
.all-stats { color: #fff; }
.all-bonus { font-size: clamp(3.2rem, 15vw, 5rem); font-weight: 900; letter-spacing: -0.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.all-bonus small { font-size: 0.4em; margin-left: 0.15em; letter-spacing: -0.02em; color: rgb(255 255 255 / 0.7); }
.all-bonus-label { color: rgb(255 255 255 / 0.8); font-weight: 600; }
.all-next { margin-top: var(--s2); font-weight: 700; }
.all-total { margin-top: var(--s1); color: rgb(255 255 255 / 0.65); font-size: 0.9rem; }
.hero .all-stats { margin-top: var(--s5); max-width: 520px; }
.all-challenge { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r); background: rgb(255 255 255 / 0.07); border: 1px solid rgb(255 255 255 / 0.12); }
.all-challenge > div { flex: 1; min-width: 0; }
.all-challenge.is-unlocked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.all-challenge-icon { font-size: 1.8rem; line-height: 1; }
.all-challenge-name { font-weight: 800; }
.all-challenge-sub { font-size: 0.85rem; color: rgb(255 255 255 / 0.75); margin-top: 2px; }
.challenge-alt { font-size: 0.9rem; }
.badge-alt { margin-top: var(--s1); }

/* ---------- Leaderboard ---------- */

.sort { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4); }
.sort::-webkit-scrollbar { display: none; }
.sort-btn { flex: none; min-height: 40px; padding: 0 0.95rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 0.88rem; cursor: pointer; }
.sort-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.leaderboard { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.runner-row { animation: rise 0.35s var(--ease) both; }
.runner-link {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--s3);
  min-height: 72px; padding: var(--s3) var(--s4); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.runner-link:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.runner-link:active { transform: scale(0.99); }
.runner-rank { width: 1.6rem; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.avatar { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }
.runner-main { display: flex; flex-direction: column; min-width: 0; }
.runner-name { font-weight: 800; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.mini-badge { font-size: 0.95rem; line-height: 1; }
.runner-distance { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.runner-distance strong { font-size: 1.45rem; font-weight: 900; letter-spacing: -0.04em; }
.runner-distance small { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-left: 2px; }
.runner-go { color: var(--muted); font-weight: 800; }
@media (max-width: 380px) { .runner-go { display: none; } .runner-link { gap: var(--s2); padding: var(--s3); } }

/* Podium: whoever is in the top three of the current sort. */
.leaderboard:not(.leaderboard-compact) .runner-row:nth-child(-n+3) .runner-link { border-color: var(--line-strong); box-shadow: var(--shadow); }
.leaderboard:not(.leaderboard-compact) .runner-row:nth-child(-n+3) .runner-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
@media (min-width: 640px) {
  .leaderboard:not(.leaderboard-compact) .runner-row:nth-child(-n+3) .runner-link { min-height: 88px; }
  .leaderboard:not(.leaderboard-compact) .runner-row:nth-child(-n+3) .avatar { width: 60px; height: 60px; border-radius: 16px; }
  .leaderboard:not(.leaderboard-compact) .runner-row:nth-child(-n+3) .runner-distance strong { font-size: 1.8rem; }
}
.leaderboard-compact .runner-link { min-height: 60px; }
.leaderboard-compact .avatar { width: 40px; height: 40px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Challenges ---------- */

.challenge-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.challenge-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.challenge-tile h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; margin-top: var(--s3); }
.challenge-tile p { color: var(--ink-2); margin-top: var(--s1); }
.challenge-emoji { font-size: 2.4rem; line-height: 1; display: block; filter: grayscale(0.85); opacity: 0.7; transition: filter 0.3s, opacity 0.3s; }
.challenge-tile.is-unlocked .challenge-emoji { filter: none; opacity: 1; }
.challenge-tile.is-unlocked { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.challenge-threshold { font-weight: 700; color: var(--ink) !important; }
.challenge-count { font-size: 0.9rem; font-weight: 700; color: var(--muted) !important; }

.challenge-list { display: grid; gap: var(--s2); margin-top: var(--s5); }
.badge { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); }
.badge-icon { font-size: 1.6rem; line-height: 1; }
.badge-name { font-weight: 800; letter-spacing: -0.01em; }
.badge-sub { font-size: 0.88rem; color: var(--muted); }
.badge-state { font-weight: 800; }
.badge-locked .badge-icon { filter: grayscale(1); opacity: 0.6; }
.badge-unlocked, .badge-completed { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.badge-unlocked .badge-state, .badge-completed .badge-state { color: var(--ok); }
.badge-waived { opacity: 0.7; }

/* ---------- Cause ---------- */

.cause p { color: var(--ink-2); max-width: 65ch; }
.cause p + p { margin-top: var(--s3); }

/* ---------- Runner page ---------- */

.runner-page { padding-top: var(--s2); }
.runner-layout { display: grid; gap: var(--s5); }
.runner-photo { aspect-ratio: 4 / 5; max-height: 52vh; width: 100%; border-radius: var(--r-lg); overflow: hidden; background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.runner-photo img { width: 100%; height: 100%; object-fit: cover; }
.runner-head { display: flex; align-items: center; gap: var(--s4); margin: var(--s2) 0 var(--s4); }
.runner-head .runner-title { margin: 0; }
.avatar-lg { width: 84px; height: 84px; border-radius: 22px; font-size: 1.8rem; }
.runner-title { font-size: clamp(2.2rem, 10vw, 3.6rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; margin: var(--s4) 0; }
.runner-stats { display: block; }
.distance-hero { text-align: left; }
.distance-number { font-size: clamp(5rem, 30vw, 8.5rem); font-weight: 900; letter-spacing: -0.07em; line-height: 0.9; font-variant-numeric: tabular-nums; margin-top: var(--s2); }
.distance-number small { font-size: 0.3em; letter-spacing: -0.02em; color: var(--muted); margin-left: 0.1em; }
.distance-meta { margin-top: var(--s3); color: var(--muted); font-weight: 600; }
.delta { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-weight: 800; }
.delta-more { background: color-mix(in srgb, var(--more) 18%, transparent); color: color-mix(in srgb, var(--more) 70%, var(--ink)); }
.delta-less { background: color-mix(in srgb, var(--less) 18%, transparent); color: color-mix(in srgb, var(--less) 60%, var(--ink)); }
.raised-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.raised-row > div { display: flex; flex-direction: column; }
.raised-value { font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.rank-pill { padding: 6px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; }
.rank-pill span { font-weight: 600; color: rgb(255 255 255 / 0.7); }
.split { display: grid; gap: var(--s4); margin-top: var(--s5); }
.split-head { display: flex; justify-content: space-between; font-weight: 700; }
.split-head strong { font-variant-numeric: tabular-nums; }
.split-note { font-size: 0.88rem; color: var(--muted); margin-top: var(--s1); }
.split-all { margin-top: 0; }
.bio { margin-top: var(--s4); }
.bio p { color: var(--ink-2); }
.bio p + p { margin-top: var(--s3); }

/* ---------- Donation selector ---------- */

.donate-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-lg); }
.donate-title { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.035em; margin-bottom: var(--s4); }
.closed-note { color: var(--muted); font-weight: 600; }
.donate-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field-label { display: block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }

.dir-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-bottom: var(--s5) !important; }
.dir { position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--s4); min-height: 112px; border-radius: var(--r); border: 2px solid var(--line); cursor: pointer; transition: border-color 0.15s, background-color 0.15s, transform 0.15s var(--ease); -webkit-tap-highlight-color: transparent; }
.dir:active { transform: scale(0.98); }
.dir input { position: absolute; opacity: 0; pointer-events: none; }
.dir-emoji { font-size: 1.6rem; line-height: 1; }
.dir-title { font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-top: var(--s2); }
.dir-sub { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.dir-more:has(input:checked) { border-color: var(--more); background: color-mix(in srgb, var(--more) 10%, var(--surface)); }
.dir-less:has(input:checked) { border-color: var(--less); background: color-mix(in srgb, var(--less) 10%, var(--surface)); }
.dir:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.dir-single { font-weight: 700; margin-bottom: var(--s4); }

.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: var(--s2); }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: grid; place-items: center; min-height: 52px; border-radius: var(--r-sm); border: 2px solid var(--line); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; transition: all 0.15s; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.custom-amount { margin-top: var(--s3); }
.money-input { display: flex; align-items: center; border: 2px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 var(--s3); background: var(--surface); }
.money-input:focus-within { border-color: var(--ink); }
.money-input span { font-weight: 800; color: var(--muted); font-size: 1.2rem; }
.money-input input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 52px; padding: 0 var(--s2); font-size: 1.25rem; font-weight: 800; }
.text-input { width: 100%; min-height: 48px; border: 2px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 var(--s3); font-size: 1rem; background: var(--surface); }
.text-input:focus { outline: 0; border-color: var(--ink); }

.preview { margin-top: var(--s4); min-height: 64px; }
.preview-card { padding: var(--s4); border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); animation: pop 0.25s var(--ease); }
.preview-more { background: color-mix(in srgb, var(--more) 9%, var(--surface)); border-color: color-mix(in srgb, var(--more) 35%, var(--line)); }
.preview-less { background: color-mix(in srgb, var(--less) 9%, var(--surface)); border-color: color-mix(in srgb, var(--less) 35%, var(--line)); }
.preview-headline { font-weight: 800; letter-spacing: -0.015em; line-height: 1.3; }
.preview-detail { font-size: 0.9rem; color: var(--ink-2); margin-top: var(--s1); }
.preview-unlock { margin-top: var(--s2); font-weight: 700; }
.preview-error { padding: var(--s3) var(--s4); border-radius: var(--r); background: #fff5f4; color: var(--danger); font-weight: 600; }
@keyframes pop { from { opacity: 0.4; transform: scale(0.985); } to { opacity: 1; transform: none; } }

.donor-name { margin-top: var(--s4); }
.field-help { font-size: 0.84rem; color: var(--muted); margin-top: var(--s1); }
.form-error { margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: #fff5f4; color: var(--danger); font-weight: 600; }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }

.donate-actions { display: grid; gap: var(--s2); margin-top: var(--s4); }
.disclosure { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* ---------- Share ---------- */

.share-card { margin-top: var(--s4); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.share { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.share-feedback { font-weight: 700; color: var(--ok); font-size: 0.9rem; }

/* ---------- Handoff / thanks ---------- */

.handoff-title { font-size: clamp(1.7rem, 7vw, 2.4rem); font-weight: 900; letter-spacing: -0.045em; line-height: 1.05; margin: var(--s2) 0 var(--s3); }
.handoff > p { color: var(--ink-2); }
.callout { margin: var(--s5) 0; padding: var(--s4); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.callout-small { font-size: 0.9rem; color: var(--ink-2); margin-top: var(--s2); }
.handoff .disclosure, .thanks .disclosure { margin-top: var(--s3); }
.handoff-steps { list-style: none; margin: var(--s5) 0 var(--s4); padding: 0; display: grid; gap: var(--s3); }
.handoff-step { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: start; }
.handoff-step p { color: var(--ink-2); margin-bottom: var(--s3); }
.handoff-step .callout { margin: 0 0 var(--s4); }
.handoff-step .text-input { margin-bottom: var(--s1); }
.handoff-step .btn { margin-top: var(--s2); }
.handoff-step .callout-small { margin-top: var(--s3); margin-bottom: 0; }
.handoff-confirm { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.thanks-distance { font-size: 1.2rem; margin: var(--s3) 0; }
.thanks .muted { margin-top: var(--s4); }

.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.event-link { display: flex; flex-direction: column; text-decoration: none; }

/* ---------- Sticky mobile donate ---------- */

.sticky-donate {
  position: fixed; left: var(--s3); right: var(--s3); bottom: calc(var(--s3) + env(safe-area-inset-bottom));
  z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: 999px;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-lg);
  transition: transform 0.25s var(--ease), opacity 0.25s;
}
.sticky-donate.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }
.sticky-info { display: flex; flex-direction: column; line-height: 1.15; }
.sticky-info strong { font-size: 1.1rem; font-weight: 900; letter-spacing: -0.03em; }
.sticky-info span { font-size: 0.8rem; color: rgb(255 255 255 / 0.7); }

/* ---------- Footer ---------- */

.footer { margin-top: var(--s8); padding: var(--s6) 0 calc(var(--s8) + var(--s5)); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.footer p + p { margin-top: var(--s2); }
.footer-title { font-weight: 800; color: var(--ink); }
.footer-small { font-size: 0.8rem; }

/* ---------- Confetti ---------- */

.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 2px; z-index: 90; pointer-events: none; animation: fall var(--dur, 2.6s) linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx, 0), 110vh, 0) rotate(var(--rot, 540deg)); opacity: 0.9; } }

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  .wrap { padding: 0 var(--s5); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-hero { grid-column: span 2; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; }
  .sort { margin: 0; padding: 2px; }
  .all-card { grid-template-columns: 1.2fr 1fr; align-items: center; padding: var(--s6); }
  .all-card .btn { grid-column: 1; }
  .chips { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 960px) {
  .hero { padding: var(--s8) 0 calc(var(--s8) * 1.6); }
  .hero-ctas .btn { flex: 0 0 auto; }
  .leaderboard:not(.leaderboard-compact) { grid-template-columns: 1fr 1fr; gap: var(--s3); }
  .runner-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: var(--s6); }
  .runner-donate { position: sticky; top: 84px; }
  .runner-photo { max-height: 560px; }
  .sticky-donate { display: none; }
  .footer { padding-bottom: var(--s6); }
}

@media (hover: hover) {
  .runner-link:hover .runner-go { color: var(--ink); transform: translateX(2px); }
}

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