/* Peta Maps homepage, "the drive". The page is the app: a drawn map you
   drive by scrolling, with the app's own sheets, guidance banner and buttons on top.
   Loads after brand.css (tokens, type scale, components from design/brand/BRAND.md). Light and dark follow the
   system appearance; the drawn map uses the map/* tokens, so it turns into the app's night map too. */

:root {
  --gx: 0.625rem;              /* page gutter on phones */
  /* the gutter, kept clear of the notch, rounded corners and home indicator (viewport-fit=cover) */
  --gx-l: max(var(--gx), env(safe-area-inset-left, 0px));
  --gx-r: max(var(--gx), env(safe-area-inset-right, 0px));
  --gx-t: max(var(--gx), env(safe-area-inset-top, 0px));
  --gx-b: max(var(--gx), env(safe-area-inset-bottom, 0px));
  --sheet-w: 100%;
  /* drawn-map shades between the map/* tokens (casings, rail, hills, highway edge) */
  --map-casing-minor: #DADDD6; --map-casing-major: #CBD0C8; --map-rail: #A3AAB4; --map-hill: #E3EEDD;
  --map-hw-casing: #E9B455; --map-water-label: #4A7DAE; --map-border: #C4CCD7; --map-state: #C3C8CC;
  --map-shadow: drop-shadow(0 3px 6px rgb(11 15 23 / .25));
}
@media (prefers-color-scheme: dark) {
  :root {
    --map-casing-minor: #0E131A; --map-casing-major: #0A0E14; --map-rail: #4D586B; --map-hill: #16211A;
    --map-hw-casing: #1A212D; --map-water-label: #6F9BC7; --map-border: #343E50; --map-state: #2C3544;
    --map-shadow: drop-shadow(0 3px 8px rgb(0 0 0 / .6));
  }
}

/* Lenis's recommended CSS (vendor/lenis/lenis.css, MIT), inlined here so it isn't a separate render-blocking request. */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent], .lenis [data-lenis-prevent-wheel], .lenis [data-lenis-prevent-touch], .lenis [data-lenis-prevent-vertical], .lenis [data-lenis-prevent-horizontal] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }
/* app.js: no transitions until the first frame has put every overlay in place (see 'boot' there) */
.boot *, .boot *::before, .boot *::after { transition: none !important; animation: none !important; }

