/* =========================================================================
   Midvaal MadMac 2026 — design tokens + stylesheet
   Palette derived from the supplied flyers (navy ground, orange/purple
   accents) and the race t-shirt's green→yellow→orange gradient, which the
   brief identifies as the strongest brand asset. Hex values are close
   approximations pending confirmation against the original vector flyer
   files — see README.md "Still needed at handover".
   ========================================================================= */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
table { border-collapse: collapse; }

@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;
  }
}

/* ---------- tokens ---------- */
:root {
  /* ground */
  --navy-950: #0a1128;
  --navy-900: #0f1836;
  --navy-800: #172247;
  --navy-700: #202e5c;
  --navy-600: #2b3d78;

  /* exact navy sampled from the MadMac wordmark logo — the header bar is
     colour-matched to it so the logo sits flush, not on a mismatched chip */
  --brand-navy: #2b2955;

  /* ink */
  --ink-0: #ffffff;
  --ink-100: #eef1fb;
  --ink-300: #aab5da;
  --ink-500: #7c87ad;

  /* brand accents */
  --green: #2fae6a;
  --yellow: #f5c518;
  --orange: #ef6a1f;
  --purple: #7a5cd6;

  --gradient-shirt: linear-gradient(90deg, var(--green) 0%, var(--yellow) 52%, var(--orange) 100%);
  --gradient-shirt-vert: linear-gradient(180deg, var(--green) 0%, var(--yellow) 52%, var(--orange) 100%);

  /* semantic */
  --bg: var(--navy-900);
  --bg-raised: var(--navy-800);
  --bg-sunken: var(--navy-950);
  --border: rgba(238, 241, 251, 0.12);
  --border-strong: rgba(238, 241, 251, 0.22);
  --text: var(--ink-100);
  --text-muted: var(--ink-300);
  --text-faint: var(--ink-500);
  --accent: var(--orange);
  --focus-ring: #ffd257;

  /* type */
  /* One font system-wide (Inter) — no secondary display face. Both tokens
     point at the same stack so every existing var(--font-display) /
     var(--font-body) reference keeps working without a rule-by-rule edit. */
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --container: 1120px;
  --container-narrow: 760px;
}

/* ---------- base ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
  container-type: inline-size;
}
.container--narrow { max-width: var(--container-narrow); }

section { position: relative; }
.section-pad { padding-block: var(--space-8); }
@media (min-width: 700px) { .section-pad { padding-block: var(--space-9); } }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;

  letter-spacing: 0.01em;
  line-height: 0.98;
  text-transform: uppercase;
  color: var(--ink-0);
}
h1 { font-size: clamp(2.6rem, 9vw, 5.2rem); }
h2 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  font-family: var(--font-body);
  font-weight: 700;
  /* sized off the width of the actual container it sits in (cqw), not the
     viewport (vw) — the hero's copy column narrows again above the 900px
     breakpoint when the two-column layout kicks in, so a viewport-based
     size would grow exactly where the available space shrinks. This way
     each eyebrow stays on one line by default everywhere on the site, and
     only wraps where its own column genuinely can't fit it. */
  font-size: clamp(0.85rem, 3.4cqw, 1.3rem);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--yellow);
}
.eyebrow::before {
  content: "";
  width: 32px; height: 4px;
  background: var(--gradient-shirt);
  border-radius: 2px;
  flex-shrink: 0;
}
/* the hero date/location line reads as the page's dateline — bigger still */
.hero-copy { container-type: inline-size; }
.hero .eyebrow { font-size: clamp(0.8rem, 2.9cqw, 1.15rem); letter-spacing: 0.06em; }
.hero .eyebrow::before { width: 30px; height: 4px; }

p { color: var(--text-muted); max-width: 62ch; }
p.lede { font-size: 1.15rem; color: var(--text); }

a.link { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }
a.link:hover { color: var(--orange); }

