/* The home page: no boxes. Night maps at the top, middle and end, with one
   route through them; everything else is plain type on the page, split by
   thin rules. Fonts, the shared colors and links come from base.css. Dark
   mode follows the device, as base.css explains. */
:root { --red: #D23B3B; }

html { scroll-behavior: smooth; }
ul, ol { padding: 0; list-style: none; }
h1, .closing h2 { font-size: clamp(52px, 6.8vw, 100px); line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: clamp(36px, 4.6vw, 66px); line-height: 1.02; letter-spacing: -0.025em; }
h3 { line-height: 1.2; }
.soft, .head p, .routed-intro p, .compare p, .stops p, .clearance-text > p:first-of-type,
.verdict span, .phones p, .lists ul, .answers p { color: var(--muted); }
.hero-text > p:first-of-type, .closing .copy > p:first-of-type { font-size: clamp(19px, 1.5vw, 22px); }
.actions a, .closing .copy a { font-weight: 600; }
.footer img { width: 180px; }

/* A section of plain type */
.block { padding: clamp(64px, 8vw, 112px) var(--gutter) 0; display: flex; flex-direction: column; gap: 44px; }
.head { display: flex; flex-wrap: wrap; gap: 16px 72px; align-items: flex-start; }
.head h2 { flex: 3 1 460px; }
.head p { flex: 2 1 340px; }

/* Maps: below the words on a phone; behind them, full width, on a wide screen */
.map-hero { display: grid; background: var(--map-ground); }
.map-hero .copy { position: relative; z-index: 1; min-width: 0; padding: 24px var(--gutter) clamp(48px, 6vw, 80px); display: flex; flex-direction: column; justify-content: space-between; gap: 56px; }
.map-hero .map { position: relative; min-width: 0; min-height: clamp(480px, 60vw, 860px); overflow: hidden; }
.map-hero .map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-width: 960px) {
  .map-hero { grid-template-columns: 1fr 1fr; }
  .map-hero .map { grid-column: 1 / -1; grid-row: 1; }
  .map-hero .copy { grid-column: 1; grid-row: 1; }
}
.map-water { fill: var(--map-water); }
.map-roads { fill: none; stroke: var(--map-road); stroke-width: 2; }
.map-major { fill: none; stroke: var(--map-major); stroke-width: 10; }
.map-minor { fill: none; stroke: var(--map-major); stroke-width: 6; }
.map-car { fill: none; stroke: var(--muted); stroke-width: 3; stroke-dasharray: 9 11; }
.map-route { fill: none; stroke: var(--line); stroke-width: 8; stroke-linecap: round; }
.map-start { fill: var(--map-ground); stroke: var(--line); stroke-width: 6; }
.map-arrive { fill: var(--amber); }
.map-warn { fill: var(--red); }
.map-warn-mark { stroke: #FFFFFF; stroke-width: 5; stroke-linecap: round; }
.map-labels text { font-size: 20px; font-weight: 700; fill: var(--ink); stroke: var(--map-ground); stroke-width: 7px; paint-order: stroke; stroke-linejoin: round; }
.map-labels .big { font-size: 22px; }
.map-labels .small { font-size: 17px; font-weight: 400; fill: var(--muted); }
.stop-dot { fill: var(--amber); }
.stop-number { font-size: 20px; font-weight: 800; text-anchor: middle; fill: var(--night); }

/* Hero */
.hero-head { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 16px; font-weight: 500; }
.nav a { text-decoration: none; }
.hero-text { display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.hero-text > p:first-of-type { line-height: 1.4; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px 8px 8px; background: var(--amber); color: var(--night); font-weight: 700; }
.store img { width: 36px; height: 36px; }
.fine { font-size: 16px; }

/* Routed as a bus: words as tall as the phone beside them */
.routed { padding: clamp(56px, 7vw, 104px) var(--gutter); display: flex; flex-wrap: wrap; gap: 40px clamp(32px, 4vw, 56px); align-items: stretch; }
.routed-text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.routed-intro { display: flex; flex-direction: column; gap: 24px; }
.routed h2 { font-size: clamp(36px, 5.4vw, 80px); line-height: 1; letter-spacing: -0.03em; }
.routed-intro p { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; }
.compare > div { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; border-top: 1px solid var(--rule); }
.compare > div:last-child { padding-bottom: 0; }
.compare h3 { font-size: clamp(21px, 1.9vw, 27px); }
.compare .ours { color: var(--line-text); }
.routed > img { flex: 0 1 340px; align-self: flex-start; width: 340px; border-radius: 26px; }

/* What it knows: the second map, then its numbered stops */
.knows { display: flex; flex-direction: column; }
.knows .head { padding: 0 var(--gutter) 40px; }
.stops-map { background: var(--map-ground); overflow-x: auto; }
.stops-map svg { display: block; width: 100%; min-width: 900px; height: auto; }
.stops-map .map-route { stroke-width: 7; stroke-linecap: butt; }
.stops-map .map-major { stroke-width: 9; }
.stops-map .map-labels text { font-size: 21px; text-anchor: middle; }
.stops { padding: 40px var(--gutter) 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 30px 44px; }
.stops li { display: flex; gap: 14px; }
.stops b { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--amber); color: var(--night); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.stops h3 { font-size: 21px; padding-bottom: 4px; }

/* Try it. home.js sets data-state and shows the section. */
.clearance { padding: clamp(48px, 6vw, 80px) var(--gutter) 0; display: flex; flex-wrap: wrap; gap: 28px 64px; align-items: center; }
.clearance[hidden] { display: none; }
.clearance[data-state="green"] { --state: #2F9A5C; --state-ink: #1E6B3F; }
.clearance[data-state="orange"] { --state: #E9821C; --state-ink: #9A4E07; }
.clearance[data-state="red"] { --state: var(--red); --state-ink: #9E2222; }
@media (prefers-color-scheme: dark) {
  .clearance[data-state="green"] { --state-ink: #8FD6A8; }
  .clearance[data-state="orange"] { --state-ink: #F2B273; }
  .clearance[data-state="red"] { --state-ink: #F2A0A0; }
}
.scene { flex: 3 1 460px; min-width: 0; display: block; height: auto; }
.scene .road, .scene .beam { fill: var(--muted); }
.scene .pier { fill: var(--rule); }
.scene .sign { fill: var(--amber); }
.scene .sign-text { font-size: 16px; font-weight: 800; fill: var(--night); }
.scene .coach { fill: var(--ink); }
.scene .coach-glass { fill: var(--paper); }
.scene .wheel { stroke: var(--paper); stroke-width: 4; }
.scene .measure-line { fill: none; stroke: var(--state); stroke-width: 2.5; stroke-dasharray: 5 5; }
.scene .measure-text { fill: var(--state-ink); font-weight: 700; font-size: 16px; }
.coach.bump { animation: bump .5s ease-out; }
@keyframes bump { 30% { transform: translateX(-6px); } 60% { transform: translateX(2px); } }
.clearance-text { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.clearance-text h3 { font-size: 28px; line-height: 1.12; letter-spacing: -0.015em; }
.height-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-weight: 600; padding-top: 6px; }
.height-label output { font-size: 26px; font-weight: 700; line-height: 1; }
input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--line); cursor: grab; }
input[type="range"]:active { cursor: grabbing; }
.verdicts { display: flex; flex-direction: column; gap: 10px; }
.verdict-ours { font-weight: 700; color: var(--state-ink); }
.verdict-ours b { font-weight: inherit; }

.safety { padding: clamp(48px, 6vw, 72px) var(--gutter) 0; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.25; letter-spacing: -0.01em; max-width: calc(60rem + var(--gutter) * 2); }
.safety strong { color: var(--safety); }

/* On the road: four phones across, two on a phone */
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 40px clamp(16px, 2.2vw, 32px); align-items: start; }
.phones > div { display: flex; flex-direction: column; gap: 14px; }
.phones img { width: 100%; border-radius: 20px; }
.phones h3 { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.15; }
.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 32px 44px; }
.lists > div { display: flex; flex-direction: column; gap: 10px; }
.lists h3 { font-size: 22px; }
.lists ul { display: flex; flex-direction: column; gap: 6px; }

/* Company */
.company { flex-flow: row wrap; gap: 20px 72px; align-items: flex-start; }
.company h2 { flex: 2 1 340px; }
.company div { flex: 3 1 420px; display: flex; flex-direction: column; gap: 16px; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.4; }

/* Questions */
.questions { padding-bottom: clamp(64px, 8vw, 112px); gap: 32px; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 28px 56px; }
.answers > div { display: flex; flex-direction: column; gap: 6px; }
.answers h3 { font-size: 20px; line-height: 1.25; }

/* Closing: the route arrives */
.closing .copy { padding-block: clamp(56px, 7vw, 104px); justify-content: center; align-items: flex-start; gap: 18px; }
.closing .map { min-height: clamp(280px, 34vw, 500px); }

/* Footer */
.footer { border-top: 1px solid var(--rule); padding: 40px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; font-size: 16px; }
.footer > div { display: flex; flex-direction: column; gap: 14px; }
.footer > div:first-child { flex: 2 1 420px; }
.footer > div:last-child { flex: 1 1 280px; gap: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* People who ask for less motion get the page standing still */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .coach.bump { animation: none; }
}
