/* RideConnect website.

   Brand (PNGs/marketing/m04): Emerald #34D399, deep emerald #059669, Night #0A0D14, Slate #151921,
   emergency red #FF3B30 for SOS and crash content only, regroup gold #DAA520, Poppins SemiBold for
   headlines.

   Interface rules follow docs/Skill Reference/IOS_UI_SKILL.md:
   - The system font for text (Roboto on Android, like the app; SF on iPhone), with tracking and
     leading set per size. Poppins only for headlines, as the brand asks.
   - Light and dark follow the device setting.
   - Translucent chrome over content: the header, and the map pages' panel and bottom sheet.
   - Press feedback on pointer-down. Springs for anything the finger drags (assets/js/sheet.js).
   - Reduced motion, reduced transparency and more contrast are honoured at the end of this file.
   - Spacing in rem, so a larger text setting scales the layout with it. */

/* Served from this site, so no page calls a third party for type. Latin subset. SIL OFL 1.1. */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/poppins-600-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --header-h: 3.75rem;
  --panel-w: 23.5rem;
  --max: 70rem;
  --radius-xl: 1.75rem; /* sheets, large tiles */
  --radius-lg: 1.25rem; /* cards */
  --radius-md: 0.875rem; /* fields, grouped lists */
  --radius-sm: 0.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Light. Text colours pass WCAG AA on both --bg and --bg-raised. */
  --bg: #f4f5f7;
  --bg-raised: #ffffff;
  --bg-sunken: #eceef2;
  --group: rgba(116, 120, 132, 0.08); /* grouped list rows inside a card or panel */
  --fill: rgba(116, 120, 132, 0.12);
  --fill-strong: rgba(116, 120, 132, 0.2);
  --separator: rgba(17, 19, 24, 0.1);
  --text: #111318;
  --text-2: #4a505c;
  --text-3: #636a78;
  --tint: #047857; /* emerald for text and links: 5.5:1 on white */
  --tint-fill: #10b981; /* emerald behind --tint-ink */
  --tint-ink: #04291d;
  --tint-soft: rgba(16, 185, 129, 0.13);
  --tint-ring: rgba(4, 120, 87, 0.28);
  --blue: #1f6feb;
  --blue-soft: rgba(41, 121, 255, 0.12);
  --violet: #7c3aed;
  --violet-soft: rgba(139, 92, 246, 0.12);
  --amber: #b45309;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --gold: #daa520;
  --sos: #ff3b30; /* graphics: pins, rings, dots */
  --sos-fill: #d70015; /* behind white text: 5.4:1 */
  --sos-text: #b3140c;
  --sos-soft: rgba(255, 59, 48, 0.1);
  --danger: #c81e1e; /* form errors. Not the emergency red. */
  --danger-soft: rgba(239, 68, 68, 0.1);
  --material: rgba(250, 250, 252, 0.72);
  --material-thick: rgba(246, 247, 249, 0.86);
  --material-edge: rgba(255, 255, 255, 0.7);
  --card-edge: 0 0 0 1px rgba(17, 19, 24, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 19, 24, 0.06), 0 1px 1px rgba(16, 19, 24, 0.03);
  --shadow-md: 0 10px 28px rgba(16, 19, 24, 0.1), 0 2px 6px rgba(16, 19, 24, 0.06);
  --shadow-lg: 0 24px 64px rgba(16, 19, 24, 0.18), 0 6px 18px rgba(16, 19, 24, 0.08);
  --edge-shadow: rgba(16, 19, 24, 0.07);
  --grabber: rgba(60, 60, 67, 0.3);
  --map-bg: #e7ebe8;
  --mock-land: #e3e9e4;
  --mock-road: #ffffff;
  --mock-road-2: #d3dbd5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d14;
    --bg-raised: #151921;
    --bg-sunken: #0e1219;
    --group: rgba(255, 255, 255, 0.05);
    --fill: rgba(148, 156, 176, 0.14);
    --fill-strong: rgba(148, 156, 176, 0.24);
    --separator: rgba(255, 255, 255, 0.08);
    --text: #f2f4f7;
    --text-2: #9da3b4;
    --text-3: #7f8799;
    --tint: #34d399;
    --tint-fill: #34d399;
    --tint-ink: #04291d;
    --tint-soft: rgba(52, 211, 153, 0.14);
    --tint-ring: rgba(52, 211, 153, 0.45);
    --blue: #6ea8ff;
    --blue-soft: rgba(41, 121, 255, 0.18);
    --violet: #b9a2ff;
    --violet-soft: rgba(167, 139, 250, 0.16);
    --amber: #f5b742;
    --amber-soft: rgba(245, 183, 66, 0.14);
    --sos-text: #ff9b93;
    --sos-soft: rgba(255, 59, 48, 0.16);
    --danger: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --material: rgba(10, 13, 20, 0.66);
    --material-thick: rgba(23, 27, 36, 0.82);
    --material-edge: rgba(255, 255, 255, 0.07);
    --card-edge: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.6), 0 8px 22px rgba(0, 0, 0, 0.35);
    --edge-shadow: rgba(0, 0, 0, 0.35);
    --grabber: rgba(235, 235, 245, 0.3);
    --map-bg: #1a2230;
    --mock-land: #18211d;
    --mock-road: #2a3a33;
    --mock-road-2: #222f2a;
  }
}

