/* ==========================================================================
   Flight layer
   Take-off preloader, the fixed 3D canvas the airliner lives on, and the
   hero choreography that hands the loader plane over to the 3D scene.
   ========================================================================== */

/* ------------------------------------------------------------- loader --- */
html.is-loading { overflow: hidden; }
html.is-loading body { overflow: hidden; }

.flight-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 80% 18%, rgba(245,173,22,.2), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(47,95,168,.42), transparent 34%),
    linear-gradient(180deg, #06172b 0%, #0a2246 100%);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s cubic-bezier(.76, 0, .24, 1);
  will-change: clip-path;
}
.flight-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .6;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 72%);
          mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 72%);
}
.flight-loader__inner {
  position: relative;
  width: min(680px, 88vw);
  text-align: center;
}
.flight-loader__sky {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.flight-loader__route { stroke: rgba(255,255,255,.22); stroke-width: 1.6; stroke-dasharray: 5 9; fill: none; }
.flight-loader__flown { stroke: var(--gold, #f5ad16); stroke-width: 2.4; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(245,173,22,.55)); }
.flight-loader__pin { fill: rgba(255,255,255,.55); }
.flight-loader__pin--end { fill: var(--gold, #f5ad16); }
.flight-loader__jet { fill: #fff; filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); }
.flight-loader__jet-glow { fill: rgba(245,173,22,.28); }

.flight-loader__brand {
  margin-top: .25rem;
  font-size: clamp(1.45rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
  overflow: hidden;
}
.flight-loader__brand span {
  display: inline-block;
  transform: translateY(110%);
  animation: flightRise .9s cubic-bezier(.22, 1, .36, 1) .15s both;
}
.flight-loader__brand em { color: var(--gold, #f5ad16); font-style: normal; }
.flight-loader__meta {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.1rem;
  color: rgba(255,255,255,.62);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.flight-loader__count {
  min-width: 3.2ch;
  color: #fff;
  font-size: clamp(1.6rem, 3.8vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.flight-loader__count::after { content: '%'; font-size: .5em; color: var(--gold, #f5ad16); margin-left: .1em; }
.flight-loader__bar {
  width: min(240px, 60vw);
  height: 2px;
  margin: 1.3rem auto 0;
  background: rgba(255,255,255,.14);
  overflow: hidden;
  border-radius: 999px;
}
.flight-loader__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold, #f5ad16), #fff);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}
.flight-loader__corner {
  position: absolute;
  color: rgba(255,255,255,.42);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.flight-loader__corner--tl { top: 1.5rem; left: 1.5rem; }
.flight-loader__corner--br { right: 1.5rem; bottom: 1.5rem; text-align: right; }

/* exit: the loader jet zooms off while the curtain lifts, the 3D jet then
   swoops in from the same side of the screen. */
.flight-loader.is-done { clip-path: inset(0 0 100% 0); transition-delay: .18s; pointer-events: none; }
.flight-loader.is-done .flight-loader__inner { animation: flightExit .8s cubic-bezier(.7, 0, .3, 1) both; }
.flight-loader.is-idle { clip-path: inset(100% 0 0 0); transition: none; visibility: hidden; pointer-events: none; }
.flight-loader.is-leaving { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .55s cubic-bezier(.76, 0, .24, 1); }
.flight-loader.is-leaving .flight-loader__meta,
.flight-loader.is-leaving .flight-loader__bar { opacity: 0; }

@keyframes flightRise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes flightExit {
  to { transform: translate3d(38vw, -22vh, 0) scale(.72); opacity: 0; }
}

/* ------------------------------------------------------------- canvas --- */
.flight-canvas {
  position: fixed;
  inset: 0;
  z-index: 6;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

/* Reduced motion / no WebGL: a still jet keeps the composition. */
.flight-fallback .video-hero::after,
.flight-fallback .page-hero::after {
  content: '';
  position: absolute;
  z-index: 3;
  right: 6%;
  top: 50%;
  width: min(34vw, 380px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  transform: translateY(-50%) rotate(-12deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,.9)' d='M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.35));
  opacity: .9;
  pointer-events: none;
}

/* ------------------------------------------------------- hero staging --- */
.video-hero__overlay {
  background:
    linear-gradient(90deg, rgba(4,16,31,.42) 0%, rgba(4,16,31,.18) 45%, rgba(4,16,31,.34) 100%),
    radial-gradient(ellipse at 76% 50%, rgba(245,173,22,.12), transparent 38%);
}
.video-hero__title-line {
  display: block;
  overflow: hidden;
  padding-bottom: .06em;
  margin-bottom: -.06em;
}
.video-hero__title-line--gradient { display: block; }
.video-hero__title-line > span {
  display: inline-block;
  transform: translate3d(0, 112%, 0) rotateX(-38deg);
  transform-origin: 50% 100%;
  opacity: 0;
  transition: transform 1.1s var(--ease), opacity .8s ease;
}
.video-hero__title-line--gradient > span {
  background: linear-gradient(90deg, #ffffff 0%, #fff4b8 25%, #ffd600 65%, #ffaa00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html.is-revealed .video-hero__title-line > span { transform: none; opacity: 1; }
html.is-revealed .video-hero__title-line:nth-child(2) > span { transition-delay: .12s; }

/* the hero copy holds until the curtain lifts, then rises in sequence */
.video-hero [data-anim] { transition-delay: calc(var(--d, 0ms) + .2s); }
html.is-loading .video-hero [data-anim].is-in { opacity: 0; transform: translateY(28px); }

.flight-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: .8rem;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .8s ease 1.4s;
  pointer-events: none;
}
html.is-revealed .flight-cue { opacity: 1; }
.flight-cue i {
  position: relative;
  width: 54px;
  height: 1px;
  background: rgba(255,255,255,.28);
  overflow: hidden;
}
.flight-cue i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold, #f5ad16);
  transform: translateX(-100%);
  animation: flightCue 2.2s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes flightCue { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(100%); } }

/* hero stat chips floating on the right, under the plane */
.hero-chips {
  position: absolute;
  right: max(1.5rem, calc((100vw - var(--shell)) / 2));
  bottom: 5.4rem;
  z-index: 3;
  display: grid;
  gap: .6rem;
  justify-items: end;
  pointer-events: none;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .95rem;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .9s var(--ease);
  animation: floatGentle 7s ease-in-out infinite;
}
.hero-chip b { color: var(--gold, #f5ad16); font-size: .95rem; letter-spacing: -.02em; }
.hero-chip:nth-child(2) { animation-duration: 8.5s; animation-delay: .8s; }
.hero-chip:nth-child(3) { animation-duration: 7.6s; animation-delay: 1.6s; }
html.is-revealed .hero-chip { opacity: 1; transform: none; }
html.is-revealed .hero-chip:nth-child(1) { transition-delay: 1.5s; }
html.is-revealed .hero-chip:nth-child(2) { transition-delay: 1.65s; }
html.is-revealed .hero-chip:nth-child(3) { transition-delay: 1.8s; }

@media (max-width: 900px) {
  .hero-chips { right: 1rem; bottom: 4.6rem; gap: .4rem; }
  .hero-chip { padding: .38rem .7rem; font-size: .66rem; }
  .flight-cue { bottom: 1.1rem; }
  .flight-loader__corner { display: none; }
  .flight-fallback .video-hero::after,
  .flight-fallback .page-hero::after { width: 44vw; top: 16%; transform: rotate(-12deg); }
}
@media (max-width: 600px) {
  .hero-chips { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flight-loader { display: none !important; }
  .video-hero__title-line > span { transform: none !important; opacity: 1 !important; }
  .hero-chip { opacity: 1; transform: none; animation: none; }
  .flight-cue { display: none; }
}
