/* beforerace.day home page: location-aware race finder. Loaded after site.css (reuses its tokens and glass classes).
   Phone first: nothing here may be wider than the viewport; scroll rows bleed to the screen edge on purpose. */
[hidden] { display: none !important; }
html.rf-lock { overflow: hidden; }
html, body { overflow-x: clip; }

/* grid tracks must be allowed to shrink, or a scroll row inside makes the whole page wider than the phone */
.wrap { grid-template-columns: minmax(0, 1fr); }
section.module { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.home-hero .band-inner > * { min-width: 0; }

/* nav and hero tap targets */
.nav-glass .seg button { min-height: 36px; min-width: 40px; }
.nav-glass { min-width: 0; }
.prefs { flex-shrink: 0; }

/* ---------- hero finder ---------- */
.finder { min-width: 0; }
.finder input { min-height: 50px; font-size: 1rem; }
.finder .chip { min-height: 40px; padding: 8px 14px; display: inline-flex; align-items: center; }
.finder-go { justify-self: start; display: none; min-height: 40px; align-items: center; color: var(--on-photo); font-weight: 600; font-size: 0.95rem; }
.finder-go.on { display: inline-flex; }
.loc-pill { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 8px 14px 8px 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.13); color: var(--on-photo); cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 24px rgba(0, 0, 0, 0.25); }
.loc-pill svg { width: 18px; height: 18px; flex: none; }
.loc-pill .lp-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.95rem; }
.loc-pill[aria-expanded="true"] { background: rgba(255, 255, 255, 0.92); color: #0b1410; border-color: transparent; }

/* ---------- location popover / bottom sheet ---------- */
.loc-backdrop { position: fixed; inset: 0; z-index: 38; background: rgba(var(--shade), 0.6); }
.loc-pop { position: fixed; z-index: 40; width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)), rgba(11, 20, 16, 0.9);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 24px 60px rgba(0, 0, 0, 0.55); }
.loc-pop:focus { outline: none; }
.loc-grab { display: none; width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); margin: 0 auto; }
.loc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loc-head h2 { font-size: 1.15rem; }
.loc-close { width: 44px; height: 44px; margin: -6px -8px -6px 0; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.loc-close svg { width: 20px; height: 20px; }
.loc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-border); }
.loc-tabs button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.loc-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.92); color: #0b1410; }
.loc-panel { display: grid; gap: 10px; min-width: 0; }
.loc-input { width: 100%; min-height: 48px; font-size: 1rem; border-radius: 999px; padding: 10px 16px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.07); color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }
.loc-glabel { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--muted); }
.loc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: min(300px, 38vh); overflow-y: auto; overscroll-behavior: contain; }
.loc-list li[role="option"] { flex: none; min-height: 52px; padding: 8px 12px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; cursor: pointer; min-width: 0; line-height: 1.3; }
.loc-list li[role="option"]:hover, .loc-list li.on { background: rgba(255, 255, 255, 0.1); }
.loc-list li.on { box-shadow: inset 0 0 0 1px rgba(79, 216, 154, 0.5); }
.lo-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lo-sub { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-list .loc-empty { padding: 10px 12px; color: var(--muted); font-size: 0.9rem; }
.loc-geo { justify-content: center; min-height: 48px; width: 100%; }
.loc-geo:disabled { opacity: 0.6; cursor: progress; }
.loc-msg { min-height: 1.2em; font-size: 0.85rem; color: var(--muted); }
.loc-radius { display: grid; gap: 6px; }
.loc-radius label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 0.9rem; }
.loc-radius output { font-family: var(--font-data); color: var(--accent-ink); }
.loc-radius input[type="range"] { width: 100%; height: 40px; margin: 0; accent-color: var(--accent); }
.loc-ends { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--muted); font-family: var(--font-data); }
.loc-units { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.9rem; font-weight: 600; }
.loc-units .seg button { min-height: 40px; min-width: 52px; }
.loc-foot { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 0.82rem; color: var(--muted); }
.loc-foot button { justify-self: start; min-height: 40px; padding: 0; border: 0; background: none; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 0.86rem; }
@media (prefers-reduced-motion: no-preference) {
  .loc-pop:not([hidden]) { animation: loc-in 0.2s ease-out; }
  @keyframes loc-in { from { opacity: 0; transform: translateY(8px); } }
}