/* ── Base ── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.5 var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
}

main { flex: 1; }

/* Tracking and leading change with size: tight and negative for display type, looser and
   neutral for text. Hierarchy comes from size, weight and leading together. */
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 600; color: var(--text); text-wrap: balance; }
h1, h2 { font-family: var(--font-display); }
h1 { font-size: clamp(1.875rem, 2.4vw + 1.2rem, 2.75rem); line-height: 1.08; letter-spacing: -0.028em; }
h2 { font-size: clamp(1.75rem, 2.6vw + 1rem, 3rem); line-height: 1.08; letter-spacing: -0.028em; }
h3 { font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.012em; }
h4 { font-size: 0.9375rem; line-height: 1.35; }
.display { font-size: clamp(2.75rem, 6.4vw + 1rem, 5.25rem); line-height: 1.02; letter-spacing: -0.04em; }
/* An h1 that looks like a section heading: the main heading of a small state panel. */
.h2 { font-size: clamp(1.5rem, 1.6vw + 1rem, 1.875rem); line-height: 1.15; letter-spacing: -0.022em; }

p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--tint); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration: underline; text-underline-offset: 0.15em; } }
img, svg { max-width: 100%; }

a, button, input, summary, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--tint-fill); outline-offset: 2px; border-radius: 0.375rem; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(1.125rem, 4vw, 2rem); }
.narrow { max-width: 46rem; }
.muted { color: var(--text-2); }
.small { font-size: 0.9375rem; line-height: 1.45; }
.fine { font-size: 0.8125rem; line-height: 1.4; letter-spacing: 0.005em; color: var(--text-3); }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.eyebrow {
  display: inline-block;
  margin-bottom: 0.625rem;
  font: 600 0.8125rem/1.2 var(--font-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tint);
}
.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; }

.skip-link { position: absolute; left: 0.75rem; top: -4rem; z-index: 2000; background: var(--tint-fill); color: var(--tint-ink); padding: 0.625rem 1rem; border-radius: 0.75rem; font-weight: 600; }
.skip-link:focus { top: 0.75rem; text-decoration: none; }

/* ── Header: a translucent layer the page scrolls under ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background-color 0.25s ease, -webkit-backdrop-filter 0.25s ease, backdrop-filter 0.25s ease;
}
/* At the top of the page nothing is underneath, so there is no material. site.js sets this. */
.site-header[data-at-top] { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* A soft edge where content meets the header, instead of a hard rule, and only once it overlaps. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.75rem;
  background: linear-gradient(var(--edge-shadow), transparent);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.site-header[data-at-top]::after { opacity: 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: 0.625rem; color: var(--text); font: 600 1.125rem/1 var(--font-display); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 1.75rem; height: 1.75rem; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.75rem); }
.nav .nav-link { color: var(--text-2); font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.005em; transition: color 0.15s ease; }
.nav .nav-link[aria-current="page"] { color: var(--text); }
@media (hover: hover) and (pointer: fine) { .nav .nav-link:hover { color: var(--text); text-decoration: none; } }
@media (max-width: 47.5rem) { .nav .nav-link { display: none; } }

/* ── Footer ── */

.site-footer {
  margin-top: clamp(4rem, 8vw, 6rem);
  padding: 2.5rem 0 3rem;
  background: var(--bg-sunken);
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.005em;
}
.site-footer .wrap { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 1.75rem; }
.site-footer .brand { margin-bottom: 0.875rem; font-size: 1rem; }
.site-footer p { margin: 0 0 0.375rem; }
.site-footer h4 { font-family: var(--font-text); font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.625rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: var(--text-2); }
@media (hover: hover) and (pointer: fine) { .site-footer a:hover { color: var(--text); } }
.site-footer .legal { grid-column: 1 / -1; margin: 0.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--separator); font-size: 0.75rem; color: var(--text-3); }
@media (max-width: 53.75rem) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .site-footer .wrap > :first-child { grid-column: 1 / -1; } }
@media (max-width: 32.5rem) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ── Buttons. Feedback is on the press, and it's instant. ── */

