/* ============================================================================
   FLIGHT — module: finale (beat #3 "Landing / Payoff")
   Prefix: .fin-  · tokens only · depth via layered translucency + emitted light
   The paper-airplane mark is the protagonist: it flies in and settles here.
   ============================================================================ */

.fin-wrap {
  position: relative;
  text-align: center;
  z-index: var(--z-content);
}

/* ambient emitted-light glow behind the whole beat */
.fin-glow {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 8%;
  height: 80%;
  margin-inline: auto;
  width: min(920px, 92%);
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(58% 46% at 50% 30%, rgba(var(--yellow-rgb), 0.16), transparent 70%),
    radial-gradient(70% 60% at 50% 78%, rgba(var(--blue-rgb), 0.12), transparent 72%);
  filter: blur(6px);
}

/* ---------- landing stage: trail + plane + touchdown ---------- */
.fin-stage {
  position: relative;
  width: min(680px, 100%);
  aspect-ratio: 68 / 30;
  margin: 0 auto var(--space-5);
  overflow: visible;
}

.fin-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fin-trail-line {
  fill: none;
  stroke: url(#fin-trail-grad);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.fin-trail-glow {
  fill: none;
  stroke: rgba(var(--yellow-rgb), 0.22);
  stroke-width: 9;
  stroke-linecap: round;
  filter: blur(5px);
}
.fin-stop-0 { stop-color: rgb(var(--yellow-rgb)); stop-opacity: 0; }
.fin-stop-1 { stop-color: var(--yellow-soft); stop-opacity: 0.92; }

/* soft touchdown flare where the plane settles */
.fin-touchdown {
  position: absolute;
  left: 72%;
  top: 50%;
  width: clamp(120px, 22vw, 240px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: var(--r-pill);
  background: radial-gradient(closest-side, rgba(var(--yellow-rgb), 0.4), transparent 72%);
  opacity: 0;
  pointer-events: none;
}

/* positioning wrapper: centres the mark on the trail's end (never animated) */
.fin-plane-pos {
  position: absolute;
  left: 72%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
/* the GSAP-animated element (flight arc: x/y/rotation/scale/opacity) */
.fin-plane {
  display: block;
  will-change: transform, opacity;
}
/* static orientation so the paper plane reads as flying level/right */
.fin-plane-orient {
  display: block;
  transform: rotate(26deg);
}
.fin-plane-svg {
  width: clamp(66px, 12vw, 136px);
  height: auto;
  filter:
    drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 20px rgba(var(--red-rgb), 0.42));
}
/* fills live in CSS (var() is not resolved in SVG presentation attributes) */
.fin-plane-body { fill: var(--red); }
.fin-plane-fold { fill: color-mix(in srgb, var(--red) 74%, #000); }

/* ---------- headline ---------- */
.fin-eyebrow {
  justify-content: center;
  margin-bottom: var(--space-5);
}
.fin-eyebrow i { width: 15px; height: 15px; }

.fin-headline {
  margin-inline: auto;
  max-width: 18ch;
}
.fin-line { display: block; }
.fin-line + .fin-line { margin-top: 0.06em; }
.fin-line-accent {
  color: var(--yellow-soft);
  text-shadow:
    0 0 24px rgba(var(--yellow-rgb), 0.42),
    0 0 70px rgba(var(--yellow-rgb), 0.22);
}

/* ---------- payoff figure (count-up) ---------- */
.fin-stat {
  margin-top: clamp(var(--space-7), 6vw, var(--space-9));
}
.fin-figure {
  display: inline-flex;
  align-items: baseline;
  gap: 0.08em;
  line-height: 1;
}
.fin-figure-pre {
  align-self: center;
  margin-inline-end: 0.35em;
  padding: 4px 12px;
  border: 1px solid var(--glass-border-hi);
  border-radius: var(--r-pill);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  font-size: var(--fs-eyebrow);
  font-weight: 800;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-3);
  white-space: nowrap;
}
.fin-figure-num {
  font-weight: 900;
  font-size: clamp(2.6rem, 1.4rem + 4.6vw, 4.6rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--fg-1);
  background: linear-gradient(178deg, var(--fg-1) 12%, var(--yellow-soft) 128%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 46px rgba(var(--yellow-rgb), 0.16);
}
.fin-figure-mo {
  font-weight: 800;
  font-size: clamp(1rem, 0.8rem + 0.8vw, 1.4rem);
  color: var(--fg-3);
}
.fin-stat-label {
  margin: var(--space-4) auto 0;
  max-width: 34ch;
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--fg-3);
}

/* ---------- CTA (magnetic + glow) ---------- */
.fin-cta-wrap {
  margin-top: clamp(var(--space-7), 6vw, var(--space-8));
}
.fin-cta-zone {
  display: inline-block;
  padding: 26px;
}
.fin-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 34px;
  border: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--yellow-soft), var(--yellow));
  color: var(--navy-950);
  font-size: var(--fs-body);
  font-weight: 900;
  letter-spacing: 0.005em;
  cursor: pointer;
  will-change: transform;
  box-shadow: var(--shadow-2), var(--shadow-glow-yellow);
  transition: box-shadow var(--dur-2) var(--ease-out-expo), filter var(--dur-2) var(--ease-out-expo);
}
/* the emitted-light halo */
.fin-cta::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 50% 0%, rgba(var(--yellow-rgb), 0.55), transparent 70%);
  opacity: 0;
  z-index: -1;
  filter: blur(16px);
  transition: opacity var(--dur-2) var(--ease-out-expo);
}
.fin-cta:hover { box-shadow: var(--shadow-3), 0 0 60px rgba(var(--yellow-rgb), 0.6); filter: brightness(1.04); }
.fin-cta:hover::before { opacity: 1; }
.fin-cta i { width: 19px; height: 19px; transition: transform var(--dur-2) var(--ease-out-expo); }
.fin-cta:hover i { transform: translateX(4px); }
.fin-cta:active { filter: brightness(0.98); }
.fin-cta:focus-visible { outline: 2px solid var(--fg-1); outline-offset: 4px; }
/* smoothing for the non-GSAP magnetic fallback only */
.fin-cta.is-magnet-css { transition: transform var(--dur-2) var(--ease-out-expo), box-shadow var(--dur-2) var(--ease-out-expo), filter var(--dur-2) var(--ease-out-expo); }

@media (max-width: 640px) {
  .fin-figure { flex-wrap: wrap; justify-content: center; }
  .fin-figure-pre { margin-inline-end: 0; margin-bottom: var(--space-2); }
}

@media (prefers-reduced-motion: reduce) {
  .fin-plane-svg { filter: drop-shadow(0 0 16px rgba(var(--red-rgb), 0.36)); }
}
