#feather-fall-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  contain: layout style paint;
}

#feather-fall-pile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--feather-fall-pile-height, 76px);
  pointer-events: none;
  overflow: hidden;
}

.feather-fall-feather {
  position: fixed;
  width: var(--feather-size);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  opacity: var(--feather-opacity);
  transform-origin: 50% 15%;
  will-change: transform, opacity;
  filter: drop-shadow(0 2px 2px rgba(38, 29, 20, 0.14));
  user-select: none;
}

.feather-fall-feather:not(img)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 86% 14% 82% 18% / 58% 20% 80% 42%;
  background:
    linear-gradient(94deg, transparent 47%, rgba(96, 71, 45, 0.48) 49%, rgba(96, 71, 45, 0.48) 52%, transparent 54%),
    radial-gradient(ellipse at 58% 24%, rgba(255, 255, 255, 0.72), transparent 32%),
    var(--feather-color);
  clip-path: polygon(50% 0%, 80% 10%, 96% 35%, 88% 62%, 62% 93%, 53% 100%, 47% 100%, 39% 93%, 13% 62%, 4% 35%, 20% 10%);
}

.feather-fall-feather:not(img)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  width: 1px;
  height: 96%;
  background: rgba(91, 68, 44, 0.45);
  transform: translateX(-50%);
}

.feather-fall-settled {
  position: absolute;
  bottom: var(--settled-bottom);
  left: var(--settled-left);
}

.feather-fall-pile-shake {
  animation: feather-fall-pile-shake 520ms cubic-bezier(.2, .8, .25, 1);
}

@keyframes feather-fall-pile-shake {
  0% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-4px, -3px, 0); }
  36% { transform: translate3d(5px, 2px, 0); }
  56% { transform: translate3d(-3px, -1px, 0); }
  78% { transform: translate3d(2px, 1px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #feather-fall-root,
  #feather-fall-pile {
    display: none;
  }
}