/* ---------- race rows ---------- */
.rf-rows { display: grid; gap: 34px; min-width: 0; }
.rf-row { display: grid; gap: 12px; min-width: 0; }
.rf-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.rf-row-head h3 { font-size: 1.35rem; font-weight: 750; }
.rf-row-head p { font-size: 0.9rem; }
.rf-wrap { position: relative; min-width: 0; }
.race-row { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  padding: 8px 2px 28px; margin-bottom: -16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
/* the rows sit below the full-screen hero: skip their layout and paint until they near the viewport (index.html re-measures the arrows when a row wakes up) */
.race-row { content-visibility: auto; contain-intrinsic-size: auto 520px; }
.race-row > .race-card { flex: 0 0 min(310px, 82%); min-width: 0; scroll-snap-align: start; }
.rf-nav { display: none; position: absolute; top: 70px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; place-items: center; cursor: pointer; color: var(--ink);
  background: rgba(16, 26, 21, 0.7); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.rf-nav svg { width: 20px; height: 20px; }
.rf-nav.prev { left: -14px; }
.rf-nav.next { right: -14px; }
.rf-nav:disabled { opacity: 0; pointer-events: none; }
@media (min-width: 761px) and (hover: hover) { .rf-nav { display: grid; } }
.rf-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.rf-more { justify-self: center; }
.rf-prompt { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: var(--r); }
.rf-prompt strong { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.rf-prompt .btn { min-height: 44px; justify-content: center; }
.rf-note { font-size: 0.85rem; color: var(--muted); }
.rf-empty { display: grid; gap: 10px; justify-items: start; }
.rf-empty .btn { min-height: 44px; }

/* cards (the base look comes from site.css .race-card) */
.race-card { min-width: 0; }
.race-card .pic { background: radial-gradient(120% 140% at 20% 0%, rgba(79, 216, 154, 0.25), rgba(var(--shade), 0.9) 70%), var(--bg-2); }
.race-card .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.race-card .pic .date { max-width: calc(100% - 24px); line-height: 1.3; }
.race-card .body { min-width: 0; }
.race-card h3 { overflow-wrap: anywhere; }
.race-card .away { margin-top: 4px; font-size: 0.84rem; font-weight: 600; color: var(--accent-ink); }
.race-card .kv .k { line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; letter-spacing: 0.06em; }  /* long German/French labels wrap instead of overlapping */
.race-card .kv .v { white-space: nowrap; }
.race-card.nofile { background: linear-gradient(155deg, hsl(var(--h, 170) 50% 42% / 0.28), rgba(255, 255, 255, 0.04) 62%), linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)); }
.race-card.nofile:hover { transform: none; border-color: var(--glass-border); }
.race-card.nofile .pic { background: linear-gradient(135deg, hsl(var(--h, 170) 55% 40% / 0.5), hsl(calc(var(--h, 170) + 40) 50% 22% / 0.35) 70%, rgba(var(--shade), 0.4)); }
.race-card.nofile:not(.has-photo) .pic::after { display: none; }
.race-card.nofile.has-photo .pic { background: var(--bg-2); }
.race-card.nofile .body { grid-template-rows: auto auto auto 1fr; }
.nf-cc { position: absolute; right: 14px; bottom: -6px; font-family: var(--font-display); font-weight: 800; font-size: 5.2rem; line-height: 1; letter-spacing: -0.06em; color: rgba(255, 255, 255, 0.12); user-select: none; }
.nf-foot { align-self: end; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 6px; }
.nf-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 0.92rem; }
.race-card.skel { min-height: 300px; }
.race-card.skel .pic { aspect-ratio: 16 / 8; }
@media (prefers-reduced-motion: no-preference) {
  .race-card.skel { animation: rf-pulse 1.4s ease-in-out infinite; }
  @keyframes rf-pulse { 50% { opacity: 0.55; } }
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .home-hero h1 { font-size: clamp(2.5rem, 12.5vw, 3.4rem); overflow-wrap: break-word; }
  .home-hero .lead { font-size: 1.05rem; }
  .compare-art { padding: 16px; }
  .race-row { margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: var(--gutter-l) var(--gutter-r); scroll-padding-inline: var(--gutter-l); }
  .race-row > .race-card { flex-basis: min(300px, 84%); }
  .rf-row-head h3 { font-size: 1.25rem; }
  .loc-pill { max-width: 100%; }
  /* the popover becomes a bottom sheet */
  .loc-pop { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 88vh; max-height: min(88dvh, 680px);
    border-radius: 24px 24px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .loc-grab { display: block; }
  .loc-list { max-height: 34vh; }
  @media (prefers-reduced-motion: no-preference) { .loc-pop:not([hidden]) { animation: loc-up 0.24s ease-out; } @keyframes loc-up { from { transform: translateY(40px); opacity: 0; } } }
}

/* ---------- wide layout (home only), modelled on races.runna.com ----------
   Content runs edge to edge with a fluid side gutter (64 px at 1440 wide, 20 px on phones) instead of a
   1040 px column. Race rows start at the gutter and bleed off the right edge so the next card peeks in. */
body.home {
  --edge: clamp(20px, 4.45vw, 64px);
  --gutter-l: max(var(--edge), env(safe-area-inset-left, 0px));
  --gutter-r: max(var(--edge), env(safe-area-inset-right, 0px));
}
.home .band-inner, .home .wrap { max-width: none; }

/* hero: one clean column built around the search */
.home-hero .band-inner { display: block; min-height: 0; padding-block: calc(var(--nav-h) + clamp(56px, 9vh, 110px)) clamp(40px, 7vh, 80px); }
.hero-main { max-width: 860px; }
.home-hero h1 { max-width: 13ch; text-wrap: balance; }
.home-hero .lead { margin-top: 14px; max-width: 46ch; }
.home .finder { margin-top: 28px; gap: 14px; }
.finder-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.searchbar { flex: 1 1 360px; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 8px 0 18px; border-radius: 999px; cursor: text;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.24); color: var(--on-photo-muted);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.25); }
.searchbar:focus-within { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.14); }
.searchbar svg { flex: none; width: 20px; height: 20px; }
.home .searchbar input { flex: 1 1 auto; min-width: 0; min-height: 54px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-appearance: none; appearance: none; color: var(--on-photo); font-size: 1.06rem; outline: none; }
.home .searchbar input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.6; }
.home .loc-pill { flex: none; min-height: 56px; padding-inline: 16px 18px; }
.home .chips { gap: 8px; }

