/* ==========================================================================
   100km.site — styles
   ========================================================================== */

/* Self-hosted Inter and Space Grotesk (SIL Open Font License), latin + latin-ext. */
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin-ext-367ba6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin-bec94a.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin-ext-367ba6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin-bec94a.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin-ext-367ba6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin-bec94a.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/inter-latin-ext-367ba6.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/inter-latin-bec94a.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-ext-012a46.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-1d9f0c.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-ext-012a46.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-1d9f0c.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-ext-012a46.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/space-grotesk-latin-1d9f0c.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --bg-alt: #f3f2ee;
  --surface: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 8px 24px rgba(11, 11, 11, .06);

  --accent: #e34948;          /* road-sign red: brand, never data */
  --accent-soft: rgba(227, 73, 72, .10);
  --limit: #2a78d6;           /* series 1: driving at the limit */
  --limit-soft: rgba(42, 120, 214, .14);
  --you: #eb6834;             /* series 2: driving faster */
  --you-soft: rgba(235, 104, 52, .16);
  --brake: #898781;

  --road: #2b2b29;
  --road-line: #f4f3ef;
  --glass: rgba(255, 255, 255, .78);
  --tyre: #1c1c1b;
  --hub: #bdbcb6;

  --radius: 18px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141413;
    --bg-alt: #1a1a19;
    --surface: #1f1f1e;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --accent: #e66767;
    --accent-soft: rgba(230, 103, 103, .14);
    --limit: #3987e5;
    --limit-soft: rgba(57, 135, 229, .20);
    --you: #d95926;
    --you-soft: rgba(217, 89, 38, .16);
    --road: #2a2a28;
    --road-line: #8d8c86;
    --glass: rgba(20, 20, 19, .7);
    --tyre: #0b0b0b;
    --hub: #6c6b66;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413;
  --bg-alt: #1a1a19;
  --surface: #1f1f1e;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --border: rgba(255, 255, 255, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --accent: #e66767;
  --accent-soft: rgba(230, 103, 103, .14);
  --limit: #3987e5;
  --limit-soft: rgba(57, 135, 229, .20);
  --you: #d95926;
  --you-soft: rgba(217, 89, 38, .16);
  --road: #2a2a28;
  --road-line: #8d8c86;
  --glass: rgba(20, 20, 19, .7);
  --tyre: #0b0b0b;
  --hub: #6c6b66;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4.4vw, 3rem); font-weight: 700; margin-bottom: .6rem; }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
em { font-style: normal; color: var(--accent); }
strong { font-weight: 600; }
small { font-size: .8em; color: var(--muted); font-weight: 400; }
a { color: inherit; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--limit); outline-offset: 2px; border-radius: 6px; }

/* ---- Top bar ------------------------------------------------------------ */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand-sign {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: #0b0b0b; border: 4px solid var(--accent);
  font: 700 11px/1 var(--font);
}
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar nav { display: flex; gap: 4px; }
.lang {
  position: relative; display: inline-flex; align-items: center;
  color: var(--ink-2);
}
.lang svg { position: absolute; left: 10px; width: 16px; height: 16px; pointer-events: none; }
.lang select {
  appearance: none; -webkit-appearance: none;
  min-height: 36px; max-width: 140px; padding: 0 12px 0 32px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--ink);
  font: 500 .88rem/1 var(--font); cursor: pointer;
}
.lang select:hover { background: var(--bg-alt); }
.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;
}
.topbar nav a {
  text-decoration: none; color: var(--ink-2); font-size: .92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 999px;
}
.topbar nav a:hover { background: var(--bg-alt); color: var(--ink); }
@media (max-width: 560px) {
  .topbar nav { display: none; }
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--accent)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn svg { width: 16px; height: 16px; }

/* ---- Hero --------------------------------------------------------------- */