.btn {
  --btn-bg: var(--fill);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.375rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 1.0625rem/1 var(--font-text);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.25s var(--ease-out), filter 0.2s ease, opacity 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); filter: brightness(0.92); transition: transform 0.1s ease-out, filter 0.1s ease-out; }
@media (hover: hover) and (pointer: fine) { .btn:hover { filter: brightness(1.05); } .btn:active { filter: brightness(0.92); } }
.btn-primary { --btn-bg: var(--tint-fill); --btn-fg: var(--tint-ink); }
.btn-ghost { --btn-bg: var(--fill); --btn-fg: var(--text); }
.btn-tinted { --btn-bg: var(--tint-soft); --btn-fg: var(--tint); }
.btn-sos { --btn-bg: var(--sos-fill); --btn-fg: #fff; }
.btn-light { --btn-bg: rgba(255, 255, 255, 0.94); --btn-fg: #8a0d0d; }
.btn-small { min-height: 2.5rem; padding: 0 1rem; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.center-row { justify-content: center; margin-top: 0.5rem; }

/* A text button, as in an iOS navigation bar. */
.text-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  margin: 0 0 0 -0.375rem; padding: 0.5rem 0.375rem;
  border: 0; border-radius: 0.5rem; background: none;
  color: var(--tint); font: 600 1.0625rem/1 var(--font-text); letter-spacing: -0.01em; cursor: pointer;
  transition: opacity 0.2s ease;
}
.text-btn:active { opacity: 0.45; transition: opacity 0.05s linear; }
.text-btn svg { width: 1.125rem; height: 1.125rem; }

/* ── Surfaces ── */

.card {
  background: var(--bg-raised);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm), var(--card-edge);
}
.card + .card { margin-top: 1rem; }
.card h3 { margin-bottom: 0.5rem; }

/* ── Landing ── */

.hero { padding: clamp(3rem, 7vw, 6rem) 0 0; text-align: center; overflow: hidden; }
.hero .display span { color: var(--tint); }
.hero .lead {
  max-width: 36rem;
  margin: 1.25rem auto 2rem;
  font-size: clamp(1.1875rem, 0.6vw + 1rem, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.014em;
  color: var(--text-2);
}
.hero .btn-row { justify-content: center; }
.hero .fine { margin: 1rem 0 0; }
.hero-stage { position: relative; display: grid; place-items: center; margin-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: 3rem; }
.hero-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 6%;
  width: min(60rem, 140%);
  aspect-ratio: 2 / 1;
  background: radial-gradient(closest-side, rgba(16, 185, 129, 0.26), transparent);
}

.phone {
  position: relative;
  width: 18.75rem;
  height: 37.5rem;
  padding: 0.6875rem;
  border-radius: 2.875rem;
  background: linear-gradient(160deg, #2a303d, #0f1219);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 2.25rem; background: #0d1a14; text-align: left; }
.phone-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.phone-chip, .phone-voice {
  position: absolute;
  left: 0.875rem;
  right: 0.875rem;
  padding: 0.75rem 0.875rem;
  border-radius: 1.125rem;
  color: #f2f4f7;
  background: rgba(23, 27, 36, 0.66);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.phone-chip { top: 1rem; }
.phone-chip strong { display: block; font: 600 1rem/1.25 var(--font-display); letter-spacing: -0.015em; }
.phone-chip span { color: #aeb4c2; }
.phone-voice { bottom: 1rem; display: flex; align-items: center; gap: 0.625rem; }
.phone-voice .dot { width: 0.625rem; height: 0.625rem; flex: none; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0.375rem rgba(52, 211, 153, 0.2); }

.section { padding: clamp(4rem, 8vw, 7rem) 0 0; }
.section-head { max-width: 44rem; margin: 0 auto clamp(2rem, 4vw, 3.25rem); text-align: center; }
.section-head p { color: var(--text-2); font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.3125rem); line-height: 1.45; letter-spacing: -0.008em; margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 47.5rem) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--bg-raised); border-radius: var(--radius-xl); padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: var(--shadow-sm), var(--card-edge); }
.tile h3 { font-size: 1.3125rem; letter-spacing: -0.016em; margin-bottom: 0.5rem; }
.tile p { margin: 0; color: var(--text-2); }
.tile-icon { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; margin-bottom: 1.25rem; border-radius: 0.875rem; background: var(--tint-soft); color: var(--tint); }
.tile-icon svg { width: 1.5rem; height: 1.5rem; }
.tile.safe .tile-icon { background: var(--sos-soft); color: var(--sos); }
.tile.guided .tile-icon { background: var(--blue-soft); color: var(--blue); }
.tile.remembered .tile-icon { background: var(--violet-soft); color: var(--violet); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.step { counter-increment: step; background: var(--bg-raised); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm), var(--card-edge); }
.step::before { content: counter(step); display: block; margin-bottom: 0.875rem; font: 600 2.5rem/1 var(--font-display); letter-spacing: -0.04em; color: var(--tint); }
.step h3 { font-size: 1.0625rem; margin-bottom: 0.25rem; }
.step p { margin: 0; color: var(--text-2); font-size: 0.9375rem; line-height: 1.45; }
.steps-title { font: 600 1.1875rem/1.3 var(--font-text); letter-spacing: -0.012em; margin: 2.25rem 0 1rem; color: var(--text-2); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 55rem) { .split { grid-template-columns: 1fr; } }
.split h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem); }
.lead-2 { color: var(--text-2); font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem); line-height: 1.45; letter-spacing: -0.008em; }
.spaced { margin-top: 2rem; }