/* race rows: full-bleed scrollers, card size close to Runna's (about 420 px at 1440 wide) */
.home .rf-rows { gap: 44px; }
.home .race-row { gap: 24px; margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: var(--gutter-l) var(--gutter-r); scroll-padding-inline: var(--gutter-l); scrollbar-width: none; }
.home .race-row::-webkit-scrollbar { display: none; }
.home .race-row > .race-card { flex: 0 0 clamp(270px, 29.3vw, 440px); }
.home .rf-nav.prev { left: max(8px, calc(var(--gutter-l) - 22px)); }
.home .rf-nav.next { right: max(8px, calc(var(--gutter-r) - 22px)); }
.home .race-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }

@media (max-width: 760px) {
  .home-hero .band-inner { padding-block: calc(var(--nav-h) + 66px) 32px; }
  .searchbar { flex-basis: 100%; min-height: 52px; }
  .home .searchbar input { min-height: 50px; font-size: 16px; }
  .home .loc-pill { min-height: 44px; }
  /* chips: one swipeable line that bleeds to the screen edges, as on Runna */
  .home .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r)); padding-inline: var(--gutter-l) var(--gutter-r); scrollbar-width: none; }
  .home .chips::-webkit-scrollbar { display: none; }
  .home .chips .chip { flex: none; white-space: nowrap; }
  .home .race-row { gap: 14px; }
  .home .race-row > .race-card { flex-basis: calc(100vw - var(--gutter-l) - var(--gutter-r) - 28px); }
}

