:root {
  color-scheme: light;
  --navy-950: #071a39;
  --navy-900: #102b5c;
  --navy-800: #183c76;
  --blue-100: #eaf2ff;
  --orange-500: #f26b21;
  --orange-100: #fff0e8;
  --teal-600: #087f76;
  --teal-100: #e4f7f3;
  --amber-700: #9a5b00;
  --amber-100: #fff5d8;
  --ink: #172033;
  --muted: #637086;
  --line: #dce3ed;
  --surface: #ffffff;
  --background: #f3f6fa;
  --shadow: 0 22px 70px rgba(7, 26, 57, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  background: var(--background);
  line-height: 1.5;
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  min-height: 82px;
  padding: 14px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid rgba(220, 227, 237, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo { width: clamp(220px, 24vw, 310px); height: 54px; display: block; object-fit: contain; object-position: left center; }

.back-link {
  color: var(--navy-800);
  font-weight: 750;
  text-underline-offset: 4px;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(36px, 7vw, 100px);
  align-items: center;
  color: white;
  background:
    radial-gradient(circle at 12% 10%, rgba(60, 120, 214, 0.55), transparent 31%),
    radial-gradient(circle at 80% 80%, rgba(242, 107, 33, 0.3), transparent 27%),
    linear-gradient(130deg, var(--navy-950), var(--navy-800));
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.16;
  background-image: linear-gradient(120deg, transparent 0 48%, rgba(255,255,255,.22) 49% 50%, transparent 51% 100%);
  background-size: 44px 44px;
}

.hero-copy { max-width: 660px; }

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--orange-500);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 660px;
  margin: 0;
  font-size: clamp(2.45rem, 6.7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy p {
  max-width: 570px;
  margin: 24px 0 0;
  color: #dbe8ff;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.lookup-card {
  padding: clamp(22px, 4vw, 34px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.form-heading {
  margin-bottom: 26px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.step {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--orange-500);
  font-weight: 850;
}

.form-heading h2 { margin: 0; color: var(--navy-950); font-size: 1.25rem; }
.form-heading p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }

label { display: block; margin: 16px 0 7px; color: var(--navy-950); font-size: 0.82rem; font-weight: 800; }

.label-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; }

.help-button {
  padding: 4px 0;
  color: var(--navy-800);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--ink);
  background: #f9fbfd;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

input:focus {
  background: white;
  border-color: var(--navy-800);
  box-shadow: 0 0 0 4px rgba(24, 60, 118, 0.12);
}

.field-tip { margin: 8px 2px 0; color: var(--muted); font-size: 0.78rem; }

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--orange-500);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(242, 107, 33, 0.28);
  cursor: pointer;
  font-weight: 850;
  transition: transform .18s, filter .18s;
}

.primary-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.primary-button:disabled { cursor: wait; opacity: .7; transform: none; }

.privacy-note { margin: 13px 0 0; color: var(--muted); font-size: 0.73rem; text-align: center; }

.result-shell {
  width: min(1200px, calc(100% - 40px));
  margin: clamp(34px, 6vw, 72px) auto;
}

.status-card {
  padding: clamp(20px, 4vw, 30px);
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: white;
  border: 1px solid var(--line);
  border-left: 6px solid var(--navy-800);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(7, 26, 57, .08);
}

.status-card[data-tone="success"] { border-left-color: var(--teal-600); }
.status-card[data-tone="warning"] { border-left-color: var(--amber-700); }
.status-card[data-tone="scheduled"] { border-left-color: var(--orange-500); }

.status-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--navy-800);
  font-weight: 900;
}

[data-tone="success"] .status-icon { background: var(--teal-600); }
[data-tone="warning"] .status-icon { background: var(--amber-700); }
[data-tone="scheduled"] .status-icon { background: var(--orange-500); }