.feature-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; }
.feature-list li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.875rem; align-items: start; }
.feature-list li::before {
  content: "";
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.0625rem;
  border-radius: 50%;
  background: var(--tint-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 0.875rem no-repeat;
}
.feature-list strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.feature-list span { color: var(--text-2); font-size: 0.9375rem; line-height: 1.45; }

/* Safety mock: the crash countdown, drawn like the app's alert. */
.countdown-card { text-align: center; padding: 2.25rem 1.75rem; border-radius: var(--radius-xl); background: var(--bg-raised); box-shadow: var(--shadow-lg), var(--card-edge); max-width: 26rem; justify-self: center; width: 100%; }
.countdown-ring { width: 8.25rem; height: 8.25rem; margin: 0 auto 1.25rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--sos) 0 72%, var(--fill-strong) 72% 100%); }
.countdown-ring span { width: 6.75rem; height: 6.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); font: 600 2.75rem/1 var(--font-display); letter-spacing: -0.03em; }
.countdown-card h3 { font-size: 1.375rem; }
.countdown-card .btn-row { flex-wrap: nowrap; margin-top: 1.25rem; }
@media (max-width: 32.5rem) { .countdown-card .btn-row { flex-wrap: wrap; } }

/* Family mock: the live location page, in small. */
.family-mock { position: relative; height: 22rem; max-width: 26rem; width: 100%; justify-self: center; overflow: hidden; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--card-edge);
  background:
    linear-gradient(115deg, transparent 44%, var(--mock-road) 44%, var(--mock-road) 48%, transparent 48%),
    linear-gradient(20deg, transparent 58%, var(--mock-road-2) 58%, var(--mock-road-2) 61%, transparent 61%),
    linear-gradient(160deg, transparent 70%, var(--mock-road-2) 70%, var(--mock-road-2) 72%, transparent 72%),
    var(--mock-land);
}
.family-mock .rider-pin { position: absolute; left: calc(50% - 1.25rem); top: 30%; }
.family-mock .mini-sheet { position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; padding: 0.5rem 1rem 1rem; border-radius: 1.375rem; background: var(--material-thick); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-md), inset 0 1px 0 var(--material-edge); }
.mini-sheet .grab { display: block; width: 2.25rem; height: 0.3125rem; margin: 0 auto 0.75rem; border-radius: 999px; background: var(--grabber); }