/* ---------- focus ---------- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  background: var(--ink-0);
  color: var(--navy-950);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-s);
  font-weight: 700;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 1.7rem;
  border-radius: var(--radius-s);
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gradient-shirt);
  color: var(--navy-950);
  box-shadow: 0 8px 24px -8px rgba(239, 106, 31, 0.55);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 28px -6px rgba(239, 106, 31, 0.65); }
.btn-ghost {
  background: transparent;
  color: var(--ink-0);
  border: 1.5px solid var(--border-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--ink-0); }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-navy);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
  transition: padding-block 0.25s ease;
}
.site-header.is-scrolled .header-row { padding-block: 0.55rem; }
.site-header.is-scrolled .brand .brand-mark { width: 27px; height: 27px; }
.brand .brand-mark { transition: width 0.25s ease, height 0.25s ease; }
@media (prefers-reduced-motion: reduce) {
  .header-row, .brand .brand-mark { transition: none; }
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}
.brand .brand-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
  transform: scale(1.18);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.brand .brand-word {
  height: 44px;
  width: auto;
  flex-shrink: 0;
  transition: height 0.25s ease;
}
.site-header.is-scrolled .brand .brand-word { height: 34px; }
@media (prefers-reduced-motion: reduce) { .brand .brand-word { transition: none; } }
.header-cta { display: flex; align-items: center; gap: var(--space-3); }
.header-cta .btn { display: none; }
@media (min-width: 560px) { .header-cta .btn { display: inline-flex; } }

/* ---------- section nav ---------- */
.site-nav { display: none; align-items: center; gap: var(--space-5); flex: 1; justify-content: center; }
.site-nav a {
  font-size: 0.88rem; font-weight: 600; color: var(--ink-300); text-decoration: none;
  white-space: nowrap; transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--ink-0); }
@media (min-width: 900px) { .site-nav { display: flex; } }

.nav-toggle {
  position: relative; width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  cursor: pointer;
}
@media (min-width: 900px) { .nav-toggle { display: none; } }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  width: 18px; height: 2px; background: var(--ink-0); border-radius: 2px;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; position: absolute; left: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--brand-navy);
}
.mobile-nav[hidden] { display: none; }
.mobile-nav-link {
  padding: var(--space-4) var(--space-5); font-weight: 600; color: var(--ink-100);
  text-decoration: none; border-bottom: 1px solid var(--border);
}
.mobile-nav-link:last-child { border-bottom: none; }
@media (min-width: 900px) { .mobile-nav { display: none !important; } }

/* ---------- route motif (signature element) ---------- */
.route-motif {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.route-motif svg { width: 100%; height: 100%; opacity: 0.5; }
.route-motif-draw {
  stroke-dasharray: var(--motif-length);
  stroke-dashoffset: var(--motif-length);
  animation: motif-draw 14s ease-in-out infinite;
}
@keyframes motif-draw {
  0%   { stroke-dashoffset: var(--motif-length); }
  55%  { stroke-dashoffset: 0; }
  80%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: calc(-1 * var(--motif-length)); }
}
@media (prefers-reduced-motion: reduce) {
  .route-motif-draw { animation: none; stroke-dashoffset: 0; }
}
.route-motif-line {
  fill: none;
  stroke: url(#motifGradient);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}

.section-divider {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.section-divider svg { width: 100%; max-width: 900px; height: 40px; opacity: 0.5; }

/* ---------- hero ---------- */
.hero {
  padding-block: var(--space-8) var(--space-7);
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(47,174,106,0.22), transparent 60%),
    radial-gradient(ellipse 900px 600px at 110% 10%, rgba(239,106,31,0.22), transparent 55%),
    var(--bg);
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: var(--space-7); }
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--ink-100);
  background: rgba(255,255,255,0.04);
}
.badge strong { color: var(--yellow); font-weight: 800; }
.hero h1 { margin-top: var(--space-3); }
.hero h1 .accent {
  background: var(--gradient-shirt);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { margin-top: var(--space-4); font-size: 1.05rem; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  margin-top: var(--space-5);
  font-weight: 600; color: var(--ink-100); font-size: 0.95rem;
}
.hero-facts span { display: flex; align-items: center; gap: var(--space-2); }
.hero-facts .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--orange); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

/* hero trust row — qualifier + organiser/municipality logos, the "pull factor" */
.hero-trust { margin-top: var(--space-6); }
.hero-trust-label {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-300); max-width: 42ch; margin-bottom: var(--space-3);
}
.hero-trust-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.trust-badge {
  display: flex; align-items: center; justify-content: center;
  height: 52px; padding: 0.4rem 0.7rem;
  background: var(--ink-0); border-radius: var(--radius-s);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.trust-badge:hover, .trust-badge:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.34);
}
@media (prefers-reduced-motion: reduce) { .trust-badge { transition: none; } .trust-badge:hover { transform: none; } }
.trust-badge img { height: 100%; width: auto; max-width: 110px; object-fit: contain; }

