/* ==========================================================================
   CoRoute website: shared design system (every page).
   Matches the mobile app (lib/core/theme/app_palette.dart, ui_tokens.dart): Manrope, one teal brand, one amber
   warning, the SOS red, calm bg / card / soft grounds and the 8 / 14 / 18 / 22 / 28 radius scale.
   Light and dark follow the system setting, or the visitor's choice (data-theme on <html>).
   ========================================================================== */

/* ---------- Self-hosted font: Manrope (SIL Open Font License, /fonts/OFL-Manrope.txt), variable 200 to 800 ---------- */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/manrope-latin.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;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens: light (app "light" palette) ---------- */
:root {
  --c-bg: #F4F7F9;
  --c-surface: #FFFFFF;
  --c-surface-2: #EEF3F5;
  --c-surface-3: #E8EFF2;
  --c-border: #E1E9EE;
  --c-border-strong: #C2CED6;

  --c-text: #15232E;
  --c-text-2: #3E4F5C;
  --c-text-3: #5B6B78;

  /* Brand teal: --c-brand is for text, icons and lines; --c-brand-fill is the solid fill under white text. */
  --c-brand: #0B6E78;
  --c-brand-fill: #0B6E78;
  --c-brand-fill-hover: #095C64;
  --c-brand-dark: #095C64;
  --c-brand-light: #E3F3F5;
  --c-brand-glow: rgba(11, 110, 120, 0.18);

  /* Warning amber and SOS red */
  --c-safety: #B4541C;
  --c-safety-light: #FFF1E6;
  --c-safety-line: #F0C9B3;
  --c-safety-ink: #B4541C;
  --c-sos: #C8102E;
  --c-sos-ink: #A50D26;

  --c-success: #2E7D32;
  --c-warning: #9A6A00;
  --c-danger: #C8102E;
  --c-info: #1565C0;

  /* Aliases used by pages.css, legal.css, live.css and older markup */
  --c-asphalt: var(--c-bg);
  --c-surface-1: var(--c-surface);
  --c-line: var(--c-border);
  --c-line-strong: var(--c-border-strong);
  --c-accent: var(--c-brand);
  --c-accent-hover: var(--c-brand-dark);
  --c-accent-press: var(--c-brand-dark);
  --c-accent-ink: #FFFFFF;
  --c-accent-soft: var(--c-brand-light);
  --c-accent-line: rgba(11, 110, 120, 0.35);
  --c-amber: var(--c-safety);
  --c-amber-soft: var(--c-safety-light);
  --c-green: var(--c-success);
  --c-green-soft: rgba(46, 125, 50, 0.12);
  --c-red: var(--c-sos);
  --c-red-fill: var(--c-sos);
  --c-red-soft: rgba(200, 16, 46, 0.1);
  --c-nav: #0277BD;
  --c-nav-soft: rgba(2, 119, 189, 0.12);
  --c-scrim: rgba(21, 35, 46, 0.66);
  --c-mesh: #1565C0;

  /* Type: Manrope everywhere, heavy headings like the app (w800) */
  --font-body: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-hero: clamp(2.5rem, 1.6rem + 4.2vw, 4.75rem);
  --fs-h1: clamp(2.125rem, 1.6rem + 2.4vw, 3.25rem);
  --fs-h2: clamp(1.75rem, 1.35rem + 1.7vw, 2.625rem);
  --fs-h3: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
  --fs-h4: 1.125rem;
  --fs-lead: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: .9375rem;
  --fs-xs: .8125rem;
  --fs-label: .75rem;

  --lh-tight: 1.08;
  --lh-heading: 1.18;
  --lh-snug: 1.45;
  --lh-body: 1.65;

  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px; --sp-24: 24px; --sp-32: 32px; --sp-36: 36px;
  --sp-40: 40px; --sp-48: 48px; --sp-56: 56px; --sp-64: 64px; --sp-80: 80px; --sp-96: 96px; --sp-128: 128px;
  --section-y: clamp(64px, 8vw, 120px);
  --gutter: clamp(16px, 4vw, 40px);

  --container: 1200px;
  --reading: 70ch;
  --header-h: 68px;
  --header-h-compact: 60px;

  /* Radii from the app: sm 8, md 14, lg 18, xl 22, sheet 28 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-sheet: 28px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(21, 35, 46, 0.06);
  --shadow-md: 0 6px 18px rgba(21, 35, 46, 0.08);
  --shadow-lg: 0 18px 48px rgba(21, 35, 46, 0.12);

  /* Motion from the app: 120 / 180 / 260 ms, ease-out cubic, no bounce */
  --d-fast: 120ms;
  --d-base: 180ms;
  --d-slow: 260ms;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-out: var(--ease);

  --border: 1px solid var(--c-border);
  --border-strong: 1px solid var(--c-border-strong);
  --shadow-1: var(--shadow-sm);
  --shadow-2: var(--shadow-md);
  --tr-label: 0.08em;
  --tr-display: -0.025em;
  --lh-display: var(--lh-heading);
  --z-marker: 10;
  --z-raised: 20;
  --z-sticky: 50;
  --r-round: var(--r-full);
  --ring: 0 0 0 3px var(--c-brand-glow);
  --rad: var(--r-md);
  --rad-lg: var(--r-lg);

  /* 3.55 page scenery (route motif under every page hero): the home hero's poster palette */
  --c-sky: #D6EAEF;
  --c-hill-far: #C9DBD8;
  --c-hill-near: #ADC7C3;
  --c-road-ink: #3E4F5C;
  --c-rider-a: #1565C0; --c-rider-b: #0B6E78; --c-rider-c: #C2185B; --c-rider-d: #9A6A00; --c-rider-e: #B4541C;
  --c-live: #2E9E5B;

  color-scheme: light;
}