/* ---------- full-screen hero ----------
   The hero fills exactly one screen on any device: svh is the height with the browser toolbars showing, so
   nothing hides under Safari's bottom bar. Content sits centred in the space below the nav; the title scales
   with the screen height too, so short laptop screens and phones in landscape still fit everything. */
.home-hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.home-hero .band-inner { flex: 1 1 auto; width: 100%; display: flex; flex-direction: column; justify-content: center;
  padding-block: calc(var(--nav-h) + clamp(24px, 6svh, 72px)) clamp(24px, 6svh, 64px); }
.home-hero h1 { font-size: clamp(2.3rem, min(8vw, 10.5svh), 5.6rem); }
.home .finder { margin-top: clamp(16px, 3.5svh, 28px); }
/* the <picture> only wraps the <img>, which site.css positions behind the hero */
.hero-poster { display: contents; }
.hero-img { object-position: 50% 45%; }
@media (max-width: 760px) {
  .home-hero .band-inner { justify-content: flex-end; padding-block: calc(var(--nav-h) + 56px) clamp(20px, 5svh, 40px); }
  .home-hero h1 { font-size: clamp(2.2rem, min(12.5vw, 7.2svh), 3.4rem); }
  .home-hero .lead { font-size: clamp(0.98rem, 2.3svh, 1.05rem); }
}

/* ---------- hero content ----------
   Status pill, title, lead, one search capsule (race + location + Find races), quick filters; three facts and a
   scroll cue sit on the bottom edge. The title block is centred in the space left above the facts. */
.home-hero .band-inner { position: relative; align-items: stretch; }
.hero-main { margin-block: auto; }
.hero-status { width: fit-content; margin: 0 0 clamp(14px, 2.6svh, 22px); font-size: 0.8rem; letter-spacing: 0.01em; }
.home-hero .lead { color: var(--on-photo-muted); }
/* the capsule: one glass bar, the parts inside it lose their own frames */
.home .finder-row { flex-wrap: nowrap; gap: 4px; padding: 6px; border-radius: 999px; max-width: 900px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 40px rgba(0, 0, 0, 0.35); }
.home .finder-row:focus-within { border-color: rgba(255, 255, 255, 0.45); }
.home .finder-row .searchbar, .home .finder-row .loc-pill { background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home .finder-row .searchbar { flex: 1 1 auto; min-height: 50px; padding-left: 14px; }
.home .finder-row .searchbar input { min-height: 48px; }
.home .finder-row .loc-pill { min-height: 50px; max-width: 260px; padding-inline: 12px 14px; }
.home .finder-row .loc-pill:hover { background: rgba(255, 255, 255, 0.08); }
.home .finder-row .loc-pill[aria-expanded="true"] { background: rgba(255, 255, 255, 0.92); }
.finder-sep { flex: none; width: 1px; height: 28px; background: rgba(255, 255, 255, 0.22); }
.finder-submit { flex: none; min-height: 50px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #06130d; font: 650 1rem var(--font-display); letter-spacing: -0.01em; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(79, 216, 154, 0.35); transition: background 0.15s, transform 0.15s; }
.finder-submit:hover { background: #6ff0b0; }
.finder-submit:active { transform: scale(0.97); }
.chips-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chips-label { flex: none; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-photo-muted); }
/* facts along the bottom edge */
.hero-facts { list-style: none; margin: clamp(20px, 4svh, 40px) 0 0; padding: clamp(14px, 2.4svh, 22px) 64px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.16); max-width: 1100px; }
.hero-facts li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.88rem; line-height: 1.35; color: var(--on-photo-muted); }
.hero-facts svg { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--accent); }
.hero-facts b { display: block; color: var(--on-photo); font-weight: 600; font-size: 0.95rem; }
.hero-scroll { position: absolute; right: var(--gutter-r); bottom: clamp(24px, 6svh, 64px); display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--on-photo); border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.hero-scroll svg { width: 20px; height: 20px; }
.hero-scroll:hover { background: rgba(255, 255, 255, 0.16); }
@media (prefers-reduced-motion: no-preference) {
  .hero-scroll svg { animation: hero-nudge 2.4s ease-in-out infinite; }
  @keyframes hero-nudge { 50% { transform: translateY(3px); } }
}
@media (max-width: 760px) {
  .hero-main { margin-block: auto 0; }
  /* the capsule opens up: search on its own line, location and the button share the second */
  .home .finder-row { flex-wrap: wrap; border-radius: 26px; padding: 6px; }
  .home .finder-row .searchbar { flex-basis: 100%; min-height: 48px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0; }
  .finder-sep { display: none; }
  .home .finder-row .loc-pill { flex: 1 1 0; min-width: 0; min-height: 46px; max-width: none; justify-content: flex-start; }
  .finder-submit { min-height: 46px; padding-inline: 20px; }
  .chips-label { display: none; }
  .hero-facts { padding-right: 0; gap: 10px; margin-top: clamp(14px, 3svh, 24px); }
  .hero-facts li { flex-direction: column; gap: 6px; font-size: 0.76rem; }
  .hero-facts li span { font-size: 0; }
  .hero-facts b { font-size: 0.8rem; }
  .hero-facts svg { width: 18px; height: 18px; }
  .hero-scroll { display: none; }
}
@media (max-width: 760px) and (max-height: 700px) { .hero-facts { display: none; } }

