/* ==========================================================================
   Passenger website: motion and travel scenes.
   Sky, planes, departure board, scroll tracker, reveals, boarding pass.
   Colours, timings and easing all come from tokens.css (design/tokens.json).
   Everything here is decoration: with prefers-reduced-motion, or without
   JavaScript, the page is complete and still.
   ========================================================================== */

/* Headline: words rise in (CSS only) -------------------------------------- */
.hero .h1 .w { display: inline-block; animation: rise 800ms var(--ease) both; }
.hero .h1 .w:nth-child(2) { animation-delay: 90ms; }
.hero .h1 .w:nth-child(3) { animation-delay: 180ms; }
.hero .h1 .w:nth-child(4) { animation-delay: 270ms; }
@keyframes rise { from { opacity: 0; translate: 0 .45em; } to { opacity: 1; translate: 0 0; } }

/* Sky behind the hero ------------------------------------------------------ */
.hero { overflow: visible; } /* the sky and glows reach the screen edges; the page itself clips sideways overflow */
.hero > .hero__copy, .hero > .hero__stage { position: relative; z-index: 1; }
.sky { position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; overflow: hidden; pointer-events: none; z-index: 0; }

.sky__star { position: absolute; width: 10px; height: 10px; color: var(--act); opacity: .0; animation: twinkle 4.5s ease-in-out infinite; transition: opacity var(--t-slow); }
[data-phase='dawn'] .sky__star { display: none; }
.sky__star.s1 { left: 6%;  top: 12%; animation-delay: .2s; }
.sky__star.s2 { left: 17%; top: 30%; width: 7px; height: 7px; animation-delay: 1.4s; }
.sky__star.s3 { left: 29%; top: 8%;  width: 8px; height: 8px; animation-delay: 2.6s; }
.sky__star.s4 { left: 41%; top: 22%; animation-delay: .9s; }
.sky__star.s5 { left: 55%; top: 6%;  width: 7px; height: 7px; animation-delay: 3.1s; }
.sky__star.s6 { left: 66%; top: 26%; width: 12px; height: 12px; animation-delay: 1.9s; }
.sky__star.s7 { left: 78%; top: 10%; animation-delay: .5s; }
.sky__star.s8 { left: 88%; top: 34%; width: 8px; height: 8px; animation-delay: 2.2s; }
.sky__star.s9 { left: 94%; top: 14%; width: 7px; height: 7px; animation-delay: 3.6s; }
.sky__star.s10 { left: 48%; top: 44%; width: 6px; height: 6px; animation-delay: 1.1s; }
@keyframes twinkle { 0%, 100% { opacity: .1; scale: .8; } 50% { opacity: .85; scale: 1.1; } }

.sky__sun {
  position: absolute; left: -8%; bottom: -30%; width: 70vw; max-width: 900px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--glow-2) 0%, var(--glow-1) 34%, transparent 68%);
  filter: blur(30px); opacity: 0; transition: opacity var(--t-slow);
}
[data-phase='dawn'] .sky__sun { opacity: .5; animation: rising 16s ease-in-out infinite alternate; }
@keyframes rising { from { translate: 0 6%; } to { translate: 0 -4%; } }

.sky__cloud { position: absolute; left: 0; height: auto; color: var(--sf2); opacity: .7; animation: drift 110s linear infinite; }
[data-phase='dawn'] .sky__cloud { color: var(--sf1); opacity: .95; }
.sky__cloud.c1 { top: 14%; width: 190px; animation-duration: 120s; animation-delay: -30s; }
.sky__cloud.c2 { top: 52%; width: 130px; animation-duration: 90s; animation-delay: -70s; opacity: .5; }
.sky__cloud.c3 { top: 74%; width: 240px; animation-duration: 150s; animation-delay: -10s; }
@keyframes drift { from { translate: -300px 0; } to { translate: calc(100vw + 100px) 0; } }

.sky__route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sky__trail { fill: none; stroke: var(--act); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 3 9; opacity: .35; }
.sky__contrail { fill: none; stroke: var(--acf); stroke-width: 2; stroke-linecap: round; opacity: 0; }
.sky__plane { position: absolute; left: 0; top: 0; width: 40px; height: 40px; color: var(--acf); opacity: 0; offset-rotate: auto; }
.sky__plane.is-static { opacity: .9; }

/* Departure board ---------------------------------------------------------- */
.board { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp2) var(--sp4); margin-top: var(--sp2); }
.board__row { display: inline-flex; align-items: center; gap: 3px; font-size: 20px; }
.board__to { margin: 0 var(--sp2); font-size: var(--fs-label); font-family: var(--font-body); font-weight: 500; color: var(--mu); }
.flap {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 38px;
  border-radius: 6px; font-style: normal; font-weight: 500; color: var(--tx);
  background: color-mix(in srgb, var(--ph) 6%, var(--sf1)); box-shadow: var(--sh);
}
.flap::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--bg); opacity: .8; }
.flap.is-flipping { animation: flip 90ms ease-in-out; }
@keyframes flip { 0% { scale: 1 1; } 50% { scale: 1 .15; } 100% { scale: 1 1; } }
.board__city { transition: opacity var(--t-slow); }