/* ---------- Tokens: dark (app "dark" palette). Written twice: chosen, and system default. ---------- */
:root[data-theme="dark"] {
  --c-bg: #0F171D; --c-surface: #1A262F; --c-surface-2: #24323B; --c-surface-3: #141E25;
  --c-border: #2A3842; --c-border-strong: #3A4A55;
  --c-text: #F2F6F8; --c-text-2: #C9D4DB; --c-text-3: #9BAAB5;
  --c-brand: #5CCAD3; --c-brand-fill: #0B6E78; --c-brand-fill-hover: #0D808B; --c-brand-dark: #3FB3BD;
  --c-brand-light: #163A3F; --c-brand-glow: rgba(92, 202, 211, 0.22);
  --c-safety: #F0A070; --c-safety-light: #3A2616; --c-safety-line: #5A3A22; --c-safety-ink: #F0A070;
  --c-sos: #C8102E; --c-sos-ink: #FF8A9A;
  --c-success: #7CD67A; --c-warning: #FFD54F; --c-danger: #FF8A9A; --c-info: #82B1FF;
  --c-accent-ink: #0F171D; --c-accent-line: rgba(92, 202, 211, 0.4);
  --c-green-soft: rgba(124, 214, 122, 0.15); --c-red-soft: rgba(255, 138, 154, 0.14); --c-red: #FF8A9A;
  --c-nav: #80DEEA; --c-nav-soft: rgba(128, 222, 234, 0.14);
  --c-scrim: rgba(6, 10, 13, 0.8); --c-mesh: #82B1FF;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --c-sky: #12262D; --c-hill-far: #1D2C35; --c-hill-near: #18252D; --c-road-ink: #0A1014;
  --c-rider-a: #82B1FF; --c-rider-b: #5CCAD3; --c-rider-c: #FF80AB; --c-rider-d: #FFD54F; --c-rider-e: #F0A070;
  --c-live: #5FD08A;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0F171D; --c-surface: #1A262F; --c-surface-2: #24323B; --c-surface-3: #141E25;
    --c-border: #2A3842; --c-border-strong: #3A4A55;
    --c-text: #F2F6F8; --c-text-2: #C9D4DB; --c-text-3: #9BAAB5;
    --c-brand: #5CCAD3; --c-brand-fill: #0B6E78; --c-brand-fill-hover: #0D808B; --c-brand-dark: #3FB3BD;
    --c-brand-light: #163A3F; --c-brand-glow: rgba(92, 202, 211, 0.22);
    --c-safety: #F0A070; --c-safety-light: #3A2616; --c-safety-line: #5A3A22; --c-safety-ink: #F0A070;
    --c-sos: #C8102E; --c-sos-ink: #FF8A9A;
    --c-success: #7CD67A; --c-warning: #FFD54F; --c-danger: #FF8A9A; --c-info: #82B1FF;
    --c-accent-ink: #0F171D; --c-accent-line: rgba(92, 202, 211, 0.4);
    --c-green-soft: rgba(124, 214, 122, 0.15); --c-red-soft: rgba(255, 138, 154, 0.14); --c-red: #FF8A9A;
    --c-nav: #80DEEA; --c-nav-soft: rgba(128, 222, 234, 0.14);
    --c-scrim: rgba(6, 10, 13, 0.8); --c-mesh: #82B1FF;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
    --c-sky: #12262D; --c-hill-far: #1D2C35; --c-hill-near: #18252D; --c-road-ink: #0A1014;
    --c-rider-a: #82B1FF; --c-rider-b: #5CCAD3; --c-rider-c: #FF80AB; --c-rider-d: #FFD54F; --c-rider-e: #F0A070;
    --c-live: #5FD08A;
    color-scheme: dark;
  }
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--c-bg); color: var(--c-text);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 500;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip; font-feature-settings: "ss01" 0;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"], ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
table { border-collapse: collapse; }
b, strong { font-weight: 800; }
[hidden] { display: none !important; }
::selection { background: var(--c-brand-light); color: var(--c-text); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 3px; border-radius: var(--r-xs); }

