/* ─────────────────────────────────────────────────────────────
   VineBusu — landing page as a bus ride (index.html only)
   Builds on styles.css + vinebusu.css. The map canvas is drawn by
   home.js; every .stop section is a stop on the line.
───────────────────────────────────────────────────────────── */
html { scroll-padding-top: 5rem; }
body { background: var(--ink); }

/* ── Map backdrop ─────────────────────────────────────────── */
.map {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100lvh;
  opacity: 0; transition: opacity 1.2s ease;
}
.has-map .map { opacity: 1; }
/* Fog towards the horizon + a vignette so text stays readable. */
.map-fog {
  position: fixed; inset: 0; z-index: 0; height: 100lvh; pointer-events: none;
  background:
    linear-gradient(180deg, var(--ink) 0%, rgba(11,10,38,.82) 9%, rgba(11,10,38,0) 34%),
    radial-gradient(120% 90% at 50% 55%, transparent 45%, rgba(11,10,38,.6) 100%),
    radial-gradient(60% 50% at 12% 8%, rgba(82,93,244,.22), transparent 70%),
    radial-gradient(50% 45% at 92% 30%, rgba(242,169,203,.10), transparent 70%);
}
.map-note {
  position: fixed; left: 14px; bottom: 10px; z-index: 3;
  margin: 0; font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  color: rgba(179,177,214,.6);
  opacity: 0; transition: opacity .6s ease;
}
.has-map .map-note { opacity: 1; }
.map-note a { text-decoration: underline; text-underline-offset: 2px; }
.map-note a:hover { color: var(--text); }

main, .footer { position: relative; z-index: 2; }

