/* PROTOTYPE (not adopted yet): sakura storm across the PC top area on HOME.
   Petals are created by assets/js/sakura.js. Remove this file, sakura.js and the
   .sakura layers in index.html to go back to the approved state. */

.sakura { display: none; }

@media (min-width: 768px) {
  .hero-visual { position: relative; overflow: hidden; }
  .hero-visual picture, .hero-visual img { position: relative; z-index: 1; }

  .sakura {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    perspective: 900px;
    line-height: 0;
  }
  .sakura--back { z-index: 0; }
  .sakura--front { z-index: 2; }

  /* Outer element: wind carries the petal from the left edge to the right edge. */
  .petal {
    position: absolute;
    left: 0;
    top: var(--y);
    width: var(--s);
    height: calc(var(--s) * 1.2);
    opacity: var(--o);
    will-change: transform;
    animation: sakura-wind var(--d) linear var(--delay) infinite;
  }
  /* Inner element: swaying up and down and tumbling in 3D. */
  .petal i {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--img) center / contain no-repeat;
    will-change: transform;
    animation: sakura-flutter var(--f) ease-in-out var(--delay) infinite;
  }
  .petal.blur i { filter: blur(1.4px); }
}

@keyframes sakura-wind {
  from { transform: translate3d(-6vw, 0, 0); }
  to { transform: translate3d(104vw, var(--dy), 0); }
}

@keyframes sakura-flutter {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg) rotate(var(--r)); }
  25% { transform: translateY(var(--sw)) rotateX(90deg) rotateY(40deg) rotate(calc(var(--r) + var(--spin) * .25)); }
  50% { transform: translateY(0) rotateX(180deg) rotateY(0deg) rotate(calc(var(--r) + var(--spin) * .5)); }
  75% { transform: translateY(calc(var(--sw) * -1)) rotateX(270deg) rotateY(-40deg) rotate(calc(var(--r) + var(--spin) * .75)); }
  100% { transform: translateY(0) rotateX(360deg) rotateY(0deg) rotate(calc(var(--r) + var(--spin))); }
}

@media (prefers-reduced-motion: reduce) {
  .sakura { display: none !important; }
}