.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 1000;
  background: var(--c-brand-fill); color: #FFFFFF; padding: 12px 18px; border-radius: var(--r-md);
  font-weight: 800; text-decoration: none; transition: top var(--d-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

.site-main { flex: 1 0 auto; padding-top: var(--header-h); display: block; }
.site-main:focus { outline: none; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container--narrow { max-width: 720px; }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.section--tight { padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(40px, 5vw, 72px); }
.section--surface { background-color: var(--c-surface); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.section--subtle { background-color: var(--c-surface-2); }
.section--brand { background-color: var(--c-brand-fill); color: #FFFFFF; }
.stack { display: flex; flex-direction: column; }
.stack--12 { gap: var(--sp-12); }
.stack--16 { gap: var(--sp-16); }
.stack--24 { gap: var(--sp-24); }
.split { display: grid; gap: clamp(32px, 5vw, 72px); }
@media (min-width: 1024px) { .split { grid-template-columns: 1fr 1fr; } }
.cluster { display: flex; flex-wrap: wrap; align-items: center; }
.cluster--4 { gap: 4px; }
.cluster--8 { gap: 8px; }
.cluster--16 { gap: var(--sp-16); }
.cluster--24 { gap: var(--sp-24); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, .t-display, .t-h1, .t-h2, .t-h3, .t-h4 {
  font-family: var(--font-display); font-weight: 800; line-height: var(--lh-heading);
  color: var(--c-text); letter-spacing: -0.02em; text-wrap: balance;
}
h3, h4, .t-h3, .t-h4 { letter-spacing: -0.01em; }
.t-hero { font-size: var(--fs-hero); line-height: var(--lh-tight); letter-spacing: var(--tr-display); }
.t-h1 { font-size: var(--fs-h1); }
.t-h2 { font-size: var(--fs-h2); }
.t-h3 { font-size: var(--fs-h3); }
.t-h4 { font-size: var(--fs-h4); }
.t-lead { font-size: var(--fs-lead); line-height: var(--lh-snug); color: var(--c-text-2); max-width: 42em; }
.t-body { font-size: var(--fs-body); }
.t-small { font-size: var(--fs-small); }
.t-xs { font-size: var(--fs-xs); }
.t-muted { color: var(--c-text-2); }
.t-faint { color: var(--c-text-3); }
.t-num { font-variant-numeric: tabular-nums; }
.t-center { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--sp-16);
  font-family: var(--font-body); font-weight: 800; font-size: var(--fs-label); letter-spacing: var(--tr-label);
  text-transform: uppercase; color: var(--c-brand);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.eyebrow--plain::before { display: none; }
.eyebrow--safety { color: var(--c-safety-ink); }

.prose { max-width: var(--reading); color: var(--c-text-2); font-size: var(--fs-body); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: var(--fs-h2); color: var(--c-text); margin-top: 2em; }
.prose h3 { font-size: var(--fs-h3); color: var(--c-text); margin-top: 1.5em; }
.prose strong, .prose b { color: var(--c-text); }
.prose a { color: var(--c-brand); text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.link { color: var(--c-brand); font-weight: 700; text-decoration: underline; text-decoration-color: var(--c-accent-line); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }

/* ---------- Icons ---------- */
.icon { display: inline-block; width: 20px; height: 20px; fill: currentColor; vertical-align: middle; flex-shrink: 0; }

/* ---------- Buttons: at least 44 px tall (gloved thumbs) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--r-md); border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 800; font-size: var(--fs-small); line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease), box-shadow var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}
.btn .icon { width: 20px; height: 20px; }
.btn--primary { background-color: var(--c-brand-fill); color: #FFFFFF !important; box-shadow: 0 6px 16px -6px rgba(11, 110, 120, 0.55); }
.btn--primary:hover { background-color: var(--c-brand-fill-hover); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--secondary { background-color: var(--c-surface); color: var(--c-text) !important; border-color: var(--c-border-strong); }
.btn--secondary:hover { border-color: var(--c-brand); color: var(--c-brand) !important; }
.btn--outline, .btn--ghost { background-color: transparent; color: var(--c-text) !important; border-color: var(--c-border-strong); }
.btn--outline:hover, .btn--ghost:hover { background-color: var(--c-surface); border-color: var(--c-brand); color: var(--c-brand) !important; }
.btn--safety { background-color: var(--c-sos); color: #FFFFFF !important; }
.btn--safety:hover { background-color: #A50D26; }
.btn--sm { min-height: 44px; padding: 10px 16px; font-size: var(--fs-xs); }
.btn--lg { min-height: 54px; padding: 14px 26px; font-size: var(--fs-body); border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: not-allowed; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 800; color: var(--c-brand); text-decoration: none; transition: gap var(--d-fast) var(--ease); }
.link-arrow:hover { gap: 10px; }
.link-arrow svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Cards ---------- */
.card {
  background-color: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  padding: var(--sp-24); box-shadow: var(--shadow-sm);
  transition: transform var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), border-color var(--d-base) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card--raised { box-shadow: var(--shadow-md); }
.card--interactive:hover { transform: translateY(-2px); border-color: var(--c-brand); }
.feature-card { display: flex; flex-direction: column; height: 100%; }
.feature-card__icon {
  width: 48px; height: 48px; border-radius: var(--r-md); background-color: var(--c-brand-light); color: var(--c-brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-16); flex-shrink: 0;
}
.feature-card__icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-8); }
.feature-card p { color: var(--c-text-2); font-size: var(--fs-small); line-height: var(--lh-snug); }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-full); font-size: var(--fs-label); font-weight: 800; letter-spacing: .04em; }
.badge--new { background: var(--c-brand-light); color: var(--c-brand); }
.badge--safety { background: var(--c-safety-light); color: var(--c-safety-ink); }
/* Route lines drawn in page illustrations (404, ride invite): the app's teal route */
.road__edge { fill: none; stroke: var(--c-border-strong); stroke-width: 30; stroke-linecap: round; }
.road { fill: none; stroke: var(--c-text-2); stroke-width: 26; stroke-linecap: round; }
.road__centre { fill: none; stroke: var(--c-bg); stroke-width: 2; stroke-dasharray: 10 12; }
.route-line { fill: none; stroke: var(--c-brand); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.route-line--thin { stroke-width: 3; }
.section-divider { width: 48px; height: 3px; background: var(--c-brand); border-radius: 2px; margin: var(--sp-16) auto 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--header-h);
  background-color: color-mix(in srgb, var(--c-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color var(--d-slow) var(--ease), border-color var(--d-slow) var(--ease), box-shadow var(--d-slow) var(--ease);
}
@supports not (background-color: color-mix(in srgb, red 50%, transparent)) { .site-header { background-color: var(--c-bg); } }
.site-header.is-scrolled, .site-header.is-open { border-bottom-color: var(--c-border); box-shadow: var(--shadow-sm); }
.site-header.is-open { background-color: var(--c-surface); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-16); }

.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px;
  text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.3125rem; letter-spacing: -0.02em; color: var(--c-text);
}
.brand__mark { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; box-shadow: 0 2px 8px rgba(15, 23, 29, 0.18); }
.brand__word { font-weight: 800; }
:root[data-theme="dark"] .brand__mark { box-shadow: 0 0 0 1px #3A4A55; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand__mark { box-shadow: 0 0 0 1px #3A4A55; } }

.site-nav__list { display: flex; align-items: center; gap: 2px; }
.site-nav__link {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: var(--r-full); font-size: var(--fs-small); font-weight: 700; color: var(--c-text-2); text-decoration: none;
  transition: color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease);
}
.site-nav__link:hover { color: var(--c-text); background: var(--c-surface-2); }
.site-nav__link[aria-current="page"] { color: var(--c-brand); background: var(--c-brand-light); font-weight: 800; }

.site-header__actions { display: flex; align-items: center; gap: var(--sp-8); }
.site-header__cta { min-height: 44px; padding: 10px 18px; border-radius: var(--r-full); }
.site-header__cta[aria-current="page"] { box-shadow: 0 0 0 2px var(--c-bg), 0 0 0 4px var(--c-brand); }

.theme-toggle-btn, .nav-toggle {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full); color: var(--c-text-2); border: 1px solid var(--c-border); background: var(--c-surface);
  transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.theme-toggle-btn:hover, .nav-toggle:hover { color: var(--c-text); border-color: var(--c-border-strong); }
.theme-toggle-btn svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle-btn .i-moon { display: block; }
.theme-toggle-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle-btn .i-sun { display: block; }
.nav-toggle { display: none; color: var(--c-text); }
.nav-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

.mobile-menu {
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 99;
  background-color: var(--c-surface); padding: var(--sp-16) var(--gutter) var(--sp-24);
  display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto; border-top: 1px solid var(--c-border);
}
.mobile-menu.is-entering { animation: menu-in var(--d-slow) var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mobile-menu[hidden] { display: none; }
.mobile-menu__list { display: flex; flex-direction: column; gap: 2px; }
.mobile-menu__link {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 14px;
  border-radius: var(--r-md); color: var(--c-text); text-decoration: none; font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.01em;
}
.mobile-menu__link:hover, .mobile-menu__link[aria-current="page"] { background-color: var(--c-brand-light); color: var(--c-brand); }
.mobile-menu__link svg { width: 18px; height: 18px; fill: currentColor; }
.mobile-menu__minor { display: flex; flex-wrap: wrap; gap: 0 var(--sp-8); margin-top: var(--sp-16); padding-top: var(--sp-16); border-top: 1px solid var(--c-border); }
.mobile-menu__minor a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--c-text-2); text-decoration: none; font-weight: 700; border-radius: var(--r-sm); }
.mobile-menu__minor a:hover, .mobile-menu__minor a[aria-current="page"] { color: var(--c-brand); background: var(--c-surface-2); }
.mobile-menu__foot { padding-top: var(--sp-24); display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 1100px) { .site-nav__link { padding: 0 10px; } }
@media (max-width: 980px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header__cta { padding: 10px 14px; }
}
@media (max-width: 380px) {
  .brand__word { display: none; }
  .site-header__cta { padding: 10px 12px; }
}
.when-wide { display: inline; }
.when-narrow { display: none; }
@media (max-width: 900px) { .when-wide { display: none; } .when-narrow { display: inline; } }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-16); text-align: left; }
.form-label { font-size: var(--fs-small); font-weight: 700; color: var(--c-text); }
.form-input, .form-textarea, .form-select {
  width: 100%; min-height: 48px; padding: 12px 14px; background-color: var(--c-surface); color: var(--c-text);
  border: 2px solid var(--c-border); border-radius: var(--r-md); font-size: var(--fs-body); font-weight: 600;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--c-text-3); }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--c-brand); box-shadow: var(--ring); }
