/* AllBusApp 2.0 site — the app's "Quiet Board" foundation on the web.
   One brand color (TheBus yellow), ink and grey on a warm ground, SF-style type. */

:root {
  --ground: #F5F3EC;
  --surface: #FFFFFF;
  --ink: #161616;
  --ink-2: #6B6B66;
  --hairline: rgba(22, 22, 22, 0.08);
  --brand: #FFC72C;
  --on-brand: #161616;
  --live: #1E9E52;
  --late: #B7791F;
  --you: #1A73E8;
  --shadow: 0 10px 30px rgba(22, 22, 22, 0.10);
  --shadow-soft: 0 2px 10px rgba(22, 22, 22, 0.06);
  --glass: rgba(255, 255, 255, 0.78);
  --backdrop: url("../images/brand/backdrop-light.png");
  --backdrop-opacity: 0.12;
  --radius: 20px;
  --radius-sm: 12px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #111214;
    --surface: #1B1C1F;
    --ink: #F3F1EA;
    --ink-2: #A3A39C;
    --hairline: rgba(243, 241, 234, 0.10);
    --live: #3FCB74;
    --late: #E0A83A;
    --you: #4A9BFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
    --glass: rgba(36, 37, 41, 0.82);
    --backdrop: url("../images/brand/backdrop-dark.png");
    --backdrop-opacity: 0.07;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #111214;
  --surface: #1B1C1F;
  --ink: #F3F1EA;
  --ink-2: #A3A39C;
  --hairline: rgba(243, 241, 234, 0.10);
  --live: #3FCB74;
  --late: #E0A83A;
  --you: #4A9BFF;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.35);
  --glass: rgba(36, 37, 41, 0.82);
  --backdrop: url("../images/brand/backdrop-dark.png");
  --backdrop-opacity: 0.07;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }

.num {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.muted { color: var(--ink-2); }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.wordmark img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--ink-2); font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.site-nav a:hover { color: var(--ink); background: var(--hairline); }
.site-nav .nav-cta { color: var(--on-brand); background: var(--brand); font-weight: 600; padding: 8px 16px; margin-left: 8px; }
.site-nav .nav-cta:hover { background: var(--brand); filter: brightness(0.96); }
@media (max-width: 720px) { .site-nav a:not(.nav-cta) { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px; border: 0;
  font: inherit; font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--on-brand); background: var(--brand);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); }
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-badges a { display: inline-flex; border-radius: 10px; }
.store-badges img { height: 52px; width: auto; }
/* Google's badge ships with built-in padding; oversize and pull it in to match the App Store one. */
.store-badges img.gp { height: 76px; margin: -12px; }
@media (max-width: 480px) {
  .store-badges { gap: 8px; }
  .store-badges img { height: 44px; }
  .store-badges img.gp { height: 64px; margin: -10px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46vw; max-height: 520px;
  background: var(--backdrop) center bottom / min(1100px, 120%) no-repeat;
  opacity: var(--backdrop-opacity); pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); font-weight: 700; }
.hero h1 .badge-inline {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 0.08em;
  min-width: 0.95em; height: 0.78em; padding: 0 0.22em; margin: 0 0.06em; border-radius: 0.18em;
  background: var(--brand); color: var(--on-brand); font-size: 0.72em; font-weight: 700;
}
.hero .lede { margin-top: 20px; font-size: clamp(18px, 2vw, 22px); color: var(--ink-2); max-width: 30em; }
.hero .store-badges { margin-top: 32px; }
.hero .fine { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
}

/* Phone + board composition */
.stage { position: relative; display: grid; place-items: center; min-height: 560px; }
.phone {
  position: relative; width: 272px; aspect-ratio: 1320 / 2868; border-radius: 44px;
  background: #0b0b0c; padding: 10px; box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 36px; }
.phone::before {
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 26px; border-radius: 13px; background: #0b0b0c; z-index: 2;
}
.board {
  position: absolute; right: 0; bottom: 48px; width: min(340px, 92%);
  background: var(--glass); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 6px;
}
@media (max-width: 1000px) { .board { right: -8px; } }
@media (max-width: 480px) { .stage { min-height: 620px; } .board { bottom: 0; width: 100%; } }
.board-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 8px; }
.board-head strong { font-size: 17px; }
.board-head span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; }
.dot.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }

.row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--hairline);
}
.row:first-of-type { border-top: 0; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 32px; padding: 0 6px; border-radius: 9px;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 17px;
}
.badge.rail { background: var(--ink); color: var(--surface); font-size: 12px; letter-spacing: 0.04em; }
.row .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row .head { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { display: flex; align-items: baseline; gap: 5px; justify-content: flex-end; }
.count .n { font-size: 26px; font-weight: 600; line-height: 1; }
.count .u { font-size: 13px; color: var(--ink-2); }
.count.sched .n { color: var(--ink-2); }
.count .clock { width: 13px; height: 13px; color: var(--ink-2); align-self: center; }
.count .dot { align-self: center; }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section.tight { padding: 56px 0; }
.section-head { max-width: 40em; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; margin-top: 10px; }
.section-head p { margin-top: 14px; font-size: 18px; color: var(--ink-2); }

/* Feature stories: text + screenshot, alternating */
.story {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  padding: 40px 0; border-top: 1px solid var(--hairline);
}
.story:first-of-type { border-top: 0; }
.story:nth-of-type(even) .story-media { order: -1; }
.story h3 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; }
.story p { margin-top: 14px; font-size: 18px; color: var(--ink-2); max-width: 30em; }
.story ul { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.story li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.story li svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--live); }
.story-media { display: grid; place-items: center; }
.story-media .phone { width: 250px; }
@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; gap: 28px; }
  .story:nth-of-type(even) .story-media { order: 0; }
}

/* Feature grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 12px;
}
.card .icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand);
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 20px; font-weight: 700; }
.card p { color: var(--ink-2); font-size: 16px; }

/* Islands */
.islands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .islands { grid-template-columns: 1fr; } }
.island { background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-soft); }
.island h3 { font-size: 26px; font-weight: 700; }
.island .agency { margin-top: 4px; color: var(--ink-2); }
.island .pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--hairline);
}
.island ul { margin: 18px 0 0; padding: 0; list-style: none; color: var(--ink-2); display: grid; gap: 8px; }

/* Download */
.download {
  display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center;
  background: var(--surface); border-radius: 28px; padding: 40px; box-shadow: var(--shadow-soft);
}
.download .qr { width: 168px; height: 168px; border-radius: 16px; background: #fff; padding: 8px; }
.download h2 { font-size: clamp(28px, 3.5vw, 40px); font-weight: 700; }
.download p { margin-top: 12px; color: var(--ink-2); }
.download .store-badges { margin-top: 24px; }
@media (max-width: 720px) { .download { grid-template-columns: 1fr; padding: 28px; } .download .qr { display: none; } }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 760px; }
.faq details { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-soft); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 20px; font-weight: 600; font-size: 17px; min-height: 56px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 10px; height: 10px; flex: none;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg); transition: transform 0.2s ease; margin-right: 4px;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 20px 20px; color: var(--ink-2); }

/* Support */
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .support { grid-template-columns: 1fr; } }
.support .card p a { color: var(--ink); font-weight: 600; }

/* Footer */
.site-footer { position: relative; overflow: hidden; padding: 64px 0 40px; margin-top: 40px; border-top: 1px solid var(--hairline); }
.site-footer::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 260px;
  background: var(--backdrop) right bottom / 720px no-repeat; opacity: var(--backdrop-opacity); pointer-events: none;
}
.site-footer .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer h4 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--ink); }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline); font-size: 14px; color: var(--ink-2); grid-column: 1 / -1; }

/* Legal pages */
.legal-page { padding: 56px 0 80px; }
.legal-page article { max-width: 720px; }
.legal-page h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 700; }
.legal-page .updated { margin-top: 10px; color: var(--ink-2); }
.legal-page h2 { font-size: 22px; font-weight: 700; margin: 40px 0 12px; }
.legal-page h3 { font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
.legal-page p, .legal-page li { color: var(--ink); line-height: 1.6; }
.legal-page p + p { margin-top: 12px; }
.legal-page ul { padding-left: 22px; margin: 12px 0; display: grid; gap: 6px; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.legal-page th, .legal-page td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.legal-page th { color: var(--ink-2); font-weight: 600; }
.legal-page a { color: var(--ink); }
.legal-page .card { margin-top: 24px; }