.faq { background: var(--bg-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm), var(--card-edge); overflow: hidden; }
.faq details { padding: 0 1.25rem; }
.faq details + details > summary { border-top: 1px solid var(--separator); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.125rem 0; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 0.5625rem; height: 0.5625rem; margin-right: 0.25rem; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: translateY(-0.125rem) rotate(45deg); transition: transform 0.3s var(--ease-out); }
.faq details[open] > summary::after { transform: translateY(0.125rem) rotate(-135deg); }
.faq details p { color: var(--text-2); margin: 0; padding-bottom: 1.125rem; }
/* Where supported, the answer grows open instead of popping in. */
@supports (interpolate-size: allow-keywords) {
  .faq { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height 0.32s var(--ease-out), content-visibility 0.32s allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

.cta-band {
  text-align: center;
  padding: clamp(2.75rem, 6vw, 4.5rem) 1.5rem;
  border-radius: var(--radius-xl);
  background: radial-gradient(120% 140% at 50% 0%, rgba(16, 185, 129, 0.22), transparent 62%), var(--bg-raised);
  box-shadow: var(--shadow-sm), var(--card-edge);
}
.cta-band h2 { margin-bottom: 0.5rem; }
.cta-band p { margin: 0; }
.cta-band .btn-row { justify-content: center; margin-top: 1.75rem; }

/* ── Tool pages: join, live link, track ── */

.tool { padding: clamp(1.5rem, 4vw, 3rem) 0 0; }
.tool-head { margin-bottom: 1.25rem; }

.code-display { margin: 0.375rem 0 0.25rem; font: 600 clamp(2.5rem, 9vw, 3.75rem)/1 var(--font-display); letter-spacing: 0.06em; color: var(--tint); }

.state { text-align: center; padding: 3rem 1.5rem; }
.card.state { padding: 3rem 1.5rem; }
.state .icon { width: 4rem; height: 4rem; display: inline-grid; place-items: center; margin-bottom: 1rem; border-radius: 1.25rem; background: var(--fill); color: var(--text-3); }
.state .icon.tint { background: var(--tint-soft); color: var(--tint); }
.state .icon.warn { background: var(--amber-soft); color: var(--amber); }
.state .icon svg { width: 1.875rem; height: 1.875rem; }
.state p { color: var(--text-2); max-width: 29rem; margin-left: auto; margin-right: auto; }

.spinner { width: 2rem; height: 2rem; margin: 0 auto 0.875rem; border-radius: 50%; border: 3px solid var(--fill-strong); border-top-color: var(--tint-fill); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field input {
  min-height: 3.25rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--fill);
  color: var(--text);
  font: 600 1.1875rem/1 var(--font-text);
  letter-spacing: 0.06em;
  appearance: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder { color: var(--text-3); font-weight: 500; letter-spacing: 0.02em; opacity: 1; }
.field input:focus { outline: none; background: var(--bg-raised); border-color: var(--tint-fill); box-shadow: 0 0 0 4px var(--tint-soft); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
.field-error { margin: 0; color: var(--danger); font-size: 0.875rem; line-height: 1.4; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-md); padding: 0.875rem 1rem; margin-bottom: 1rem; font-size: 0.9375rem; }

.hint { margin: 0.75rem 0 1rem; font-size: 0.875rem; line-height: 1.45; color: var(--text-3); }
.notice { margin: 1.25rem 0; padding: 1rem 1.125rem; border-radius: var(--radius-md); background: var(--group); text-align: left; }
.notice strong { display: block; margin-bottom: 0.25rem; }
.notice p { margin: 0; color: var(--text-2); font-size: 0.9375rem; }

.join-card { text-align: center; padding: clamp(1.75rem, 5vw, 2.5rem) clamp(1.25rem, 4vw, 2rem); }
.join-label { margin: 1.25rem 0 0; font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.join-card .code-display { margin-bottom: 1rem; }
.join-actions { margin-top: 1.75rem; text-align: left; }
.join-actions .btn + .hint + .btn { margin-top: 0; }
.join-actions .btn-row { justify-content: center; }

.track-intro { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; align-items: start; }
.track-intro .card + .card { margin-top: 0; }
.track-intro h1 { margin-top: 0.25rem; }
@media (max-width: 53.75rem) { .track-intro { grid-template-columns: 1fr; } }

/* Status chips. Colour carries the state; the text always says it too. */
.chip { display: inline-flex; align-items: center; gap: 0.4375rem; padding: 0.3125rem 0.75rem; border-radius: 999px; background: var(--fill); color: var(--text-2); font: 600 0.8125rem/1.25 var(--font-text); letter-spacing: 0.01em; white-space: nowrap; }
.chip::before { content: ""; width: 0.5rem; height: 0.5rem; flex: none; border-radius: 50%; background: currentColor; }
.chip-live { background: var(--tint-soft); color: var(--tint); }
.chip-recent { background: var(--amber-soft); color: var(--amber); }
.chip-stale, .chip-ended { color: var(--text-2); }
.chip-sos { background: var(--sos-fill); color: #fff; }
.chip-sos::before { background: #fff; }

.avatar { width: 3rem; height: 3rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--tint-soft); color: var(--tint); box-shadow: inset 0 0 0 2px var(--tint-ring); font: 600 1.1875rem/1 var(--font-display); }
.avatar.sos { background: var(--sos-soft); color: var(--sos-text); box-shadow: inset 0 0 0 2px var(--sos); }
.avatar.faded { background: var(--fill); color: var(--text-3); box-shadow: none; }

.rider-card { display: grid; grid-template-columns: 3rem 1fr; gap: 0.875rem; align-items: center; }
.rider-name { font: 600 1.25rem/1.2 var(--font-display); letter-spacing: -0.018em; }
.meta-line { color: var(--text-2); font-size: 0.9375rem; line-height: 1.4; }

/* Grouped rows, as in iOS Settings: label on the left, value on the right. */
.detail-grid { margin: 1rem 0 0; padding: 0 1rem; border-radius: var(--radius-md); background: var(--group); }
.detail-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; min-height: 2.875rem; }
.detail-grid > div + div { border-top: 1px solid var(--separator); }
.detail-grid dt { color: var(--text-2); font-size: 0.9375rem; white-space: nowrap; }
.detail-grid dd { margin: 0; font-weight: 500; text-align: right; }

/* Title and the call button on one line, the explanation under both: as little map hidden as
   the message allows. */
.sos-banner { display: grid; grid-template-columns: 1fr auto; gap: 0.375rem 0.75rem; align-items: center; padding: 0.875rem 1rem 1rem 1.125rem; border-radius: var(--radius-lg); background: var(--sos-fill); color: #fff; box-shadow: var(--shadow-md); }
.sos-banner strong { grid-column: 1; grid-row: 1; font: 600 1.0625rem/1.3 var(--font-text); letter-spacing: -0.01em; }
.sos-banner .btn { grid-column: 2; grid-row: 1; min-height: 2.25rem; padding: 0 0.875rem; }
.sos-banner span { grid-column: 1 / -1; grid-row: 2; font-size: 0.875rem; line-height: 1.4; color: rgba(255, 255, 255, 0.92); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin: 0.875rem 0; color: var(--text-3); font-size: 0.875rem; }
.card-actions { margin-top: 1rem; }
.page-note { margin-top: 1rem; }
.ended-details { max-width: 29rem; margin: 1.5rem auto 1.75rem; text-align: left; }
.detail-prompt { margin: 0; }

/* ── Map pages: the map fills the screen, the details float over it ──
   Desktop: a translucent panel on the left, a parallel task with no dimming.
   Phone: a bottom sheet with three resting heights, dragged with springs (assets/js/sheet.js). */

body.has-map { height: 100vh; height: 100dvh; overflow: hidden; }
.has-map .site-footer { display: none; }
.has-map .site-header { position: fixed; left: 0; right: 0; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.has-map .site-header::after { opacity: 0; }
.has-map main.tool { padding: 0; }

.has-map .map-view { position: fixed; inset: 0; }
.map-stage { display: none; }
/* Its own stacking context, so Leaflet's controls (z-index up to 1000) stay under the panel. */
.has-map .map-stage { display: block; position: absolute; inset: 0; z-index: 0; isolation: isolate; background: var(--map-bg); }
.map-stage .map { position: absolute; inset: 0; }
.map-empty { position: absolute; inset: 0; display: grid; place-content: start center; padding: calc(var(--header-h) + 18vh) 1.5rem 0; text-align: center; color: var(--text-2); }
.map-empty p { max-width: 22rem; margin: 0 auto; }
@media (min-width: 47.5625rem) { .map-empty { padding-left: calc(var(--panel-w) + 2.5rem); padding-top: calc(var(--header-h) + 22vh); } }

.map-alert { margin-bottom: 1rem; }
.has-map .map-alert { position: absolute; z-index: 800; margin: 0; top: calc(var(--header-h) + 0.75rem); left: 0.75rem; right: 0.75rem; }
@media (min-width: 47.5625rem) { .has-map .map-alert { left: calc(var(--panel-w) + 2rem); right: 1rem; max-width: 36rem; } }

/* Outside a map page (a ride that hasn't started or has ended) the panel is plain page content. */
.panel-grabber { display: none; }
.panel-title { margin: 0; font: 600 1.375rem/1.2 var(--font-display); letter-spacing: -0.02em; }
.panel-section { margin-top: 1.25rem; }
.panel-foot { display: none; }
.has-map .panel-foot { display: block; margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--separator); font-size: 0.75rem; line-height: 1.5; color: var(--text-3); }
.panel-foot p { margin: 0 0 0.375rem; }
.panel-foot a { color: var(--text-2); }

.has-map .panel {
  position: absolute;
  z-index: 900;
  top: calc(var(--header-h) + 1rem);
  left: 1rem;
  bottom: 1rem;
  width: var(--panel-w);
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--material-thick);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--material-edge);
}
.has-map .panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.25rem 1.5rem; border-radius: inherit; }

@media (max-width: 47.5rem) {
  .has-map .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: calc(100dvh - var(--header-h) - 0.5rem);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translate3d(0, 55%, 0);
    will-change: transform;
    touch-action: none;
  }
  /* Below the sheet, so a springy settle never shows a gap under it. */
  .has-map .panel::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 50vh; background: var(--material-thick); }
  .has-map .panel-grabber {
    display: flex;
    flex: none;
    justify-content: center;
    width: 100%;
    height: 1.625rem;
    padding: 0.5rem 0 0;
    border: 0;
    background: none;
    cursor: grab;
    touch-action: none;
  }
  .has-map .panel-grabber::before { content: ""; width: 2.25rem; height: 0.3125rem; border-radius: 999px; background: var(--grabber); }
  /* touch-action is checked up to the nearest scroll container, which this is, so it has to say
     "none" itself for drags on its content to reach the sheet. */
  .has-map .panel-scroll { overflow: hidden; touch-action: none; padding: 0.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); border-radius: 0; }
  .has-map .panel[data-detent="full"] .panel-scroll { overflow-y: auto; touch-action: pan-y; }
  .has-map .panel.dragging { cursor: grabbing; }
}

