.snowfall {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: hidden;
    pointer-events: none;
}

.snowfall__flake {
    position: absolute;
    top: -40px;
    left: var(--snow-left);
    width: var(--snow-size);
    height: var(--snow-size);
    opacity: var(--snow-opacity);
    animation: snowfall var(--snow-duration) var(--snow-delay) linear infinite;
}

.snowfall__flake::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../images/yuki-01.png") center / contain no-repeat;
    animation: snow-rotation var(--snow-rotation-duration) var(--snow-rotation-delay) linear infinite;
    animation-direction: var(--snow-rotation-direction);
}

.snowfall__flake--2::before {
    background-image: url("../images/yuki-02.png");
}

.snowfall__flake--3::before {
    background-image: url("../images/yuki-03.png");
}

.snowfall.is-paused .snowfall__flake,
.snowfall.is-paused .snowfall__flake::before {
    animation-play-state: paused;
}

@keyframes snow-rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes snowfall {
    0% {
        transform: translate3d(0, -40px, 0);
    }
    50% {
        transform: translate3d(var(--snow-drift), 50vh, 0);
    }
    100% {
        transform: translate3d(0, calc(100vh + 80px), 0);
    }
}

@media (max-width: 767px) {
    .snowfall__flake:nth-child(n + 29) {
        display: none;
    }
}

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

    .snowfall__flake,
    .snowfall__flake::before {
        animation: none;
    }
}
