
.scene {
  --h: 100svh;
  --fw: max(100vw, calc(var(--h) * 16 / 9));
  --fh: calc(var(--fw) * 9 / 16);
  position: relative; width: 100%; height: var(--h); overflow: hidden;
}
.frame {
  position: absolute; left: 50%; translate: -50% 0;
  top: calc((var(--h) - var(--fh)) * .32);
  width: var(--fw); height: var(--fh);
}
.art { display: block; width: 100%; height: 100%; }

.flock { animation-timing-function: linear; animation-iteration-count: infinite; }
.flock--r { animation-name: door-fly-r; }
.flock--l { animation-name: door-fly-l; }
.bird { animation: door-bob ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.bd { animation: door-drift var(--drift, 12s) ease-in-out infinite alternate; animation-delay: var(--driftd, 0s); }
.wing { animation-duration: var(--beat, 1.9s); animation-delay: var(--beatd, 0s); animation-timing-function: linear; animation-iteration-count: infinite; transform-box: fill-box; }
.wing--l { animation-name: door-beat-l; transform-origin: 100% 53%; }
.wing--r { animation-name: door-beat-r; transform-origin: 0% 53%; }
.haze { animation: door-haze linear infinite; }
@keyframes door-fly-r {
  0%   { transform: translate(-420px, 24px); }
  25%  { transform: translate(190px, 4px); }
  50%  { transform: translate(800px, -8px); }
  75%  { transform: translate(1410px, -20px); }
  100% { transform: translate(2020px, -24px); }
}
@keyframes door-fly-l {
  0%   { transform: translate(2020px, -18px); }
  25%  { transform: translate(1410px, -2px); }
  50%  { transform: translate(800px, 10px); }
  75%  { transform: translate(190px, 18px); }
  100% { transform: translate(-420px, 22px); }
}
@keyframes door-bob {
  0%   { transform: translate(0, 0); }
  34%  { transform: translate(.5px, -3.4px); }
  66%  { transform: translate(-.3px, 1.1px); }
  100% { transform: translate(0, 0); }
}
@keyframes door-drift { from { transform: translate(0, 0); } to { transform: translate(5px, -3.5px); } }
@keyframes door-beat-l {
  0%   { transform: rotate(11deg);  animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  20%  { transform: rotate(-25deg); animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  50%  { transform: rotate(10deg);  animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  70%  { transform: rotate(-21deg); animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  100% { transform: rotate(11deg); }
}
@keyframes door-beat-r {
  0%   { transform: rotate(-11deg); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  20%  { transform: rotate(25deg);  animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  50%  { transform: rotate(-10deg); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  70%  { transform: rotate(21deg);  animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  100% { transform: rotate(-11deg); }
}
@keyframes door-haze { from { transform: translateX(-2.5%); } to { transform: translateX(2.5%); } }

@media (prefers-reduced-motion: reduce) {
  .flock, .bird, .bd, .wing, .haze { animation: none; }
  .flock { transform: translateX(var(--rest, 0px)); }
}

@media (max-width: 900px) {
  .flock { scale: 1.9; opacity: .8; }
}