.hero { position: relative; padding: clamp(56px, 10vw, 120px) 0 0; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; max-width: 920px; }
.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.lede { font-size: clamp(1.08rem, 2.2vw, 1.3rem); color: var(--ink-2); max-width: 680px; margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-cta .btn { white-space: nowrap; }
/* phones: both buttons share one row, whatever the language */
@media (max-width: 560px) {
  .hero-cta { flex-wrap: nowrap; gap: 10px; }
  .hero-cta .btn { flex: 1 1 0; min-width: 0; padding: 0 12px; font-size: .95rem; }
}

.hero-road {
  position: relative; height: 120px; margin-top: clamp(48px, 8vw, 88px);
  background: var(--road);
}
.hero-road::before, .hero-road::after {
  content: ""; position: absolute; left: 0; right: 0; height: 4px; background: var(--road-line); opacity: .5;
}
.hero-road::before { top: 10px; }
.hero-road::after { bottom: 10px; }
.road-lines {
  position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
  background: repeating-linear-gradient(90deg, var(--road-line) 0 36px, transparent 36px 72px);
  background-size: 72px 4px;
  animation: lines 0.9s linear infinite;
}
@keyframes lines { to { background-position: -72px 0; } }
.hero-car { position: absolute; width: 84px; color: var(--limit); }
.hero-car svg { display: block; width: 100%; height: auto; }
.hero-car-a { top: 18px; left: 22%; animation: bob 1.6s ease-in-out infinite; }
.hero-car-b { bottom: 18px; left: 46%; color: var(--you); animation: weave 7s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1px); } }
@keyframes weave {
  0%, 100% { transform: translateX(-12vw); }
  50% { transform: translateX(10vw); }
}

/* ---- Sections ----------------------------------------------------------- */

.section { padding: clamp(64px, 10vw, 120px) 0; }
.section-alt { background: var(--bg-alt); }
.section-lede { font-size: clamp(1.02rem, 1.8vw, 1.15rem); color: var(--ink-2); max-width: 720px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- Lesson ------------------------------------------------------------- */

.lesson { margin: 40px 0 0; padding: clamp(20px, 3vw, 32px); }
.lesson-head, .race-head, .stop-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px;
}
.lesson-head figcaption, .race-head figcaption, .stop-head figcaption { font-weight: 600; }

.lesson-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.lesson-row {
  display: grid; grid-template-columns: 92px 1fr; gap: 6px 16px; align-items: center;
  opacity: .25; transition: opacity .5s ease;
}
.lesson-row.on { opacity: 1; }
.lesson-speed { font: 700 1.05rem/1 var(--font-display); }
.lesson-speed small { display: block; margin-top: 2px; font: 500 .72rem/1 var(--font); color: var(--muted); }
.lesson-track { position: relative; height: 40px; }
.lesson-bar {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: var(--limit); border-radius: 4px 6px 6px 4px;
  transition: width 1.1s cubic-bezier(.2, .8, .2, 1);
}
.lesson-gap {
  position: absolute; top: 0; bottom: 0; width: 0;
  background: repeating-linear-gradient(135deg, var(--you-soft) 0 6px, transparent 6px 12px);
  border: 2px dashed var(--you); border-left: 0; border-radius: 0 6px 6px 0;
  opacity: 0; transition: opacity .5s ease .9s, width 1.1s cubic-bezier(.2, .8, .2, 1);
}
.lesson-row.on .lesson-gap { opacity: 1; }
.lesson-label {
  position: absolute; top: 50%; transform: translateY(-50%);
  font: 700 1rem/1 var(--font-display); white-space: nowrap; padding-left: 10px;
  opacity: 0; transition: opacity .4s ease .8s;
}
.lesson-row.on .lesson-label { opacity: 1; }
.lesson-label span { font: 600 .82rem/1 var(--font); color: var(--ink-2); margin-left: 6px; }
.lesson-total {
  margin-top: 24px; padding: 14px 18px; border-radius: 12px;
  background: var(--accent-soft); font-size: 1.05rem;
  opacity: 0; transform: translateY(6px); transition: opacity .5s ease, transform .5s ease;
}
.lesson-total.on { opacity: 1; transform: none; }
.lesson-note { margin-top: 16px; color: var(--ink-2); font-size: .95rem; }

@media (max-width: 560px) {
  .lesson-row { grid-template-columns: 1fr; }
  .lesson-track { height: 30px; margin-bottom: 26px; }
  .lesson-label { left: 0 !important; top: calc(100% + 14px); padding-left: 0; font-size: .92rem; }
}

.curve { margin-top: 24px; padding: clamp(20px, 3vw, 32px); }
.curve-head p { color: var(--ink-2); font-size: .95rem; margin-top: 4px; }

/* ---- Charts (shared) ---------------------------------------------------- */

.chart { position: relative; width: 100%; margin-top: 12px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font: 500 11px var(--font); }
.chart .axis-title { fill: var(--muted); font: 500 11px var(--font); }
.chart .curve-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .label { font: 600 12px var(--font); fill: var(--ink); }
.chart .label-muted { font: 500 11px var(--font); fill: var(--ink-2); }
.chart .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }

.tooltip {
  position: fixed; z-index: 80; pointer-events: none;
  background: var(--ink); color: var(--bg);
  font: 500 13px/1.45 var(--font); padding: 8px 12px; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease;
  max-width: 240px;
}
.tooltip.on { opacity: 1; transform: none; }
.tooltip b { font-weight: 700; }
.tooltip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---- Calculator --------------------------------------------------------- */

.calc {
  display: grid; gap: 24px; margin-top: 40px;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } }

.controls { padding: 8px 24px; position: sticky; top: 76px; }
@media (max-width: 900px) { .controls { position: static; padding: 4px 18px; } }

.field { border: 0; margin: 0; padding: 20px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.field:last-child { border-bottom: 0; }
.field-label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: .95rem;
}
.field-value { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-2); }
.field-value input {
  width: 74px; text-align: right;
  font: 700 1.25rem/1 var(--font-display); color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid var(--border);
  padding: 4px 2px; border-radius: 0;
  -moz-appearance: textfield;
}
.field-value input:focus { outline: none; border-bottom-color: var(--limit); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.dot-limit { background: var(--limit); }
.dot-you { background: var(--you); }

/* range */
input[type=range] {
  --pct: 50%;
  --fill: var(--ink);
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 32px; background: transparent; margin: 0; cursor: pointer;
}
#limit { --fill: var(--limit); }
#speed { --fill: var(--you); }
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--fill) var(--pct), var(--grid) var(--pct));
}
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--grid); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--fill); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--fill); box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--fill); box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button {
  min-height: 34px; min-width: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--ink-2);
  font: 600 .85rem/1 var(--font); cursor: pointer;
}
.chips button:hover { background: var(--bg-alt); color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px;
  background: var(--bg-alt); border-radius: 12px; margin-bottom: 14px;
}
.segmented button {
  min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2);
  font: 600 .88rem/1 var(--font); cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-price { grid-template-columns: 1.1fr 1fr; }
.select { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); min-width: 0; }
.select select, .select input, .input-unit {
  width: 100%; min-height: 44px; padding: 0 12px;
  font: 500 .95rem/1 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.select select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23898781' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
.select select:focus, .select input:focus, .input-unit:focus-within { outline: none; border-color: var(--limit); box-shadow: 0 0 0 3px var(--limit-soft); }
.input-unit { display: flex; align-items: center; gap: 6px; padding-right: 10px; }
.input-unit input { border: 0; padding: 0; min-height: 42px; background: transparent; box-shadow: none !important; }
.input-unit span { white-space: nowrap; color: var(--muted); font-size: .82rem; }
.vehicle-info { margin-top: 12px; font-size: .86rem; color: var(--ink-2); }
.vehicle-info b { color: var(--ink); }

/* Results */
.results { display: grid; gap: 16px; min-width: 0; }

.verdict {
  padding: 22px 24px; font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.45;
  border-left: 6px solid var(--accent);
}
.verdict b { font-weight: 700; }
.verdict .tag { display: inline-block; font: 600 .74rem/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; min-width: 0; }
.stat h3 { font: 600 .82rem/1.3 var(--font); color: var(--ink-2); letter-spacing: 0; }
.stat-big {
  font: 700 clamp(1.7rem, 4vw, 2.4rem)/1.1 var(--font-display); letter-spacing: -0.02em;
  margin: 8px 0 6px; font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: .85rem; color: var(--ink-2); }
.stat-accent { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
@media (max-width: 420px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; }
}

/* Race */
.race { margin: 0; padding: 20px 22px; }
.race-track { position: relative; display: grid; gap: 12px; }
.lane { display: grid; grid-template-columns: 74px 1fr 76px; align-items: center; gap: 10px; }
.lane-label { font: 700 .95rem/1 var(--font-display); }
.lane-time { font: 600 .85rem/1.2 var(--font); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.lane-road {
  position: relative; height: 44px; border-radius: 8px; background: var(--road);
  overflow: hidden;
}
.lane-road::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: repeating-linear-gradient(90deg, var(--road-line) 0 14px, transparent 14px 28px); opacity: .45;
}
.lane-road::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 10px;
  background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 10px 10px;
}
.race-car { position: absolute; top: 50%; left: 0; width: 52px; transform: translate(0, -50%); }
.race-car svg { display: block; width: 100%; height: auto; }
.race-car-limit { color: var(--limit); }
.race-car-you { color: var(--you); }
.race-clock { margin-top: 14px; font-size: .92rem; color: var(--ink-2); min-height: 1.5em; }
.race-clock b { color: var(--ink); }
@media (max-width: 480px) {
  .lane { grid-template-columns: 56px 1fr 64px; gap: 8px; }
  .race-car { width: 40px; }
}

