:root {
  --cobalt: #1B3FE0;
  --ink: #0A1650;
  --paper: #F4F6FF;
  --red: #EE2B3B;
  --sun: #FFD23F;
  --white: #FFFFFF;
  --flap: #141A2B;
  --flap-ink: #F6F4EA;
  /* Spacing scale: everything below uses these steps. */
  --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-24: 24px; --s-32: 32px; --s-40: 40px;
  --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
  --section: 48px;
  --peek: 58px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --board: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s-16); }
body {
  font-family: var(--display);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.airmail {
  height: 10px;
  background: repeating-linear-gradient(-45deg,
    var(--red) 0 16px, var(--white) 16px 32px,
    var(--cobalt) 32px 48px, var(--white) 48px 64px);
}

/* Hero */
.hero {
  background: var(--cobalt);
  color: var(--white);
  padding: var(--s-16) var(--gutter) var(--s-24);
  display: flex; flex-direction: column;
  min-height: calc(100vh - 10px - var(--peek));
  min-height: calc(100svh - 10px - var(--peek));
  border-radius: 0 0 22px 22px;
  overflow-x: clip;
}
.top { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0 auto var(--s-24); }
.logo { display: inline-flex; align-items: center; min-height: 44px; font-size: 27px; font-weight: 800; letter-spacing: -0.04em; text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: var(--s-8); }
.sound {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: var(--white);
}
.sound .mute { display: none; }
.sound[aria-pressed='false'] .mute { display: block; }
.sound[aria-pressed='false'] .wave { display: none; }
.top-join {
  display: inline-flex; align-items: center; min-height: 44px;
  background: var(--sun); color: var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none;
  padding: 0 var(--s-16); border-radius: 999px;
}
h1 {
  width: 100%; margin: auto auto 0;
  /* Safe size before fonts load. fitTitle() in app.js then measures the real text on the device. */
  font-size: min(calc((100vw - 2 * var(--gutter)) / 7.4), 96px);
  font-weight: 800; line-height: .94; letter-spacing: -0.045em;
  white-space: nowrap;
  font-variation-settings: 'opsz' 96;
}
.lede { width: 100%; margin: var(--s-16) auto var(--s-24); font-size: clamp(18px, 2.4vw, 22px); line-height: 1.3; opacity: .92; }

/* Departure board */
.board-wrap {
  flex: 1 1 0; display: grid; width: 100%; margin: 0 auto;
  min-height: 190px; max-height: 118vw;
  background: #000; border-radius: 12px; padding: var(--s-8);
}
.board { container-type: size; display: grid; gap: var(--s-8); grid-template-rows: repeat(var(--r), minmax(0, 1fr)); }
.row {
  display: grid; width: 100%; min-height: 0; padding: 0; border: 0; background: none;
  grid-template-columns: repeat(var(--n), 1fr); grid-auto-rows: minmax(0, 1fr); gap: 2px;
  border-radius: 4px;
}
.f {
  position: relative; perspective: 90px;
  font-family: var(--board); font-weight: 600;
  font-size: min(calc(100cqw / var(--n) * 1.12), calc(100cqh / var(--lines) * .86)); line-height: 1;
  color: var(--flap-ink);
}
.f.fare { color: var(--sun); }
.f.was { color: #C9CFE3; }
.f.struck::before {
  content: ''; position: absolute; left: -2px; right: -2px; top: calc(50% - 1px);
  height: 3px; background: var(--red); z-index: 4;
}
.f > span {
  position: absolute; left: 0; right: 0; height: 50%; overflow: hidden;
  background: var(--flap);
}
.f .t, .f .l { top: 0; border-radius: 3px 3px 0 0; }
.f .b { bottom: 0; border-radius: 0 0 3px 3px; }
.f b { position: absolute; left: 0; right: 0; height: 200%; display: grid; place-items: center; font-weight: 600; }
.f .t b, .f .l b { top: 0; }
.f .b b { bottom: 0; }
.f .l { transform-origin: bottom; z-index: 2; visibility: hidden; backface-visibility: hidden; background: #1C2338; }
.f::after {
  content: ''; position: absolute; left: 0; right: 0; top: calc(50% - .5px);
  height: 1px; background: #000; z-index: 3;
}

/* City picker */
.cities {
  margin: var(--s-24) auto 0;
  display: flex; gap: var(--s-8); overflow-x: auto; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
  margin-bottom: auto;
}
.cities::-webkit-scrollbar { display: none; }
.city {
  flex: none; min-height: 44px; padding: 0 var(--s-16); border-radius: 999px;
  background: transparent; color: var(--white);
  border: 2px solid rgba(255, 255, 255, .45);
  font-weight: 600; font-size: 16px;
}
.city[aria-pressed='true'] { background: var(--white); border-color: var(--white); color: var(--cobalt); }

/* Deals */
main { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
h2 { font-size: clamp(32px, 6vw, 52px); font-weight: 800; line-height: 1; letter-spacing: -0.035em; font-variation-settings: 'opsz' 72; }
/* Sits in the last strip of the fold, so the next section shows on load and invites the scroll. */
.deals-head { min-height: var(--peek); display: flex; align-items: center; justify-content: space-between; gap: var(--s-12); }
.deals-head h2 { min-width: 0; font-size: clamp(20px, 6vw, 52px); white-space: nowrap; }
.more {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--sun); color: var(--ink);
  animation: nudge 1.5s ease-in-out infinite; transition: opacity .2s ease;
}
.scrolled .more { opacity: 0; pointer-events: none; animation: none; }
@keyframes nudge { 50% { transform: translateY(5px); } }
.tickets { display: grid; gap: var(--s-12); margin-top: var(--s-8); }
.ticket {
  --notch: 11px;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  width: 100%; text-align: left; border: 0;
  background: var(--white);
  border-radius: 14px; overflow: hidden;
  -webkit-mask: radial-gradient(circle var(--notch) at calc(100% - 118px) 0, #0000 98%, #000) top,
                radial-gradient(circle var(--notch) at calc(100% - 118px) 100%, #0000 98%, #000) bottom;
  -webkit-mask-size: 100% 51%; -webkit-mask-repeat: no-repeat;
  mask: radial-gradient(circle var(--notch) at calc(100% - 118px) 0, #0000 98%, #000) top,
        radial-gradient(circle var(--notch) at calc(100% - 118px) 100%, #0000 98%, #000) bottom;
  mask-size: 100% 51%; mask-repeat: no-repeat;
  transition: transform .15s ease;
}
.ticket:active { transform: scale(.985); }
.ticket-main { padding: var(--s-16); min-width: 0; }
.ticket-to { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.ticket-meta { display: block; font-size: 15px; color: #4B5688; margin-top: var(--s-4); }
.ticket-stub {
  width: 118px; padding: var(--s-16) var(--s-8); text-align: center; align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
  border-left: 2px dashed #D4DAF5;
}
.ticket-price { font-size: 29px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--cobalt); }
.ticket-was { font-size: 16px; color: #6A7399; margin-top: var(--s-4); text-decoration-color: var(--red); text-decoration-thickness: 2px; }

.all {
  display: block; margin-top: var(--s-16); padding: var(--s-16); border-radius: 12px; text-align: center;
  font-weight: 800; font-size: 18px; letter-spacing: -0.02em; text-decoration: none;
  background: var(--cobalt); color: var(--white);
}

/* Pays for itself */
.pays { margin-top: var(--section); padding: var(--s-24); border-radius: 18px; background: var(--sun); }
.pays-line { margin-top: var(--s-12); max-width: 26em; font-size: clamp(20px, 3vw, 26px); line-height: 1.25; letter-spacing: -0.015em; }
.pays-line strong { font-weight: 800; }
.bars { margin-top: var(--s-24); display: grid; gap: var(--s-12); }
.bar i { display: block; height: 22px; min-width: 6px; border-radius: 5px; background: var(--ink); }
.bar.fee i { background: var(--red); }
.bar span { display: block; margin-top: var(--s-4); font-size: 15px; font-weight: 600; }
.bar span span { display: inline; margin: 0; }

/* How */
.how { margin-top: var(--section); }
.how ol { list-style: none; padding: 0; margin-top: var(--s-24); display: grid; gap: var(--s-24); counter-reset: s; }
.how li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; column-gap: var(--s-12); max-width: 34em; }
.how li::before {
  content: counter(s); grid-row: span 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: var(--sun); font-weight: 800; font-size: 20px;
}
.how strong { display: block; font-size: 20px; letter-spacing: -0.02em; }

/* Past deals */
.past { margin-top: var(--section); }
.past-lede { margin-top: var(--s-8); color: #4B5688; }
.past-grid { margin-top: var(--s-24); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-12); }
.gone { position: relative; overflow: hidden; padding: var(--s-16); border-radius: 14px; background: var(--white); }
.gone h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; min-height: 2.2em; }
.gone-price { margin-top: var(--s-4); }
.gone-price strong { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.gone-price s { font-size: 15px; color: #6A7399; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.gone-on { font-size: 14px; color: #4B5688; }
.stamp {
  position: absolute; right: var(--s-8); bottom: var(--s-8); padding: 0 var(--s-4);
  border: 2px solid var(--red); border-radius: 5px; color: var(--red);
  font-family: var(--board); font-size: 17px; line-height: 1.15;
  transform: rotate(-13deg);
}

/* Join */
.join { margin-top: var(--section); }
.pass, .sheet { --pad: var(--s-24); }
.pass { background: var(--ink); color: var(--white); border-radius: 18px; overflow: hidden; padding-bottom: var(--pad); max-width: 560px; margin: 0 auto; }
.pass h2 { padding: var(--pad) var(--pad) 0; }
.join-lede { padding: var(--s-12) var(--pad) 0; }
.wait { display: grid; padding: var(--s-16) var(--pad) 0; }
.wait label { display: block; margin-bottom: var(--s-4); font-size: 15px; font-weight: 600; }
.wait[hidden] { display: none; }
.wait input {
  width: 100%; min-height: 52px; padding: 0 var(--s-16); margin-bottom: var(--s-12);
  border: 0; border-radius: 12px; background: var(--white); color: var(--ink);
  font: inherit; font-size: 18px;
}
.wait .cta { width: 100%; margin: var(--s-4) 0 0; }
.picker { position: relative; }
#homeList {
  list-style: none; padding: var(--s-4); margin: calc(var(--s-4) * -2) 0 var(--s-12);
  max-height: 250px; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 12px; background: var(--white); color: var(--ink);
}
#homeList li { display: flex; align-items: center; min-height: 44px; padding: 0 var(--s-12); border-radius: 8px; cursor: pointer; }
#homeList li.on, #homeList li[aria-selected='true'] { background: var(--paper); }
#homeList li.none { color: #4B5688; cursor: default; }
.wait .cta:disabled { opacity: .6; }
.fine { padding: var(--s-12) var(--pad) 0; font-size: 14px; opacity: .75; }
.cta {
  display: block; width: calc(100% - 2 * var(--pad)); margin: 0 var(--pad); padding: var(--s-16);
  border: 0; border-radius: 12px; text-align: center; text-decoration: none;
  background: var(--red); color: var(--white);
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
}
.cta:active { transform: translateY(1px); }
.soon { padding: var(--s-12) var(--pad) 0; font-size: 16px; font-weight: 600; color: var(--sun); }
.soon:empty { display: none; }

/* FAQ */
.faq { max-width: 720px; margin: var(--section) auto; }
.faq h2 { margin-bottom: var(--s-16); }
.faq details { border-top: 2px solid #D4DAF5; }
.faq details:last-child { border-bottom: 2px solid #D4DAF5; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-16);
  padding: var(--s-16) 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-size: 26px; line-height: 1; color: var(--cobalt); }
.faq details[open] summary::after { content: '\2212'; }
.faq details p { padding: 0 0 var(--s-16); max-width: 36em; }

/* Last call */
.last { background: var(--cobalt); color: var(--white); text-align: center; padding-bottom: var(--section); }
.last h2 { padding: var(--section) var(--gutter) 0; max-width: 14em; margin: 0 auto; }
.last-cta {
  display: inline-block; margin-top: var(--s-24); padding: var(--s-16) var(--s-32); border-radius: 999px;
  background: var(--sun); color: var(--ink);
  font-size: 19px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none;
}

.foot { padding: var(--s-32) var(--gutter) calc(var(--s-32) + env(safe-area-inset-bottom)); text-align: center; color: #4B5688; font-size: 14px; }
.foot span { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }

/* Deal sheet */
.sheet {
  width: 100%; max-width: 480px; margin: auto auto 0; padding: 0 0 calc(var(--pad) + env(safe-area-inset-bottom));
  border: 0; border-radius: 20px 20px 0 0; overflow: hidden;
  background: var(--white); color: var(--ink);
}
.sheet::backdrop { background: rgba(10, 22, 80, .62); }
.sheet[open] { animation: rise .24s cubic-bezier(.2, .9, .3, 1); }
@keyframes rise { from { transform: translateY(60px); } }
.close { position: absolute; top: calc(10px + var(--s-16)); right: var(--s-16); width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); font-size: 26px; line-height: 1; }
.route { padding: var(--pad) var(--pad) 0; font-size: 16px; color: #4B5688; }
.sheet h3 { padding: var(--s-4) calc(var(--pad) + 44px) 0 var(--pad); font-size: 42px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.sheet-price { padding: var(--s-16) var(--pad) 0; display: flex; align-items: baseline; gap: var(--s-12); }
.sheet-price strong { font-size: 54px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; color: var(--cobalt); }
.sheet-price s { font-size: 21px; color: #6A7399; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.saved { margin: var(--s-12) var(--pad) 0; display: inline-block; padding: var(--s-4) var(--s-12); border-radius: 6px; background: var(--sun); font-weight: 600; font-size: 16px; }
.dates-title { padding: var(--s-16) var(--pad) var(--s-8); font-weight: 600; }
.dates { list-style: none; padding: 0 var(--pad) var(--s-16); display: grid; gap: var(--s-8); }
.dates li { padding: var(--s-8) var(--s-16); border-radius: 10px; background: var(--paper); }
.tip { padding: 0 var(--pad) var(--pad); font-size: 16px; line-height: 1.35; }
.tip strong { display: block; font-weight: 600; }

@media (max-width: 374px) {
  .past-grid { grid-template-columns: 1fr; }
  .gone h3 { min-height: 0; }
}

@media (max-width: 759px) and (max-height: 720px) {
  .hero { padding-top: var(--s-8); padding-bottom: var(--s-12); }
  .top { margin-bottom: var(--s-16); }
  .lede { margin: var(--s-12) auto; }
  .cities { margin-top: var(--s-12); }
}

@media (min-width: 760px) {
  /* Hero width follows the window height, so type and board scale together to fill the fold. */
  :root {
    --gutter: max(32px, env(safe-area-inset-left), env(safe-area-inset-right));
    --section: 80px;
    --peek: 72px;
    --chrome: calc(345px + var(--peek));
    --w: min(100vw - 2 * var(--gutter), 1500px, max(600px, (100svh - var(--chrome)) / .417));
  }
  .hero { padding-bottom: var(--s-40); }
  .top { margin-bottom: var(--s-40); }
  .top, h1, .lede, .board-wrap, .cities, .deals, .pays, .how, .past { width: var(--w); max-width: 100%; }
  .deals, .pays, .how, .past { margin-inline: auto; }
  .city-break { display: none; }
  h1 { font-size: calc(var(--w) * .074); }
  .lede { font-size: clamp(15px, calc(var(--w) * .02), 22px); }
  .cities { margin-inline: auto; padding-inline: 0; }
  .board-wrap { padding: var(--s-12); min-height: 300px; max-height: calc(var(--w) * .42); }
  .row { gap: 3px; }
  .board { gap: var(--s-8); }
  .tickets { grid-template-columns: 1fr 1fr; gap: var(--s-16); }
  .how ol { grid-template-columns: repeat(3, 1fr); gap: var(--s-32); }
  .pays { padding: var(--s-40); }
  .past-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-16); }
  .gone { padding: var(--s-24); }
  .gone h3 { min-height: 0; }
  .sheet { margin: auto; border-radius: 20px; }
}

@media (min-width: 760px) and (max-height: 720px) {
  :root { --chrome: calc(300px + var(--peek)); }
  .hero { padding-bottom: var(--s-16); }
  .top { margin-bottom: var(--s-16); }
  .board-wrap { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sheet[open] { animation: none; }
  .more { animation: none; }
  .ticket { transition: none; }
}
