/* Bird flight demo — DEMO ONLY, not part of the parity clone. */
.bd-stage {
  /* Page-width clipping layer, top of the document down past the flock. Birds
     flying off the right are clipped here instead of widening the page. */
  position: absolute;
  left: 0; top: 0; width: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 9;
}
.bd-flock {
  /* In-page, placed in document coordinates by JS: it scrolls with the artwork
     natively. (It used to be position:fixed and chased the page on scroll.) */
  position: absolute;
  pointer-events: none;
  overflow: visible;
}

.bd-bird {
  position: absolute;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* The <i> is the bird. The wrapper carries only position and the flight
   transform, so the flap on the <i> composes with the flight instead of sitting
   behind a second, static copy of the same image. */
.bd-bird > i {
  display: block; width: 100%; height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transform-origin: 50% 65%;   /* pivot near the body, not the wingtips */
  will-change: transform;
}

/* One continuous crossing: in from the left and below, through the bird's real
   place in the artwork (the 0,0 keyframe at 42%), then up and out of the top
   right. Held off-page before it starts and after it ends, so nothing is on the
   page at first paint and nothing comes back. The mid keyframe is at 28%: at 42%
   almost half the flight happened off-screen before the bird appeared, which read
   as a lag before anything started. */
.bd-flock.bd-cross .bd-bird {
  transform: translate3d(var(--sx), var(--sy), 0) rotate(var(--sr, 0deg));
  /* LINEAR. Any ease makes the bird accelerate or brake in mid-air, and an
     ease-out in particular makes it crawl to a halt as it leaves — which looked
     like the last few getting stuck near the corner. Cruising flight is steady. */
  animation: bd-cross var(--dur, 8s) linear var(--delay, 0s) both;
}
@keyframes bd-cross {
  0%   { transform: translate3d(var(--sx), var(--sy), 0) rotate(var(--sr, 0deg)); }
  28%  { transform: translate3d(0, 0, 0) rotate(0deg); }        /* her composition */
  100% { transform: translate3d(var(--ex), var(--ey), 0) rotate(var(--er, 0deg)); }
}

/* Suggested wingbeat. These are flat silhouettes with no separate wings, so a
   vertical squash plus a little roll is as close as the artwork allows — it reads
   as a wingbeat at the ~50px these render at. Real articulation needs layered
   source art from the designer. */
.bd-flock:not(.bd-still) .bd-bird > i {
  animation: bd-flap var(--flap, .34s) ease-in-out var(--flapdelay, 0s) infinite;
}
/* A calm wingbeat, with the body rising on the downstroke the way a real one
   does — the little lift is most of what sells it. Shallower than the previous
   pass: 0.48 was a snap, and a snap at this size reads as an insect. */
@keyframes bd-flap {
  0%, 100% { transform: translateY(0)     scaleY(1)    rotate(0deg); }
  28%      { transform: translateY(-6%)   scaleY(1.10) rotate(1.5deg); }   /* downstroke, lift */
  62%      { transform: translateY(3%)    scaleY(.74)  rotate(-2deg); }    /* upstroke, settle */
}

/* ?still=1 — held at rest, which is the parity composition. */
.bd-flock.bd-still .bd-bird { transition: none !important; }

/* Someone who has asked their system for less motion keeps the birds where the
   artwork put them: no flight, no flapping, nothing flying off the page. */
@media (prefers-reduced-motion: reduce) {
  .bd-flock .bd-bird { transform: none !important; transition: none !important; }
  .bd-flock .bd-bird > i { animation: none !important; }
}

/* The flight now waits for the page to settle, so the still artwork used to show
   its birds for a moment mid-page and then blink out as the flock entered from
   the left. Hide the still homepage birds from first paint for everyone who gets
   the flight. Reduced-motion visitors keep them: no flock replaces theirs. The
   image keeps its layout box (visibility, not display). */
@media (prefers-reduced-motion: no-preference) {
  img[src*="7bI2tS7y-YJ_birds"] { visibility: hidden; }
}