.form-textarea { min-height: 120px; resize: vertical; }
.checkbox-label { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: var(--fs-small); color: var(--c-text-2); }
.checkbox-input { width: 20px; height: 20px; accent-color: var(--c-brand-fill); margin-top: 2px; flex-shrink: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background-color: var(--c-surface); border-top: 1px solid var(--c-border); padding-top: clamp(48px, 6vw, 80px); padding-bottom: var(--sp-40); }
.site-footer__top { display: grid; grid-template-columns: 1fr; gap: var(--sp-40); margin-bottom: var(--sp-40); }
@media (min-width: 900px) { .site-footer__top { grid-template-columns: 1.1fr 1.6fr; gap: var(--sp-64); } }
.site-footer__brand p { margin-top: var(--sp-16); color: var(--c-text-2); font-size: var(--fs-small); max-width: 34em; line-height: var(--lh-snug); }
.site-footer__motto { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--c-text) !important; font-size: 1.125rem !important; letter-spacing: -0.01em; }
.site-footer__motto::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c-safety); box-shadow: 0 0 0 4px var(--c-safety-light); }
.site-footer__nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-24); }
@media (min-width: 600px) { .site-footer__nav { grid-template-columns: repeat(3, 1fr); } }
.site-footer__heading { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: var(--tr-label); color: var(--c-text-3); font-weight: 800; margin-bottom: var(--sp-8); }
.site-footer__list { display: flex; flex-direction: column; gap: 0; }
.site-footer__list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-text-2); text-decoration: none; font-weight: 600; transition: color var(--d-fast) var(--ease); }
.site-footer__list a:hover, .site-footer__list a[aria-current="page"] { color: var(--c-brand); }
.site-footer__bottom {
  padding-top: var(--sp-24); border-top: 1px solid var(--c-border); display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; font-size: var(--fs-xs); color: var(--c-text-3);
}
.site-footer__bottom a { color: var(--c-text-2); }
@media (max-width: 540px) { .site-footer__bottom { flex-direction: column; align-items: flex-start; } }