/* As page content (a ride not started or ended), the panel's title is the page's heading. */
body:not(.has-map) .panel .panel-title { font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem); line-height: 1.1; letter-spacing: -0.026em; }

/* The panel's own two screens on the Track rider page: the list, and one rider. */
.list-title { margin: 0 0 0.625rem; font: 600 1.0625rem/1.3 var(--font-text); letter-spacing: -0.01em; }
.list-title .muted { font-weight: 500; }

/* The status chip sits on the eyebrow's line, so the name and destination get the full width. */
.ride-head { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 1rem; }
.ride-head > div { display: contents; }
.ride-head .eyebrow { grid-column: 1; grid-row: 1; margin-bottom: 0.375rem; }
.ride-head .chip { grid-column: 2; grid-row: 1; align-self: start; }
.ride-head h1 { grid-column: 1 / -1; }
.ride-head p { grid-column: 1 / -1; margin: 0.25rem 0 0; }
.ride-actions { margin-top: 1rem; }

.live-head { display: grid; grid-template-columns: 3rem 1fr auto; gap: 0.875rem; align-items: center; }
.live-head .meta-line { margin-top: 0.125rem; }
.live-sub { margin: 0.875rem 0 0; }

.rider-list { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-md); background: var(--group); overflow: hidden; }
.rider-list button {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto 0.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6875rem 0.875rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.rider-list li + li button::before { content: ""; position: absolute; top: 0; right: 0; left: 4.125rem; height: 1px; background: var(--separator); }
.rider-list button:active { background: var(--fill-strong); transition: none; }
@media (hover: hover) and (pointer: fine) { .rider-list button:hover { background: var(--fill); } }
.rider-list button[aria-pressed="true"] { background: var(--tint-soft); }
.rider-list .avatar { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.rider-list .name, .rider-list .sub { display: block; }
.rider-list .name { font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rider-list .sub { color: var(--text-2); font-size: 0.8125rem; line-height: 1.35; }
.rider-list .chip { font-size: 0.75rem; padding: 0.25rem 0.625rem; }
.rider-list .chev { width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--text-3); border-top: 2px solid var(--text-3); transform: rotate(45deg); opacity: 0.7; }

/* Rider pins on the map (Leaflet divIcon). */
.rider-pin { background: none; border: none; }
.rider-pin span {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #34d399;
  color: #04291d;
  font: 600 1rem/1 var(--font-display);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease-out);
}
.rider-pin.live span { animation: pulse 2s ease-out infinite; }
.rider-pin.recent span { background: #f5b742; color: #2e1800; }
.rider-pin.stale span { background: #8a93a3; color: #10131a; }
.rider-pin.sos span { background: var(--sos); color: #fff; }
.rider-pin.selected span { transform: scale(1.18); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35); } 100% { box-shadow: 0 0 0 1.125rem rgba(52, 211, 153, 0), 0 6px 18px rgba(0, 0, 0, 0.35); } }

/* Leaflet, restyled as floating material controls. */
.leaflet-container { background: var(--map-bg); font: 500 0.75rem/1.4 var(--font-text); }
.has-map .leaflet-top { top: calc(var(--header-h) + var(--alert-h, 0px)); transition: top 0.25s var(--ease-out); }
.leaflet-touch .leaflet-bar, .leaflet-bar { border: 0 !important; border-radius: 0.875rem !important; overflow: hidden; box-shadow: var(--shadow-md) !important; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 2.5rem !important; height: 2.5rem !important; line-height: 2.5rem !important; background: var(--material-thick); color: var(--text); border-bottom-color: var(--separator) !important; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.leaflet-bar a:hover { background: var(--bg-raised); color: var(--text); }
.leaflet-control-attribution { font-size: 0.6875rem; color: var(--text-2) !important; background: var(--material) !important; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 0 0 0 0.5rem; }
.leaflet-control-attribution a { color: var(--tint) !important; }
@media (max-width: 47.5rem) { .leaflet-control-zoom { display: none; } }
/* OpenStreetMap only draws light tiles. In dark mode they're inverted so the map doesn't glare. */
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.88) contrast(0.92) saturate(0.7); }
}

