/* RideSaathi home page: the morning trip (assets/trip.js). A road from Rahul's home to the office that winds down
   the margins and crosses the page between sections. Wide screens only. Sizes scale with --k (set by the script). */
:root {
  --trip-road: #C3D0C7; --trip-lane: #F4F7F3; --trip-tree: #8DBF9B; --trip-tree2: #6FAE83;
  --trip-roof: #D9714E; --trip-edge: #C9D3CD;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --trip-road: #202A25; --trip-lane: #3A4740; --trip-tree: #24432F; --trip-tree2: #2D5239;
    --trip-roof: #A4553A; --trip-edge: #34413A;
  }
}
:root[data-theme="dark"] {
  --trip-road: #202A25; --trip-lane: #3A4740; --trip-tree: #24432F; --trip-tree2: #2D5239;
  --trip-roof: #A4553A; --trip-edge: #34413A;
}

/* Roadside (trees, palms, bushes, shops, flats, houses, signal, level crossing). Day colours here, night below. */
:root {
  --trip-leaf: #7DB98E; --trip-leafd: #5B9C70; --trip-leafhi: #A9D6B2; --trip-frond: #5E9F71; --trip-frond2: #7BB98A; --trip-trunk: #8A6A4E;
  --trip-flower: #F2A33A; --trip-shade: rgba(30, 50, 40, .12);
  --trip-w1: #F3DDB8; --trip-w2: #EBCBC3; --trip-w3: #D3E3E7; --trip-w4: #F1E5AE; --trip-wedge: #CBB8A0;
  --trip-sign1: #E8683F; --trip-sign2: #13A150; --trip-sign3: #2C8C8A; --trip-sign4: #C9A227;
  --trip-shopin: #7A5E4A; --trip-winoff: var(--il-win); --trip-tank: #2C312E;
  --trip-sleeper: #9C8A78; --trip-rail: #7D8783; --trip-pole: #5A6660;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --trip-leaf: #24432F; --trip-leafd: #1A3324; --trip-leafhi: #2F573D; --trip-frond: #1F3B2A; --trip-frond2: #294C36; --trip-trunk: #4A3A2E;
    --trip-flower: #7A5A2A; --trip-shade: rgba(0, 0, 0, .28);
    --trip-w1: #5A4F42; --trip-w2: #564546; --trip-w3: #3F4D52; --trip-w4: #575033; --trip-wedge: #3A332C;
    --trip-sign1: #A84B2E; --trip-sign2: #0F7A3D; --trip-sign3: #22696A; --trip-sign4: #8F7420;
    --trip-shopin: #E3B45E; --trip-winoff: #1E2724; --trip-tank: #151917;
    --trip-sleeper: #3E362F; --trip-rail: #66706C; --trip-pole: #4A5550;
  }
}
:root[data-theme="dark"] {
  --trip-leaf: #24432F; --trip-leafd: #1A3324; --trip-leafhi: #2F573D; --trip-frond: #1F3B2A; --trip-frond2: #294C36; --trip-trunk: #4A3A2E;
  --trip-flower: #7A5A2A; --trip-shade: rgba(0, 0, 0, .28);
  --trip-w1: #5A4F42; --trip-w2: #564546; --trip-w3: #3F4D52; --trip-w4: #575033; --trip-wedge: #3A332C;
  --trip-sign1: #A84B2E; --trip-sign2: #0F7A3D; --trip-sign3: #22696A; --trip-sign4: #8F7420;
  --trip-shopin: #E3B45E; --trip-winoff: #1E2724; --trip-tank: #151917;
  --trip-sleeper: #3E362F; --trip-rail: #66706C; --trip-pole: #4A5550;
}
.tm-shade { fill: var(--trip-shade); }
.tm-leaf { fill: var(--trip-leaf); } .tm-leafd { fill: var(--trip-leafd); } .tm-leafhi { fill: var(--trip-leafhi); }
.tm-frond { fill: var(--trip-frond); } .tm-frond2 { fill: var(--trip-frond2); } .tm-trunk { fill: var(--trip-trunk); }
.tm-flower { fill: var(--trip-flower); }
.tm-c1 { --tw: var(--trip-w1); --ts: var(--trip-sign1); } .tm-c2 { --tw: var(--trip-w2); --ts: var(--trip-sign2); }
.tm-c3 { --tw: var(--trip-w3); --ts: var(--trip-sign3); } .tm-c4 { --tw: var(--trip-w4); --ts: var(--trip-sign4); }
.tm-bw-wall { fill: var(--tw, var(--trip-w1)); } .tm-bw-edge { fill: var(--trip-wedge); } .tm-bw-sign { fill: var(--ts, var(--trip-sign1)); }
.tm-awn-a { fill: var(--ts, var(--trip-sign1)); } .tm-awn-b { fill: #FFF6EA; opacity: calc(1 - var(--trip-night, 0) * .55); }
.tm-shopin { fill: var(--trip-shopin); } .tm-tank { fill: var(--trip-tank); }
.tm-bwl { fill: var(--il-win); } .tm-bwo { fill: var(--trip-winoff); }
.tm-zebra { fill: var(--trip-lane); }
.tm-sleeper { fill: var(--trip-sleeper); } .tm-rail { stroke: var(--trip-rail); fill: none; }
.tm-spole, .tm-bpost { fill: var(--trip-pole); } .tm-shead { fill: #1F2622; }
.tm-boom-w { fill: #F4F1EA; } .tm-boom-r { fill: #D9412B; }
.tm-xb-o { stroke: #D9412B; stroke-width: 3; stroke-linecap: round; fill: none; } .tm-xb { stroke: #F4F1EA; stroke-width: 1.4; stroke-linecap: round; fill: none; }
/* Signal lights: the lit one is bright, the others dim; at night the lit one glows */
.tm-sl { opacity: .22; transition: opacity .45s ease-in-out; }
.tm-sr { fill: #FF4A3A; } .tm-sa { fill: #FFB020; } .tm-sg { fill: #2FD27A; }
.tm-sgl { opacity: 0; transition: opacity .45s ease-in-out; }
.tm-sgl.r { fill: #FF4A3A; } .tm-sgl.a { fill: #FFB020; } .tm-sgl.g { fill: #2FD27A; }
.tm-sig.red .tm-sr, .tm-sig.amber .tm-sa, .tm-sig.green .tm-sg { opacity: 1; }
.tm-sig.red .tm-sgl.r, .tm-sig.amber .tm-sgl.a, .tm-sig.green .tm-sgl.g { opacity: calc(var(--trip-night, 0) * .4); }

.trip, .trip-snd { display: none; }
.trip-on .trip { display: block; position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; --k: 1; }

/* The road, its trees and the two buildings */
.trip-map { position: absolute; left: 0; overflow: visible; max-width: none; }
.tm-road { fill: none; stroke: var(--trip-road); stroke-linecap: round; stroke-linejoin: round; }
.tm-lane { fill: none; stroke: var(--trip-lane); stroke-width: 2; }
.tm-tree { fill: var(--trip-tree); } .tm-tree2 { fill: var(--trip-tree2); }
.tm-roof { fill: var(--trip-roof); }
.tm-wall { fill: var(--il-wall); } .tm-win { fill: var(--il-win); } .tm-door { fill: var(--il-door); }
.tm-bldg { fill: var(--il-bldg); stroke: var(--trip-edge); stroke-width: 1.5; }
.tm-bwin { fill: var(--il-bwin); }
.tm-glass { fill: var(--il-glass); } .tm-frame { stroke: var(--il-bldg); stroke-width: 1.2; fill: none; }
.tm-mast { fill: var(--muted); }
.tm-logo { fill: #1B2620; } .tm-logo-line { stroke: #13A150; stroke-width: 2.6; fill: none; }
.tm-logo-dot { fill: #FFD23F; stroke: #1B2620; stroke-width: 1.6; }

/* Signs: who waits where, and when */
.trip-lab { position: absolute; left: 0; top: 0; white-space: nowrap; text-align: center; font: 500 9px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; padding: 3px 6px 2px; transition: opacity .7s ease-in-out; }
.trip-lab b { display: block; color: var(--text); font-weight: 500; }
.trip-lab.passed { opacity: .5; }

/* Riders: they glide to the open door and fade into their seat. At the office they walk to the door and go in. */
.trip-who { position: absolute; width: calc(14px * var(--k)); height: calc(29.4px * var(--k)); transition: transform .65s ease-in-out, opacity .45s ease-in-out; }
.trip-who svg { display: block; width: 100%; height: 100%; }
.trip-who.walk { transform: translateX(var(--walk, 0)); }
.trip-who.gone { opacity: 0; }
.trip-who.quick { transition-duration: .28s, .22s; }
.trip-who.exit { opacity: 0; transition: transform 1.3s ease-in-out, opacity .5s ease-in-out; }
.trip-who.exit.show { opacity: 1; }
.trip-who.exit.walk { transform: translate(var(--gx, 0), var(--gy, 0)) scale(.8); }
.trip-who.exit.gone { opacity: 0; }

/* The car: position and heading come from the script */
.trip-car { position: absolute; z-index: 2; left: calc(var(--cw, 46px) / -2); top: calc(var(--cl, 93px) / -2); width: var(--cw, 46px); height: var(--cl, 93px); transform-origin: 50% 50%; }
.trip-car svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .18)); }
.trip-car .tc-av { fill: var(--pc, var(--sky)); opacity: 0; transition: opacity .6s ease-in-out; stroke: var(--seat); stroke-width: 6; }
.trip-car .tc-av.on { opacity: 1; }
.trip-car .tc-slot { fill: var(--cabin); opacity: 0; transition: opacity .3s ease-in-out; }
.trip-car .tc-slot.open { opacity: 1; }
.trip-car .tc-door { fill: var(--car-light); stroke: var(--tail); stroke-width: 3; transform-box: view-box; transition: transform .55s ease-in-out; }
.trip-car .tc-door.l.open { transform: rotate(58deg); }
.trip-car .tc-door.r.open { transform: rotate(-58deg); }
.trip-car.quick .tc-door { transition-duration: .22s; }
.trip-car.brake use { --tail: #FF3B1F; }

.trip-tag { position: absolute; z-index: 3; left: 0; top: 0; white-space: nowrap; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; background: var(--ink); color: var(--on-ink);
  padding: 6px 8px 5px; border-radius: 999px; opacity: 0; transition: opacity .5s ease-in-out; }
.trip-tag.show { opacity: 1; }
.trip-tag i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--tag-c, var(--sun)); }

/* Sound on/off, bottom right in the margin */
.trip-on .trip-snd { display: grid; place-items: center; position: fixed; right: 16px; bottom: 16px; z-index: 15; width: 34px; height: 34px; padding: 0; border-radius: 50%;
  background: var(--surface); color: var(--text); border: 1px solid var(--hairline); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); cursor: pointer; transition: color .3s ease-in-out; }
.trip-snd svg { width: 16px; height: 16px; }
.trip-snd .off { display: none; }
.trip-snd.muted { color: var(--muted); }
.trip-snd.muted .on { display: none; }
.trip-snd.muted .off { display: inline; }
.trip-snd:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }

/* Night (dark theme): the car drives with its headlights on and flashes them as it pulls up for a rider, the tail
   lights glow, and street lamps light pools on the road. --trip-night is 0 by day, so none of it shows. */
:root { --trip-night: 0; --trip-beam: #FFE6A6; --trip-lamp: #FFD47E; --trip-glow-tail: #FF3B1F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --trip-night: 1; } }
:root[data-theme="dark"] { --trip-night: 1; }

.trip-car .tc-lights { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; filter: none; }
.tc-beam { opacity: calc(var(--trip-night) * .85); transition: opacity .8s ease-in-out; }
.tc-b0 { stop-color: var(--trip-beam); stop-opacity: .75; } .tc-b1 { stop-color: var(--trip-beam); stop-opacity: 0; }
.tc-tg0 { stop-color: var(--trip-glow-tail); stop-opacity: .7; } .tc-tg1 { stop-color: var(--trip-glow-tail); stop-opacity: 0; }
.tc-tailglow { opacity: calc(var(--trip-night) * .35); transition: opacity .3s ease-in-out; }
.trip-car.brake .tc-tailglow { opacity: calc(var(--trip-night) * .9); }
.trip-car .tc-hl { fill: #FFF8E1; opacity: var(--trip-night); transition: opacity .8s ease-in-out; }
/* The flash: quick on purpose (it is a signal), but a soft fade, no hard blink */
.trip-car.flash .tc-beam { opacity: var(--trip-night); transition-duration: .12s; }

.tm-lamps { opacity: var(--trip-night); transition: opacity .8s ease-in-out; }
.tm-l0 { stop-color: var(--trip-lamp); stop-opacity: .42; } .tm-lmid { stop-opacity: .22; } .tm-l1 { stop-color: var(--trip-lamp); stop-opacity: 0; }
.tm-arm { stroke: #5A6660; stroke-width: 1.6; stroke-linecap: round; }
.tm-post { fill: #5A6660; }
.tm-bulb { fill: #FFF3CC; }

@media (prefers-reduced-motion: reduce) {
  .trip-who, .trip-who.exit, .trip-car .tc-av, .trip-car .tc-door, .trip-car .tc-slot, .trip-lab, .trip-tag,
  .tc-beam, .tc-tailglow, .trip-car .tc-hl, .tm-lamps, .tm-sl, .tm-sgl { transition: none; }
}

/* ---------- The destination: a strip after "Coming soon" where the road ends at the office ---------- */
.trip-room main { padding-bottom: 210px; }
.tm-bwin { transition: fill .9s ease-in-out; }
.tm-bwin.lit { fill: #FFD46B; }
.tm-glow { fill: #FFD23F; opacity: 0; transition: opacity 1.2s ease-in-out; }
.tm-office.lit .tm-glow { opacity: .35; }

/* Ghost cars: the cars that stayed at home. Grey, faint, and they drift up as they clear. */
.trip-ghost { position: absolute; left: calc(var(--cl, 93px) / -2); top: calc(var(--cw, 46px) / -2); width: var(--cl, 93px); height: var(--cw, 46px);
  opacity: 0; translate: 0 0; transition: opacity .9s ease-in-out, translate 1.4s ease-in-out; filter: grayscale(1); }
.trip-ghost svg { position: absolute; left: 50%; top: 50%; width: var(--cw, 46px); height: var(--cl, 93px); max-width: none; transform: translate(-50%, -50%) rotate(-90deg); }
.trip-ghost.show { opacity: .32; }
.trip-ghost.show, .trip-ghost.gone { transition-delay: calc(var(--i, 0) * .3s); }
.trip-ghost.gone { opacity: 0; translate: 0 -16px; }

/* Trip summary card, in the strip beside the office */
.trip-sum { display: none; }
.trip-on .trip-sum { display: block; position: absolute; z-index: 3; visibility: hidden; opacity: 0; translate: 0 6px; box-sizing: border-box; padding: 11px 14px 10px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
  transition: opacity .8s ease-in-out, translate .8s ease-in-out, visibility 0s linear .8s; }
.trip-on .trip-sum.show { visibility: visible; opacity: 1; translate: 0 0; transition-delay: 0s; }
.tsum-k { margin: 0; font: 500 9.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tsum-k i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line); margin-right: 6px; vertical-align: 1px; }
.tsum-h { margin: 3px 0 8px; font: 700 14px/1.25 var(--display, inherit); color: var(--text); letter-spacing: -.01em; }
.tsum-d { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 7px 0 8px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.tsum-d div { min-width: 0; }
.tsum-d dt { font: 500 8.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsum-d dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.tsum-d div:last-child dd { color: var(--line-text, var(--line)); }
.tsum-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.tsum-f b { font-weight: 600; color: var(--text); }
.tsum-again { flex: none; border: 0; padding: 4px 0; background: none; color: var(--line-text, var(--line)); font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.tsum-again:hover { text-decoration: underline; text-underline-offset: 3px; }
.tsum-again:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  .trip-ghost, .trip-on .trip-sum, .tm-bwin, .tm-glow { transition: none; }
}

/* ---------- Watch the trip: above the sound button. Both sit bottom left, because on arrival the bottom right is
   where Rahul's home and the parked car are. ---------- */
.trip-on .trip-snd { left: 16px; right: auto; }
.trip-watch { display: none; }
.trip-on .trip-watch { display: inline-flex; align-items: center; gap: 7px; position: fixed; left: 16px; bottom: 58px; z-index: 15; height: 34px; padding: 0 12px 0 10px;
  border-radius: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--hairline); box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  transition: border-color .4s ease-in-out, color .4s ease-in-out; }
.trip-watch svg { width: 12px; height: 12px; fill: currentColor; flex: none; }
.trip-watch .pa { display: none; }
.trip-watch.playing { border-color: var(--line); color: var(--line-text, var(--line)); }
.trip-watch.playing .pl { display: none; }
.trip-watch.playing .pa { display: inline; }
.trip-watch.compact { width: 34px; padding: 0; justify-content: center; border-radius: 50%; }
.trip-watch.compact span { display: none; }
.trip-watch:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .trip-on .trip-watch { display: none; } }