/* ---------- Accordion ---------- */
.accordion { display: flex; flex-direction: column; gap: var(--sp-12); }
.accordion-item { background-color: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; }
.accordion-trigger { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; font-weight: 800; font-size: var(--fs-h4); color: var(--c-text); text-align: left; }
.accordion-trigger svg { width: 18px; height: 18px; fill: currentColor; transition: transform var(--d-base) var(--ease); }
.accordion-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.accordion-panel { padding: 0 22px 20px; color: var(--c-text-2); font-size: var(--fs-small); line-height: var(--lh-snug); }

/* ---------- Product-page primitives (safety, features, get, about) ---------- */
.hm-call {
  display: inline-flex; align-items: center; gap: var(--sp-8); width: fit-content; margin-top: var(--sp-16);
  padding: var(--sp-12) var(--sp-16); border-radius: var(--r-md); background: var(--c-safety-light); color: var(--c-safety-ink);
  border: 1px solid var(--c-safety-line); font-size: var(--fs-small); font-weight: 700; text-decoration: none;
}
.hm-call .icon { width: 18px; height: 18px; }
.hm-hero--page {
  position: relative; overflow: hidden;
  padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px);
  background:
    radial-gradient(900px 380px at 85% -10%, var(--c-brand-light), transparent 70%),
    linear-gradient(180deg, var(--c-surface) 0%, var(--c-bg) 100%);
  border-bottom: 1px solid var(--c-border);
}
.hm-hero__inner { max-width: 760px; }
.hm-hero--page h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); margin-bottom: var(--sp-16); letter-spacing: var(--tr-display); }
.hm-hero--page .t-lead { font-size: var(--fs-lead); color: var(--c-text-2); line-height: var(--lh-snug); }
.hm-head { margin-bottom: var(--sp-48); max-width: 720px; }
.hm-head h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-12); }
.hm-head > p { color: var(--c-text-2); font-size: var(--fs-lead); line-height: var(--lh-snug); margin-top: var(--sp-8); max-width: 60ch; }
.hm-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--sp-20); list-style: none; padding: 0; margin: 0; }
.hm-feature {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--sp-24);
  display: flex; flex-direction: column; gap: var(--sp-12);
  transition: transform var(--d-base) var(--ease), border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease);
}
.hm-feature:hover { transform: translateY(-2px); border-color: var(--c-accent-line); box-shadow: var(--shadow-md); }
.hm-feature__icon { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--c-brand-light); color: var(--c-brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hm-feature__icon .icon { width: 22px; height: 22px; }
.hm-feature--account .hm-feature__icon { background: var(--c-safety-light); color: var(--c-safety-ink); }
.hm-feature h3 { font-size: var(--fs-h4); margin: 0; }
.hm-feature p { font-size: var(--fs-small); color: var(--c-text-2); line-height: var(--lh-snug); margin: 0; }
.topo { position: relative; overflow: hidden; }

/* ==========================================================================
   3.55 motion system, shared by every page (the app's 120 / 180 / 260 ms, ease-out, no bounce).
   Everything below is decoration: with prefers-reduced-motion the content is simply there, still.
   ========================================================================== */

/* ---------- Reveal on scroll: [data-reveal] (site.js adds .is-in, staggers siblings with --reveal-delay) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { transition: opacity .6s var(--ease), transform .7s var(--ease); transition-delay: var(--reveal-delay, 0ms); }
  .js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(18px) scale(.985); }
  .js [data-reveal].is-instant { transition: none; }
  /* Once in place, the element's own hover transitions take over again (site.js adds .is-done). */
  .js [data-reveal].is-done { transition: transform var(--d-base) var(--ease), border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), background-color var(--d-base) var(--ease); }
}

