/* =========================================================
   Brandon's 2nd Birthday — "Wheels on the Bus" invitation
   ========================================================= */

:root {
  --sky-top: #9bd4f5;
  --sky-mid: #bce6fb;
  --sky-bottom: #e2f4ff;
  --blue: #1f5fd0;
  --blue-dark: #16408f;
  --blue-light: #5b9be8;
  --yellow: #ffce31;
  --yellow-dark: #f2b100;
  --white: #ffffff;
  --green: #6fbf4f;
  --green-dark: #4e9e37;
  --red: #e8503a;
  --road: #38404e;
  --road-light: #4a5464;
  --text: #22344f;
  --text-soft: #52627b;
  --card: #ffffff;
  --shadow: 0 14px 34px rgba(22, 64, 143, 0.16);
  --shadow-sm: 0 6px 16px rgba(22, 64, 143, 0.14);
  --radius: 26px;
  --font-head: "Fredoka", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--sky-bottom);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .count-num, .celebrant { font-family: var(--font-head); }

/* ================= ENTER GATE ================= */
.enter-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
  transition: opacity .6s ease, visibility .6s ease;
  padding: 24px;
  text-align: center;
}
.enter-gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* keep the ambient bits clear of the ticket */
.gate-sky .star-1 { top: 12%; left: 18%; }
.gate-sky .star-2 { top: 8%; left: 76%; }
.gate-sky .star-3 { top: 86%; left: 28%; }
/* negative delays start each cloud mid-journey, so the sky is already
   populated the moment the gate opens instead of filling up from the left */
.gate-sky .cloud-1 { top: 9%; animation-delay: -6s; }
.gate-sky .cloud-2 { top: 19%; animation-delay: -17s; }
.gate-sky .cloud-3 { top: 30%; animation-delay: -11s; }
.gate-sky .cloud-4 { top: 38%; animation-delay: -3s; }
/* balloons stay in the upper sky so the ticket never has to fight them */
.gate-balloons { top: 5%; bottom: 58%; z-index: 0; }
/* a strip of road along the bottom, so the ticket is standing at the stop
   rather than floating in an empty sky */
.gate-road {
  position: absolute; left: 0; right: 0; bottom: 0; height: 76px;
  background: linear-gradient(180deg, var(--road-light), var(--road));
  box-shadow: 0 -3px 0 var(--green-dark), 0 -9px 0 var(--green);
  overflow: hidden;
}
.gate-road .road-line { top: 46%; }
.gate-stop {
  position: absolute; right: 11%; bottom: 68px; font-size: 46px;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18));
  animation: bob 3.2s ease-in-out infinite;
}
/* Two copies of the hero bus take turns on the road: the yellow one drives off
   to the right, then the blue one comes back from the right. */
.gate-bus {
  position: absolute; left: 0; bottom: 14px;
  width: clamp(112px, 30vw, 170px); line-height: 0;
}
.gate-bus .bus { width: 100%; height: auto; filter: drop-shadow(0 8px 7px rgba(0, 0, 0, .22)); }
/* the artwork's wheels spin clockwise: reversed reads correctly for the mirrored
   yellow bus, and for the blue one actually travelling leftwards */
.gate-bus .wheel { animation-direction: reverse; }

.gate-bus-yellow { animation: driveAcross 16s linear infinite; }
.gate-bus-yellow .bus { animation: gateBusBob 1s ease-in-out infinite; }
/* flip the roof lettering back, otherwise the mirror renders it "YPPAH" */
.gate-bus-yellow .bus text { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }

.gate-bus-blue { animation: driveBack 16s linear infinite; }
.gate-bus-blue .bus { animation: bob 1s ease-in-out infinite; }

/* The gate is a bus ticket: tear off the stub and you're on board. */
.ticket {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 24px;
  box-shadow: 0 26px 50px rgba(22, 64, 143, .26);
  overflow: hidden;
  animation: ticketIn .7s cubic-bezier(.2, .8, .3, 1) both;
}
.ticket-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  color: #fff; padding: 13px 18px;
}
.ticket-bus { font-size: 28px; animation: busHop 2.4s ease-in-out infinite; }
.ticket-route {
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  letter-spacing: 1.6px; text-transform: uppercase;
}
/* Perforation between the stub and the pass — the notches sit on the card edges. */
.ticket-tear { position: relative; height: 0; margin: 0 16px; border-top: 3px dashed #d7e7fa; }
.ticket-tear::before, .ticket-tear::after {
  content: ""; position: absolute; top: 0; width: 26px; height: 26px;
  border-radius: 50%; transform: translateY(-50%);
  /* the gate's own gradient, painted against the viewport, so the punch-outs
     line up with the sky behind them instead of showing a seam */
  background: linear-gradient(160deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom)) fixed;
}
.ticket-tear::before { left: -29px; }
.ticket-tear::after { right: -29px; }