/* countdown */
.countdown-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: var(--space-5);
  position: relative;
  z-index: 1;
}
.countdown-card .eyebrow { margin-bottom: var(--space-3); }
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.countdown-unit {
  text-align: center;
  background: var(--bg-sunken);
  border-radius: var(--radius-s);
  padding: var(--space-3) var(--space-1);
}
.countdown-unit .num {
  font-family: var(--font-display);
  font-weight: 800;

  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.countdown-unit .lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.countdown-note { margin-top: var(--space-4); font-size: 0.9rem; color: var(--text-muted); }
.countdown-note strong { color: var(--yellow); }

/* ---------- qualifier panel ---------- */
.qualifier-panel {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.qualifier-grid {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}
@media (min-width: 720px) { .qualifier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .qualifier-grid { grid-template-columns: repeat(4, 1fr); } }
.qual-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--space-5);
}
.qual-card .qual-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-shirt);
  color: var(--navy-950);
  margin-bottom: var(--space-3);
  font-weight: 800;
}
.qual-card h3 { font-size: 1.1rem; margin-bottom: var(--space-2); }
.qual-card p { font-size: 0.92rem; }
.qual-caveat {
  margin-top: var(--space-6);
  padding: var(--space-5);
  border-radius: var(--radius-m);
  background: rgba(245, 197, 24, 0.08);
  border: 1px solid rgba(245, 197, 24, 0.3);
}
.qual-caveat p { color: var(--ink-100); max-width: none; }
.qual-caveat strong { color: var(--yellow); }

/* ---------- why run this one ---------- */
.reasons-grid {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}
@media (min-width: 700px) { .reasons-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .reasons-grid { grid-template-columns: repeat(4, 1fr); } }
.reason-card {
  padding: var(--space-5);
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,0.03), transparent);
}
.reason-num {
  font-family: var(--font-display);

  font-weight: 800;
  font-size: 2rem;
  background: var(--gradient-shirt);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--space-2);
}
.reason-card h3 { font-size: 1.05rem; margin-bottom: var(--space-2); }
.reason-card p { font-size: 0.92rem; }

/* ---------- distances & fees ---------- */
.distance-cards { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
@media (min-width: 720px) { .distance-cards { grid-template-columns: repeat(2, 1fr); } }
.distance-table-wrap { display: none; }

.distance-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--space-5);
  background: var(--bg-raised);
  position: relative;
}
.distance-card.flagship {
  border-color: var(--orange);
  background: linear-gradient(165deg, rgba(239,106,31,0.14), var(--bg-raised) 60%);
}
.distance-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.distance-card-head .dist-label { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; color: var(--ink-0); }
.distance-card .flag-tag {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy-950); background: var(--gradient-shirt); padding: 0.25rem 0.6rem; border-radius: 999px;
}
.dist-fee-row { display: flex; justify-content: space-between; margin-top: var(--space-4); font-size: 0.92rem; padding-block: var(--space-1); border-bottom: 1px dashed var(--border); }
.dist-fee-row:last-of-type { border-bottom: none; }
.dist-fee-row .lbl { color: var(--text-muted); }
.dist-fee-row .val { font-weight: 700; color: var(--ink-100); }
.dist-fee-row .val.late { color: var(--orange); }
.dist-meta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); font-size: 0.82rem; color: var(--text-faint); }
.distance-card .btn { margin-top: var(--space-5); }

@media (min-width: 860px) {
  .distance-cards { display: none; }
  .distance-table-wrap { display: block; overflow-x: auto; margin-top: var(--space-6); border-radius: var(--radius-m); border: 1px solid var(--border); }
  table.distance-table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--bg-raised); }
  table.distance-table th, table.distance-table td { padding: var(--space-4); text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
  table.distance-table thead th { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ink-0); background: var(--bg-sunken); }
  table.distance-table th:first-child, table.distance-table td:first-child { color: var(--text-muted); font-weight: 600; }
  table.distance-table tbody tr:last-child td { border-bottom: none; }
  table.distance-table td.late { color: var(--orange); font-weight: 700; }
  table.distance-table .flagship-col { position: relative; }
  table.distance-table thead th.flagship-col { color: var(--orange); }
}