/* ── Legal pages ── */

.legal-doc { padding: clamp(2rem, 5vw, 3.5rem) 0 0; }
.legal-doc h1 { font-size: clamp(2.125rem, 3vw + 1rem, 3rem); }
.legal-doc h2 { font-size: clamp(1.375rem, 1vw + 1rem, 1.625rem); letter-spacing: -0.02em; margin-top: 2.25em; padding-top: 0.75em; border-top: 1px solid var(--separator); }
.legal-doc h3 { font-size: 1.125rem; margin-top: 1.75em; }
.legal-doc p, .legal-doc li { color: var(--text-2); }
.legal-doc strong { color: var(--text); }
.legal-doc ul, .legal-doc ol { padding-left: 1.4em; }
.legal-doc li + li { margin-top: 0.4em; }
.legal-doc hr { border: none; border-top: 1px solid var(--separator); margin: 2.25em 0; }
/* The markdown puts a --- before most sections; one divider is enough. */
.legal-doc hr + h2 { border-top: none; padding-top: 0; margin-top: 0; }
.legal-doc blockquote { margin: 1.25em 0; padding: 0.875rem 1.125rem; border-radius: var(--radius-md); background: var(--amber-soft); }
.legal-doc blockquote p { margin: 0; color: var(--text); }
.legal-doc .table-scroll { overflow-x: auto; margin: 1em 0 1.5em; border-radius: var(--radius-md); box-shadow: var(--card-edge); }
.legal-doc table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; background: var(--bg-raised); }
.legal-doc th, .legal-doc td { padding: 0.625rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--separator); }
.legal-doc th { background: var(--group); font-weight: 600; }
.legal-doc mark.todo { background: var(--amber-soft); color: var(--amber); padding: 0 0.25rem; border-radius: 0.25rem; }

