.launch-celebration {
    position: fixed;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

.launch-celebration[hidden],
.launch-motion-toggle[hidden] {
    display: none;
}

.launch-celebration-defs {
    position: absolute;
    width: 0;
    height: 0;
}

.launch-bloom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.launch-bloom-bouquet {
    flex-shrink: 0;
    width: min(110vw, 88dvh);
    height: auto;
    opacity: 0;
    animation: launch-bloom 10s cubic-bezier(.22, .61, .36, 1) both;
}

.launch-particle {
    position: absolute;
    top: 100%;
    left: var(--left);
    width: var(--size);
    margin-left: calc(var(--size) / -2);
    color: var(--color);
    opacity: 0;
    animation: launch-rise var(--duration) var(--delay) linear infinite both;
}

.launch-particle > svg {
    width: 100%;
    height: auto;
    overflow: visible;
    animation: launch-sway 5s ease-in-out infinite alternate;
    animation-delay: var(--delay);
}

.launch-celebration[data-paused="true"] .launch-particle,
.launch-celebration[data-paused="true"] .launch-particle > svg,
.launch-celebration[data-paused="true"] .launch-bloom-bouquet {
    animation-play-state: paused;
}

.launch-motion-toggle {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 3px 16px #183c3010;
    cursor: pointer;
}

.launch-motion-toggle:hover {
    background: var(--lime);
}

.launch-motion-toggle:focus-visible {
    outline: 3px solid #648536;
    outline-offset: 4px;
}

.launch-motion-toggle > svg {
    width: 18px;
    height: 18px;
}

.launch-motion-toggle .launch-play-icon,
.launch-motion-toggle[data-paused="true"] .launch-pause-icon {
    display: none;
}

.launch-motion-toggle[data-paused="true"] .launch-play-icon {
    display: block;
}

@keyframes launch-bloom {
    0% {
        opacity: 0;
        transform: translate3d(0, 75dvh, 0) scale(.015) rotate(-30deg);
    }
    6% {
        opacity: 1;
    }
    42%, 56% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    }
    78%, 100% {
        opacity: 0;
        transform: translate3d(0, -45dvh, 0) scale(1.08) rotate(12deg);
    }
}

@keyframes launch-rise {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(.65);
    }
    12%, 78% {
        opacity: .88;
    }
    100% {
        opacity: 0;
        transform: translate3d(20px, calc(-100dvh - 260px), 0) scale(1);
    }
}

@keyframes launch-sway {
    from {
        transform: translateX(-12px) rotate(-9deg);
    }
    to {
        transform: translateX(12px) rotate(9deg);
    }
}

@media (max-width: 720px) {
    .launch-bloom-bouquet {
        width: min(140vw, 88dvh);
    }

    .launch-particle {
        width: calc(var(--size) * .65);
        margin-left: calc(var(--size) * -.325);
    }

    .launch-particle[data-desktop] {
        display: none;
        animation: none;
    }

    .launch-particle[data-desktop] > svg {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .launch-celebration,
    .launch-motion-toggle {
        display: none;
    }

    .launch-particle,
    .launch-particle > svg,
    .launch-bloom-bouquet {
        animation: none;
    }
}