/* Charts row */
.charts-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
@media (max-width: 900px) { .charts-row { grid-template-columns: minmax(0, 1fr); } }
.chart-card { margin: 0; padding: 22px; }
.chart-card figcaption p { color: var(--ink-2); font-size: .9rem; margin-top: 4px; }

/* Steps */
.steps-card { margin-top: 24px; padding: 22px; }
.steps-head p { color: var(--ink-2); font-size: .9rem; margin-top: 4px; }
.steps { margin-top: 18px; display: grid; }
.step-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.step-row.head { border-top: 0; padding-top: 0; font: 600 .78rem/1.2 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.step-row.beyond { opacity: .45; }
.step-range { font: 700 .95rem/1.2 var(--font-display); white-space: nowrap; }
.step-cell { display: grid; grid-template-columns: minmax(0, 1fr) 82px; align-items: center; gap: 10px; }
.step-bar { height: 14px; border-radius: 2px 4px 4px 2px; transform-origin: left; transition: width .6s cubic-bezier(.2, .8, .2, 1); min-width: 2px; }
.step-bar.t { background: var(--limit); }
.step-bar.c { background: var(--you); }
.step-val { font: 600 .9rem/1 var(--font); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .step-row { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  .step-range { grid-column: 1 / -1; }
  .step-row.head .step-range { display: none; }
  .step-cell { grid-template-columns: 1fr; gap: 4px; }
  .step-val { text-align: left; }
}

/* ---- Risk --------------------------------------------------------------- */

.stop { margin: 40px 0 0; padding: clamp(20px, 3vw, 32px); }
.stop-head figcaption { font-weight: 500; color: var(--ink-2); }
.stop-head figcaption b { color: var(--ink); }
.stop-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: .85rem; color: var(--ink-2); }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.sw-react { background: repeating-linear-gradient(135deg, var(--muted) 0 3px, transparent 3px 6px); border: 1px solid var(--muted); }
.sw-brake { background: var(--muted); }
.stats-risk { margin-top: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats-risk { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Reasons ------------------------------------------------------------ */

.reasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
@media (max-width: 1000px) { .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .reasons { grid-template-columns: minmax(0, 1fr); } }
.reason { padding: 22px; }
.reason-icon { font-size: 1.8rem; display: block; margin-bottom: 12px; }
.reason p { color: var(--ink-2); font-size: .93rem; margin-top: 8px; }

/* ---- Closer ------------------------------------------------------------- */

.closer { text-align: center; }
.closer-inner { max-width: 760px; }
.closer .section-lede { margin: 10px auto 0; }
.closer .hero-cta { justify-content: center; }
.share-status { margin-top: 14px; min-height: 1.5em; color: var(--ink-2); font-size: .9rem; }

/* ---- Footer ------------------------------------------------------------- */

.footer { border-top: 1px solid var(--border); padding: 36px 0 120px; color: var(--ink-2); font-size: .9rem; }
.footer summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.footer details ul { padding-left: 20px; margin: 14px 0 0; display: grid; gap: 8px; max-width: 820px; }
.footer-note { margin-top: 24px; color: var(--muted); }

/* ---- Mobile dock -------------------------------------------------------- */

.dock {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 140%);
  display: none; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font: 600 .92rem/1 var(--font); white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.dock.on { transform: translate(-50%, 0); }
.dock-sep { width: 1px; height: 16px; background: currentColor; opacity: .3; }
@media (max-width: 900px) { .dock { display: flex; } }

/* ---- Motion preferences ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; }
}

/* ---- Overtaken truck ---------------------------------------------------- */

.truck {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px;
  margin-top: 40px; padding: clamp(18px, 3vw, 28px);
}
@media (max-width: 900px) { .truck { grid-template-columns: minmax(0, 1fr); } }
.truck-controls, .avg-controls { display: grid; gap: 18px; align-content: start; }
.mini-field { min-width: 0; }
.mini-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: .88rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px;
}
.mini-label b { font: 700 1rem/1 var(--font-display); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
#tk-you, #av-share { --fill: var(--you); }
#tk-other { --fill: var(--limit); }
.truck-stage { min-width: 0; }
.truck-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.truck-head .race-clock { margin: 0; }
.truck-road { margin-top: 10px; }
.truck-road svg { display: block; width: 100%; height: auto; }
.truck-road .axis text { fill: var(--muted); font: 500 11px var(--font); }
.truck-road .label { font: 600 12px var(--font); fill: var(--ink); }
.truck-bottom { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; }
@media (max-width: 640px) { .truck-bottom { grid-template-columns: minmax(0, 1fr); } }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.events li {
  display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: baseline;
  font-size: .9rem; color: var(--ink-2); opacity: .35; transition: opacity .3s ease;
}
.events li.on { opacity: 1; }
.events li b { font: 600 .82rem/1.3 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.truck-result {
  align-self: start; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft);
  font-size: .92rem; color: var(--ink-2);
}
.truck-result .truck-big { font: 700 1.3rem/1.25 var(--font-display); color: var(--ink); margin-bottom: 6px; }
.truck-chart-card { margin-top: 24px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: .85rem; color: var(--ink-2); }
.ln { display: inline-block; width: 22px; height: 0; border-top: 3px solid; border-radius: 2px; margin-right: 8px; vertical-align: 4px; }
.ln-you { border-color: var(--you); }
.ln-limit { border-color: var(--limit); }
.ln-ink { border-color: var(--ink); }
.ln-dash { border-top: 2px dashed var(--muted); }

/* ---- Average vs cruising ------------------------------------------------ */

.avg-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; margin-top: 40px; align-items: start; }
@media (max-width: 900px) { .avg-grid { grid-template-columns: minmax(0, 1fr); } }
.avg-controls { padding: 22px; }
.avg-grid .chart-card { margin: 0; }

.select-wide { margin-bottom: 10px; }
.price-hint { margin-top: 8px; font-size: .8rem; color: var(--muted); }
.price-hint a { color: inherit; }
.price-hint .src { display: block; margin-top: 2px; }

/* ---- Share dialog ------------------------------------------------------- */

.share-dialog {
  width: min(460px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--border);
  border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.share-dialog::backdrop { background: rgba(11, 11, 11, .45); backdrop-filter: blur(3px); }
.share-dialog[open] { animation: share-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes share-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-title { font: 700 1.3rem/1.1 var(--font-display); letter-spacing: -0.02em; margin: 0; }
.share-close {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg-alt); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.share-close svg { width: 18px; height: 18px; }
.share-text {
  margin: 14px 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg-alt);
  font-size: .9rem; color: var(--ink-2);
}
.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.share-grid.has-native { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
.share-grid button {
  display: grid; justify-items: center; gap: 6px; padding: 10px 2px; border: 0; border-radius: 14px;
  background: transparent; color: var(--ink-2); font: 500 .78rem/1.2 var(--font); cursor: pointer;
}
.share-grid button[hidden] { display: none; }
.share-grid button:hover { background: var(--bg-alt); color: var(--ink); }
.si { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.si svg { width: 26px; height: 26px; }
.si-x { background: #000; }
:root[data-theme="dark"] .si-x { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.si-fb { background: #1877f2; }
.si-wa { background: #25d366; }
.si-tg { background: #229ed9; }
.si-rd { background: #ff4500; }
.si-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.si-li { background: #0a66c2; }
.si-em, .si-more { background: var(--ink-2); color: var(--surface); }
.share-copy { display: flex; gap: 8px; margin-top: 16px; }
.share-copy input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-alt); color: var(--ink-2); font: 500 .85rem var(--font);
}
.share-dialog .share-status { margin-top: 10px; min-height: 1.3em; text-align: center; }
@media (max-width: 560px) {
  .share-dialog { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .share-dialog[open] { animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
}

/* ---- Hero stat, FAQ, footer columns ------------------------------------- */

.hero-stat {
  display: inline-block; margin-top: 18px; padding: 10px 16px; border-radius: 12px;
  background: var(--accent-soft); font-size: clamp(1rem, 2vw, 1.12rem); color: var(--ink);
}
.hero-stat b { font-weight: 700; }

.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
@media (max-width: 760px) { .faq { grid-template-columns: minmax(0, 1fr); } }
.faq-item { padding: 22px; }
.faq-item h3 { font-size: 1.08rem; }
.faq-item p { margin-top: 10px; color: var(--ink-2); font-size: .95rem; }

.footer-grid { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 28px; margin-top: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.footer-h { font: 600 .95rem/1.3 var(--font); color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
.footer-col p { max-width: 42ch; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-list a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.footer-list a:hover { color: var(--ink); text-decoration-color: currentColor; }
.footer-langs { grid-template-columns: repeat(2, max-content); column-gap: 18px; }
.not-found-langs { margin-top: 28px; font-size: 1.1rem; }