/* ── Preferences ── */

/* Reduced motion: no scaling, sliding or pulsing. Colour and opacity changes stay, because they
   still say what happened. The sheet follows the finger and settles without bounce (sheet.js). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active { transform: none; }
  .rider-pin.live span { animation: none; }
  .rider-pin span { transition: none; }
  .faq summary::after { transition: none; }
  .has-map .leaflet-top { transition: none; }
}
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: reduce) { .faq details::details-content { transition: none; } }
}

/* Reduced transparency: solid surfaces, no blur. */
@media (prefers-reduced-transparency: reduce) {
  :root { --material: var(--bg); --material-thick: var(--bg-raised); }
  .site-header, .has-map .panel, .phone-chip, .phone-voice, .family-mock .mini-sheet, .leaflet-bar a, .leaflet-control-attribution { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .phone-chip, .phone-voice { background: #171b24; }
}

/* More contrast: near-solid surfaces with a defined edge, and stronger secondary text. */
@media (prefers-contrast: more) {
  :root { --material: var(--bg); --material-thick: var(--bg-raised); --separator: rgba(17, 19, 24, 0.35); --text-2: #2f343d; --text-3: #474d59; --fill: rgba(116, 120, 132, 0.2); }
  .card, .tile, .step, .faq, .cta-band, .has-map .panel, .countdown-card, .family-mock { box-shadow: 0 0 0 1px var(--text-3); }
  .btn-ghost { box-shadow: inset 0 0 0 1px var(--text-3); }
  .field input { border-color: var(--text-3); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --separator: rgba(255, 255, 255, 0.3); --text-2: #c9ced8; --text-3: #aab1bf; --fill: rgba(148, 156, 176, 0.26); }
}