/* ---------- Page to page: a soft cross-fade where the browser supports view transitions ----------
   The header keeps its place while the page underneath changes. Older browsers get site.js's short fade. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root) { animation: vt-out 160ms var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in 320ms var(--ease) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
  .is-leaving .site-main { opacity: 0; transform: translateY(6px); transition: opacity 150ms var(--ease), transform 150ms var(--ease); }
}

/* ---------- Press and hover micro-interactions ---------- */
.btn:active { transform: scale(.98); }
.link-arrow svg { transition: transform var(--d-base) var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Live dot (same as the home hero's): a steady green dot with a slow ping ---------- */
.live-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--c-live); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--c-live); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot::after { animation: live-ping 2.4s var(--ease) infinite; }
  @keyframes live-ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
}

/* ---------- iOS: building now, coming soon (shown while no App Store / TestFlight link is configured) ---------- */
.btn--soon, .btn--soon[aria-disabled="true"] {
  opacity: 1; cursor: default; pointer-events: auto; gap: 8px 10px; flex-wrap: wrap; white-space: normal; text-align: center;
  background: var(--c-surface); color: var(--c-text-2) !important; border: 1px dashed var(--c-border-strong); box-shadow: none;
}
.btn--soon:hover, .btn--soon:active { transform: none; background: var(--c-surface); border-color: var(--c-border-strong); color: var(--c-text-2) !important; }
.soon-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-full);
  background: var(--c-safety-light); color: var(--c-safety-ink); border: 1px solid var(--c-safety-line);
  font-size: var(--fs-label); font-weight: 800; letter-spacing: .04em; white-space: nowrap; line-height: 1.5;
}
.soon-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .soon-pill::before { animation: soon-blink 1.8s ease-in-out infinite; }
  @keyframes soon-blink { 50% { opacity: .25; } }
}
.site-footer__soon { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--c-text-2); font-weight: 600; }
.hm-cta .btn--soon, .hp-final .btn--soon { background: transparent; color: #FFFFFF !important; border-color: rgba(255, 255, 255, .6); }
.hm-cta .soon-pill, .hp-final .soon-pill { background: rgba(255, 255, 255, .14); color: #FFFFFF; border-color: rgba(255, 255, 255, .4); }

/* ---------- Route motif: the app's convoy on a mountain road, under every page hero ----------
   Inline SVG (partials/route-motif.html). Riders travel the route with CSS offset-path; without support,
   or with reduced motion, they wait in place along the road. */
.route-motif { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(96px, 13vw, 190px); z-index: 0; pointer-events: none; }
.route-motif svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rm-hill--far { fill: var(--c-hill-far); opacity: .55; }
.rm-hill--near { fill: var(--c-hill-near); opacity: .6; }
.rm-road { fill: none; stroke: var(--c-road-ink); stroke-width: 20; stroke-linecap: round; opacity: .9; }
.rm-centre { fill: none; stroke: var(--c-bg); stroke-width: 1.5; stroke-dasharray: 10 12; opacity: .7; }
.rm-route { fill: none; stroke: var(--c-brand); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 3 13; }
.rm-rider circle { stroke: var(--c-bg); stroke-width: 3; }
.rm-rider--1 circle { fill: var(--c-rider-d); } .rm-rider--2 circle { fill: var(--c-rider-b); } .rm-rider--3 circle { fill: var(--c-rider-c); }
.rm-rider--4 circle { fill: var(--c-rider-a); } .rm-rider--5 circle { fill: var(--c-rider-e); }
.rm-rider { visibility: hidden; }
@supports (offset-path: path("M0 0")) {
  .rm-rider {
    visibility: visible; offset-path: path("M-20 200 C 260 200 380 130 640 138 S 1040 210 1460 120"); offset-rotate: 0deg;
    offset-distance: var(--rm-at, 50%);
  }
  .rm-rider--1 { --rm-at: 64%; } .rm-rider--2 { --rm-at: 58%; } .rm-rider--3 { --rm-at: 53%; } .rm-rider--4 { --rm-at: 48%; } .rm-rider--5 { --rm-at: 42%; }
  @media (prefers-reduced-motion: no-preference) {
    .rm-route { animation: rm-march 1.4s linear infinite; }
    .rm-rider { animation: rm-ride 26s linear infinite; }
    .rm-rider--1 { animation-delay: -16.6s; } .rm-rider--2 { animation-delay: -15.1s; } .rm-rider--3 { animation-delay: -13.8s; }
    .rm-rider--4 { animation-delay: -12.5s; } .rm-rider--5 { animation-delay: -10.9s; }
    .is-offscreen .rm-rider, .is-offscreen .rm-route { animation-play-state: paused; }
  }
}
@keyframes rm-march { to { stroke-dashoffset: -16; } }
@keyframes rm-ride {
  0% { offset-distance: 0%; opacity: 0; }
  6% { opacity: 1; }
  94% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* ---------- CoRoute impact, live (home, and a compact strip on /safety and /features) ----------
   Hidden until site.js has at least two real numbers from /api/public/impact-stats. */
.imp[hidden], .imp [hidden] { display: none !important; }
.imp__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-16); }
.imp__head h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); }
.imp__head .imp__lead { margin-top: var(--sp-16); color: var(--c-text-2); font-size: var(--fs-lead); line-height: var(--lh-snug); max-width: 44rem; }
.imp__live {
  display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 14px 6px 12px; border-radius: var(--r-full);
  background: var(--c-surface); border: 1px solid var(--c-border); font-size: var(--fs-xs); font-weight: 800; color: var(--c-text-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.imp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-12); margin-top: clamp(24px, 4vw, 40px); }