/* ---------- crawlable browse links under the race rows (pipeline/build_home_links.py) ---------- */
.browse-races { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 28px; }
.browse-races .eyebrow { flex-basis: 100%; }
.browse-races .pill { text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; padding-inline: 14px; }
.race-index { margin-top: 26px; }
.race-index h3 { font-size: 1.05rem; margin-bottom: 10px; }
.race-groups { display: grid; gap: 8px; }
.race-groups details { border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }
.race-groups summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 13px 18px; font-size: 0.95rem; color: var(--ink); user-select: none; }
.race-groups summary::-webkit-details-marker { display: none; }
.race-groups summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0.6; transition: transform 0.2s; }
.race-groups details[open] > summary::after { transform: rotate(-135deg); }
.race-groups summary:hover { background: rgba(255,255,255,0.05); border-radius: 16px; }
.race-groups .count { opacity: 0.55; font-variant-numeric: tabular-nums; }
.race-groups ul { list-style: none; padding: 4px 18px 16px; margin: 0; columns: 4 220px; column-gap: 28px; max-height: 420px; overflow-y: auto; }
.race-index li { break-inside: avoid; padding: 3px 0; font-size: 0.92rem; }
.race-index a { color: var(--ink); text-decoration: none; }
.race-index a:hover { color: var(--accent); text-decoration: underline; }
.race-index .muted { font-size: 0.82rem; }
@media (max-width: 760px) {
  .race-index ul { columns: 2 140px; column-gap: 18px; }
  .race-index li { font-size: 0.86rem; padding: 4px 0; }
  .race-index .muted { display: none; }
}

/* ---------- below the hero: the same type and glass language as the hero ----------
   Section titles use the hero's display face at a smaller size, with a green eyebrow; sections get more air. */
.home .wrap { gap: clamp(72px, 10vw, 128px); padding-block: clamp(48px, 7vw, 88px) clamp(72px, 9vw, 112px); }
.home .sec-head { gap: 10px; max-width: 760px; }
.home .sec-head .eyebrow { color: var(--accent-ink); }
.home .sec-head h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; }
.home .sec-head p { font-size: 1.05rem; line-height: 1.5; max-width: 56ch; }
.home #races-section > .sec-head { margin-bottom: 8px; }
.home .rf-row-head h3 { font-size: clamp(1.25rem, 1.8vw, 1.55rem); font-weight: 750; letter-spacing: -0.03em; }

