/*
 * spring.css — drifting blossom petals
 * Usage: <img class="petal" src="petal.svg" alt="">
 */

@keyframes drift {
  0%   { transform: translateY(-10vh) translateX(0)          rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translateY(50vh)  translateX(var(--sway)) rotate(180deg); }
  90%  { opacity: 1; }
  100% { transform: translateY(108vh) translateX(0)          rotate(360deg); opacity: 0; }
}

.petal {
  position: fixed;
  top: 0;
  pointer-events: none;
  user-select: none;
  animation: drift var(--duration) var(--delay) ease-in-out infinite;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0;
}

.petal:nth-child(1)  { --x: 5%;   --size: 1.4em;  --duration: 14s; --delay:  0s;   --sway:  60px; }
.petal:nth-child(2)  { --x: 15%;  --size: 1em;    --duration: 18s; --delay: -5s;   --sway: -80px; }
.petal:nth-child(3)  { --x: 25%;  --size: 1.2em;  --duration: 16s; --delay: -2s;   --sway:  70px; }
.petal:nth-child(4)  { --x: 35%;  --size: 0.9em;  --duration: 20s; --delay: -9s;   --sway: -55px; }
.petal:nth-child(5)  { --x: 45%;  --size: 1.5em;  --duration: 15s; --delay: -4s;   --sway:  90px; }
.petal:nth-child(6)  { --x: 55%;  --size: 1.1em;  --duration: 17s; --delay: -12s;  --sway: -75px; }
.petal:nth-child(7)  { --x: 63%;  --size: 0.8em;  --duration: 19s; --delay: -7s;   --sway:  65px; }
.petal:nth-child(8)  { --x: 72%;  --size: 1.3em;  --duration: 13s; --delay: -3s;   --sway: -85px; }
.petal:nth-child(9)  { --x: 80%;  --size: 1em;    --duration: 21s; --delay: -15s;  --sway:  50px; }
.petal:nth-child(10) { --x: 88%;  --size: 1.2em;  --duration: 16s; --delay: -6s;   --sway: -60px; }
.petal:nth-child(11) { --x: 92%;  --size: 0.9em;  --duration: 18s; --delay: -10s;  --sway:  80px; }
.petal:nth-child(12) { --x: 50%;  --size: 1.4em;  --duration: 14s; --delay: -17s;  --sway: -70px; }

@media (prefers-reduced-motion: reduce) {
  .petal { animation: none; display: none; }
}
