/* The public page and the shared parts of /app (top bar, buttons, colours: site/app/index.html loads this file too). */
:root {
  --bg: #06111d;
  --bg-2: #0a1a2b;
  --panel: #0e2135;
  --panel-2: #12293f;
  --line: rgba(148, 197, 235, .14);
  --line-strong: rgba(148, 197, 235, .28);
  --text: #eaf4fb;
  --muted: #9bb3c7;
  --faint: #869fb5;   /* at least 4.9 : 1 on every panel */
  --water: #2fd4e6;
  --water-deep: #0fa3b8;
  --swimmer: #ffd43b;
  --swimmer-ink: #1c1600;
  --predicted: #f59f55;
  --lost: #ff6b6b;
  --good: #51e0a1;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 20px 60px -24px rgba(0, 0, 0, .65);
  --font: 'Inter Variable', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;   /* Inter where fonts.css is loaded */
  --display: var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;   /* a short page (/app) would otherwise repeat the gradients below its content */
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 212, 230, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(15, 163, 184, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 10px;
  background: var(--water); color: #00222a; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* a member's own race (/?job=<id>) has no public sections; the public page has no member links */
.job-mode .public-only, html:not(.job-mode) .job-only { display: none !important; }
/* the player inside the member's result page (/?job=<id>&embed=1): the video, its controls and the charts only */
.embed-mode .topbar, .embed-mode .footer, .embed-mode .skip, .embed-mode #race .section-head, .embed-mode #race .hint,
.embed-mode #race-breakouts, .embed-mode main > section:not(#race) { display: none !important; }
.embed-mode body { background: transparent; }
.embed-mode #race.band { padding: 0; border: 0; background: none; }
.embed-mode #race .wrap { width: 100%; max-width: none; padding: 0; }

/* top bar: on a phone the brand, language and the menu button (the sections and the call to action in the menu, the call
   to action also in the bar from 520 px), the section links from 861 px */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px); background: rgba(6, 17, 29, .78); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 10px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand b { color: var(--water); font-weight: 700; }
.brand-mark { width: 30px; height: 30px; color: var(--water); flex: 0 0 auto; }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav .menu-only { display: none; }
.lang { display: inline-flex; flex: 0 0 auto; margin-left: auto; padding: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.lang button { border: 0; background: transparent; padding: 5px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; letter-spacing: .04em; }
.lang button[aria-pressed="true"] { background: var(--water); color: #00222a; }
.topbar-cta { margin-left: auto; padding: 8px 14px; border-radius: 11px; font-size: 14px; white-space: nowrap; }
.topbar-cta ~ .lang { margin-left: 0; }
.topbar-cta svg { width: 17px; height: 17px; }
.nav-toggle { display: inline-grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .i-close, .topbar.open .nav-toggle .i-menu { display: none; }
.topbar.open .nav-toggle .i-close { display: block; }
.cta-long { display: none; }
@media (min-width: 480px) { .cta-long { display: inline; } .cta-short { display: none; } }
@media (max-width: 519px) { .topbar .topbar-cta { display: none; } }
@media (max-width: 860px) {
  .brand { margin-right: auto; }
  .topbar-cta, .lang { margin-left: 0; }
  .topbar.open .nav { display: flex; flex-direction: column; gap: 2px; position: absolute; top: calc(100% + 8px); left: 16px; right: 16px;
    max-height: calc(100svh - 84px); overflow-y: auto; overscroll-behavior: contain; padding: 10px; border-radius: var(--radius);
    background: var(--bg-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
  .topbar.open .nav a { padding: 14px 16px; font-size: 16px; }
  .topbar.open .nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .05); }
  .topbar.open .nav .menu-only { display: block; }
  .topbar.open .nav .menu-cta { display: flex; justify-content: center; margin-top: 6px; border-radius: 999px; font-weight: 600;
    background: linear-gradient(180deg, #74f0ff, #46e3f0 55%, #2cc8dc); color: #02141c; }
}
@media (min-width: 861px) {
  .topbar-inner { gap: 20px; height: 64px; }
  .nav { display: flex; }
  .topbar-cta { margin-left: 0; }
  .lang { margin-left: 0; }
  .nav-toggle { display: none; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; cursor: pointer; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(180deg, #74f0ff, #46e3f0 55%, #2cc8dc); color: #02141c; box-shadow: 0 12px 32px -12px rgba(70, 227, 240, .6), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .04); }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

/* type */
.eyebrow { margin: 0 0 12px; color: var(--water); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font: 700 clamp(34px, 7.4vw, 62px)/1.04 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.lead { margin: 18px 0 0; max-width: 60ch; color: var(--muted); font-size: clamp(16px, 1.7vw, 18.5px); }

/* hero: the copy, then the sample result; side by side from 940 px */
.hero { padding: clamp(32px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-actions .btn { flex: 1 1 auto; }
.hero-inputs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; }
.hero-inputs li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(14, 33, 53, .6); color: var(--muted); font-size: 13.5px; }
.hero-inputs li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--water); }
.hero-inputs li:first-child::before { background: var(--swimmer); }
@media (min-width: 600px) { .hero-actions .btn { flex: 0 0 auto; } }
@media (min-width: 940px) { .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(32px, 5vw, 64px); } }

.sample-card { padding: 18px 16px 16px; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.sample-kicker { margin: 0; color: var(--water); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sample-title { margin: 6px 0 12px; font: 600 16.5px/1.35 var(--display); letter-spacing: -.01em; }
.sample-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sample-table th, .sample-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.sample-table thead th { padding-top: 0; color: var(--faint); font-size: 12px; font-weight: 600; white-space: normal; vertical-align: bottom; line-height: 1.25; }
.sample-table th:first-child { text-align: left; padding-left: 0; }
.sample-table td:last-child, .sample-table thead th:last-child { padding-right: 0; }
.sample-table tbody th { font-weight: 500; color: var(--muted); }
.sample-table td:nth-child(2) { color: var(--text); font-weight: 700; }
.sl-n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 6px; background: rgba(47, 212, 230, .12); color: var(--water); font-size: 12px; font-weight: 700; }
.sample-table tr.skeleton td { height: 37px; padding: 0; }
.sample-table tr.skeleton td::after { content: ''; display: block; height: 12px; margin: 0; border-radius: 6px; background: linear-gradient(90deg, rgba(148, 197, 235, .08), rgba(148, 197, 235, .16), rgba(148, 197, 235, .08)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sample-table tr.skeleton td::after { animation: none; } }
.sample-finish { margin: 12px 0 0; font: 700 18px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.sample-finish:empty { display: none; }
.sample-note { margin: 6px 0 0; color: var(--faint); font-size: 13px; line-height: 1.45; }
.sample-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--water); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.sample-link::after { content: '→'; }
.sample-link:hover { text-decoration: underline; }
.sample-card.empty .sample-table, .sample-card.empty .sample-finish, .sample-card.empty .sample-note, .sample-card.empty .sample-link { display: none; }
@media (min-width: 400px) { .sample-card { padding: 20px 20px 18px; } }
@media (min-width: 460px) { .sample-table th, .sample-table td { padding-inline: 6px; } }
@media (max-width: 459px) { .sample-table { font-size: 13.5px; } .sl-n { width: 17px; height: 17px; margin-right: 3px; font-size: 11px; border-radius: 5px; } }
@media (max-width: 379px) { .sample-card { padding-inline: 14px; } .sample-table { font-size: 13px; } .sl-n { display: none; } }

/* sections */
section { position: relative; }
.band, .numbers { padding: clamp(44px, 7vw, 72px) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 26px; }
.section-head h2 { margin: 0; font: 700 clamp(26px, 3.4vw, 38px)/1.12 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.section-head p { margin: 12px 0 0; color: var(--muted); }
.sub-title { margin: 34px 0 14px; font: 600 19px/1.25 var(--display); letter-spacing: -.01em; }

/* what it does: three inputs */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.feature-card { display: flex; flex-direction: column; padding: 20px; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); min-width: 0; }
.feature-art { width: 100%; max-width: 230px; height: auto; margin: 0 0 14px; }
.fa-frame { fill: none; stroke: var(--line-strong); stroke-width: 2; }
.fa-back { opacity: .55; }
.fa-screen { fill: rgba(4, 12, 20, .55); }
.fa-water { fill: rgba(47, 212, 230, .12); stroke: rgba(47, 212, 230, .35); stroke-width: 1; }
.fa-rope { fill: none; stroke: var(--water); stroke-width: 1.4; stroke-dasharray: 3 2.2; opacity: .8; }
.fa-wall { fill: none; stroke: var(--text); stroke-width: 1.6; opacity: .55; }
.fa-tick { fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .75; }
.fa-box { fill: none; stroke: var(--swimmer); stroke-width: 2; stroke-linecap: round; }
.fa-dot { fill: var(--swimmer); }
.fa-dot-2 { fill: var(--water); }
.fa-score { fill: var(--muted); opacity: .5; }
.feature-tag { align-self: flex-start; margin: 0 0 10px; padding: 4px 10px; border-radius: 999px; background: rgba(81, 224, 161, .12); color: var(--good); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.feature-tag.tag-muted { background: rgba(245, 159, 85, .12); color: var(--predicted); }
.feature-card h3 { margin: 0 0 8px; font: 600 19px/1.25 var(--display); letter-spacing: -.01em; }
.feature-card > p { margin: 0; color: var(--muted); font-size: 15px; }
.feature-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.feature-list li { position: relative; padding-left: 24px; }
.feature-list li::before { content: ''; position: absolute; left: 3px; top: .42em; width: 11px; height: 6px; border-left: 2px solid var(--water); border-bottom: 2px solid var(--water); transform: rotate(-45deg); }
.feature-card > .feature-note { margin-top: auto; padding-top: 14px; color: var(--faint); font-size: 13.5px; line-height: 1.5; }
.feature-list + .feature-note { border-top: 1px solid var(--line); margin-top: 16px; }
@media (min-width: 900px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } .feature-art { max-width: none; } }
@media (min-width: 1200px) { .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* player */
.howto { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 0; padding: 0; color: var(--muted); font-size: 14px; }
.howto li { position: relative; padding-left: 16px; }
.howto li::before { content: ''; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--water); }
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); border: 1px solid var(--line); outline-offset: 4px; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: contain; }
.stage canvas { pointer-events: none; }
.stage-badge { position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(4, 12, 20, .72); backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--water); box-shadow: 0 0 0 0 rgba(47, 212, 230, .7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 212, 230, .6); } 70% { box-shadow: 0 0 0 8px rgba(47, 212, 230, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 212, 230, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.stage-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; border: 0; background: rgba(4, 12, 20, .62); backdrop-filter: blur(6px); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: transform .15s, opacity .2s, background .15s; }
.stage-play svg { width: 34px; height: 34px; margin-left: 4px; }
.stage-play:hover { transform: scale(1.06); background: rgba(47, 212, 230, .85); color: #00222a; }
.stage.playing .stage-play, .stage.started .stage-play { opacity: 0; visibility: hidden; pointer-events: none; }
.stage-loading { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(4, 12, 20, .72); font-size: 13px; color: var(--text); white-space: nowrap; }
.stage-loading:empty, .stage.ready .stage-loading { display: none; }

.controls { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.icon-btn { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 11px; background: transparent; cursor: pointer; color: var(--text); transition: background .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .07); }
.icon-btn svg { width: 22px; height: 22px; }
.scrub { position: relative; flex: 1 1 auto; min-width: 80px; height: 40px; }
.scrub canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scrub:focus-within { outline: 2px solid var(--water); outline-offset: 2px; border-radius: 8px; }
.clock { flex: 0 0 auto; min-width: 64px; text-align: right; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.hint { margin: 10px 4px 0; font-size: 13px; color: var(--faint); }

/* whole race */
.race-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.lane-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; user-select: none; transition: border-color .15s, opacity .15s; }
.lane-chip input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); vertical-align: -2px; }
.lane-chip strong { font-weight: 600; }
.lane-chip small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.lane-chip:has(input:not(:checked)) { opacity: .5; }
.lane-chip:has(input:focus-visible) { outline: 2px solid var(--water); outline-offset: 2px; }
.race-select { margin-bottom: 10px; }
.race-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s, opacity .15s; }
.race-chip[aria-pressed="false"] { opacity: .55; }
.race-chip[aria-pressed="true"] { border-color: var(--water); }
.race-chip:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }
.race-scrub { height: 46px; }
#race-play { background: var(--water); color: #00222a; }
#race-play:hover { background: #5fe1ef; }
#race-play .i-pause, .race-playing #race-play .i-play { display: none; }
.race-playing #race-play .i-pause { display: block; }
.race-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 4px 0; padding: 0; color: var(--muted); font-size: 13px; }
.race-legend li { display: inline-flex; align-items: center; gap: 7px; }
.rl { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.rl-tracked { background: linear-gradient(90deg, var(--swimmer) 50%, var(--water) 50%); }
.rl-predicted { background: var(--predicted); }
.rl-close { background: repeating-linear-gradient(135deg, rgba(155, 179, 199, .55) 0 3px, rgba(155, 179, 199, .15) 3px 6px); }
.rl-none { background: rgba(148, 197, 235, .16); }
.rl-breakout { width: 8px; height: 8px; margin: 0 3px; border-radius: 1px; background: var(--text); transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(6, 17, 29, .9); }

/* readouts */
.race-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.readout-card { padding: 12px 14px 14px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--lane); min-width: 0; }
.readout-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.readout-head .swatch { background: var(--lane); }
.readout-head strong { font-weight: 600; }
.readout-head .state-pill { margin-left: auto; }
.readout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.readout-grid > div { display: grid; align-content: start; gap: 2px; min-width: 0; }
.metric-label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.metric-value { font: 700 22px/1.15 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { font: 600 13px var(--font); color: var(--muted); letter-spacing: 0; }
.metric-note { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.state-pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 12.5px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.state-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state-pill.s-tracked { color: var(--good); background: rgba(81, 224, 161, .1); }
.state-pill.s-predicted { color: var(--predicted); background: rgba(245, 159, 85, .1); }
.state-pill.s-modelled { color: var(--water); background: rgba(47, 212, 230, .1); }

/* charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.chart-card { margin: 0; padding: 14px 16px 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.chart-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 14px; margin-bottom: 6px; font-weight: 600; font-size: 14.5px; }
.chart-card canvas { width: 100%; height: 220px; cursor: crosshair; touch-action: pan-y; }
.legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-left: 6px; background: var(--text); }
.lg-thin { height: 2px; opacity: .45; }
.lg-dash { background: repeating-linear-gradient(90deg, var(--text) 0 4px, transparent 4px 7px); }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; }

/* breakouts */
.race-breakouts { margin: 20px 4px 0; }
.race-breakouts h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.breakout-rows { display: grid; gap: 8px; }
.breakout-row { display: grid; gap: 8px; }
.breakout-lane { display: flex; align-items: center; gap: 8px; }
.breakout-lane .swatch { width: 12px; height: 12px; border-radius: 3px; }
.breakout-lane strong { font-weight: 600; }
.breakout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.breakout-card { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; text-align: left; }
.breakout-card img, .breakout-card .bc-empty { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; background: #000; }
.breakout-card .bc-empty { display: grid; place-items: center; background: rgba(148, 197, 235, .07); color: var(--faint); }
.bc-label { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 0 4px 2px; }
.bc-label b { font-weight: 600; font-variant-numeric: tabular-nums; }
button.breakout-card { cursor: pointer; transition: border-color .15s; }
button.breakout-card:hover { border-color: var(--line-strong); }
button.breakout-card:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }
.breakout-card.muted { color: var(--muted); }
.breakout-note { margin: 10px 0 0; max-width: 72ch; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* numbers */
.export-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 22px; }
.export-bar .btn { padding: 10px 16px; font-size: 15px; }
@media (max-width: 479px) { .export-bar .btn, .demo-cta .btn { width: 100%; } }
.export-hint { flex: 1 1 100%; margin: 0; color: var(--faint); font-size: 13px; }
.tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.table-card { padding: 18px 18px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.table-wide { grid-column: 1 / -1; }
.table-card h3 { margin: 0 0 6px; font: 600 18px/1.2 var(--display); }
.table-lead { margin: 0 0 12px; color: var(--muted); font-size: 14px; max-width: 80ch; }
.table-note { margin: 0 0 12px; color: var(--faint); font-size: 13px; max-width: 80ch; line-height: 1.5; }
.method { margin: 0 0 12px; }
.method summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; color: var(--water); font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; border-radius: 8px; }
.method summary::-webkit-details-marker { display: none; }
.method summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.method[open] summary::before { transform: rotate(45deg); }
.method[open] summary { margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .method summary::before { transition: none; } }
.scroll { overflow-x: auto; }
.table-card table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table-card th, .table-card td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-card thead th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-card thead th .swatch { margin-right: 7px; }
.table-card tbody th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.table-card tr.length-row th { padding-top: 14px; color: var(--text); font-weight: 600; border-bottom-color: var(--line-strong); }
.table-card tr.touch-row th, .table-card tr.touch-row td { background: rgba(148, 197, 235, .05); }
.table-card td .muted { color: var(--faint); }
.table-card tr.table-foot td { color: var(--faint); font-size: 13px; border-bottom: 0; }
.seek-btn { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 3px 8px; margin: -3px -8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; transition: background .15s; }
.seek-btn:hover { background: rgba(255, 255, 255, .07); }
.seek-btn small { color: var(--faint); font-weight: 500; }
.seek-btn em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--water); }
.seek-btn.modelled { color: var(--muted); }
.seek-btn.corrected em { color: var(--muted); }
.seek-btn .split { flex-basis: 100%; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cell-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cell-line + .cell-line { margin-top: 4px; }
.cell-label { color: var(--faint); font-size: 12.5px; }
.cell-line b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cell-line small { color: var(--faint); font-size: 12px; }
.cell-line em.tag { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
.print-head { display: none; }

/* what the numbers mean */
.terms { margin: 0; display: grid; gap: 12px; }
.term { padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.term dt { display: flex; align-items: center; gap: 10px; font: 600 17px/1.3 var(--display); }
.term dt::before { content: ''; flex: 0 0 auto; width: 4px; height: 18px; border-radius: 2px; background: var(--water); }
.term dd { margin: 8px 0 0; }
.term dd p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.term dd .term-example { margin-top: 10px; padding: 7px 10px; border-radius: 8px; border-left: 3px solid var(--swimmer); background: rgba(255, 212, 59, .07); color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .terms { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* how accurate it is */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: how; }
.how-steps li { position: relative; padding: 16px 18px 16px 58px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); counter-increment: how; }
.how-steps li::before { content: counter(how); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(47, 212, 230, .12); color: var(--water); font-weight: 700; font-size: 14px; }
.how-steps h4 { margin: 0 0 4px; font: 600 16px/1.3 var(--display); }
.how-steps p { margin: 0; color: var(--muted); font-size: 14.5px; }
.acc-read { margin: -4px 0 14px; max-width: 80ch; color: var(--muted); font-size: 14.5px; }
.acc-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.acc-item { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); min-width: 0; }
.acc-what { margin: 0; line-height: 1.35; }
.acc-what strong { display: block; font: 600 17px/1.3 var(--display); }
.acc-what span { color: var(--muted); font-size: 14px; }
.acc-values { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; }
.acc-value { display: grid; gap: 1px; }
.acc-value b { font: 700 24px/1.15 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-value small { color: var(--faint); font-size: 12.5px; }
.acc-sample { margin: auto 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.acc-badge { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
.acc-badge.tuned { background: rgba(245, 159, 85, .14); color: var(--predicted); }
.acc-badge.blind { background: rgba(81, 224, 161, .14); color: var(--good); }
.acc-terms { margin: 14px 0 0; max-width: 80ch; color: var(--faint); font-size: 13.5px; }
.limit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.limit-list li { position: relative; padding: 14px 16px 14px 46px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.limit-list li::before { content: ''; position: absolute; left: 17px; top: 18px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--predicted); }
@media (min-width: 640px) { .how-steps, .acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .limit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .how-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } .acc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* upload your own race */
.upload-grid { display: grid; gap: 24px; align-items: start; }
.upload-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.upload-steps li { position: relative; padding: 2px 0 2px 54px; counter-increment: step; min-height: 40px; }
.upload-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--water), var(--water-deep)); color: #00222a; font-weight: 800; }
.upload-steps h3 { margin: 0 0 2px; font: 600 17px/1.3 var(--display); }
.upload-steps p { margin: 0; color: var(--muted); font-size: 15px; }
.upload-side { display: grid; gap: 14px; }
.side-card { padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.side-card h3 { margin: 0 0 10px; font: 600 17px/1.3 var(--display); }
.side-card p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 14.5px; }
.tips li::marker { color: var(--water); }
.members-card { border-color: rgba(47, 212, 230, .4); background: linear-gradient(160deg, rgba(47, 212, 230, .12), var(--panel) 60%); }
/* the three hints of the /app form for a phone following one swimmer */
.hint-block { margin-top: 8px; }
.hint-lead { margin: -4px 0 14px; max-width: 80ch; color: var(--muted); font-size: 15px; }
.hint-race { margin: 0 0 14px; max-width: 80ch; padding: 9px 12px; border-left: 3px solid var(--water); border-radius: 8px; background: rgba(47, 212, 230, .08); color: var(--text); font-size: 14.5px; }
.hint-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hint-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.hint-kind { align-self: flex-start; margin: 0; padding: 2px 9px; border-radius: 999px; background: rgba(47, 212, 230, .12); color: var(--water); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.hint-card h4 { margin: 0; font: 600 16.5px/1.35 var(--display); }
.hint-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.hint-card p strong { color: var(--text); font-weight: 600; }
.hint-example { margin: 14px 0 0; max-width: 80ch; padding: 8px 12px; border-left: 3px solid var(--swimmer); border-radius: 8px; background: rgba(255, 212, 59, .07); color: var(--text); font-size: 14px; }
@media (min-width: 900px) { .hint-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .upload-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; } }

/* footer */
/* the footer of every page, laid out as on the landing page (landing.css) */
.footer { border-top: 1px solid var(--line); padding: 44px 0 56px; color: var(--faint); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 40px; }
.footer-brand { display: grid; gap: 10px; max-width: 420px; }
.footer-brand p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer .brand { color: var(--text); }

/* the steps under the video and the race over the whole screen (app.js race.fullscreen): the video as large as fits,
   its controls under it; a phone held sideways puts the steps beside the controls */
.race-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.step-btn { display: grid; place-items: center; min-height: 44px; padding: 0 4px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); color: var(--text); font: 600 13.5px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
  touch-action: manipulation; }
.step-btn:hover { background: var(--panel-2); }
.step-btn:focus-visible, .race-full-btn:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }
.step-btn svg { width: 20px; height: 20px; }
.race-full-btn .i-exit, .race-full .race-full-btn .i-full { display: none; }
.race-full .race-full-btn .i-exit { display: block; }
.race-rotate { display: none; }
.race-full, .race-full body { overflow: hidden; }
.race-full .race-player { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 8px; overflow: auto; background: #000; }
.race-full .race-player .race-stage { flex: none; width: min(100%, calc((100vh - 150px) * 16 / 9)); width: min(100%, calc((100dvh - 150px) * 16 / 9));
  margin: 0 auto; border-radius: 10px; }
.race-full .race-player .controls, .race-full .race-player .race-steps { width: 100%; max-width: 960px; margin: 0 auto; }
@media (orientation: landscape) and (max-height: 560px) {
  .race-full .race-player { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto;
    align-content: center; gap: 6px; padding: 4px 8px 6px; }
  .race-full .race-player .race-stage { grid-column: 1 / -1; width: min(100%, calc((100vh - 66px) * 16 / 9)); width: min(100%, calc((100dvh - 66px) * 16 / 9)); }
  .race-full .race-player .controls { padding: 3px 6px; max-width: none; }
  .race-full .race-player .race-steps { grid-template-columns: repeat(6, 46px); max-width: none; }
}
@media (orientation: portrait) and (pointer: coarse) {
  .race-full .race-rotate { display: block; margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
}

/* responsive (the player and the tables) */
@media (hover: none) { .hint { display: none; } }
@media (pointer: coarse) {
  /* the language buttons keep their look, their tap area is 44 px */
  .lang button { position: relative; min-width: 44px; }
  .lang button::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
  .topbar-cta { min-height: 44px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .sample-link { min-height: 44px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .topbar { position: relative; }
  .stage { width: min(100%, calc((100svh - 80px) * 16 / 9)); margin-inline: auto; }
}
@media (max-width: 860px) {
  .charts, .tables, .race-readouts { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .controls { flex-wrap: wrap; }
  .scrub { order: 10; flex-basis: 100%; }
  .clock { margin-left: auto; }
  .readout-grid { grid-template-columns: 1fr 1fr; }
  .metric-value { font-size: 20px; }
  .stage-badge { font-size: 11.5px; left: 10px; top: 10px; }
  .stage-play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .table-card { padding: 14px 12px 12px; }
}
@media (max-width: 399px) {
  .topbar-inner { gap: 8px; }
  .brand { gap: 8px; font-size: 16.5px; }
  .brand-mark { width: 26px; height: 26px; }
  .topbar-cta { padding: 8px 11px; }
  .lang button { padding: 5px 9px; }
}

/* print: the analysis of the race on white paper (the export's print button, or the browser's print) */
@media print {
  :root { --text: #111; --muted: #3d4650; --faint: #4f5963; --line: #d5dbe1; --line-strong: #a9b3bd; --panel: #fff; --panel-2: #fff; --water: #0b6b78; color-scheme: light; }
  @page { margin: 12mm; }
  html { scroll-padding-top: 0; }
  body { background: #fff; color: #111; font-size: 10.5pt; line-height: 1.4; }
  .topbar, .skip, .hero, .features, .glossary, .accuracy, .upload-cta, .footer, .export-bar,
  #race > .wrap > :not(.race-breakouts), .numbers .section-head p, .method summary,
  .breakout-card img, .breakout-card .bc-empty { display: none !important; }
  .wrap { width: auto; }
  .race, .band, .numbers { padding: 0; border: 0; }
  .print-head { display: block; margin: 0 0 7mm; padding-bottom: 4mm; border-bottom: 1.5pt solid #111; }
  .print-head p { margin: 0; }
  .print-brand { font-size: 9pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #0b6b78; }
  .print-event { margin-top: 2mm !important; font-size: 17pt; font-weight: 700; line-height: 1.2; }
  .print-meta { margin-top: 1mm !important; color: #3d4650; }
  .print-note { margin-top: 2mm !important; font-size: 9pt; color: #3d4650; }
  .race-breakouts { margin: 0 0 6mm; break-inside: avoid; }
  .race-breakouts h3 { font-size: 12pt; margin-bottom: 2mm; }
  .breakout-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2mm; }
  .breakout-card { padding: 2mm; border-radius: 4px; border-color: #d5dbe1; }
  .numbers .section-head { margin-bottom: 4mm; }
  .numbers .section-head h2 { font-size: 14pt; }
  .tables { display: block; }
  .tables > * + * { margin-top: 5mm; }
  .table-card { padding: 0; border: 0; border-radius: 0; break-inside: avoid; }
  .table-wide { break-inside: auto; }
  .table-card h3 { font-size: 12pt; margin-bottom: 1.5mm; }
  .method { margin-bottom: 2mm; }
  .table-lead, .table-note { font-size: 8.5pt; margin-bottom: 2mm; max-width: none; }
  .table-card table { font-size: 9pt; }
  .table-card th, .table-card td { padding: 1.2mm 2mm; }
  .table-card tr.touch-row th, .table-card tr.touch-row td { background: #f2f5f7; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .scroll { overflow: visible; }
  .seek-btn { padding: 0; margin: 0; }
  .swatch, .table-card tr.touch-row th, .table-card tr.touch-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* the player page (/demo): the landing page's headings (Barlow Condensed from fonts.css), a short intro and a call to
   action; a member's own race (job mode) shows neither */
.demo-page h1, .demo-page .section-head h2, .demo-cta h2 { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: -.004em; line-height: .95; }
.demo-page .section-head h2 { font-size: clamp(32px, 4.4vw, 56px); }
.demo-intro { padding: clamp(40px, 7vw, 72px) 0 clamp(18px, 4vw, 34px); }
.demo-intro h1 { margin: 8px 0 16px; font-size: clamp(46px, 7vw, 92px); }
.demo-intro .lead { max-width: 40em; margin: 0; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); }
.demo-back { display: inline-flex; gap: 8px; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-size: 14px; }
.demo-back:hover { color: var(--text); }
.demo-cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  padding: clamp(24px, 4vw, 40px); border-radius: 24px; border: 1px solid rgba(47, 212, 230, .3);
  background: radial-gradient(600px 300px at 100% 0%, rgba(47, 212, 230, .12), transparent 60%), var(--panel); }
.demo-cta h2 { margin: 0 0 8px; font-size: clamp(30px, 4vw, 48px); }
.demo-cta p { margin: 0; color: var(--muted); }
/* the intro says what the race section's heading and lead said; a member's race (job mode) keeps them */
html:not(.job-mode) .demo-page #race .section-head > h2, html:not(.job-mode) .demo-page #race .section-head > p { display: none; }
html:not(.job-mode) .demo-page #race.band { border-top: 0; padding-top: 8px; }