@media (min-width: 760px) { .imp-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-16); } }
@media (min-width: 1024px) {
  .imp-grid--main { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .imp-grid--main > .imp-tile:first-child { grid-column: span 2; }
  .imp-grid--main > .imp-tile:first-child dd { font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.5rem); }
}
.imp-tile {
  position: relative; overflow: hidden; min-width: 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px;
  padding: var(--sp-20) var(--sp-20) var(--sp-24); border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-border);
  transition: border-color var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease), transform var(--d-base) var(--ease);
}
.imp-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--imp-c, var(--c-brand)); }
.imp-tile:hover { border-color: var(--c-accent-line); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.imp-tile dt { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); font-weight: 700; color: var(--c-text-2); line-height: 1.3; }
.imp-tile dt .icon { width: 18px; height: 18px; color: var(--imp-c, var(--c-brand)); }
.imp-tile dd { font-size: clamp(1.625rem, 1.2rem + 1.9vw, 2.625rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; color: var(--c-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.imp-tile dd small { font-size: .5em; font-weight: 800; letter-spacing: 0; color: var(--c-text-3); margin-left: 4px; }
.imp-tile--amber { --imp-c: var(--c-safety); }
.imp-tile--sos { --imp-c: var(--c-sos-ink); }
.imp-tile.is-updated { border-color: var(--c-accent-line); }
@media (prefers-reduced-motion: no-preference) {
  .imp-tile.is-updated::after { content: ""; position: absolute; inset: 0; background: var(--c-brand-glow); animation: imp-flash 1.2s var(--ease) both; pointer-events: none; }
  @keyframes imp-flash { from { opacity: 1; } to { opacity: 0; } }
}
/* Safety at work: a night band like the app's SOS screen */
.imp-safety {
  margin-top: clamp(24px, 4vw, 40px); padding: clamp(20px, 3.5vw, 40px); border-radius: var(--r-sheet);
  background: radial-gradient(600px 260px at 100% 0%, rgba(200, 16, 46, .22), transparent 70%), #0F171D; color: #C9D4DB; border: 1px solid #2A3842;
}
.imp-safety__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-12); }
.imp-safety__title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h3); color: #F2F6F8; }
.imp-safety__title .icon { width: 22px; height: 22px; color: #FF8A9A; }
.imp-safety__sub { margin-top: var(--sp-8); font-size: var(--fs-small); color: #9BAAB5; max-width: 44rem; }
.imp-safety .imp-grid { margin-top: var(--sp-20); }
.imp-safety .imp-tile { background: rgba(255, 255, 255, .04); border-color: #2A3842; }
.imp-safety .imp-tile:hover { border-color: #3A4A55; box-shadow: none; }
.imp-safety .imp-tile dt { color: #C9D4DB; }
.imp-safety .imp-tile dd { color: #F2F6F8; }
.imp-safety .imp-tile dd small { color: #9BAAB5; }
.imp-safety .imp-tile { --imp-c: #5CCAD3; }
.imp-safety .imp-tile--sos { --imp-c: #FF8A9A; }
.imp-safety .imp-tile--amber { --imp-c: #F0A070; }
.imp__note { margin-top: var(--sp-16); font-size: var(--fs-small); color: var(--c-text-3); max-width: 52rem; }
.imp__note .icon { width: 16px; height: 16px; margin-right: 6px; color: var(--c-brand); vertical-align: -3px; }
.imp__more { margin-top: var(--sp-8); }
/* Compact strip (/safety, /features) */
.imp--compact .imp__head h2 { font-size: var(--fs-h3); }
.imp--compact .imp-grid { margin-top: var(--sp-20); }
.imp--compact .imp-tile dd { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.125rem); }

/* ---------- Motion: respect the visitor's system setting ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .btn--primary:hover, .card--interactive:hover, .hm-feature:hover, .imp-tile:hover, .btn:active, .link-arrow:hover svg { transform: none; }
}
/* Windows high contrast: keep control outlines visible */
@media (forced-colors: active) {
  .btn, .theme-toggle-btn, .nav-toggle, .site-nav__link[aria-current="page"] { border: 1px solid ButtonText; }
}
@media print {
  .site-header, .mobile-menu, .site-footer__nav, .skip-link { display: none !important; }
  .site-main { padding-top: 0; }
  body { background: #FFFFFF; color: #000000; }
}
@media (max-width: 480px) {
  .btn--soon .soon-more { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}