.deadline-strip {
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-3);
}
@media (min-width: 640px) { .deadline-strip { grid-template-columns: 1fr 1fr; } }
.deadline-box {
  border-radius: var(--radius-m);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.deadline-box .date {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.5rem; line-height: 1; color: var(--yellow);
  white-space: nowrap; flex-shrink: 0;
}
.deadline-box p { font-size: 0.88rem; margin: 0; }

/* ---------- route section ---------- */
.route-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); }
.route-tab {
  font-weight: 700; font-size: 0.95rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink-300);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.route-tab[aria-selected="true"] {
  background: var(--gradient-shirt);
  color: var(--navy-950);
  border-color: transparent;
}
.route-panel { margin-top: var(--space-5); }
.route-panel[hidden] { display: none; }
.route-layout { display: grid; gap: var(--space-5); }
@media (min-width: 900px) { .route-layout { grid-template-columns: 1.3fr 1fr; } }

.route-map {
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
  position: relative;
}
.route-map .map-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: var(--space-2);
  color: var(--text-faint); font-size: 0.85rem; text-align: center; padding: var(--space-4);
}
.route-map .leaflet-container { background: var(--bg-sunken); font-family: var(--font-body); }

.route-stats { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--space-5); }
.route-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-5); }
.route-stat .num { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--ink-0); }
.route-stat .lbl { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.elevation-profile { margin-top: var(--space-2); }
.elevation-profile svg { width: 100%; height: auto; color: var(--ink-100); }
.elevation-draw {
  stroke-dasharray: var(--elev-length);
  stroke-dashoffset: var(--elev-length);
  transition: stroke-dashoffset 1.1s ease;
}
.elevation-draw.elevation-visible { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .elevation-draw { transition: none; stroke-dashoffset: 0; }
}
.route-caveat { margin-top: var(--space-2); font-size: 0.74rem; color: var(--text-faint); }
.route-desc { margin-top: var(--space-4); font-size: 0.92rem; }
.route-links { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }

/* ---------- qualifying prose section ---------- */
.qualifying-prose { background: var(--bg-sunken); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.qualifying-prose .container--narrow p { max-width: none; }
.qualifying-prose h3 { margin-top: var(--space-6); font-size: 1.2rem; }
.qualifying-prose ul { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.qualifying-prose li { padding-left: var(--space-5); position: relative; color: var(--text-muted); font-size: 0.95rem; }
.qualifying-prose li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 2px; background: var(--gradient-shirt); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-top: var(--space-6); }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { padding: var(--space-4); border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--bg-raised); text-align: center; }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2rem); background: var(--gradient-shirt); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.stat-lbl { margin-top: var(--space-2); font-size: 0.76rem; color: var(--text-muted); line-height: 1.35; }

/* ---------- prize money ---------- */
.prize-highlight {
  margin-top: var(--space-6);
  padding: var(--space-5);
  border-radius: var(--radius-m);
  background: linear-gradient(120deg, rgba(47,174,106,0.14), rgba(239,106,31,0.14));
  border: 1px solid var(--border-strong);
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between;
}
.prize-highlight .total { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; color: var(--ink-0); }
.prize-table-wrap { margin-top: var(--space-5); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); }
table.prize-table { width: 100%; min-width: 560px; background: var(--bg-raised); }
table.prize-table th, table.prize-table td { padding: var(--space-3) var(--space-4); text-align: left; font-size: 0.88rem; border-bottom: 1px solid var(--border); }
table.prize-table thead th { background: var(--bg-sunken); font-weight: 700; color: var(--ink-100); }
table.prize-table tbody tr.masters-row { background: rgba(245, 197, 24, 0.06); }
table.prize-table tbody tr.masters-row td:first-child { font-weight: 700; color: var(--yellow); }
table.prize-table td.num { font-variant-numeric: tabular-nums; }
table.prize-table tbody tr:last-child td { border-bottom: none; }
.prize-footnote { margin-top: var(--space-3); font-size: 0.74rem; color: var(--text-faint); }