/* cards: no-photo placeholder gets a faint course line instead of an empty tile */
.race-card .pic svg.nf-art { inset: 0; right: auto; bottom: auto; width: 100%; height: 100%; }
.nf-art path { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.nf-art path + path { stroke: hsl(var(--h, 170) 70% 65% / 0.28); stroke-dasharray: 4 6; }

/* ---------- race-file preview ---------- */
.home .preview { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.pv-intro { display: grid; gap: 26px; align-content: start; }
.pv-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pv-points li { display: flex; gap: 12px; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.pv-points li > svg { flex: none; width: 22px; height: 22px; padding: 3px; margin-top: 1px; border-radius: 50%; color: var(--accent); background: var(--accent-wash); }
.pv-points b { display: block; color: var(--ink); font-weight: 650; font-size: 1rem; }
.pv-cta { justify-self: start; }
.pv-card { display: grid; gap: 12px; padding: 14px; border-radius: 28px; border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(79, 216, 154, 0.1), rgba(255, 255, 255, 0.03) 45%), rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 80px rgba(0, 0, 0, 0.45); }
.pv-head { display: flex; gap: 14px; align-items: center; padding: 4px 6px 4px 4px; color: var(--ink); text-decoration: none; border-radius: 18px; }
.pv-head:hover { background: rgba(255, 255, 255, 0.05); }
.pv-head img { display: block; width: 64px; height: 48px; object-fit: cover; border-radius: 12px; }
.pv-head > span { display: grid; min-width: 0; flex: 1; }
.pv-head b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 750; letter-spacing: -0.02em; }
.pv-head .muted { font-size: 0.82rem; }
.pv-tag { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--accent-ink); }
.pv-go { flex: none; width: 20px; height: 20px; color: var(--muted); }
.pv-panel { display: grid; gap: 10px; align-content: start; padding: 16px 18px; border-radius: 20px; background: rgba(var(--shade), 0.45); border: 1px solid var(--line); min-width: 0; }
.pv-ph { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.pv-ph h3 { font-size: 0.72rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--muted); }
.pv-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--font-data); font-size: 0.8rem; }
.pv-stats b { font-weight: 600; }
.pv-chart { position: relative; }
.pv-profile { display: block; width: 100%; height: clamp(110px, 12vw, 150px); }
.pv-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.pv-climb { fill: rgba(255, 255, 255, 0.07); }
.pv-ticks { position: relative; height: 16px; font-family: var(--font-data); font-size: 0.68rem; color: var(--faint); border-top: 1px solid var(--line); }
.pv-ticks span { position: absolute; top: 3px; transform: translateX(-50%); }
.pv-ticks .pv-km { left: 0; transform: none; }
.pv-chip { justify-self: start; font-size: 0.8rem; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.pv-chip b { color: var(--ink); }
.pv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pv-temp { display: grid; gap: 2px; }
.pv-temp .muted { font-size: 0.82rem; }
.pv-big { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.pv-strip { position: relative; height: 26px; margin-top: 6px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(120, 180, 255, 0.22), rgba(79, 216, 154, 0.18) 45%, rgba(255, 170, 90, 0.25)); }
.pv-range { position: absolute; top: 4px; bottom: 4px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); }
.pv-strip i { position: absolute; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); }
.pv-scale { display: flex; justify-content: space-between; font-family: var(--font-data); font-size: 0.68rem; color: var(--faint); }
.pv-note { margin: 0; font-size: 0.78rem; color: var(--faint); }
.pv-splits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pv-splits div { display: grid; gap: 1px; padding: 7px 9px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.pv-splits .k { font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pv-splits .t { font-family: var(--font-data); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.pv-splits .slow { background: rgba(255, 170, 90, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 170, 90, 0.35); }

/* ---------- browse block (moved below the calculator) ---------- */
.home .browse .browse-races { margin-top: 0; }
.home .browse .browse-races .eyebrow { display: none; }

@media (max-width: 960px) {
  .home .preview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .home .wrap { gap: 72px; }
  .pv-card { padding: 10px; border-radius: 22px; }
  .pv-panel { padding: 14px; }
  .pv-grid { grid-template-columns: minmax(0, 1fr); }
}

/* "Your races" (saved on race pages by race-share.js, localStorage brd-my-races) */
.mr-list { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.mr-card { position: relative; flex: 0 0 240px; min-height: 150px; padding: 16px; border-radius: 20px; overflow: hidden; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  border: 1px solid var(--glass-border); background: #13201a; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32); }
.mr-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; z-index: 0; }
.mr-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 14, 11, 0.1), rgba(8, 14, 11, 0.85)); z-index: 0; }
.mr-card > :not(img) { position: relative; z-index: 1; }
.mr-days { display: flex; align-items: baseline; gap: 6px; margin-bottom: auto; }
.mr-days b { font-family: var(--font-data); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.mr-days span { font-size: 0.82rem; color: var(--muted); }
.mr-name { font-weight: 650; font-size: 1.02rem; }
.mr-goal { font-family: var(--font-data); font-size: 0.85rem; }
.mr-card:hover { border-color: rgba(255, 255, 255, 0.3); }

/* data-story promo (rankings pages) */
.promo-rank { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pr-card { display: flex; flex-direction: column; gap: 10px; padding: 28px; border-radius: 24px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--glass-border); background: radial-gradient(120% 140% at 0% 0%, rgba(74, 222, 128, 0.16), transparent 55%), linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 12px 32px rgba(0, 0, 0, 0.32); transition: border-color 0.2s, transform 0.2s; }
.pr-card + .pr-card { background: radial-gradient(120% 140% at 100% 0%, rgba(251, 191, 36, 0.14), transparent 55%), linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)); }
.pr-card h2 { font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; line-height: 1.12; margin: 0; }
.pr-card p { color: var(--muted); }
.pr-go { margin-top: auto; font-weight: 600; color: var(--accent); }
.pr-go::after { content: " →"; }
.pr-card:hover { border-color: rgba(255, 255, 255, 0.3); }
@media (prefers-reduced-motion: no-preference) { .pr-card:hover { transform: translateY(-2px); } }
@media (max-width: 760px) { .promo-rank { grid-template-columns: 1fr; } .pr-card { padding: 22px; } }