/* Scroll tracker: a flight across the top of the page ---------------------- */
.tracker { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; opacity: 0; transition: opacity var(--t-slow);
  background: repeating-linear-gradient(90deg, var(--sf2) 0 6px, transparent 6px 12px); }
.tracker.is-on { opacity: 1; }
.tracker::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p, 0) * 100%); background: var(--acf); }
.tracker__plane { position: absolute; top: -9px; left: calc(var(--p, 0) * (100% - 20px)); width: 20px; height: 20px; color: var(--acf); }

/* Reveals ------------------------------------------------------------------ */
.js .rv { opacity: 0; translate: 0 28px; transition: opacity var(--reveal) ease, translate var(--reveal) var(--ease); transition-delay: var(--d, 0ms); }
.js .rv.rv--in { opacity: 1; translate: 0 0; }

/* Phones: float, and tilt toward the pointer ------------------------------- */
.hero .device--hero { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@media (hover: hover) and (pointer: fine) {
  .hero .device--hero { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 160ms ease-out; }
  .show__stage .device { transition: transform var(--t-slow) var(--ease); }
  .show__stage:hover .device { transform: translateY(-6px) rotate(-.6deg); }
  .show--flip .show__stage:hover .device { transform: translateY(-6px) rotate(.6deg); }
}

/* Night to Dawn: colours cross-fade for a moment --------------------------- */
html.phase-anim *, html.phase-anim *::before, html.phase-anim *::after {
  transition: background-color var(--t-slow) ease, color var(--t-slow) ease, box-shadow var(--t-slow) ease, fill var(--t-slow) ease, stroke var(--t-slow) ease !important;
}

/* Buttons: a little lift --------------------------------------------------- */
.btn-p .ic { width: 20px; height: 20px; transition: translate var(--t) var(--ease), rotate var(--t) var(--ease); }
.btn-p:hover .ic { translate: 3px -2px; rotate: -8deg; }

/* Boarding pass (sign-up confirmation) ------------------------------------- */
.beta__done { flex: 1 1 420px; max-width: 640px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp6); }
.pass {
  position: relative; width: 100%; display: flex; align-items: stretch; border-radius: var(--r); overflow: hidden;
  background: color-mix(in srgb, var(--ph) 6%, var(--sf1)); box-shadow: var(--sh);
  animation: pass-in 900ms var(--ease) both;
}
.pass__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--sp4); padding: var(--sp8); }
.pass__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp4) var(--sp8); }
.pass__grid dd { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.pass__stub {
  position: relative; flex: none; width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: var(--sp3);
  padding: var(--sp8) var(--sp4); background: color-mix(in srgb, var(--acf) 10%, transparent);
  border-left: 2px dashed color-mix(in srgb, var(--mu) 45%, transparent);
}
/* the two notches where the stub tears off */
.pass__stub::before, .pass__stub::after { content: ''; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.pass__stub::before { top: -10px; }
.pass__stub::after { bottom: -10px; }
.pass__plane { width: 32px; height: 32px; color: var(--acf); animation: takeoff 2.6s var(--ease) 700ms both; }
.pass__bars { flex: 1; width: 44px; min-height: 60px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--tx) 0 2px, transparent 2px 5px, var(--tx) 5px 6px, transparent 6px 10px, var(--tx) 10px 13px, transparent 13px 15px); opacity: .75; }
@keyframes pass-in { from { opacity: 0; translate: 0 40px; rotate: -2deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes takeoff { 0% { translate: -8px 8px; rotate: 0deg; } 60% { translate: 6px -8px; rotate: -18deg; } 100% { translate: 0 0; rotate: -8deg; } }
@media (max-width: 480px) {
  .pass { flex-direction: column; }
  .pass__stub { width: auto; flex-direction: row; border-left: 0; border-top: 2px dashed color-mix(in srgb, var(--mu) 45%, transparent); padding: var(--sp4) var(--sp6); }
  .pass__stub::before, .pass__stub::after { top: -11px; bottom: auto; left: auto; }
  .pass__stub::before { left: -10px; }
  .pass__stub::after { right: -10px; }
  .pass__bars { min-height: 0; height: 36px; width: auto; flex: 1; }
  .pass__main { padding: var(--sp6); }
}

/* Access section when the app is live ------------------------------------- */
.access__block { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp6); width: 100%; }

/* Motion off: everything complete, nothing moving -------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero .h1 .w, .sky__star, .sky__sun, .sky__cloud, .hero .device--hero, .pass, .pass__plane, .flap.is-flipping { animation: none !important; }
  .sky__star { opacity: .5; }
  .sky__cloud { translate: 12vw 0; }
  .js .rv { opacity: 1; translate: 0 0; transition: none; }
  .tracker { display: none; }
  .btn-p:hover .ic { translate: 0 0; rotate: 0deg; }
  .hero .device--hero, .show__stage .device { transform: none !important; }
}