/* ---------- proof: testimonials + gallery ---------- */
.quote-grid { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
@media (min-width: 700px) { .quote-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .quote-grid { grid-template-columns: repeat(4, 1fr); } }
.quote-card {
  margin: 0; padding: var(--space-5); border-radius: var(--radius-m);
  border: 1px solid var(--border); background: var(--bg-raised);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.quote-card blockquote { margin: 0; font-size: 0.98rem; color: var(--ink-100); line-height: 1.5; }
.quote-card figcaption { font-size: 0.78rem; color: var(--text-faint); }

.carousel-wrap { margin-top: var(--space-7); }
.carousel {
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}
.carousel-track { display: flex; gap: var(--space-4); }
.carousel-item {
  flex: 0 0 min(320px, 82vw); scroll-snap-align: start;
  margin: 0; border-radius: var(--radius-m); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-raised);
}
.carousel-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.carousel-item figcaption { padding: var(--space-3) var(--space-4); font-size: 0.85rem; color: var(--text-muted); }
.carousel-nav { display: flex; gap: var(--space-3); margin-top: var(--space-4); justify-content: flex-end; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: var(--space-3); }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: var(--space-4) var(--space-5); background: var(--bg-raised);
}
.faq-item summary {
  cursor: pointer; font-weight: 700; color: var(--ink-100); list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800;
  color: var(--yellow); flex-shrink: 0; transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: var(--space-3); font-size: 0.92rem; }

/* ---------- what you get ---------- */
.perks-grid { display: grid; gap: var(--space-4); margin-top: var(--space-6); }
@media (min-width: 700px) { .perks-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .perks-grid { grid-template-columns: repeat(3, 1fr); } }
.perk-card { padding: var(--space-5); border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--bg-raised); }
.perk-card h3 { font-size: 1rem; margin-bottom: var(--space-2); }
.perk-card p { font-size: 0.9rem; }
.plato-card { border-color: var(--purple); background: linear-gradient(160deg, rgba(122,92,214,0.16), var(--bg-raised) 60%); grid-column: 1 / -1; }

/* ---------- practical info ---------- */
.collection-table-wrap { margin-top: var(--space-6); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); }
table.collection-table { width: 100%; min-width: 520px; background: var(--bg-raised); }
table.collection-table th, table.collection-table td { padding: var(--space-3) var(--space-4); text-align: left; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
table.collection-table thead th { background: var(--bg-sunken); font-weight: 700; }
table.collection-table tr.race-day { background: rgba(239,106,31,0.08); }
table.collection-table tr.race-day td:first-child { color: var(--orange); font-weight: 700; }
table.collection-table tbody tr:last-child td { border-bottom: none; }
.practical-notes { display: grid; gap: var(--space-3); margin-top: var(--space-6); }
@media (min-width: 700px) { .practical-notes { grid-template-columns: repeat(2, 1fr); } }
.practical-note { padding: var(--space-4) var(--space-5); border-radius: var(--radius-m); border: 1px solid var(--border); font-size: 0.9rem; }
.practical-note strong { display: block; color: var(--ink-100); margin-bottom: var(--space-1); font-size: 0.95rem; }

/* ---------- facebook feed ---------- */
.facebook-feed-inner { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 900px) {
  .facebook-feed-inner { grid-template-columns: 1fr 1fr; }
}
.fb-feed-card {
  margin-top: var(--space-6);
  max-width: 560px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--space-4);
  overflow: hidden; /* clip the plugin iframe corners to the card radius */
}
@media (min-width: 900px) { .fb-feed-card { margin-top: 0; } }
.fb-feed-card .fb-page, .fb-feed-card iframe { max-width: 100%; }
/* shown only until the SDK swaps it for the live plugin (see fb-xfbml-parse-ignore) */
.fb-feed-card blockquote {
  margin: 0; padding: var(--space-6);
  background: var(--bg-sunken); border-radius: var(--radius-s);
  color: var(--text-muted); font-size: 0.95rem; text-align: center;
}
.fb-feed-card blockquote a { color: var(--yellow); font-weight: 600; }