/* ---------- "When" pill + date popover (index.html: whenPreset/setWhen) ---------- */
.home .finder-row .when-pill { max-width: 220px; }
.when-pill.set .lp-text { color: var(--accent); }
.when-pill[aria-expanded="true"].set .lp-text { color: inherit; }
.finder-submit .fs-icon { display: none; }
.when-pop { gap: 10px; }
.when-pop .chip { color: var(--ink); min-height: 38px; }
.wh-sub { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.wh-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.wh-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wh-months .chip { justify-content: center; padding-inline: 6px; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-mode { justify-self: start; }
.wh-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wh-field { display: grid; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.wh-field[hidden] { display: none; }
.wh-field input { min-height: 44px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.06); color: var(--ink); color-scheme: dark; font-size: 0.95rem; }
.wh-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wh-err { min-height: 0; color: #fca5a5; font-size: 0.85rem; }
.wh-err:empty { display: none; }
.wh-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; }
.wh-foot .btn { flex: 1; }
@media (max-width: 760px) {
  .home .finder-row .when-pill { flex: 1 1 0; max-width: none; }
  .finder-submit { padding-inline: 0; width: 46px; }
  .finder-submit .fs-text { display: none; }
  .finder-submit .fs-icon { display: block; margin: auto; }
  .wh-months .chip { font-size: 0.74rem; padding-inline: 2px; letter-spacing: -0.01em; }
  /* two pills and the round search button share one line: drop the chevrons, keep the words */
  .home .finder-row .loc-pill > svg:last-child { display: none; }
  .home .finder-row .loc-pill { padding-inline: 10px 8px; gap: 6px; }
  .home .finder-row .loc-pill .lp-text { font-size: 0.88rem; }
}
.home .finder-row .searchbar { min-width: 200px; }
.when-pop .chip[aria-pressed="true"] { color: #0b1410; }

/* no backdrop blur (see --blur in site.css): denser fills over the photos */
.rf-nav { background: rgba(16, 26, 21, 0.92); }
.loc-pill, .searchbar, .hero-scroll, .home .finder-row { background: rgba(var(--shade), 0.5); }
.home .finder-row .searchbar, .home .finder-row .loc-pill { background: transparent; }
.searchbar:focus-within { background: rgba(var(--shade), 0.62); }

/* race-file preview: at ~1024px the pacing panel is about 230px wide, too narrow for three h:mm:ss tiles at the
   default padding; the tiles tighten inside a narrow panel instead of overflowing it */
.pv-panel { container-type: inline-size; }
@container (max-width: 300px) { .pv-splits div { padding-inline: 7px; } .pv-splits .t { font-size: 0.8rem; } }
