/* Lap by Lap: shared styles for the report and the dashboard.
   The look is night racing: one photograph of a car panned against streaking
   lights sits behind the whole site, content rides over it on dark glass, and
   the type is wide and red with one yellow accent. */

:root {
  color-scheme: dark;
  --black: #000000;
  --page: #070708;            /* the studio floor away from the lights */
  --surface: #121214;         /* chart panels, tiles, tables */
  --surface-2: #1b1b1f;
  --ink: #f4f2ef;
  --ink-2: #cfccc7;
  --muted: #98958f;
  --line: #26262b;
  --line-strong: #3b3b42;
  --red: #f21d2b;             /* display type, the car, the primary button */
  --red-ink: #ff7566;         /* red that stays readable at text sizes */
  --red-wash: rgba(242, 29, 43, 0.14);
  --flare: #ffe3d6;           /* the white-hot end of a light streak */
  --yellow: #f6c416;          /* the one accent: fastest figure, keyboard focus */
  --accent: var(--red);

  /* chart series, in fixed order (validated for colour-blind separation on --surface) */
  --s1: #f04a45; --s2: #3987e5; --s3: #c98500; --s4: #d55181;
  --s5: #008300; --s6: #9085e9; --s7: #199e70; --s8: #d95926;
  --grid: #232328;
  --axis: #3b3b42;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Michroma", "Archivo", system-ui, sans-serif;
  --measure: 66ch;
  --wide: 1180px;
  --veil: rgba(6, 6, 8, 0.76);        /* what running text sits on, over the wallpaper */
  --glass: rgba(17, 17, 20, 0.74);    /* panels: charts, tiles, tables */
  --glass-line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; background: var(--black); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: transparent; color: var(--ink);   /* the wallpaper layer sits between the black page and the content */
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  font-variation-settings: "wdth" 100; -webkit-font-smoothing: antialiased;
}
a { color: var(--red-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-variation-settings: "wdth" 108; font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code { font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- the wallpaper: one photograph, fixed behind every page ---------- */
.wall { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--black); }
.wall::before {
  content: ""; position: absolute; inset: -3%;
  background: url("../img/wallpaper.jpg") 50% 100% / cover no-repeat;
  transform: translate3d(calc(var(--sy, 0) * -0.02px), 0, 0);
}
/* film grain keeps the enlarged photograph from looking soft, and a shade under the navigation */
.wall::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 22%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.11 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* a blurred copy fades in over the sharp one as the reader leaves the opening screen (--soft is set in motion.js),
   so the car never sits in focus behind the text */
.wall i { position: absolute; inset: -3%; background: url("../img/wallpaper-soft.jpg") 50% 100% / cover no-repeat; opacity: var(--soft, 0); }
.wall.soft i { opacity: 1; }
@media (orientation: portrait) {
  .wall::before { background-image: url("../img/wallpaper-portrait.jpg"); background-position: 12% 50%; }
  .wall i { background-image: url("../img/wallpaper-portrait-soft.jpg"); background-position: 12% 50%; }
}
.veil { background: var(--veil); border-top: 1px solid var(--glass-line); }

/* ---------- light streaks: the rule above each part and the progress bar ---------- */
.streak, .progress i {
  background: linear-gradient(90deg, transparent, var(--streak, var(--red)) 34%, color-mix(in srgb, var(--streak, var(--red)) 55%, #fff) 70%, var(--flare) 90%, #fff);
}

/* ---------- navigation (shared) ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; color: var(--ink);
  background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.progress { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; --streak: var(--part); }
.progress i { display: block; height: 100%; transform: scaleX(0); transform-origin: left; filter: drop-shadow(0 0 5px var(--part)); }
.emblem { display: inline-block; width: 28px; height: 18px; margin-right: 11px; vertical-align: -4px; color: var(--red); filter: drop-shadow(0 0 5px rgba(242, 29, 43, 0.7)); }
.emblem svg { display: block; width: 100%; height: 100%; }
.nav-inner { max-width: var(--wide); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; min-height: 58px; }
.brand { font-family: var(--display); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--red); }
.nav-links { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { position: relative; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 3px; }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--red); box-shadow: 0 0 10px 1px rgba(242, 29, 43, 0.8); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 20px; }

/* ---------- hero: the photograph, the lights, the title ---------- */
.hero-band { color: var(--ink); position: relative; }
.opener { min-height: calc(100svh - 59px); display: grid; grid-template-rows: auto 1fr; }
.byline {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px;
  width: 100%; max-width: var(--wide); margin: 0 auto; padding: 30px 20px 0;
  font-family: var(--display); font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}
/* the car sits in the lower third of the photograph, so the title keeps to the dark upper half */
.opener-title { align-self: center; display: grid; justify-items: center; gap: 30px; padding: 0 20px 30svh; }
.lights { display: flex; gap: 9px; padding: 8px 12px; background: rgba(5, 5, 6, 0.8); border-radius: 999px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.lights i { width: 15px; height: 15px; border-radius: 50%; background: #2a2a30; transition: background 0.1s, box-shadow 0.1s; }
.lights i.on { background: #ff2d2d; box-shadow: 0 0 16px 4px rgba(255, 45, 45, 0.65); }
[data-car] { --tyre: var(--yellow); }
[data-car] svg { display: block; width: 100%; height: auto; overflow: visible; }
.car-num { letter-spacing: -0.02em; }

.hero-band h1 {
  margin: 0; max-width: 28em; text-wrap: balance;
  font-family: var(--display); font-weight: 400; font-variation-settings: normal; text-transform: uppercase;
  font-size: clamp(17px, 2.9vw, 38px); line-height: 1.3; letter-spacing: 0.015em;
  color: var(--ink); text-shadow: 0 2px 26px rgba(0, 0, 0, 0.85);
}
.opener h1 { text-align: center; }
@media (orientation: portrait) {
  /* the portrait photograph stands the car upright on the left, so the title stacks in a column beside it */
  .opener-title { justify-items: start; align-self: start; padding: 16svh 16px 0 46%; }
  .opener h1 { text-align: left; }
}
.hero-fold { background: linear-gradient(to bottom, transparent, var(--veil) 150px); }
.hero { padding: 120px 20px 72px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: start; }
.summary { font-size: 18.5px; line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 650; font-size: 15.5px;
  padding: 10px 18px; border-radius: 3px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 26px rgba(242, 29, 43, 0.45); }
.btn-primary:hover { background: #ff3b3b; border-color: #ff3b3b; color: #fff; }

/* headline numbers: a stack of big figures, the first one lit */
.tower { color: var(--ink); background: var(--glass); border: 1px solid var(--glass-line); border-radius: 6px; padding: 4px 22px 6px; backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }
.tower-head { display: flex; justify-content: space-between; padding: 12px 0; color: var(--muted); font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.tower-row { display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.tower-row:last-child { border-bottom: 0; }
.tower-row i { display: block; width: 3px; height: 36px; background: var(--line-strong); }
.tower-row.fastest i { background: var(--yellow); box-shadow: 0 0 12px 1px rgba(246, 196, 22, 0.7); }
.tower-label { font-size: 15px; line-height: 1.35; color: var(--muted); }
.tower-label b { color: var(--ink); font-weight: 600; display: block; }
.tower-value { font-variation-settings: "wdth" 104; font-weight: 300; font-size: 38px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.tower-row.fastest .tower-value { color: var(--yellow); font-weight: 700; }
.tower-value small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* ---------- report: body ---------- */
.report { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; padding-top: 56px; padding-bottom: 80px; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 14.5px; line-height: 1.4; max-height: calc(100vh - 100px); overflow: auto; padding-right: 6px; }
.toc p { margin: 18px 0 6px; font-weight: 700; color: var(--ink); }
.toc p:first-child { margin-top: 0; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.here { color: var(--ink); border-left-color: var(--part); box-shadow: -1px 0 0 var(--part); }
main { min-width: 0; }
.finding { padding: 48px 0 12px; border-top: 1px solid var(--glass-line); }
.finding.first { border-top: 0; padding-top: 34px; }
.finding:first-child { border-top: 0; padding-top: 8px; }
.finding h2 { font-size: clamp(25px, 3vw, 34px); max-width: 30ch; text-wrap: balance; margin-bottom: 18px; }
.finding .text { max-width: var(--measure); }
.finding .text p { color: var(--ink-2); }
.methods h3 { font-size: 20px; margin: 28px 0 10px; }
.methods ul { padding-left: 20px; max-width: var(--measure); color: var(--ink-2); }
.methods li { margin-bottom: 8px; }
.methods b { color: var(--ink); }

/* ---------- figures and charts (shared) ---------- */
.figure { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 6px; padding: 20px 22px 16px; margin: 22px 0 14px; }
.figure-title { font-weight: 700; font-size: 16.5px; line-height: 1.3; margin: 0 0 2px; }
.figure-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; line-height: 1.4; }
.figure-note { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 10px 0 0; }
.figure-link { font-size: 14.5px; font-weight: 600; margin: 0 0 8px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--ink-2); font-size: 13px; }
.chart .val { fill: var(--ink); font-weight: 600; font-size: 12.5px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .mark:hover, .chart .mark:focus { filter: brightness(1.2); outline: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend i.ln { height: 3px; width: 16px; border-radius: 2px; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: #1f1f24; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 9px 12px; font-size: 13.5px; line-height: 1.45; max-width: 300px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.08s;
}
.tip.on { opacity: 1; }
.tip .t { color: var(--muted); margin-bottom: 3px; }
.tip .r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .r b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tip .k { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tip .n { color: var(--muted); }
.empty { padding: 48px 12px; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- tables (shared) ---------- */
.table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--glass-line); border-radius: 6px; background: var(--glass); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-2); font-weight: 650; z-index: 1; }
thead th button { all: unset; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
thead th button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
thead th[aria-sort] { color: var(--ink); }
tbody tr:hover { background: #18181c; }
td.sel, th.sel { background: var(--red-wash); }
thead th.sel { background: #33141a; }
.small-table table { font-size: 14.5px; }
.small-table { max-width: 100%; }

/* ---------- dashboard ---------- */
.hero-band.slim { background: linear-gradient(90deg, #000 27%, rgba(0, 0, 0, 0.6) 46%, transparent 68%), var(--black) url("../img/wallpaper.jpg") calc(100% + 3vw) 92% / 80vw auto no-repeat; }
.dash-head { padding: 52px 20px 56px; position: relative; min-height: 250px; }
.dash-head h1 {
  position: relative; z-index: 2; font-family: var(--display); font-weight: 400; font-variation-settings: normal; text-transform: uppercase;
  font-size: clamp(22px, 3.3vw, 40px); letter-spacing: 0.015em; line-height: 1.25;
}
.dash-head p { position: relative; z-index: 2; color: var(--ink-2); max-width: 50ch; margin: 14px 0 0; }
.controls { position: sticky; top: 59px; z-index: 10; background: rgba(6, 6, 8, 0.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 0 0 100vmax rgba(6, 6, 8, 0.9); clip-path: inset(0 -100vmax); padding: 16px 0 12px; border-bottom: 1px solid var(--line-strong); margin-bottom: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.field select, .ms > button {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 8px 10px; min-height: 40px; cursor: pointer;
}
.field select:hover, .ms > button:hover { border-color: var(--muted); }
.field .range { display: flex; gap: 6px; align-items: center; }
.ms { position: relative; }
.ms > button { min-width: 168px; max-width: 230px; text-align: left; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ms > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms > button.active { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.ms-pop { position: absolute; top: calc(100% + 4px); left: 0; width: 290px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7); padding: 10px; z-index: 30; display: none; }
.ms.open .ms-pop { display: block; }
.ms-pop input[type="search"] { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--page); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 3px; margin-bottom: 8px; }
.ms-pop input[type="checkbox"] { accent-color: var(--red); }
.ms-list { max-height: 260px; overflow: auto; }
.ms-list label { display: flex; gap: 9px; align-items: center; padding: 5px 6px; border-radius: 3px; font-weight: 500; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.ms-list label:hover { background: #26262c; }
.ms-list small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.ms-foot { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line-strong); margin-top: 8px; }
.ms-foot button { all: unset; cursor: pointer; color: var(--red-ink); font-weight: 600; font-size: 14px; padding: 2px 4px; }
.ms-foot button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.switches { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin-top: 12px; }
.switches .field select { border-color: var(--red); background: #26090d; font-weight: 650; }
.measure-note { color: var(--ink-2); font-size: 14px; margin: 0; flex: 1 1 280px; align-self: center; line-height: 1.4; }
.status { font-size: 14px; color: var(--muted); margin-left: auto; align-self: center; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--glass); border: 1px solid var(--glass-line); border-radius: 6px; padding: 14px 16px; }
.tile-label { font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.tile-value { font-variation-settings: "wdth" 104; font-weight: 300; font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile:first-child .tile-value { color: var(--yellow); font-weight: 700; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2 .figure { margin: 0; }
.dash-section { margin: 18px 0 60px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 0 10px; flex-wrap: wrap; }
.table-head h2 { font-size: 21px; }
.loader { background: rgba(0, 0, 0, 0.6); color: var(--ink); border: 1px solid var(--glass-line); border-radius: 6px; padding: 26px 24px; margin: 18px 0; overflow: hidden; }
.loader b { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; font-size: 15px; color: var(--red); }
.loader .bar { position: relative; height: 2px; background: var(--line-strong); border-radius: 2px; margin-top: 58px; }
.loader .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, transparent, var(--red) 40%, var(--flare)); filter: drop-shadow(0 0 6px var(--red)); border-radius: 2px; transition: width 0.15s; }
/* the loading car drives left to right, so this copy is mirrored and loses its number */
.bar-car { position: absolute; bottom: 0; left: calc(var(--p, 0) * 1% - 30px); width: 132px; transition: left 0.15s; transform: scaleX(-1); }
.bar-car .car-num { display: none; }
.bar-car .wheel { transform-box: fill-box; transform-origin: center; }
.loader p { margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }
.inline-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; margin: 0 0 10px; }
.inline-switch button { all: unset; cursor: pointer; padding: 5px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.inline-switch button[aria-pressed="true"] { background: var(--ink); color: var(--black); }
.inline-switch button:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }

.footer { border-top: 1px solid var(--glass-line); padding: 26px 20px 50px; color: var(--muted); font-size: 14.5px; }

/* ---------- parts of the report: one tyre-compound colour each, shared with the lap map ---------- */
@property --part { syntax: "<color>"; inherits: true; initial-value: #f21d2b; }
:root { --part: #f21d2b; }
body { transition: --part 0.5s; }
[data-part="car"] { --part: #f21d2b; }          /* soft */
[data-part="strategy"] { --part: #f6c416; }     /* medium */
[data-part="eras"] { --part: #f4f2ef; }         /* hard */
[data-part="prediction"] { --part: #3fcf6c; }   /* intermediate */
[data-part="reference"] { --part: #3d8bff; }    /* wet */

/* ---------- lap-progress map in the side column ---------- */
.circuit { margin: 0 0 22px; padding: 12px 10px 10px; background: rgba(0, 0, 0, 0.55); border: 1px solid var(--glass-line); border-radius: 6px; }
.circuit svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-track { fill: none; stroke: #d9d6d1; stroke-width: 1.4; stroke-linejoin: round; opacity: 0.55; }
.c-driven { fill: none; stroke: var(--part); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px var(--part)); }
.c-posts circle { fill: var(--black); stroke: #d9d6d1; stroke-width: 1.2; }
.c-posts circle.passed { fill: var(--part); stroke: var(--part); }
.c-start { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.c-car circle { fill: #fff; }
.c-car .c-halo { fill: var(--part); opacity: 0.45; filter: blur(2.5px); }
.toc .lap-readout { margin: 8px 4px 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.toc .lap-readout b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- part boards: a photograph, a streak of light, the title over the fade ---------- */
.part-board { margin: 80px 0 0; --streak: var(--part); }
.part-board:first-child { margin-top: 0; }
.part-photo { position: relative; aspect-ratio: 21 / 9; overflow: hidden; border-radius: 6px 6px 0 0; background: var(--surface); }
.part-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.part-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, rgba(4, 4, 6, 0.82)); pointer-events: none; }
.part-photo.duo { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 3px; }
.part-photo.duo img { min-height: 0; }
[data-part="strategy"] .part-photo img { object-position: 50% 78%; }
[data-part="prediction"] .part-photo img { object-position: 50% 30%; }
.streak { display: block; height: 2px; border-radius: 2px; transform-origin: left; filter: drop-shadow(0 0 6px var(--part)); }
.part-title {
  position: relative; z-index: 1; font-family: var(--display); text-transform: uppercase; font-weight: 400; font-size: clamp(26px, 5vw, 60px); line-height: 1.08;
  letter-spacing: 0.01em; margin: -1.25em 0 0.42em; padding: 0 0 0 18px; color: var(--part); text-shadow: 0 2px 22px rgba(0, 0, 0, 0.9), 0 0 34px color-mix(in srgb, var(--part) 45%, transparent);
}
.part-board .streak { position: relative; z-index: 1; }
.part-line { font-size: 19px; line-height: 1.45; color: var(--ink-2); max-width: 46ch; margin: 0; }

/* ---------- finish line: the car driving away ---------- */
.finish { background: var(--black); color: var(--ink); position: relative; }
.flag { height: 28px; background: conic-gradient(#f4f2ef 25%, #000 0 50%, #f4f2ef 0 75%, #000 0) 0 0 / 28px 28px; transition: background-position 1.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.finished .flag { background-position: 168px 0; }
.finish-scene { position: relative; display: grid; min-height: clamp(380px, 46vw, 620px); overflow: hidden; }
.finish-scene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 55%; }
.finish-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(0, 0, 0, 0.88) 12%, rgba(0, 0, 0, 0.55) 40%, transparent 66%); }
.finish-inner { position: relative; z-index: 1; width: 100%; display: grid; align-content: center; justify-items: end; padding-top: 48px; padding-bottom: 48px; }
.finish-text { max-width: 400px; }
.finish-text .finish-title { font-family: var(--display); text-transform: uppercase; font-size: clamp(24px, 3.4vw, 42px); line-height: 1.15; letter-spacing: 0.015em; margin: 0 0 14px; color: var(--ink); }
.finish-text p { color: var(--ink-2); }
.finish-text .btn { margin-top: 8px; }

/* ---------- motion: only for readers who have not asked for less of it ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* lights out: the photograph comes up from the dark and settles */
  .wall::before { opacity: 0.22; scale: 1.06; transform-origin: 60% 80%; }
  .go .wall::before { opacity: 1; scale: 1; transition: opacity 1.3s ease-out, scale 2.2s cubic-bezier(0.16, 0.84, 0.3, 1); }
  .reveal .chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .reveal.in .chart .ln { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(0.3, 0.6, 0.2, 1); }
  .reveal .chart .bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
  .reveal .chart .hbar { transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); }
  .reveal.in .chart .bar, .reveal.in .chart .hbar { transform: none; transition: transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .reveal .chart circle, .reveal .chart .val, .reveal .chart .whisker { opacity: 0; }
  .reveal.in .chart circle, .reveal.in .chart .val { opacity: 1; transition: opacity 0.5s 0.7s; }
  .reveal.in .chart .whisker { opacity: 0.45; transition: opacity 0.5s 0.4s; }
  .part-board.reveal .streak { transform: scaleX(0); }
  .part-board.reveal.in .streak { transform: none; transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .part-board.reveal .part-title { opacity: 0; transform: translateX(-28px); }
  .part-board.reveal.in .part-title { opacity: 1; transform: none; transition: opacity 0.5s 0.15s, transform 0.7s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .wall::before { transform: none; }
}

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 110px; }
  .report { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .controls { position: static; }
  .hero-band.slim { background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), var(--black) url("../img/wallpaper.jpg") 70% 80% / cover no-repeat; }
  .dash-head { min-height: 0; }
  .finish-scene::after { background: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.9) 62%); }
  .finish-inner { align-content: end; justify-items: start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap, .nav-inner { padding-left: 16px; padding-right: 16px; }
  .footer { padding: 26px 16px 50px; }
  .nav-inner { gap: 6px; }
  .nav-links { gap: 2px; flex-wrap: nowrap; }
  .nav-links a { padding: 8px 6px; font-size: 13.5px; }
  .nav-links a[aria-current="page"]::after { left: 6px; right: 6px; }
  .brand { font-size: 10.5px; letter-spacing: 0.04em; }
  .emblem { width: 22px; height: 14px; margin-right: 7px; }
  .byline { padding: 20px 16px 0; font-size: 10px; letter-spacing: 0.08em; }
  .opener-title { gap: 22px; }
  .lights { gap: 6px; padding: 6px 9px; }
  .lights i { width: 10px; height: 10px; }
  .hero { padding: 96px 16px 48px; }
  .dash-head { padding-top: 34px; padding-bottom: 34px; }
  .part-photo { aspect-ratio: 16 / 9; }
  .part-title { padding-left: 12px; }
  .finish-scene { min-height: 460px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure { padding: 16px 14px 12px; }
  .tower-value { font-size: 27px; }
  .part-line { font-size: 17px; }
  .ms > button { min-width: 140px; }
  .ms-pop { width: min(290px, calc(100vw - 32px)); }
}
@media (max-width: 400px) {
  /* the wide wordmark gives way to the emblem; the link keeps its name for screen readers */
  .brand { font-size: 0; }
  .emblem { margin-right: 0; width: 28px; height: 18px; }
}