/* ── Top bar: floating glass pill with the "next stop" display ─ */
.topbar {
  position: fixed; top: 12px; left: 50%; z-index: 50;
  translate: -50% 0;
  width: min(1180px, calc(100% - 24px));
  display: flex; align-items: center; gap: 1rem;
  padding: .5rem .55rem .5rem .8rem;
  border-radius: 999px;
  background: rgba(17, 15, 48, .6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
          backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
}
.topbar .wordmark { font-size: 1.12rem; }
.topbar__links { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.topbar__links a:not(.btn) { font-weight: 600; font-size: .92rem; color: var(--muted); transition: color .16s ease; }
.topbar__links a:not(.btn):hover { color: var(--text); }

/* Like the display inside the bus. */
.next {
  display: flex; align-items: baseline; gap: .55rem; min-width: 0;
  margin: 0 0 0 .4rem; padding: .38rem .85rem;
  border-radius: 999px;
  background: rgba(0,0,0,.34);
  border: 1px solid rgba(255,190,158,.16);
  font-variant-numeric: tabular-nums;
}
.next::before {
  content: ""; align-self: center; flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--peach); box-shadow: 0 0 10px var(--peach);
  animation: blink 1.6s steps(2, jump-none) infinite;
}
.next__label { font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); white-space: nowrap; }
.next__stop { font-size: .9rem; font-weight: 800; color: var(--peach); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes blink { 50% { opacity: .25; } }

/* ── Line strip: the page as a list of stops ──────────────── */
.rail {
  position: fixed; left: 26px; top: 50%; z-index: 40;
  translate: 0 -50%;
  height: min(58vh, 520px); width: 14px;
  opacity: 0; transition: opacity .6s ease;
}
.has-map .rail { opacity: 1; }
.rail::before, .rail__fill {
  content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; border-radius: 2px;
}
.rail::before { background: rgba(255,255,255,.16); }
.rail__fill { background: linear-gradient(180deg, var(--sky), #9C8CF8 35%, var(--rose) 70%, var(--peach)); transform-origin: top; transform: scaleY(0); }
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail a {
  position: absolute; left: 0; translate: 0 -50%;
  display: flex; align-items: center; gap: .7rem;
  height: 22px; white-space: nowrap;
}
.rail a i {
  flex: none; width: 8px; height: 8px; margin: 0 3px; border-radius: 50%;
  background: var(--ink); border: 2px solid rgba(255,255,255,.32);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.rail a.is-done i { background: #fff; border-color: #fff; }
.rail a.is-on i { transform: scale(1.5); }
.rail a span {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  padding: .16rem .55rem; border-radius: 999px; background: rgba(17,15,48,.8); border: 1px solid var(--line);
  opacity: 0; translate: -6px 0; pointer-events: none;
  transition: opacity .2s ease, translate .2s ease;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; translate: 0 0; }
.rail__bus {
  position: absolute; left: 7px; top: 0; translate: -50% -50%;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--indigo); border: 3px solid #fff;
  box-shadow: 0 0 0 5px rgba(82,93,244,.3);
  pointer-events: none;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero-ride {
  position: relative;
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: end; gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 1320px; margin: 0 auto;
  padding: 7rem var(--pad) clamp(5.5rem, 12vh, 8rem) max(var(--pad), 88px);
}
.hero-ride::before {
  content: ""; position: absolute; inset: 0 -50vw; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, rgba(11,10,38,.82) 26%, rgba(11,10,38,.4) 48%, rgba(11,10,38,0) 66%);
}
.hero-ride__name {
  margin: 0 0 .1em -.04em;
  font-weight: 900; font-size: clamp(3.6rem, 10.4vw, 9.6rem);
  line-height: .86; letter-spacing: -0.055em;
}
.hero-ride__tag {
  margin: 0 0 1rem; max-width: 20ch;
  font-weight: 800; font-size: clamp(1.3rem, 3.2vw, 2.2rem); line-height: 1.15; letter-spacing: -0.015em;
}
.hero-ride__sub { margin: 0 0 1.7rem; max-width: 46ch; font-size: clamp(1rem, 2.2vw, 1.15rem); color: var(--muted); }
.hero-ride .eyebrow { margin-bottom: .9rem; }
.hero-ride .pills { margin-top: 1.2rem; }
.hero-ride .pill { background: rgba(17,15,48,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero-ride__phone {
  justify-self: center; align-self: center;
  width: min(100%, 290px);
  transform: perspective(1400px) rotateY(-16deg) rotateX(5deg) rotate(2deg);
  transform-origin: 60% 50%;
}
.hero-ride__phone .shot { box-shadow: 40px 50px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12) inset; }

/* "Scroll to depart" */
.depart {
  position: absolute; left: max(var(--pad), 88px); bottom: 1.6rem;
  display: inline-flex; align-items: center; gap: .8rem;
  font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.depart__line { display: inline-grid; place-items: center; min-width: 2.5em; height: 1.9em; padding: 0 .5em; border-radius: .5em; background: var(--indigo); color: #fff; letter-spacing: .02em; font-weight: 800; }
.depart b { color: var(--text); font-weight: 700; }
.depart__arrow { width: 14px; height: 22px; border: 2px solid var(--muted-2); border-radius: 9px; position: relative; }
.depart__arrow::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 5px; margin-left: -1px; border-radius: 2px;
  background: var(--text); animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70%, 100% { transform: translateY(7px); opacity: 0; } }

/* ── Stops ────────────────────────────────────────────────── */
.stop {
  position: relative;
  min-height: 125vh;
  display: flex; align-items: center;
  max-width: 1320px; margin: 0 auto;
  padding: 12vh var(--pad) 12vh max(var(--pad), 88px);
}
.stop--right { flex-direction: row-reverse; padding-inline: var(--pad); }
.stop--center { justify-content: center; padding-inline: var(--pad); min-height: 115vh; }

.panel {
  position: relative; z-index: 1;
  width: min(100%, 470px); flex: none;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: 30px;
  background: linear-gradient(160deg, rgba(28,26,74,.72), rgba(14,13,44,.72));
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
          backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
}
.panel--wide { width: min(100%, 1000px); }
.panel h2 {
  margin: 0 0 .8rem;
  font-weight: 900; font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1; letter-spacing: -0.03em;
  text-wrap: balance;
}
.panel > p { margin: 0; color: var(--muted); font-size: clamp(1rem, 2.1vw, 1.1rem); }
.panel > p + p { margin-top: .8rem; }

/* Stop sign: number, what it is, which stop */
.sign { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.3rem; }
.sign__num {
  display: grid; place-items: center; flex: none;
  width: 2.5rem; height: 2.5rem; border-radius: 12px;
  background: var(--indigo); color: #fff;
  font-weight: 900; font-size: .95rem; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 22px rgba(82,93,244,.45);
}
.sign__text { display: grid; line-height: 1.2; min-width: 0; }
.sign__kind {
  font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text;
  justify-self: start;
}
.sign__stop { font-size: .8rem; font-weight: 600; color: var(--muted-2); }

.ticks { list-style: none; margin: 1.3rem 0 0; padding: 1.1rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .55rem; }
.ticks li { position: relative; padding-left: 1.6rem; font-size: .95rem; font-weight: 600; color: var(--text); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: .7rem; height: .7rem; border-radius: 50%;
  border: 2.5px solid var(--sky);
}

/* Screenshot riding next to the panel */
.stop__shot { width: 232px; flex: none; margin: 0 0 0 -34px; z-index: 2; rotate: 4deg; }
.stop--right .stop__shot { margin: 0 -34px 0 0; rotate: -4deg; }
.shot.is-empty { display: none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stop__shot, .hero-ride__phone .shot { animation: drift linear both; animation-timeline: view(); }
    .hero-ride__phone .shot { animation-name: drift-hero; animation-range: exit 0% exit 100%; }
    @keyframes drift { from { translate: 0 70px; } to { translate: 0 -70px; } }
    @keyframes drift-hero { to { translate: 0 -90px; opacity: .2; } }
  }
}

/* Honest estimates */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 1.6rem; background: var(--line); border-radius: 20px; overflow: hidden; }
.fact { padding: 1.3rem 1.4rem 1.4rem; background: rgba(14,13,44,.86); }
.fact h3 { margin: 0 0 .4rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: .6rem; }
.fact h3::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--dot, var(--sky)); box-shadow: 0 0 12px var(--dot, var(--sky)); flex: none; }
.fact p { margin: 0; color: var(--muted); font-size: .97rem; }
.panel__lead { max-width: 56ch; }

/* Big statement, straight on the map */
.say { text-align: center; }
.say::before {
  content: ""; position: absolute; inset: 10% -50vw; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(11,10,38,.86), rgba(11,10,38,0));
}
.say p { margin: 0; }
.say__line { font-weight: 900; font-size: clamp(2.6rem, 10vw, 7.4rem); line-height: .94; letter-spacing: -0.04em; }
.say__line--stroke { color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.5); }
.say__note { margin-top: 1.5rem !important; font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--muted); }