/* Without Lenis (script blocked or failed) anchors still glide; with reduced motion they jump. */
@media (prefers-reduced-motion: no-preference) { html:not(.lenis) { scroll-behavior: smooth; } }
body { background: var(--map-land); }
h1, h2 { font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
/* Web display sizes extend Display/Large (32/38, -2%) and Title/XL (26/32, -1.5%) for the marketing page. */
h1 { font-size: clamp(2.25rem, 1.7rem + 2.3vw, 3.5rem); line-height: 1.04; letter-spacing: -0.025em; font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(1.625rem, 1.35rem + 1.1vw, 2.25rem); line-height: 1.12; letter-spacing: -0.02em; font-variation-settings: "opsz" 60; }
h3 { font: var(--type-title-s); }

/* ---------- stage: fixed drawn map + car ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; z-index: 0; background: var(--map-land); }
.map { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map svg { width: 3000px; height: 6400px; }
.map-top { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map .land { fill: var(--map-land); }
.map .hill path { fill: var(--map-hill); }
.map .landuse rect { fill: var(--map-building); }
.map .park path { fill: var(--map-park); }
.map .waterfill path { fill: var(--map-water); }
.map .water { fill: none; stroke: var(--map-water); stroke-linecap: round; stroke-linejoin: round; }
.map .border { fill: none; stroke: var(--map-border); stroke-width: 2.5; stroke-dasharray: 12 8; }
.map .minorC { fill: none; stroke: var(--map-casing-minor); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.map .minor { fill: none; stroke: var(--map-road); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.map .majorC { fill: none; stroke: var(--map-casing-major); stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.map .major { fill: none; stroke: var(--map-road); stroke-width: 9.5; stroke-linecap: round; stroke-linejoin: round; }
.map .rail { fill: none; stroke: var(--map-rail); stroke-width: 3; stroke-dasharray: 10 7; }
.map .hwC { fill: none; stroke: var(--map-hw-casing); stroke-width: 17; stroke-linecap: round; stroke-linejoin: round; }
.map .hw { fill: none; stroke: var(--map-road-major); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.map text, .map-top text { font-family: var(--font-text); }
.map .lt { font-size: 15px; font-weight: 700; letter-spacing: 2.5px; fill: var(--map-label); paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; }
.map .lt.big { font-size: 22px; letter-spacing: 4px; }
/* under 360 px the logo chip sits right over "KUALA LUMPUR"; the Suria KLCC label still marks the start */
@media (max-width: 22.49em) { .map .lt.kl { display: none; } }
.map .lr { font-size: 13px; font-weight: 600; fill: var(--map-label); paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; }
.map .lp { font-size: 14px; font-weight: 700; fill: var(--text-primary); paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; }
.map .lw { font-size: 14px; font-style: italic; font-weight: 600; fill: var(--map-water-label); }
.map .ls { font-size: 26px; font-weight: 700; letter-spacing: 9px; fill: var(--map-state); }
.map .lpoi { font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--map-land); stroke-width: 3px; }
.map .stn circle { fill: var(--map-road); stroke: var(--map-label); stroke-width: 2; }
.map .stn path { fill: none; stroke: var(--map-label); stroke-width: 1.6; stroke-linecap: round; }
.map .shield rect { fill: #FFD43B; stroke: #C9A100; stroke-width: 1; }
.map .shield text { font-size: 11px; font-weight: 800; fill: #131924; }
/* route line as drawn in the v2 driving screens: a 12 px line inside a thick 22 px darker casing */
.map-top .route-casing { fill: none; stroke: var(--route-casing); stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.map-top .route, .map-top .route-slow, .map-top .route-heavy { fill: none; stroke: var(--route-primary); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.map-top .route-slow { stroke: var(--traffic-slow); }
.map-top .route-heavy { stroke: var(--traffic-heavy); }
.map .clutter { opacity: 0; transition: opacity .45s var(--ease); }
.map .clutter.on { opacity: 1; }
.map #clutter-traffic path { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.map-top .stop { opacity: 0; transition: opacity .35s var(--ease); }
.map-top .stop.on { opacity: 1; }
.map-top .detour { fill: none; stroke: var(--route-primary); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1.5px var(--route-casing)); }
.map-top .waypoint circle { fill: var(--bg-surface); stroke: var(--category-rest); stroke-width: 4; }
.map-top .waypoint .in { fill: var(--category-rest); stroke: none; }
.map-top .lwp { font-size: 14px; font-weight: 700; fill: var(--text-primary); paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; }
.map-top .origin circle { fill: var(--bg-surface); stroke: var(--icon-secondary); stroke-width: 3.5; }
.map-top .dest path { fill: var(--bg-brand); stroke: #fff; stroke-width: 2.5; }
.map-top .dest .in { fill: #fff; }
/* driver report pins (hazard badge on a white ring, tail to the road) */
.map-top .rpin { filter: drop-shadow(0 3px 6px rgb(11 15 23 / .18)); transition: opacity .35s var(--ease); }
.map-top .rpin.past { opacity: 0; }
/* pins drop in when their alert starts */
.js .map-top .rpin-in { transform-box: fill-box; transform-origin: 50% 100%; transform: translateY(-14px) scale(.3); opacity: 0; transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .2s var(--ease); }
.js .map-top .rpin.near .rpin-in { transform: none; opacity: 1; }
.map-top .rpin-tail { fill: #fff; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
/* turn arrows: white with a dark edge, along the route through the next turn */
.map-top .turn-arrow { transition: opacity .3s var(--ease); }
.map-top .turn-arrow.past { opacity: 0; }
.map-top .turn-arrow path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map-top .turn-arrow polygon { stroke-linejoin: round; }
.map-top .turn-arrow .ta-edge { stroke: #131924; }
.map-top .turn-arrow path.ta-edge { stroke-width: 19; }
.map-top .turn-arrow polygon.ta-edge { fill: #131924; stroke-width: 7; }
.map-top .turn-arrow path.ta-fill { stroke: #fff; stroke-width: 12; }
.map-top .turn-arrow polygon.ta-fill { fill: #fff; stroke: #fff; stroke-width: 1.5; }

/* the car: the app's v2 car puck seen from above, nose up (assets/map/car-puck.svg, shadow included) */
.car { position: absolute; left: 0; top: 0; width: 4.8rem; height: 6.75rem; margin: -3.375rem 0 0 -2.4rem; will-change: transform; }
.car img { display: block; width: 100%; height: 100%; }

/* ---------- header: logo in a floating pill, like the app's search pill ---------- */
.bar { position: fixed; z-index: 10; top: var(--gx-t); left: var(--gx-l); right: var(--gx-r); display: flex; align-items: center; justify-content: space-between; gap: .75rem; pointer-events: none; transition: transform .3s var(--ease); }
.brand { pointer-events: auto; display: flex; align-items: center; min-height: 3rem; padding: .5rem 1rem .5rem .5rem; background: var(--bg-surface); border-radius: var(--radius-full); box-shadow: var(--elev-2); }
.brand .lockup { height: 2rem; width: auto; }
.brand .mark { display: none; height: 2rem; width: 2rem; }
.bar-ctas { pointer-events: auto; flex-wrap: nowrap; --store-h: 3rem; }
/* One primary action per view: with scripts on, the header button starts fully hidden and only fades in (solid) once
   the hero's button has left the screen (app.js adds .is-shown), so it is never seen half-faded on load. Without
   scripts it simply stays visible. */
#bar-ctas { transition: opacity .18s var(--ease), visibility 0s linear .18s; }
.js #bar-ctas:not(.is-shown) { opacity: 0; visibility: hidden; }
#bar-ctas.is-shown { transition: opacity .18s var(--ease), visibility 0s; }

/* ---------- guidance banner (HUD): guidance/bg, "then" in guidance/bg-deep ---------- */
.hud { position: fixed; z-index: 6; left: var(--gx-l); right: var(--gx-r); top: calc(var(--gx-t) + 3.5rem); margin: 0 auto; max-width: 30rem; color: var(--guidance-text); background: var(--guidance-bg); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--elev-2); transition: opacity .3s var(--ease), visibility .3s, transform .3s var(--ease); }
.hud [data-part] { position: relative; }
.g-main { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.125rem; }
.g-icon { flex: none; width: 2.75rem; height: 2.75rem; }
.g-icon path, .g-then-icon path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.g-copy { min-width: 0; }
.g-dist { font: var(--type-guidance-distance); letter-spacing: var(--track-guidance-distance); font-variant-numeric: tabular-nums; }
.g-text { font: 700 1.1875rem/1.25 var(--font-text); letter-spacing: -0.005em; margin-top: .125rem; }
.g-then { display: flex; align-items: center; gap: .625rem; padding: .625rem 1.125rem .75rem; background: var(--guidance-bg-deep); font: var(--type-label-m); }
.g-then-icon { flex: none; width: 1.375rem; height: 1.375rem; }
.g-then-text { flex: 1; min-width: 0; }
.g-then-after { flex: none; font: var(--type-caption); color: var(--guidance-text-muted); }
.hud.swap .g-main { animation: swap .32s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.hud [data-part].hl::after { content: ""; position: absolute; inset: 3px; border: 2px solid rgb(255 255 255 / .9); border-radius: var(--radius-md); pointer-events: none; }
.hud.uturn { background: #222A38; }
.hud.uturn .g-then { display: none; }
/* phones: the banner folds to one band outside the hero and guidance sections */
.hud.compact .g-then { display: none; }
.hud.compact .g-main { padding: .625rem .875rem; gap: .75rem; }
.hud.compact .g-icon { width: 2.125rem; height: 2.125rem; }
.hud.compact .g-dist { font-size: 1.5rem; line-height: 1.1; }
.hud.compact .g-text { font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- trip bar: Display/ETA time left, caption meta ---------- */
.trip { position: fixed; z-index: 6; left: var(--gx-l); right: var(--gx-r); bottom: var(--gx-b); margin: 0 auto; max-width: 30rem; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: .75rem; padding: .625rem 1.125rem; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--elev-2); transition: opacity .3s var(--ease), visibility .3s; }
.trip-time { font: 700 1.75rem/1.1 var(--font-display); color: var(--text-primary); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trip-meta { font: var(--type-body-m); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-delta { position: absolute; right: .875rem; top: 50%; transform: translateY(-50%); font: var(--type-label-s); padding: .25rem .5rem; border-radius: var(--radius-xs); background: var(--bg-brand-subtle); color: var(--text-brand); opacity: 0; transition: opacity .3s; }
.trip-delta.show { opacity: 1; }
/* while the "+4 min" badge shows, the details beside the time make room for it instead of running under it */
.trip:has(.trip-delta.show) .trip-meta { padding-right: 4.75rem; }
/* room for the longest time ("2 hr 44 min"), so the details beside it don't move as the minutes count down */
.trip-time { min-width: 4.9em; transition: color .3s; }
.trip-time.late { color: var(--text-warning); }
/* alert ahead pill, under the guidance card (top set by app.js from the card's height) */
.nav-alert { position: fixed; z-index: 6; left: var(--gx-l); right: var(--gx-r); top: 0; margin: 0 auto; max-width: 30rem; pointer-events: none; transition: opacity .3s var(--ease), visibility .3s; }
.nav-alert-pill { display: inline-flex; align-items: center; gap: .625rem; padding: .375rem 1.125rem .375rem .375rem; background: var(--bg-surface); border-radius: var(--radius-full); box-shadow: var(--elev-2); }
.nav-alert-pill img { width: 2.5rem; height: 2.5rem; }
.nav-alert-copy { display: grid; }
.nav-alert-title { font: var(--type-label-m); color: var(--text-primary); }
.nav-alert-dist { font: var(--type-label-s); font-variant-numeric: tabular-nums; }
.tone-danger.nav-alert-dist, .tone-danger.al-dist { color: var(--text-danger); }
.tone-warning.nav-alert-dist, .tone-warning.al-dist { color: var(--text-warning); }
.tone-muted.nav-alert-dist, .tone-muted.al-dist { color: var(--text-secondary); }
.tone-brand.nav-alert-dist, .tone-brand.al-dist { color: var(--text-brand); }
body.parked .hud, body.parked .trip, body.parked .nav-alert { opacity: 0; visibility: hidden; }
/* phones (and phones on their side): the reading sheets fill the screen under the card, so the pill would sit on
   their text; the pins still show. Same query as pillMQ in app.js. */
@media (max-width: 39.99em), (max-height: 30em) { .nav-alert { display: none; } }
/* the card and trip bar only show the drive (aria-hidden, no controls): taps go through to the page underneath */
.hud, .trip { pointer-events: none; }

/* traffic on your route: a strip of the next 17 km, the car moving along it with the map */
.tmeter { padding: 1rem 1.125rem 1.125rem; --c: 0; }
.tm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.tm-label { font: var(--type-label-s); color: var(--text-secondary); }
.tm-eta { font: 700 1.375rem/1.1 var(--font-display); color: var(--text-success); font-variant-numeric: tabular-nums; transition: color .4s var(--ease); }
.tm-eta.late { color: var(--text-warning); }
.tm-track { position: relative; height: .75rem; margin: 2.75rem .25rem 1.25rem; border-radius: 99px; background: var(--route-primary); box-shadow: inset 0 0 0 2px rgb(0 0 0 / .12); }
.tm-seg { position: absolute; top: 0; bottom: 0; }
/* 6.3–31 km (TM_A–TM_B in app.js): slow 17–27.5 km, heavy 27.5–30 km, accident at 30 km */
.tm-slow { left: 43.32%; width: 42.51%; background: var(--traffic-slow); }
.tm-heavy { left: 85.83%; width: 10.12%; background: var(--traffic-heavy); }
.tm-pin { position: absolute; left: 95.95%; bottom: 100%; width: 1.75rem; height: 1.75rem; transform: translate(-50%, -2px); filter: drop-shadow(0 2px 3px rgb(11 15 23 / .2)); }
/* the car rides on a full-width layer moved with transform (no layout per frame, no layout shift) */
.tm-carpos { position: absolute; inset: 0; transform: translateX(calc(var(--c) * 100%)); }
.tm-car { position: absolute; top: 50%; left: 0; width: 1.25rem; height: 1.25rem; margin: -.625rem 0 0 -.625rem; border-radius: 50%; background: #fff; border: 4px solid var(--route-primary); box-shadow: var(--elev-2); }
.tm-legend { display: flex; flex-wrap: wrap; gap: .375rem 1rem; margin: 0; padding: 0; list-style: none; font: var(--type-label-s); color: var(--text-secondary); }
.tm-legend li { display: inline-flex; align-items: center; gap: .375rem; }
.sw { display: inline-block; width: .875rem; height: .375rem; border-radius: 99px; }
.sw-slow { background: var(--traffic-slow); } .sw-heavy { background: var(--traffic-heavy); }
.tm-status { margin-top: .75rem; font: var(--type-label-m); color: var(--text-primary); }
/* phones: room for the longest status on two lines, so the panel doesn't grow while you scroll */
@media (max-width: 39.99em) { .tm-status { min-height: 2lh; } }

/* alerts ahead: the drive's alerts in order, the current one lit and counting down */
.aheadlist { margin: 1.25rem 0 0; padding: .5rem; list-style: none; display: grid; gap: .25rem; }
.aheadlist li { display: flex; align-items: center; gap: .75rem; padding: .375rem .875rem .375rem .375rem; border-radius: 99px; transition: background .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
.aheadlist img { width: 2.25rem; height: 2.25rem; flex: none; }
.al-copy { display: grid; }
.al-title { font: var(--type-label-m); color: var(--text-primary); }
.al-dist { font: var(--type-label-s); font-variant-numeric: tabular-nums; }
.aheadlist li.up { opacity: .55; }
.aheadlist li.up .al-dist { color: var(--text-secondary); }
.aheadlist li.now { background: var(--bg-surface); box-shadow: var(--elev-2); transform: scale(1.02); }
.aheadlist li.done { opacity: .4; }
.aheadlist li.done img { filter: grayscale(1); }
.aheadlist li.done .al-dist { color: var(--text-secondary); }

/* ---------- sections and sheets ---------- */
main { position: relative; z-index: 2; }
/* the city stretch is drawn much longer per km than the highway: these sections get half a screen more map to
   scroll through, so the car keeps the same pace as the rest of the drive */
.leg-long { margin-bottom: 50vh; }
.leg { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 46vh var(--gx-r) 0 var(--gx-l); }
.leg-hero { min-height: 100vh; min-height: 100svh; padding-top: 18rem; padding-bottom: var(--gx); }
.leg-beta { padding-bottom: 40vh; }
.sheet { position: relative; width: 100%; max-width: 36rem; margin: 0 auto; padding: 1.75rem 1.25rem 1.5rem; background: var(--bg-surface); border-radius: var(--radius-xl); box-shadow: var(--elev-2); }
.sheet::before { content: ""; position: absolute; top: .5rem; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--border-strong); }
.sheet > * + * { margin-top: 1rem; }
.sheet > p { color: var(--text-secondary); }
.lede { font-size: 1.1875rem; line-height: 1.5; color: var(--text-secondary); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding-top: .5rem; }
.meta { font: var(--type-body-m); color: var(--text-secondary); }
.hint { display: flex; align-items: flex-start; gap: .5rem; font: var(--type-body-m); color: var(--text-secondary); border-top: 1px solid var(--border-subtle); padding-top: 1rem; }
.hint .i { width: 1.125rem; height: 1.125rem; margin-top: .125rem; color: var(--icon-secondary); }
.hint-still { display: none; }
.fine { font: var(--type-body-m); line-height: 1.5; color: var(--text-secondary) !important; }
.fine a { color: var(--text-primary); font-weight: 600; }

/* guidance legend: rows with an overline-weight key */
.parts { list-style: none; margin: 1.25rem 0 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.parts li { display: grid; grid-template-columns: 9.5rem 1fr; gap: .25rem 1rem; padding: .875rem 0; border-bottom: 1px solid var(--border-subtle); font: var(--type-body-m); color: var(--text-secondary); }
.part-key { font: var(--type-body-m-strong); color: var(--text-primary); }
.hud-slot:empty { display: none; }
.hud-slot .hud { position: static; margin: 1.25rem 0 0; max-width: none; box-shadow: none; }

/* panels: replicas of app sheets, built from the brand components */
.panel { margin-top: 1.25rem !important; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); overflow: hidden; }

/* plan a stop */
.plan { background: var(--bg-subtle); padding: 1rem 1rem 0; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.plan-title { font: var(--type-title-m); color: var(--text-primary); }
.plan-cat.chip { border-color: transparent; }
.plan-caution { margin-top: .875rem; padding: .625rem .75rem; font: var(--type-body-m); }
.rail { list-style: none; margin: 1rem 0 0; padding: 0 0 0 1.75rem; position: relative; }
.rail::before { content: ""; position: absolute; left: .5625rem; top: .75rem; bottom: .75rem; width: 3px; border-radius: 2px; background: var(--route-alt); }
.rail li { position: relative; }
.rail-dot { position: absolute; left: -1.75rem; top: .3125rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 3px solid var(--route-primary); background: var(--bg-surface); }
.rail-stop .rail-dot { top: 2.3rem; border-color: var(--category-rest); }
.rail-stop.chosen .rail-dot { background: var(--category-rest); }
.rail-dest .rail-dot { background: var(--route-primary); }
.rail-name { font: var(--type-body-m-strong); }
.rail-end { padding: .125rem 0; }
.rail-stop { padding-top: .875rem; }
.rail-from { display: block; font: var(--type-caption); color: var(--text-secondary); margin-bottom: .375rem; }
.rail-dest { padding-top: 1rem; }
.stop-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: .75rem .875rem .75rem; transition: border-color .25s, box-shadow .25s, background-color .25s; }
.stop-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.stop-name { font: var(--type-body-m-strong); font-size: 1rem; line-height: 1.3; min-width: 0; overflow-wrap: break-word; }
.stop-extra { flex: none; text-align: right; font: 700 1.375rem/1 var(--font-display); letter-spacing: -0.02em; color: var(--text-brand); font-variant-numeric: tabular-nums; }
.stop-extra small { display: block; margin-top: .125rem; font: var(--type-caption); color: var(--text-secondary); letter-spacing: 0; }
.stop-where { display: block; font: var(--type-caption); color: var(--text-secondary); margin-top: .125rem; }
.stop-add { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 2.75rem; margin-top: .75rem; padding: .5rem .75rem; border: 0; border-radius: var(--radius-md); background: var(--bg-brand-subtle); font: var(--type-label-m); color: var(--text-brand); cursor: pointer; text-align: left; transition: background-color .15s, color .15s; }
.stop-add .i { width: 1.25rem; height: 1.25rem; }
.stop-add .i-check { display: none; }
.stop-add .add-hint { display: none; font-weight: 500; opacity: .85; margin-left: auto; }
/* "Added · Tap to remove" stays one line, so the button keeps its height when a stop is added (the hint gives way
   first); with large text it may wrap instead of being cut off */
.stop-add > span { white-space: nowrap; }
.stop-add .add-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
body.big-text .stop-add { flex-wrap: wrap; }
body.big-text .stop-add > span { white-space: normal; }
.stop-add[aria-pressed="true"] { justify-content: flex-start; background: var(--bg-brand); color: var(--text-on-brand); }
.stop-add[aria-pressed="true"] .i-plus { display: none; }
.stop-add[aria-pressed="true"] .i-check { display: block; }
.stop-add[aria-pressed="true"] .add-hint { display: inline; }
.rail-stop.chosen .stop-card { border-color: var(--border-brand); box-shadow: 0 0 0 1px var(--border-brand); background: var(--bg-brand-subtle); }
.stop-add.pressing { animation: press .3s var(--ease); }
@keyframes press { 40% { transform: scale(.97); opacity: .7; } }
.plan-foot { margin: 1rem -1rem 0; padding: .75rem 1rem .875rem; font: var(--type-caption); color: var(--text-secondary); border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }

/* traffic cameras row (one drawn still) */
.cam-thumb { flex: none; width: 4rem; aspect-ratio: 16 / 9; border-radius: var(--radius-xs); overflow: hidden; background: var(--bg-muted); }
.cam-thumb svg { width: 100%; height: 100%; }

/* home sheet: Title/L, shortcut tiles, a list row, option rows */
.home-btn { display: flex; align-items: center; gap: .625rem; min-height: 3.75rem; padding: .625rem .75rem; border: 1px solid var(--border-subtle); background: var(--bg-subtle); border-radius: var(--radius-md); font: var(--type-label-m); color: var(--text-primary); text-align: left; cursor: pointer; transition: background-color .15s, transform .15s var(--ease); }
.home-btn:hover { background: var(--bg-muted); }
.home-btn:active { transform: scale(.98); }
.home-btn .row-icon { width: 2.25rem; height: 2.25rem; aspect-ratio: 1; align-self: center; }
.home-btn small { display: block; margin-top: 1px; font: var(--type-caption); color: var(--text-secondary); }
.opts { border-top: 1px solid var(--border-subtle); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: 3.25rem; padding: .5rem 0; border: 0; border-bottom: 1px solid var(--border-subtle); background: none; font: var(--type-body-m-strong); color: var(--text-primary); text-align: left; cursor: pointer; }
.opts-summary { margin-top: .75rem; font: var(--type-caption); color: var(--text-secondary); }

/* beta sign-up form (the car arrives here) */
#beta-sheet { scroll-margin-top: 6rem; }
.signup { display: grid; gap: 1.125rem; margin-top: 1.5rem !important; }
.seg-ask { font: var(--type-body-m); line-height: 1.5; color: var(--text-secondary); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
#beta-cta { width: 100%; }
#beta-cta[aria-busy="true"] { background: var(--bg-brand-pressed); color: var(--text-on-brand); cursor: progress; }
@media (prefers-color-scheme: dark) { #beta-cta[aria-busy="true"] { background: #104DCB; } }
#beta-cta[aria-disabled="true"]:active { transform: none; }
/* error notice: danger-subtle with a warning icon (the text is set by signup.js, so the icon is drawn in CSS) */
.form-msg { position: relative; padding: .75rem 1rem .75rem 2.75rem; border-radius: var(--radius-md); background: var(--bg-danger-subtle); color: var(--text-danger); font: var(--type-body-m-strong); line-height: 1.4; }
.form-msg::before { content: ""; position: absolute; left: 1rem; top: .8125rem; width: 1.25rem; height: 1.25rem; background: var(--icon-danger); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.0001 8.99999V13M12.0001 17H12.0101M10.3001 3.89999L1.80008 18C1.62584 18.3017 1.53343 18.6437 1.532 18.992C1.53057 19.3404 1.62018 19.6832 1.79194 19.9863C1.9637 20.2894 2.21166 20.5424 2.51127 20.7202C2.81087 20.898 3.15173 20.9944 3.50008 21H20.5001C20.8484 20.9944 21.1893 20.898 21.4889 20.7202C21.7885 20.5424 22.0365 20.2894 22.2082 19.9863C22.38 19.6832 22.4696 19.3404 22.4682 18.992C22.4667 18.6437 22.3743 18.3017 22.2001 18L13.7001 3.89999C13.5207 3.61057 13.2704 3.37173 12.9729 3.20611C12.6754 3.04048 12.3406 2.95355 12.0001 2.95355C11.6596 2.95355 11.3247 3.04048 11.0272 3.20611C10.7297 3.37173 10.4794 3.61057 10.3001 3.89999Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.0001 8.99999V13M12.0001 17H12.0101M10.3001 3.89999L1.80008 18C1.62584 18.3017 1.53343 18.6437 1.532 18.992C1.53057 19.3404 1.62018 19.6832 1.79194 19.9863C1.9637 20.2894 2.21166 20.5424 2.51127 20.7202C2.81087 20.898 3.15173 20.9944 3.50008 21H20.5001C20.8484 20.9944 21.1893 20.898 21.4889 20.7202C21.7885 20.5424 22.0365 20.2894 22.2082 19.9863C22.38 19.6832 22.4696 19.3404 22.4682 18.992C22.4667 18.6437 22.3743 18.3017 22.2001 18L13.7001 3.89999C13.5207 3.61057 13.2704 3.37173 12.9729 3.20611C12.6754 3.04048 12.3406 2.95355 12.0001 2.95355C11.6596 2.95355 11.3247 3.04048 11.0272 3.20611C10.7297 3.37173 10.4794 3.61057 10.3001 3.89999Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.notice { font: var(--type-body-m); line-height: 1.5; color: var(--text-secondary); }
.notice a, .textlink-quiet { color: var(--text-primary); font-weight: 600; text-underline-offset: 3px; }
.signup-done { display: flex; gap: .875rem; align-items: flex-start; margin-top: 1.5rem !important; padding: 1.125rem 1.125rem 1.25rem; border-radius: var(--radius-lg); background: var(--bg-success-subtle); }
.signup-done:focus { outline: none; }
.signup-done:focus-visible { outline: var(--focus-ring); }
.signup-done > .i { width: 1.75rem; height: 1.75rem; color: var(--text-success); }
.signup-done h3 { font: var(--type-title-m); }
.signup-done p { margin-top: .25rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.linkbtn { margin-top: .625rem; padding: 0; border: 0; background: none; font: 600 .9375rem/1.4 var(--font-text); cursor: pointer; }

/* privacy: four rows with icons, 2x2 from tablet up */
.grid2 { display: grid; grid-template-columns: 1fr; margin-top: 1.25rem !important; border-top: 1px solid var(--border-subtle); }
.grid2 > div { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 0; border-bottom: 1px solid var(--border-subtle); }
.grid2 p { margin-top: .125rem; font: var(--type-body-m); color: var(--text-secondary); }

/* ---------- the parked sheet: app mockups, what's in the beta, FAQ, footer ---------- */
.end { position: relative; background: var(--bg-surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--elev-3); }
.end::before { content: ""; position: absolute; top: .625rem; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--border-strong); }
.end-inner { max-width: 70rem; margin: 0 auto; padding: 3.5rem max(1.25rem, env(safe-area-inset-right, 0px)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px)); }
.end-inner > * + * { margin-top: 4.5rem; }
.real-sub { margin-top: .75rem; max-width: 40rem; color: var(--text-secondary); }
/* Lenis leaves sideways swipes on the phone carousel to the browser (data-lenis-prevent-horizontal) but still smooths
   vertical scrolling over it. Its CSS contains overscroll on both axes; only sideways should stop at the strip
   (no back-swipe), so a vertical swipe that starts on a mockup still scrolls the page. */
.faq-list { margin-top: 1.5rem; border-top: 1px solid var(--border-subtle); }
.faq details { border-bottom: 1px solid var(--border-subtle); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 3.5rem; padding: .875rem 0; font: var(--type-title-s); font-size: 1.0625rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 1.25rem; height: 1.25rem; background: var(--icon-secondary); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9L12 15L18 9'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9L12 15L18 9'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 0 1.25rem; max-width: 44rem; color: var(--text-secondary); }
.foot { padding-top: 2.5rem; border-top: 1px solid var(--border-subtle); }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.foot-top img { height: 2.5rem; width: auto; }
.foot-tuju { color: var(--text-secondary); font: var(--type-body-m); }
.foot-links { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin-left: auto; }
.foot-links a { padding: .375rem 0; color: var(--text-primary); font: var(--type-label-m); text-decoration: none; }
.foot-links a:hover { color: var(--text-brand); }
.foot-legal { margin-top: 1.25rem; font: var(--type-caption); line-height: 1.6; color: var(--text-secondary); max-width: 52rem; }
.foot-legal + .foot-legal { margin-top: .5rem; }

/* ---------- phone mockups of the new app design, drawn in HTML/CSS (from design/brand/figma/screens-light-dark.png).
   Everything inside scales with the phone's width: --pt is one Figma point on a 390 pt wide screen. ---------- */
.phone { container-type: inline-size; position: relative; aspect-ratio: 390 / 844; border-radius: 12% / 5.5%; overflow: hidden; background: var(--map-land); border: 1px solid var(--border-default); box-shadow: var(--elev-2); color: var(--text-primary); font-family: var(--font-text); }
.phone * { --pt: calc(100cqw / 390); }
.phone > * { position: absolute; }

/* ---------- reveal ---------- */
/* Only hidden when scripts run (html.js), so the page still reads without JavaScript. */
.js .rise { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: var(--d, 0ms); }
.js .rise.in { opacity: 1; transform: none; }
.no-js .rise { opacity: 1; transform: none; }
/* if app.js hasn't taken over the reveals within 3 s (slow or blocked map script), show everything anyway */
html.js:not(.rise-ready) .rise { animation: rise-fallback .4s var(--ease) 3s forwards; }
@keyframes rise-fallback { to { opacity: 1; transform: none; } }
/* without the map the header's invite button has no section buttons to make way for, so it simply shows */
.no-js #bar-ctas { opacity: 1; visibility: visible; }

/* ---------- tablet ---------- */
@media (min-width: 40em) {
  :root { --gx: 1rem; }
  .sheet { padding: 2rem 2rem 1.75rem; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid2 > div:nth-child(odd) { padding-right: 1.25rem; }
  .grid2 > div:nth-child(even) { padding-left: 1.25rem; border-left: 1px solid var(--border-subtle); }
  .end-inner { padding: 4.5rem max(2rem, env(safe-area-inset-right, 0px)) calc(2.5rem + env(safe-area-inset-bottom, 0px)) max(2rem, env(safe-area-inset-left, 0px)); }
}

/* ---------- desktop: sheets on the left, the map and car on the right ---------- */
@media (min-width: 64em) {
  :root { --sheet-w: min(33rem, 41vw); --col: calc(2rem + var(--sheet-w)); }
  .leg { padding: 30vh 0 0 2rem; align-items: flex-start; }
  .leg-hero { justify-content: center; padding-top: 6rem; padding-bottom: 4rem; }
  .leg-beta { padding-bottom: 45vh; }
  .sheet { width: var(--sheet-w); max-width: none; margin: 0; padding: 2.25rem 2.25rem 2rem; }
  .hud, .trip, .nav-alert { left: calc(var(--col) + (100vw - var(--col) - 27rem) / 2); right: auto; width: 27rem; max-width: none; margin: 0; }
  .hud { top: 5.25rem; }
  .trip { bottom: 1.25rem; }
  .end-inner > .split, .end-inner > .faq { display: grid; grid-template-columns: 22rem 1fr; gap: 2rem; }
  .faq-list { margin-top: 0; }
}
@media (min-width: 64em) {
  .brand { transition: padding .25s var(--ease), background-color .25s, box-shadow .25s; }
  body.past-hero .brand { padding: 0; min-height: 0; background: none; box-shadow: none; }
  body.past-hero .brand .lockup { display: none; }
  body.past-hero .brand .mark { display: block; width: 2.5rem; height: 2.5rem; border-radius: 11px; box-shadow: var(--elev-2); }
}
@media (min-width: 90em) {
  .leg { padding-left: 3rem; }
  :root { --col: calc(3rem + var(--sheet-w)); }
}

/* phones and tablets: the header slides away while you read, the banner moves up into its place */
@media (max-width: 63.99em) {
  body.bar-away .bar { transform: translateY(calc(-100% - 1.5rem)); }
  body.bar-away .hud, body.bar-away .nav-alert { transform: translateY(-3.5rem); }
  body.in-hero .trip { opacity: 0; visibility: hidden; }
  body.in-hero:not(.big-text) .hud .g-then { display: none; }
}

/* phones: the mockups become a swipeable row with the next one peeking */
@media (max-width: 39.99em) {
  .trip { opacity: 0; visibility: hidden; }
  body.in-stops:not(.in-hero) .trip { opacity: 1; visibility: visible; }
  .leg:not(.leg-hero):not(.leg-beta) { padding-bottom: 5rem; }
  .foot-links { margin-left: 0; }
}

/* phones on their side: a short screen gets the phone treatment too, so the card and trip bar don't cover most of it */
@media (max-width: 63.99em) and (max-height: 30em) {
  .trip { opacity: 0; visibility: hidden; }
  body.in-stops:not(.in-hero) .trip { opacity: 1; visibility: visible; }
}

/* very small phones */
@media (max-width: 22em) {
  .parts li { grid-template-columns: 1fr; }
  .brand .lockup { display: none; }
  .brand .mark { display: block; }
}

/* large text (browser text size 150%+): the banner and trip strip stop floating */
body.big-text .trip { display: none; }
body.big-text .bar { position: absolute; }
body.big-text .brand .lockup { display: none; }
body.big-text .brand .mark { display: block; }
body.big-text .parts li { grid-template-columns: 1fr; }
body.big-text .leg { padding-top: 30vh; }
body.big-text .leg-hero { padding-top: 6rem; }
body.big-text .hud { transform: none !important; }
body.big-text .g-main { flex-direction: column; align-items: flex-start; gap: .5rem; }
body.big-text .g-then { flex-wrap: wrap; }
body.big-text .g-then-text { flex-basis: calc(100% - 2.5rem); }
body.big-text .g-then-after { margin-left: 2rem; }
body.big-text .sheet { padding-left: 1rem; padding-right: 1rem; }
body.big-text .plan { padding: .75rem 0 0; border: 0; background: var(--bg-surface); }
body.big-text .plan .rail-stop .stop-card { margin-right: 0; }
body.big-text .plan-head { flex-direction: column; align-items: flex-start; }
body.big-text .plan-foot { margin: 1rem 0 0; padding-left: 0; padding-right: 0; }
body.big-text .rail { padding-left: 1.25rem; }
body.big-text .rail::before { left: .3rem; }
body.big-text .rail-dot { left: -1.25rem; width: .875rem; height: .875rem; border-width: 2px; }
body.big-text .stop-card { padding: .625rem .625rem .625rem; }
body.big-text .stop-top { flex-direction: column; gap: .25rem; }
body.big-text .stop-extra { text-align: left; }
body.big-text .stop-name, body.big-text .g-text, body.big-text h1, body.big-text h2 { overflow-wrap: anywhere; hyphens: auto; }
body.big-text .opt { flex-wrap: wrap; }
body.big-text .grid2 > div { flex-direction: column; }

@media (prefers-reduced-motion: reduce) {
  .js .rise { opacity: 1; transform: none; transition: none; }
  .hud.swap .g-main { animation: none; }
  .map .clutter, .map-top .stop, .switch, .faq summary::after { transition: none; }
  .stop-add.pressing { animation: none; }
  .hint-motion { display: none; }
  .hint-still { display: inline; }
  #bar-ctas, #bar-ctas.is-shown { transition: none; }
  .js .map-top .rpin-in, .tm-eta, .aheadlist li { transition: none; animation: none; }
  .bar, .hud, .nav-alert { transition: none; }
}
/* large text: the header button won't fit beside the logo; the hero and form buttons carry the action */
body.big-text #bar-ctas { display: none; }

/* ---------- production additions ---------- */
/* Focus and find-in-page never land under the floating header, guidance banner or trip strip. */
[id], a, button, input, summary { scroll-margin-top: 8.5rem; scroll-margin-bottom: 5rem; }
@media (min-width: 64em) { [id], a, button, input, summary { scroll-margin-top: 6rem; } }
main:focus, h2[tabindex]:focus, .sheet[tabindex]:focus { outline: none; }
/* Turnstile (only rendered when a site key is configured) */
.ts { min-height: 65px; }
.ts:empty { display: none; }
.form-status { font: var(--type-body-m); color: var(--text-secondary); }
/* live regions stay rendered while empty (out of the layout, like .sr-only): screen readers may skip one that appears and fills in the same moment */
.form-status:empty { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); }
/* Shown until the sign-up script is running (no JavaScript, or it failed to load), so nobody is stuck. */
.signup-fallback { padding: .75rem 1rem; border-radius: var(--radius-md); background: var(--bg-brand-subtle); color: var(--text-primary); font: var(--type-body-m); }
html.signup-ready .signup-fallback { display: none; }
.form-msg a { color: inherit; }
/* after signing up, the ask above the panel would repeat the thank-you text */
#beta-sheet.is-done .beta-ask { display: none; }