.status-kicker { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.status-card h2 { margin: 3px 0 5px; color: var(--navy-950); font-size: clamp(1.22rem, 2.5vw, 1.65rem); }
.status-card p { margin: 0; color: var(--muted); }

.map-panel {
  margin-top: 18px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.map-toolbar {
  min-height: 88px;
  padding: 17px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.map-toolbar h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 1.18rem; }
.map-toolbar p { margin: 0; color: var(--muted); font-size: .85rem; }
.status-live { color: var(--teal-600); font-size: .75rem; font-weight: 850; text-transform: uppercase; }
.status-live span { width: 8px; height: 8px; margin-right: 5px; display: inline-block; border-radius: 50%; background: #1abd9f; box-shadow: 0 0 0 5px rgba(26,189,159,.13); }

.map-metrics { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.eta-card { min-width: 152px; padding: 10px 14px; display: grid; gap: 1px; border: 1px solid #cfe8e4; border-radius: 14px; background: #effaf8; }
.eta-card span { color: var(--teal-600); font-size: .67rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.eta-card strong { color: var(--navy-950); font-size: 1.32rem; line-height: 1.15; }
.eta-card small { color: var(--muted); font-size: .72rem; }

#map { width: 100%; height: clamp(390px, 58vh, 680px); background: #dce7ef; }

.map-legend { min-height: 54px; padding: 12px 22px; display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 8px; }
.map-legend i { width: 14px; height: 14px; display: inline-block; border-radius: 50%; }
.legend-bus { background: var(--orange-500); }
.legend-stop { background: var(--navy-900); }

.map-marker { display: grid; place-items: center; background: transparent; filter: drop-shadow(0 0 2px white) drop-shadow(0 4px 5px rgba(7,26,57,.48)); pointer-events: none; }
.map-marker svg { width: 100%; height: 100%; display: block; overflow: visible; }
.map-marker-bus { width: 46px; height: 46px; color: var(--orange-500); }
.map-marker-bus svg { fill: white; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.8; }
.map-marker-stop { width: 38px; height: 38px; color: var(--navy-900); }
.map-marker-stop svg { fill: currentColor; stroke: white; stroke-linejoin: round; stroke-width: 2; paint-order: stroke fill; }

.how-it-works {
  width: min(1200px, calc(100% - 40px));
  margin: clamp(55px, 8vw, 110px) auto;
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.6fr);
  gap: clamp(30px, 7vw, 90px);
}

.how-it-works h2 { margin: 0; color: var(--navy-950); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.how-it-works ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; }
.how-it-works li { min-height: 170px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.how-it-works li span { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--navy-900); border-radius: 50%; font-weight: 800; }
.how-it-works li p { margin: 25px 0 0; color: var(--muted); }

footer {
  min-height: 126px;
  padding: 24px clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 380px);
  align-items: center;
  gap: clamp(24px, 4vw, 54px);
  color: #aebbd0;
  background: var(--navy-950);
  font-size: .8rem;
}

footer p { margin: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: white; font-weight: 750; }
.footer-logo-wrap { width: 132px; height: 40px; padding: 7px 10px; display: grid; place-items: center; border-radius: 8px; background: white; }
.footer-logo-wrap img { width: 100%; height: 100%; display: block; object-fit: contain; }
.footer-license { display: grid; gap: 5px; text-align: center; }
.footer-license p:first-child { color: #e2e9f3; font-weight: 650; }
.footer-license p:last-child { font-size: .72rem; }
.footer-notice { text-align: right; line-height: 1.5; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 54px; }
  .hero-copy { text-align: center; margin-inline: auto; }
  .lookup-card { width: min(100%, 560px); margin-inline: auto; }
  .how-it-works { grid-template-columns: 1fr; }
  .how-it-works ol { grid-template-columns: 1fr; }
  .how-it-works li { min-height: 0; display: grid; grid-template-columns: 38px 1fr; align-items: start; gap: 13px; }
  .how-it-works li p { margin: 4px 0 0; }
  footer { grid-template-columns: auto 1fr; }
  .footer-notice { grid-column: 1 / -1; text-align: center; }
}

@media (max-width: 560px) {
  .site-header { min-height: 68px; padding: 10px 16px; }
  .brand-logo { width: min(70vw, 235px); height: 44px; }
  .back-link { display: none; }
  .hero { padding: 44px 16px 52px; gap: 30px; }
  .hero h1 { font-size: clamp(2.35rem, 14vw, 3.4rem); }
  .lookup-card { border-radius: 18px; }
  .result-shell, .how-it-works { width: calc(100% - 24px); }
  .status-card { gap: 13px; border-radius: 14px; }
  .status-icon { width: 36px; height: 36px; }
  .map-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .map-metrics { justify-content: space-between; gap: 12px; }
  .eta-card { min-width: 145px; }
  #map { height: 56vh; min-height: 350px; }
  .map-legend { justify-content: space-between; gap: 8px; }
  footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-notice { grid-column: auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
