@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: dark;
  --ink: #f8f8f4;
  --muted: #a7aaa8;
  --dim: #707571;
  --bg: #0b0c0b;
  --panel: rgba(24, 26, 24, 0.88);
  --panel-strong: #1b1d1b;
  --line: rgba(255, 255, 255, 0.10);
  --orange: #ff4f1f;
  --orange-soft: #ff6b3d;
  --lime: #d6ff38;
  --green: #66e58a;
  --yellow: #ffd36a;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 45% -15%, rgba(255, 79, 31, 0.14), transparent 34rem),
    linear-gradient(180deg, #0c0d0c 0%, #111311 62%, #0c0d0c 100%);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(214, 255, 56, 0.82);
  outline-offset: 3px;
}

.ambient { position: fixed; inset: auto; border-radius: 50%; filter: blur(100px); opacity: .16; pointer-events: none; z-index: -1; }
.ambient-one { width: 24rem; height: 24rem; background: var(--orange); top: 20rem; right: -10rem; }
.ambient-two { width: 20rem; height: 20rem; background: #718f2e; top: 72rem; left: -12rem; }

.topbar {
  max-width: 1480px;
  margin: 0 auto;
  min-height: 86px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; background: var(--orange); color: white;
  font: 800 15px/1 Manrope, sans-serif; letter-spacing: -.04em;
  transform: rotate(-4deg); box-shadow: 0 8px 25px rgba(255, 79, 31, .25);
}
.brand strong, .brand small { display: block; }
.brand strong { font: 800 16px/1.2 Manrope, sans-serif; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; text-transform: uppercase; letter-spacing: .1em; }
.source-link { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; }
.source-link:hover { color: var(--ink); }

main { max-width: 1480px; margin: 0 auto; padding: 0 28px 42px; }
.hero { max-width: 960px; margin: 0 auto; padding: 72px 0 54px; text-align: center; }
.eyebrow, .section-kicker {
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 9px; }
.eyebrow span { width: 8px; height: 8px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 16px var(--lime); }
.hero h1 {
  margin: 18px 0 14px;
  font: 800 clamp(44px, 7vw, 82px)/.98 Manrope, sans-serif;
  letter-spacing: -.065em;
}
.hero h1 em { color: var(--orange-soft); font-style: normal; }
.hero > p { margin: 0 auto; max-width: 680px; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.hero-search {
  margin: 34px auto 18px; min-height: 68px; max-width: 700px;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  border-radius: 22px; background: #f7f7f1; color: #171817;
  box-shadow: 0 22px 60px rgba(0,0,0,.32), 0 0 0 1px rgba(255,255,255,.2);
}
.hero-search svg { width: 24px; fill: none; stroke: #252825; stroke-width: 2; stroke-linecap: round; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: #151615; font-size: 18px; }
.hero-search input::placeholder { color: #777a77; }
kbd { padding: 5px 9px; border-radius: 8px; background: #e5e6df; color: #60635f; font: 700 12px/1 monospace; }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; color: var(--dim); font-size: 13px; }
.hero-stats strong { color: var(--ink); margin-right: 4px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.workspace { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 20px; align-items: start; }
.directory { position: sticky; top: 18px; padding: 22px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; }
.directory-head, .video-head, .timing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.section-kicker { margin: 0 0 5px; }
.directory h2, .video-head h2, .timing-head h2, .method h2 { margin: 0; font: 800 24px/1.2 Manrope, sans-serif; letter-spacing: -.035em; }
.result-count { color: var(--muted); background: rgba(255,255,255,.06); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.filter-row { display: flex; gap: 6px; margin: 18px 0 14px; }
.filter { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 12px; font-weight: 700; }
.filter:hover, .filter.active { background: var(--ink); color: #171817; border-color: var(--ink); }
.runner-list { overflow-y: auto; min-height: 18rem; scrollbar-color: #4a4f4a transparent; padding-right: 4px; }
.runner-row {
  width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 11px; align-items: center;
  border: 0; border-bottom: 1px solid rgba(255,255,255,.065); background: transparent; color: inherit;
  text-align: left; padding: 12px 8px; cursor: pointer; border-radius: 14px;
}
.runner-row:hover { background: rgba(255,255,255,.055); }
.runner-row.selected { background: rgba(255,79,31,.13); box-shadow: inset 3px 0 var(--orange); }
.mini-bib { width: 46px; min-height: 34px; padding: 5px 4px; display: grid; place-items: center; background: #f4f4ee; color: #1a1b1a; border-radius: 9px; font: 800 13px/1 Manrope, sans-serif; }
.runner-row strong, .runner-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-row strong { font-size: 14px; }
.runner-row small { color: var(--dim); font-size: 11px; margin-top: 3px; }
.row-result { text-align: right; }
.row-result b { display: block; font: 700 13px/1.2 Manrope, sans-serif; }
.row-result small { color: var(--dim); }
.empty-results { padding: 42px 16px; text-align: center; color: var(--muted); }
.show-more { width: 100%; margin-top: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink); border-radius: 13px; padding: 10px; cursor: pointer; font-weight: 700; }

.detail-column { display: grid; gap: 20px; }
.runner-card { min-height: 145px; padding: 26px; display: flex; justify-content: space-between; align-items: center; gap: 18px; overflow: hidden; position: relative; }
.runner-card::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: var(--orange); filter: blur(80px); opacity: .13; right: -60px; top: -70px; pointer-events: none; }
.runner-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }
.bib-badge { width: 92px; height: 76px; flex: 0 0 auto; background: #f4f4ee; color: #171817; border-radius: 14px; display: grid; place-content: center; text-align: center; transform: rotate(-2deg); box-shadow: 0 10px 28px rgba(0,0,0,.22); }
.bib-badge span { color: #777a77; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.bib-badge strong { font: 800 28px/1.05 Manrope, sans-serif; }
.runner-identity h2 { margin: 0; font: 800 clamp(25px, 3vw, 38px)/1.08 Manrope, sans-serif; letter-spacing: -.05em; overflow-wrap: anywhere; }
.runner-meta { color: var(--muted); margin: 7px 0 0; font-size: 14px; }
.headline-result { min-width: 170px; position: relative; z-index: 1; text-align: right; }
.headline-result span, .headline-result small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.headline-result strong { display: block; margin: 4px 0; font: 800 clamp(27px, 4vw, 42px)/1 Manrope, sans-serif; color: var(--lime); letter-spacing: -.05em; }

.video-card { padding: 22px; }
.timing-badge { color: var(--yellow); border: 1px solid rgba(255,211,106,.22); background: rgba(255,211,106,.07); padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.video-shell { margin-top: 18px; aspect-ratio: 16 / 9; width: 100%; background: #030403; border-radius: 18px; overflow: hidden; position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.video-shell iframe, #racePlayer { width: 100%; height: 100%; border: 0; object-fit: contain; background: #030403; }
.player-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: #050605; font-size: 13px; z-index: 0; }
.video-shell iframe { position: relative; z-index: 1; }
.moment-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.moment-controls.has-evidence { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.moment-button { min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.045); color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.moment-button:hover { background: rgba(255,255,255,.09); transform: translateY(-1px); }
.moment-button.primary { background: var(--orange); border-color: var(--orange); color: white; }
.moment-button.evidence { background: rgba(102,229,138,.12); border-color: rgba(102,229,138,.28); }
.moment-button.is-current { box-shadow: 0 0 0 2px var(--lime), 0 10px 30px rgba(0,0,0,.22); }
.moment-button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.moment-icon { flex: 0 0 auto; width: 31px; height: 31px; border-radius: 10px; background: rgba(0,0,0,.18); display: grid; place-items: center; font: 800 12px/1 Manrope, sans-serif; }
.moment-button small, .moment-button strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moment-button small { opacity: .7; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.moment-button strong { font: 700 15px/1.2 Manrope, sans-serif; margin-top: 2px; }
.nudge-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--dim); font-size: 11px; }
.nudge-row > span { max-width: 65%; }
.nudge { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 6px 8px; cursor: pointer; }
.nudge:first-child { border-radius: 8px 0 0 8px; }
.nudge:last-child { border-radius: 0 8px 8px 0; }
.nudge + .nudge { margin-left: -1px; }
.nudge:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.youtube-fallback { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.youtube-fallback:hover { color: var(--ink); }

.timing-card { padding: 24px; }
.copy-link { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 8px 11px; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 700; }
.copy-link:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.timing-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; margin-top: 18px; }
.timing-grid > div { padding: 16px; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.timing-grid > div:nth-child(3n) { border-right: 0; }
.timing-grid > div:nth-child(n+4) { border-bottom: 0; }
.timing-grid span, .timing-grid strong { display: block; }
.timing-grid span { color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.timing-grid strong { margin-top: 5px; font: 700 16px/1.2 Manrope, sans-serif; overflow-wrap: anywhere; }
.evidence-note { margin-top: 14px; display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid var(--line); }
.evidence-dot { margin-top: 5px; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--dim); box-shadow: 0 0 12px currentColor; }
.evidence-note strong { font-size: 13px; }
.evidence-note p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.evidence-note.bib-readable .evidence-dot { background: var(--green); color: var(--green); }
.evidence-note.occluded .evidence-dot, .evidence-note.cutaway .evidence-dot { background: var(--yellow); color: var(--yellow); }

.method { margin-top: 20px; padding: 28px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px 50px; align-items: center; }
.method > p { color: var(--muted); line-height: 1.6; margin: 0; }
.method-facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.method-facts span { color: var(--muted); background: rgba(255,255,255,.04); padding: 9px 12px; border-radius: 10px; font-size: 12px; }
.method-facts strong { color: var(--ink); margin-right: 4px; }

footer { max-width: 1480px; margin: 0 auto; padding: 24px 28px 38px; display: flex; justify-content: space-between; gap: 20px; color: var(--dim); font-size: 11px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .directory { position: static; max-height: none; }
  .runner-list { max-height: 360px; }
  .method { grid-template-columns: 1fr; }
  .method-facts { grid-column: auto; }
}

@media (max-width: 620px) {
  .topbar { min-height: 70px; padding: 13px 16px; }
  .brand small { display: none; }
  .source-link { font-size: 12px; }
  main { padding: 0 12px 28px; }
  .hero { padding: 44px 4px 34px; }
  .hero h1 { font-size: 45px; }
  .hero > p { font-size: 15px; }
  .hero-search { min-height: 60px; border-radius: 18px; padding: 0 14px; }
  .hero-search input { font-size: 16px; }
  .hero-search kbd { display: none; }
  .hero-stats { gap: 12px; }
  .card { border-radius: 19px; }
  .directory, .video-card, .timing-card, .method { padding: 17px; }
  .runner-card { padding: 19px; align-items: flex-start; }
  .bib-badge { width: 68px; height: 58px; }
  .bib-badge strong { font-size: 21px; }
  .runner-identity { gap: 12px; }
  .runner-identity h2 { font-size: 24px; }
  .headline-result { min-width: 88px; }
  .headline-result strong { font-size: 23px; }
  .headline-result span { font-size: 9px; }
  .moment-controls, .moment-controls.has-evidence { grid-template-columns: 1fr; }
  .nudge-row { align-items: flex-start; flex-direction: column; }
  .nudge-row > span { max-width: 100%; }
  .timing-grid { grid-template-columns: repeat(2, 1fr); }
  .timing-grid > div, .timing-grid > div:nth-child(3n), .timing-grid > div:nth-child(n+4) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .timing-grid > div:nth-child(2n) { border-right: 0; }
  .timing-grid > div:nth-child(n+5) { border-bottom: 0; }
  .video-head { align-items: center; }
  .timing-badge { font-size: 9px; }
  footer { padding: 20px 16px 30px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