/* ---------- email capture ---------- */
.email-section {
  background: linear-gradient(135deg, rgba(47,174,106,0.14), rgba(239,106,31,0.1));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.email-card {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.email-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
  max-width: 460px;
  margin-inline: auto;
}
.email-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
@media (min-width: 520px) {
  .email-form-fields { flex-direction: row; }
  .email-form-fields .btn { flex-shrink: 0; }
}
.email-input {
  flex: 1;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-sunken);
  color: var(--ink-0);
  font-size: 1rem;
}
.email-input::placeholder { color: var(--text-faint); }
.email-consent { margin-top: var(--space-4); font-size: 0.78rem; color: var(--text-faint); max-width: 460px; margin-inline: auto; }
.email-consent a { color: var(--text-faint); text-decoration: underline; }
.email-status { margin-top: var(--space-3); font-size: 0.9rem; min-height: 1.2em; }
.email-status.success { color: var(--green); }
.email-status.error { color: #ff8a65; }

/* ---------- footer ---------- */
/* ---------- sponsor marquee ---------- */
.sponsor-marquee { padding-block: var(--space-7); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-sunken); }
.marquee-label {
  text-align: center; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-300); margin-bottom: var(--space-5);
}
.marquee-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee-scroll 42s linear infinite; }
/* pause the scroll on hover/focus so a visitor can actually read or click
   a logo instead of chasing it — :focus-within covers keyboard tabbing
   into a linked logo the same way hover covers the mouse */
.marquee-viewport:hover .marquee-track,
.marquee-viewport:focus-within .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; align-items: center; flex-shrink: 0; }
.marquee-item {
  flex-shrink: 0; padding-inline: var(--space-6); font-size: 1.1rem; font-weight: 600;
  color: var(--ink-300); white-space: nowrap; opacity: 0.85;
  border-right: 1px solid var(--border);
  display: flex; align-items: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
a.marquee-item:hover, a.marquee-item:focus-visible { opacity: 1; }
a.marquee-item-logo:hover img, a.marquee-item-logo:focus-visible img { box-shadow: 0 0 0 2px var(--yellow); }
.marquee-item-logo { padding-inline: var(--space-6); }
.marquee-item-logo img {
  height: 64px; width: auto; max-width: 190px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-s);
  padding: 9px 14px;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee-viewport { overflow-x: auto; }
}

.site-footer { background: var(--bg-sunken); padding-block: var(--space-8) var(--space-6); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: var(--space-6); }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h4 { font-family: var(--font-body); font-style: normal; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: var(--space-3); }
.footer-col ul { display: grid; gap: var(--space-2); }
.footer-col a { color: var(--ink-300); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--ink-0); }
.footer-brand { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.footer-brand .brand-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.18);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.footer-clown { font-size: 0.85rem; color: var(--text-faint); }
.sponsor-wall { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
.sponsor-chip {
  font-size: 0.78rem; color: var(--text-faint); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.7rem; text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a.sponsor-chip:hover, a.sponsor-chip:focus-visible { border-color: var(--yellow); color: var(--ink-100); }
.sponsor-chip-logo { padding: 0.3rem; border-radius: var(--radius-s); border-color: transparent; }
.sponsor-chip-logo img { display: block; height: 24px; width: auto; max-width: 90px; object-fit: contain; background: #fff; border-radius: 4px; padding: 3px 6px; }
a.sponsor-chip-logo:hover img, a.sponsor-chip-logo:focus-visible img { box-shadow: 0 0 0 2px var(--yellow); }
.footer-bottom { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; font-size: 0.8rem; color: var(--text-faint); }
.footer-bottom a { color: var(--text-faint); }

/* ---------- CTA repeat strip ---------- */
.cta-strip { text-align: center; margin-top: var(--space-7); }
.cta-strip p { margin-inline: auto; }

/* ---------- utility ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-6 { margin-top: var(--space-6); }
.max-narrow { max-width: var(--container-narrow); }
.mx-auto { margin-inline: auto; }

/* ---------- leaflet marker + attribution polish ---------- */
.route-marker { border-radius: 50%; border: 2px solid var(--navy-950); box-shadow: 0 0 0 2px rgba(255,255,255,0.8); }
.route-marker-start { background: var(--green); }
.route-marker-finish { background: var(--orange); }
.leaflet-control-attribution {
  background: rgba(10,17,40,0.75) !important;
  color: var(--ink-300) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--ink-100) !important; }
.leaflet-control-zoom a {
  background: var(--bg-raised) !important;
  color: var(--ink-0) !important;
  border-color: var(--border) !important;
}

/* ---------- scroll reveal ---------- */
/* .reveal-init is only ever added by JS, never present in static markup —
   content is fully visible without JS, this is pure enhancement. */
.reveal-init {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-init.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