/* Data & attribution inside a panel */
.panel .data { margin-top: 1.4rem; padding: 0; background: none; border: 0; border-radius: 0; }

/* Terminus */
.terminus { text-align: center; min-height: 100vh; padding-top: 30vh; padding-bottom: 8vh; }
.terminus::before {
  content: ""; position: absolute; inset: 0 -50vw; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 50% 46%, rgba(11,10,38,.8), rgba(11,10,38,0)),
    linear-gradient(180deg, rgba(11,10,38,0) 70%, var(--ink) 100%);
}
.terminus .contact__title { font-size: clamp(2.6rem, 9vw, 6.6rem); letter-spacing: -0.04em; }
.terminus .sign { justify-content: center; }
.terminus .sign__text { text-align: left; }

.footer { background: var(--ink); max-width: none; padding-inline: max(var(--pad), calc((100% - var(--maxw)) / 2)); }

/* ── Reveal: panels pull in like a bus at the kerb ────────── */
.reveal { transform: translateY(26px) scale(.98); filter: blur(6px); transition: opacity .7s ease, transform .8s cubic-bezier(.2,.7,.2,1), filter .7s ease; }
.reveal.is-in { filter: none; }
html:not(.js) .reveal { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { filter: none; }
  .next::before, .depart__arrow::after { animation: none; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .rail { display: none; }
  .hero-ride, .stop { padding-left: var(--pad); }
  .depart { left: var(--pad); }
  .topbar__links a:not(.btn) { display: none; }
}
@media (max-width: 860px) {
  /* The map gets the top of the screen, the panel rides in from below. */
  .hero-ride { grid-template-columns: 1fr; align-items: end; padding-top: 44vh; padding-bottom: 6.5rem; }
  .hero-ride::before { background: linear-gradient(180deg, rgba(11,10,38,0) 12%, rgba(11,10,38,.82) 46%, rgba(11,10,38,.92)); }
  .hero-ride__phone { display: none; }
  .stop, .stop--right { flex-direction: column; align-items: stretch; min-height: 0; padding: 62vh 14px 8vh; }
  .stop--center { padding-top: 46vh; }
  .panel { width: 100%; border-radius: 26px; }
  .stop__shot, .stop--right .stop__shot { width: min(62%, 240px); margin: -18px auto 0; rotate: 2deg; }
  .facts { grid-template-columns: 1fr; }
  .say::before { inset: 30% -50vw 0; }
  .terminus { padding-top: 40vh; min-height: 100vh; justify-content: flex-end; }
  .next__label { display: none; }
  .topbar { gap: .5rem; }
  .topbar .wordmark { display: none; }
  .topbar__links { gap: .6rem; }
  .map-note { font-size: .6rem; left: 10px; bottom: 6px; }
}