.ticket-body { padding: 20px 24px 24px; text-align: center; }
.ticket-eyebrow {
  font-family: var(--font-head); font-size: 12px; font-weight: 600;
  letter-spacing: 2.6px; text-transform: uppercase; color: var(--blue);
}
.enter-title {
  font-size: clamp(26px, 7vw, 36px);
  color: var(--blue-dark);
  margin: 4px 0 16px;
  text-shadow: 2px 2px 0 rgba(31, 95, 208, .12);
}
.ticket-rows {
  display: flex; gap: 16px; text-align: left; margin-bottom: 18px; padding: 13px 0;
  border-top: 2px dashed #e4eefb; border-bottom: 2px dashed #e4eefb;
}
.ticket-rows > div { flex: 1 1 0; min-width: 0; }
.ticket-rows dt {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-soft);
}
.ticket-rows dd {
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  color: var(--blue-dark); margin-top: 3px; overflow-wrap: anywhere;
}
.ticket-rows dd span { display: block; }
.ticket-time { color: var(--blue); font-size: 14px; }
.enter-btn {
  width: 100%;
  font-family: var(--font-head);
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  border: none;
  border-radius: 999px;
  padding: 15px 30px;
  cursor: pointer;
  box-shadow: 0 7px 0 var(--blue-dark);
  transition: transform .12s ease, box-shadow .12s ease;
  animation: pulse 1.6s ease-in-out infinite;
}
.enter-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--blue-dark); }
.enter-sub { color: var(--text-soft); font-weight: 700; font-size: 13px; margin-top: 11px; }

/* ================= CONTROLS ================= */
.controls {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  right: 0;
  margin: 12px 12px;
  z-index: 60;
  display: flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(22, 64, 143, 0.12);
}
.control-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-dark));
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
  display: grid; place-items: center;
}
.control-btn:hover { transform: scale(1.08) rotate(-4deg); }
.control-btn:active { transform: scale(.95); }
.music-icon { display: inline-block; }
.music-icon.playing { animation: spin 2.4s linear infinite; }

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 66px;
  padding-bottom: max(34vh, 230px); /* keep card clear of the road/bus scene below */
}
.sky {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
  z-index: 0;
}
/* sits just behind the treeline so the buildings read as distance */
.city { position: absolute; bottom: 17%; left: 0; width: 100%; height: 32vh; z-index: 1; }
.city-far { opacity: .55; }
.city-near { opacity: .66; }
.city-windows { opacity: .4; }

/* clouds */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: .9;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.05));
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud-1 { width: 90px; height: 34px; top: 12%; left: -120px; animation: drift 19s linear infinite; }
.cloud-2 { width: 130px; height: 44px; top: 22%; left: -160px; animation: drift 26s linear infinite 4s; }
.cloud-3 { width: 70px; height: 28px; top: 8%; left: -100px; animation: drift 16s linear infinite 7s; }
.cloud-4 { width: 110px; height: 40px; top: 30%; left: -140px; animation: drift 23s linear infinite 2s; }
.cloud::before { width: 55%; height: 160%; top: -40%; left: 10%; }
.cloud::after  { width: 55%; height: 150%; top: -30%; right: 12%; }

/* stars */
.star { position: absolute; color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.9); opacity: .9; animation: twinkle 2.6s ease-in-out infinite; z-index: 1; }
.star-1 { top: 14%; left: 22%; font-size: 18px; }
.star-2 { top: 26%; left: 74%; font-size: 22px; animation-delay: .5s; color: var(--yellow); }
.star-3 { top: 40%; left: 15%; font-size: 16px; animation-delay: 1s; color: var(--blue); }
.star-4 { top: 18%; left: 55%; font-size: 14px; animation-delay: 1.4s; }
.star-5 { top: 45%; left: 82%; font-size: 20px; animation-delay: .8s; color: var(--red); }

