:root {
  --bfa-size: 220px;
  --bfa-mobile-size: 125px;
  --bfa-duration: 14s;
  --bfa-wing-speed: 2600ms;
  --bfa-flight-top: 14vh;
}

.bfa-flight {
  position: fixed;
  z-index: 40;
  top: var(--bfa-flight-top);
  left: -360px;
  width: var(--bfa-size);
  max-width: 34vw;
  height: auto;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transform: translate3d(0, 3vh, 0) scale(0.92) rotate(-2deg);
  will-change: transform, opacity;
  contain: layout style;
}

.bfa-flight.is-flying {
  animation: bfa-falcon-flight var(--bfa-duration) cubic-bezier(0.2, 0.04, 0.4, 1) forwards;
}

.bfa-glide {
  position: relative;
  width: 100%;
  transform-origin: 62% 58%;
  animation: bfa-air-current 5.4s ease-in-out infinite;
  will-change: transform;
}

.bfa-falcon-art {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  aspect-ratio: 520 / 580;
  margin: 0;
  padding: 0;
  background-image: url('falcon-sprite.png');
  background-repeat: no-repeat;
  background-position: 0% 0;
  background-size: 600% 100%;
  filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.13));
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: background-position;
  animation: bfa-falcon-frames var(--bfa-wing-speed) steps(1, end) infinite;
  animation-play-state: paused !important;
}

.bfa-no-shadow .bfa-falcon-art {
  filter: none;
}

.bfa-invite-card {
  position: absolute;
  z-index: 1;
  top: 58%;
  right: 58%;
  box-sizing: border-box;
  width: 310px;
  min-height: 92px;
  padding: 12px 62px 11px 20px;
  overflow: hidden;
  color: #f8f2e5;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(190, 145, 57, 0.16), transparent 36%),
    linear-gradient(105deg, rgba(14, 14, 13, 0.98), rgba(37, 30, 20, 0.97));
  border: 1px solid rgba(201, 159, 75, 0.88);
  clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.19), inset 0 1px rgba(255, 255, 255, 0.07);
  transform: translateY(-50%);
}

.bfa-invite-kicker,
.bfa-invite-title,
.bfa-invite-details,
.bfa-invite-dates {
  display: block;
  white-space: nowrap;
}

.bfa-invite-kicker {
  margin-bottom: 3px;
  color: #d7ad59;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.2em;
}

.bfa-invite-title {
  margin: 0 0 7px;
  color: #fffaf0;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.035em;
}

.bfa-invite-details {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d9d1c1;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.09em;
}

.bfa-invite-details b {
  color: #e0b966;
  font-weight: 800;
}

.bfa-invite-details i {
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  background: #c99f4b;
  border-radius: 50%;
}

.bfa-invite-dates {
  margin-top: 6px;
  color: #bdb4a3;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
}

.bfa-no-invite .bfa-invite-card,
.bfa-no-shadow .bfa-invite-card {
  box-shadow: none;
}

.bfa-no-invite .bfa-invite-card {
  display: none;
}

.bfa-screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bfa-flight.is-flying .bfa-falcon-art {
  animation-play-state: running !important;
}

@keyframes bfa-falcon-frames {
  0%, 10%   { background-position: 0% 0; }
  11%, 20%  { background-position: 20% 0; }
  21%, 30%  { background-position: 40% 0; }
  31%, 39%  { background-position: 60% 0; }
  40%, 49%  { background-position: 0% 0; }
  50%, 59%  { background-position: 20% 0; }
  60%, 69%  { background-position: 40% 0; }
  70%, 78%  { background-position: 60% 0; }
  79%, 84%  { background-position: 100% 0; }
  85%, 96%  { background-position: 80% 0; }
  97%, 100% { background-position: 0% 0; }
}

@keyframes bfa-falcon-flight {
  0% {
    opacity: 0;
    transform: translate3d(0, 3vh, 0) scale(0.9) rotate(-2deg);
  }
  8% {
    opacity: 0.94;
  }
  25% {
    transform: translate3d(calc(27vw + 250px), -1.5vh, 0) scale(0.97) rotate(1deg);
  }
  51% {
    transform: translate3d(calc(54vw + 420px), 1.6vh, 0) scale(1.02) rotate(-0.6deg);
  }
  77% {
    transform: translate3d(calc(80vw + 585px), -2vh, 0) scale(0.98) rotate(1.2deg);
  }
  94% {
    opacity: 0.94;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(100vw + 760px), -5vh, 0) scale(0.91) rotate(-1.8deg);
  }
}

/* The sprite's eye/body anchor sits at 58% of its frame height. Keeping that
   point on --bfa-flight-top makes the visible falcon follow the chosen path. */
@keyframes bfa-air-current {
  0%,
  100% {
    transform: translate3d(0, -58%, 0) rotate(-0.45deg);
  }
  44% {
    transform: translate3d(0, calc(-58% - 3px), 0) rotate(0.45deg);
  }
  73% {
    transform: translate3d(0, calc(-58% + 2px), 0) rotate(-0.15deg);
  }
}

@media (max-width: 767px) {
  .bfa-flight {
    left: -250px;
    width: var(--bfa-mobile-size);
    max-width: 44vw;
  }

  .bfa-invite-card {
    right: 54%;
    width: 202px;
    min-height: 66px;
    padding: 8px 34px 8px 14px;
  }

  .bfa-invite-kicker {
    margin-bottom: 2px;
    font-size: 7px;
  }

  .bfa-invite-title {
    margin-bottom: 5px;
    font-size: 9.5px;
  }

  .bfa-invite-details {
    gap: 5px;
    font-size: 7.5px;
  }

  .bfa-invite-details i {
    width: 2px;
    height: 2px;
    flex-basis: 2px;
  }

  .bfa-invite-dates {
    margin-top: 4px;
    font-size: 6.8px;
  }

  @keyframes bfa-falcon-flight {
    0% {
      opacity: 0;
      transform: translate3d(0, 2vh, 0) scale(0.9) rotate(-2deg);
    }
    9% { opacity: 0.94; }
    30% {
      transform: translate3d(calc(31vw + 180px), -1vh, 0) scale(0.97) rotate(1deg);
    }
    60% {
      transform: translate3d(calc(62vw + 320px), 1.2vh, 0) scale(1.01) rotate(-0.6deg);
    }
    93% { opacity: 0.94; }
    100% {
      opacity: 0;
      transform: translate3d(calc(100vw + 520px), -4vh, 0) scale(0.92) rotate(-1.5deg);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfa-flight,
  .bfa-flight.is-flying,
  .bfa-glide,
  .bfa-falcon-art,
  .bfa-invite-card {
    display: none !important;
    animation: none !important;
  }
}