/* bunting */
.bunting { position: absolute; top: 0; left: 0; width: 100%; height: 70px; z-index: 3; }
.bunting-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.flags { position: absolute; inset: 0; }
.flag {
  position: absolute;
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 24px solid var(--blue);
  transform-origin: top center;
  animation: flagSway 3s ease-in-out infinite;
}

/* balloons */
.balloons { position: absolute; top: 60px; bottom: 32%; width: 90px; z-index: 2; }
.balloons-left { left: 2%; }
.balloons-right { right: 2%; }
.balloon {
  position: absolute;
  width: 46px; height: 58px;
  border-radius: 50% 50% 48% 48%;
  box-shadow: inset -6px -8px 12px rgba(0,0,0,.12), inset 6px 6px 10px rgba(255,255,255,.4);
  animation: floatY 4s ease-in-out infinite;
}
.balloon::after {
  content: ""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid currentColor;
}
.balloon::before {
  content: ""; position: absolute; bottom: -46px; left: 50%; width: 1px; height: 46px;
  background: rgba(255,255,255,.6);
}

/* balloon garlands flanking the arch */
.garland { position: absolute; top: 34px; bottom: 27%; width: clamp(62px, 17vw, 126px); z-index: 2; }
/* hug the arch on wide screens instead of drifting off to the window edges */
.garland-left { left: max(0px, calc(50% - 292px)); }
.garland-right { right: max(0px, calc(50% - 292px)); }
.garland-balloon {
  position: absolute;
  border-radius: 50% 50% 46% 46%;
  box-shadow: inset -7px -9px 14px rgba(0,0,0,.13), inset 7px 7px 12px rgba(255,255,255,.45);
  animation: floatY 5s ease-in-out infinite;
}
/* the knot — JS sets color to the balloon's own hue */
.garland-balloon::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translate(-50%, -1px);
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 6px solid currentColor;
}
/* a straight string so they don't read as eggs — length set per balloon in js */
.garland-balloon::before {
  content: ""; position: absolute; top: calc(100% + 5px); left: 50%;
  width: 1.5px; height: var(--string, 46px);
  background: rgba(255,255,255,.62);
  transform: translateX(-50%);
}

/* the arch backdrop the party photos get taken against */
.arch {
  position: relative;
  z-index: 5;
  width: min(74vw, 360px);
  padding: clamp(38px, 10vw, 56px) 18px 16px;
  text-align: center;
  background: linear-gradient(180deg, #e9f6ff, #d5ebfc);
  border: 5px solid #fff;
  border-radius: 50% 50% 28px 28px / 26% 26% 4% 4%;
  box-shadow: var(--shadow);
}
/* the stitched outline that runs just inside the white frame */
.arch::before {
  content: "";
  position: absolute; inset: 9px;
  border: 3px dashed rgba(255,255,255,.92);
  border-radius: 50% 50% 22px 22px / 26% 26% 4% 4%;
  pointer-events: none;
}
.arch-inner { position: relative; }
/* each line arrives in turn once the arch has settled */
.arch-inner > * { animation: liftIn .55s cubic-bezier(.2,.8,.3,1) both; }
.arch-inner > :nth-child(1) { animation-delay: .18s; }
.arch-inner > :nth-child(2) { animation-delay: .26s; }
.arch-inner > :nth-child(3) { animation-delay: .34s; }
.arch-inner > :nth-child(4) { animation-delay: .44s; }
.arch-inner > :nth-child(5) { animation-delay: .54s; }
.arch-inner > :nth-child(6) { animation-delay: .66s; }

.greeting { font-weight: 800; color: var(--text-soft); font-size: clamp(14px, 4vw, 17px); }
.guest-name { color: var(--blue); }
.wave { display: inline-block; animation: wave 1.6s ease-in-out infinite; transform-origin: 70% 70%; }
.invited-eyebrow {
  font-family: var(--font-head); font-weight: 600; color: var(--blue);
  font-size: clamp(10px, 2.8vw, 12px); letter-spacing: 2.4px;
  text-transform: uppercase; margin-top: 8px;
}
/* the whole name, one line, one style */
.celebrant {
  font-size: clamp(14px, 4.7vw, 26px);
  color: var(--blue-dark);
  line-height: 1.1;
  margin: 2px 0 9px;
  white-space: nowrap;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(31,95,208,.16);
}
/* notched banner, like the printed one on the backdrop */
.ribbon {
  display: inline-block;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-dark));
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 2px;
  padding: 7px 30px;
  font-size: clamp(11px, 3.2vw, 14px);
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 15px) 50%, 100% 100%, 0 100%, 15px 50%);
  filter: drop-shadow(0 4px 3px rgba(22,64,143,.22));
}
.big-two { position: relative; display: block; margin: 8px auto 0; width: clamp(112px, 38vw, 168px); }
.two-svg { display: block; width: 100%; height: auto; animation: popBeat 2.8s ease-in-out infinite; }
.two-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.two-edge { stroke: #fff; stroke-width: 40; }          /* the white halo */
.two-road { stroke: var(--blue); stroke-width: 26; }   /* the tarmac */
.two-lane { stroke: #fff; stroke-width: 3.4; stroke-dasharray: 9 10; }
.two-sparkle { position: absolute; color: var(--yellow); animation: twinkle 1.8s ease-in-out infinite; }
.two-sparkle.s1 { top: 2%; right: -8%; font-size: 24px; }
.two-sparkle.s2 { top: 38%; left: -12%; font-size: 18px; color: var(--blue); animation-delay: .6s; }
.two-sparkle.s3 { bottom: 8%; right: -6%; font-size: 20px; color: var(--red); animation-delay: 1.1s; }

/* ================= SCENE (road/bus) ================= */
.scene { position: absolute; bottom: 0; left: 0; width: 100%; height: 34%; min-height: 210px; z-index: 4; }
/* grassy ground the road sits on */
.scene::before {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 56%;
  background: linear-gradient(180deg, #82d15f, #5fae3f); z-index: 0;
}
/* a treeline along the horizon; each one leans on its own rhythm so the row
   breathes like there's a breeze instead of pulsing in unison */
.trees { position: absolute; bottom: 45%; width: 100%; z-index: 2; }
.tree {
  position: absolute; font-size: clamp(30px, 9vw, 52px);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.12));
  transform-origin: 50% 100%;
  animation: treeSway 4.4s ease-in-out infinite;
}
.tree.t1  { left: 2%;   bottom: 0;   animation-duration: 4.6s; }
.tree.t2  { left: 11%;  bottom: 7px; font-size: clamp(22px, 6.4vw, 38px); animation-delay: -1.2s; animation-duration: 3.8s; }
.tree.t3  { left: 20%;  bottom: 2px; font-size: clamp(26px, 7.6vw, 44px); animation-delay: -2.4s; animation-duration: 5.1s; }
.tree.t4  { left: 29%;  bottom: 9px; font-size: clamp(19px, 5.4vw, 32px); animation-delay: -0.6s; animation-duration: 4.2s; }
.tree.t5  { left: 37%;  bottom: 12px; font-size: clamp(16px, 4.6vw, 27px); animation-delay: -3.1s; animation-duration: 5.6s; }
.tree.t6  { right: 36%; bottom: 12px; font-size: clamp(16px, 4.6vw, 27px); animation-delay: -1.8s; animation-duration: 4.9s; }
.tree.t7  { right: 27%; bottom: 8px; font-size: clamp(20px, 5.8vw, 34px); animation-delay: -2.9s; animation-duration: 4.1s; }
.tree.t8  { right: 18%; bottom: 1px; font-size: clamp(26px, 7.6vw, 44px); animation-delay: -0.9s; animation-duration: 5.3s; }
.tree.t9  { right: 9%;  bottom: 7px; font-size: clamp(23px, 6.6vw, 39px); animation-delay: -3.6s; animation-duration: 3.9s; }
.tree.t10 { right: 1%;  bottom: 3px; animation-delay: -2.1s; animation-duration: 4.7s; }

.traffic-light { position: absolute; right: 7%; bottom: 46%; z-index: 6; }
.tl-box { background: #2b2f36; border-radius: 10px; padding: 6px 5px; display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow-sm); }
.tl-lamp { width: 14px; height: 14px; border-radius: 50%; opacity: .28; }
.tl-lamp.red { background: var(--red); }
.tl-lamp.yellow { background: var(--yellow); }
.tl-lamp.green { background: var(--green); }
.tl-lamp.on { opacity: 1; box-shadow: 0 0 12px currentColor; }
.tl-lamp.red.on { color: var(--red); }
.tl-lamp.yellow.on { color: var(--yellow); }
.tl-lamp.green.on { color: var(--green); }
.tl-pole { width: 6px; height: 34px; background: #6b7280; margin: 0 auto; border-radius: 3px; }

/* bus-stop sign and the three direction arrows share one post */
.signpost { position: absolute; left: 3%; bottom: 40%; z-index: 6; display: flex; flex-direction: column; align-items: flex-start; }
.stop-sign {
  width: clamp(46px, 13vw, 62px); height: clamp(46px, 13vw, 62px);
  border-radius: 50%; background: var(--blue); border: 3px solid #fff;
  box-shadow: var(--shadow-sm); margin-left: 4px; margin-bottom: 6px;
  display: grid; place-items: center; gap: 0; padding-bottom: 3px;
}
.stop-glyph { width: 58%; height: auto; }
.stop-label {
  font-family: var(--font-head); font-weight: 600; color: #fff;
  font-size: clamp(6px, 1.8vw, 8px); letter-spacing: .5px; margin-top: -3px;
  white-space: pre-line; line-height: 1.02; text-align: center;
}
.signs { display: flex; flex-direction: column; gap: 6px; }
/* arrow-shaped direction signs, pointing off toward the party */
.sign {
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(9px, 2.4vw, 13px);
  padding: 6px 26px 6px 11px;
  letter-spacing: .5px;
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);
  filter: drop-shadow(0 4px 3px rgba(22,64,143,.22));
}
.sign-blue { background: var(--blue); }
.sign-yellow { background: var(--yellow); color: var(--blue-dark); }
.sign-green { background: var(--green); }
.post { width: 7px; height: clamp(26px, 7vw, 40px); background: linear-gradient(90deg, #8b94a3, #5f6875); border-radius: 3px; margin-left: 14px; }

/* rounded shrubs along the grass line */
.bushes { position: absolute; left: 0; right: 0; bottom: 44%; height: 40px; z-index: 1; }
.bush {
  position: absolute; bottom: 0; border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #7ecb5b, #56a338);
}
.bush::before, .bush::after {
  content: ""; position: absolute; bottom: 0; border-radius: 50%;
  background: linear-gradient(180deg, #7ecb5b, #56a338);
}
.bush::before { width: 62%; height: 74%; left: -26%; }
.bush::after { width: 56%; height: 62%; right: -22%; }
.bush.b1 { left: 12%; width: 62px; height: 26px; }
.bush.b2 { left: 32%; width: 44px; height: 20px; }
.bush.b3 { right: 26%; width: 56px; height: 24px; }
.bush.b4 { right: 6%; width: 40px; height: 18px; }

/* The bus faces us, so the road recedes: a flat plane tilted back in 3D.
   Markings drawn on that plane inherit the perspective for free — dashes and
   zebra stripes converge toward the horizon and swell as they reach us. */
.road {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 46%; min-height: 92px;
  overflow: hidden; z-index: 1;
  perspective: 340px; perspective-origin: 50% 0%;
}
.road-plane {
  position: absolute; left: -4%; right: -4%; bottom: 0; height: 260%;
  transform-origin: 50% 100%;
  transform: rotateX(71deg);
  background: linear-gradient(180deg, #525c6b, var(--road) 45%, #333b47);
}
/* centre line: dashes running away from us, flowing toward the viewer */
.road-dashes {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 26px; margin-left: -13px;
  background: repeating-linear-gradient(180deg, var(--yellow) 0 58px, transparent 58px 132px);
  animation: roadRush 1.15s linear infinite;
}
/* zebra crossing at the near end, stripes repeating across the width */
.road-zebra {
  position: absolute; left: 0; right: 0; bottom: 0; height: 15%;
  background: repeating-linear-gradient(90deg, #fff 0 40px, transparent 40px 84px);
  opacity: .92;
}

.bus { width: 100%; height: auto; filter: drop-shadow(0 10px 8px rgba(0,0,0,.2)); }
.wheel { transform-box: fill-box; transform-origin: center; animation: spin 1.1s linear infinite; }

/* the bus pulled up head-on at the stop; sits in .scene so nothing clips it */
.bus-front-wrap {
  position: absolute; left: 50%; bottom: 16px;
  width: clamp(158px, 44vw, 246px); z-index: 7;
  transform: translateX(-50%); /* also in the keyframes, so it holds if animation never runs */
  animation: busIdle 3.6s ease-in-out infinite;
}
.bus-front { width: 100%; height: auto; filter: drop-shadow(0 12px 10px rgba(0,0,0,.22)); }
.bus-sign-text { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: 1px; }
.bus-plate-text { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .5px; }
.headlight { animation: lampGlow 2.6s ease-in-out infinite; }
/* transform-origin is in the svg's own user units (transform-box: view-box) */
.wiper-left { transform-origin: 98px 146px; animation: wipeLeft 2.9s ease-in-out infinite; }
.wiper-right { transform-origin: 202px 146px; animation: wipeRight 2.9s ease-in-out infinite; }

/* scroll hint */
.scroll-hint {
  position: absolute; bottom: calc(34% - 26px); left: 50%; transform: translateX(-50%);
  z-index: 8; background: rgba(255,255,255,.85); border: none; border-radius: 999px;
  padding: 7px 16px; font-family: var(--font-body); font-weight: 800; color: var(--blue-dark);
  font-size: 12px; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 6px;
}
/* an svg chevron instead of the "⌄" glyph, which sat low in its em box and
   could not be centred against the label reliably */
.scroll-hint .chevron {
  width: 13px; height: 13px; display: block; flex: none;
  animation: nudge 1.4s ease-in-out infinite;
}

/* ================= SECTIONS ================= */
.section { padding: 68px 20px 54px; max-width: 900px; margin: 0 auto; scroll-margin-top: 70px; }
.section-title { text-align: center; font-size: clamp(24px, 6.4vw, 38px); color: var(--blue-dark); margin-bottom: 8px; }
.section-title span { text-shadow: 2px 2px 0 #fff; }
.section-sub { text-align: center; color: var(--text-soft); font-weight: 700; margin-bottom: 26px; }

.countdown-section { background: linear-gradient(180deg, var(--sky-bottom), #fff); }
.countdown { display: flex; justify-content: center; gap: clamp(6px, 2.4vw, 18px); flex-wrap: nowrap; }
.count-box {
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  color: #fff; border-radius: 18px; border: 3px solid #fff;
  flex: 1 1 0; min-width: 0; max-width: 104px; padding: 16px 6px; text-align: center;
  box-shadow: var(--shadow); position: relative;
}
.count-box::before { content: "🚌"; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 16px; opacity: .0; }
.count-num { display: block; font-size: clamp(30px, 9vw, 48px); font-weight: 700; line-height: 1; text-shadow: 2px 2px 0 rgba(0,0,0,.12); }
.count-label { display: block; font-size: clamp(10px, 3vw, 13px); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; opacity: .92; }
.countdown-over { text-align: center; font-family: var(--font-head); font-size: clamp(22px, 6vw, 34px); color: var(--red); margin-top: 10px; animation: pulse 1.4s ease-in-out infinite; }

/* details */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.detail-card {
  background: var(--card); border-radius: var(--radius); border: 3px solid #eaf4ff;
  padding: 26px 20px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.detail-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.detail-icon { font-size: 44px; margin-bottom: 6px; display: inline-block; animation: floatY 3.4s ease-in-out infinite; }
.detail-card h3 { color: var(--blue); font-size: 20px; margin-bottom: 8px; }
.detail-main { font-weight: 800; font-size: 17px; color: var(--text); }
.detail-sub { color: var(--text-soft); font-weight: 700; margin-top: 4px; }
/* Full street address — long, so keep it lighter and easier to read than .detail-sub */
.detail-address { font-weight: 600; font-size: 14px; line-height: 1.5; margin-top: 8px; }
.map-btn, .rsvp-btn, .cal-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 12px; text-decoration: none;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-dark));
  color: var(--blue-dark); font-family: var(--font-head); font-weight: 600;
  padding: 10px 22px; border-radius: 999px; box-shadow: 0 5px 0 var(--yellow-dark);
  transition: transform .12s ease, box-shadow .12s ease;
}
.map-btn:active, .rsvp-btn:active, .cal-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow-dark); }

.rsvp-wrap { text-align: center; margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.rsvp-btn { background: linear-gradient(180deg, #34d07a, var(--green-dark)); color: #fff; box-shadow: 0 5px 0 var(--green-dark); font-size: 18px; padding: 14px 30px; }
/* the icons sit on the text's optical centre, a touch larger than the label */
.rsvp-btn i, .cal-btn i, .map-btn i { font-size: 1.1em; line-height: 1; }
.rsvp-btn:active { box-shadow: 0 1px 0 var(--green-dark); }
.cal-btn { background: linear-gradient(180deg, var(--blue-light), var(--blue)); color: #fff; box-shadow: 0 5px 0 var(--blue-dark); font-size: 18px; padding: 14px 30px; }
.cal-btn:active { box-shadow: 0 1px 0 var(--blue-dark); }

/* wishes */
.wishes-section { background: linear-gradient(180deg, #fff, var(--sky-bottom)); }
.wish-form {
  max-width: 520px; margin: 0 auto 34px; background: var(--card);
  border-radius: var(--radius); border: 3px solid #eaf4ff; padding: 24px; box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-weight: 800; color: var(--blue-dark); margin-bottom: 6px; font-size: 14px; }
.field input, .field textarea {
  width: 100%; border: 2px solid #dbe9fb; border-radius: 14px; padding: 12px 14px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--text);
  background: #f7fbff; transition: border-color .15s ease, box-shadow .15s ease; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue-light); box-shadow: 0 0 0 4px rgba(91,155,232,.18); }
.wish-submit {
  width: 100%; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--blue-light), var(--blue)); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 19px; padding: 14px;
  border-radius: 999px; box-shadow: 0 6px 0 var(--blue-dark); transition: transform .12s ease, box-shadow .12s ease;
}
.wish-submit:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--blue-dark); }
/* Sending, or already sent this visit — the button sits down and stops responding. */
.wish-submit:disabled {
  background: linear-gradient(180deg, #a9bdd8, #8ba3c4); box-shadow: 0 3px 0 #7086a5;
  cursor: default; transform: translateY(3px);
}
.wish-note { margin-top: 12px; text-align: center; font-weight: 800; color: var(--green-dark); }
.wish-note.error { color: var(--red); }

.wishes-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.wish-card {
  background: var(--card); border-radius: 20px; padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  border-top: 6px solid var(--yellow); position: relative; animation: cardIn .5s ease both;
}
.wish-card:nth-child(3n) { border-top-color: var(--blue); }
.wish-card:nth-child(3n+1) { border-top-color: var(--green); }
.wish-card .wish-msg { font-weight: 700; color: var(--text); line-height: 1.45; margin-bottom: 10px; overflow-wrap: anywhere; }
.wish-card .wish-from { font-family: var(--font-head); color: var(--blue); font-weight: 600; font-size: 15px; }
.wish-card .wish-emoji { position: absolute; top: -12px; right: 14px; font-size: 26px; }
.wishes-empty { text-align: center; color: var(--text-soft); font-weight: 700; grid-column: 1/-1; padding: 10px; }

/* footer */
/* The invitation opened with a boarding pass, so it closes with the bus signing
   off on its roof board and driving home down one last strip of road. */
.footer {
  position: relative; overflow: hidden; text-align: center;
  padding: 46px 20px 0;
  background: linear-gradient(180deg, var(--sky-bottom), var(--sky-mid));
  color: var(--blue-dark);
}
.footer-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.footer-sky .cloud-2 { top: 14%; animation-delay: -9s; opacity: .75; }
.footer-sky .cloud-3 { top: 46%; animation-delay: -4s; opacity: .6; }

/* the destination board — dark panel, amber lettering, like the sign on the bus */
.board {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 12px;
  max-width: min(92vw, 440px);
  padding: 12px 20px;
  background: linear-gradient(180deg, #3b434f, #23282f);
  border: 3px solid #171b21;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(22, 64, 143, .2), inset 0 2px 0 rgba(255,255,255,.09);
}
.board-lamp {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 8px rgba(255,206,49,.85);
  animation: lampGlow 2.2s ease-in-out infinite;
}
.board-lamp:last-child { animation-delay: 1.1s; }
.board-text {
  font-family: var(--font-head); font-weight: 600; color: var(--yellow);
  font-size: clamp(11px, 3.2vw, 14px); letter-spacing: 1.7px;
  text-transform: uppercase; line-height: 1.45;
  text-shadow: 0 0 12px rgba(255, 206, 49, .5);
}

.footer-name {
  position: relative; z-index: 1;
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(16px, 4.4vw, 21px); color: var(--blue-dark);
  margin-top: 20px; text-shadow: 1px 1px 0 #fff;
}
.footer-date {
  position: relative; z-index: 1;
  display: inline-block; margin-top: 9px;
  background: linear-gradient(180deg, var(--yellow), var(--yellow-dark));
  color: var(--blue-dark); font-family: var(--font-head); font-weight: 600;
  font-size: clamp(12px, 3.4vw, 15px); letter-spacing: 2.4px;
  padding: 6px 20px; border-radius: 999px;
  box-shadow: 0 4px 0 var(--yellow-dark);
}

.footer-scene { position: relative; margin-top: 30px; height: 96px; }
.footer-road {
  position: absolute; left: -20px; right: -20px; bottom: 0; height: 62px;
  background: linear-gradient(180deg, var(--road-light), var(--road));
  box-shadow: 0 -3px 0 var(--green-dark), 0 -10px 0 var(--green);
  overflow: hidden;
}
.footer-road .road-line { top: 46%; }
.footer-bus {
  position: absolute; left: 0; bottom: 10px;
  width: clamp(112px, 30vw, 158px); line-height: 0;
  animation: driveHome 13s linear infinite;
}
.footer-bus .bus { width: 100%; height: auto; filter: drop-shadow(0 7px 6px rgba(0,0,0,.22)); }
.footer-bus .wheel { animation-direction: reverse; } /* it travels leftward */

/* confetti */
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ================= ANIMATIONS ================= */
@keyframes busHop { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(115vw); } }
@keyframes twinkle { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes flagSway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
/* a gust leans the tree over and lets it spring back */
@keyframes treeSway {
  0%, 100% { transform: rotate(-2.6deg); }
  35%      { transform: rotate(1.6deg); }
  60%      { transform: rotate(2.8deg); }
}
/* wipers pivot at their base and sweep up the windscreen together */
@keyframes wipeLeft  { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(-42deg); } }
@keyframes wipeRight { 0%, 100% { transform: rotate(4deg); }  50% { transform: rotate(42deg); } }
@keyframes wave { 0%,100% { transform: rotate(0); } 25% { transform: rotate(18deg); } 75% { transform: rotate(-12deg); } }
@keyframes popBeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes roadMove { to { transform: translateX(-80px); } }
/* centre dashes sliding toward the viewer down the tilted plane */
@keyframes roadRush { to { background-position-y: 132px; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
/* small enough that the chevron still reads as centred on the label */
@keyframes nudge { 0%,100% { transform: translateY(-1.5px); } 50% { transform: translateY(1.5px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes liftIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* the bus settling on its suspension while it waits at the stop */
@keyframes busIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-.5deg); }
  50%      { transform: translateX(-50%) translateY(-5px) rotate(.5deg); }
}
@keyframes lampGlow { 0%, 100% { opacity: .72; } 50% { opacity: 1; } }
@keyframes ticketIn { from { opacity: 0; transform: translateY(30px) rotate(-2deg) scale(.95); } to { opacity: 1; transform: none; } }
/* one 16s cycle: the yellow bus crosses during the first half, the blue one
   during the second, so only one is ever on the road */
@keyframes driveAcross { 0% { transform: translateX(-110%); } 50%, 100% { transform: translateX(100vw); } }
@keyframes driveBack { 0%, 50% { transform: translateX(100vw); } 100% { transform: translateX(-110%); } }
/* one unhurried pass across the footer, right to left */
@keyframes driveHome { from { transform: translateX(100vw); } to { transform: translateX(-120%); } }
/* keeps the mirror flip while bobbing — a plain translate would undo the scaleX */
@keyframes gateBusBob { 0%,100% { transform: scaleX(-1) translateY(0); } 50% { transform: scaleX(-1) translateY(-3px); } }

/* ================= RESPONSIVE ================= */
/* short screens: shrink the arch so the bus and road still make the first view */
@media (max-height: 720px) {
  .arch { padding-top: clamp(28px, 7vw, 42px); width: min(70vw, 320px); }
  .celebrant { font-size: clamp(13px, 4.3vw, 24px); }
  .big-two { width: clamp(88px, 29vw, 124px); margin-top: 4px; }
  .greeting, .invited-eyebrow { font-size: 12px; }
}

@media (max-width: 560px) {
  .balloons { width: 64px; }
  .balloon { width: 38px; height: 48px; }
  .signpost { left: 2%; }
  .traffic-light { right: 4%; }
  .section { padding: 44px 16px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
