.holiday-garland,
.holiday-snow {
    pointer-events: none;
    user-select: none;
}

.holiday-garland {
    --holiday-band-height: 52px;
    --holiday-branch-rise: 12px;
    --holiday-branch-tail: 0px;

    position: relative;
    z-index: 31;
    block-size: var(--holiday-band-height);
    background:
        radial-gradient(ellipse at 50% 0, #e5b66c2e, transparent 65%),
        linear-gradient(180deg, #161c14, var(--surface-site-top));
}

.holiday-garland__branch {
    --holiday-band-edge: calc(var(--holiday-band-height) + var(--holiday-branch-rise));

    position: absolute;
    inset-block-start: calc(-1 * var(--holiday-branch-rise));
    inline-size: min(51%, 720px);
    aspect-ratio: 1320 / 432;
    background: url('../../img/holiday-evergreen.webp') center / contain no-repeat;
    clip-path: polygon(0 0, 100% 0, 100% var(--holiday-band-edge),
        var(--holiday-branch-tail) var(--holiday-band-edge), var(--holiday-branch-tail) 100%, 0 100%);
}

.holiday-garland__branch--left {
    inset-inline-start: 0;
}

.holiday-garland__branch--right {
    inset-inline-end: 0;
    transform: scaleX(-1);
}

.holiday-garland__strand {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    inline-size: min(50%, 760px);
    block-size: 25px;
    margin-inline: auto;
    border-block-end: 1px solid #a18454;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    box-shadow: 0 1px 2px #eac48038;
}

.holiday-garland__bulb {
    position: absolute;
    inset: var(--bulb-y) auto auto var(--bulb-x);
    inline-size: 7px;
    block-size: 12px;
    margin: 1px 0 0 -3.5px;
    border-radius: 45% 45% 54% 54%;
    background: radial-gradient(ellipse at 41% 38%, #fffdf0 12%, #ffedbd 45%, #eebc68 77%, #a96829);
    box-shadow: 0 0 6px #ffd997, 0 0 16px #ffc96aa8;
}

.holiday-garland__bulb::before {
    position: absolute;
    inset: -3px .5px auto;
    block-size: 3px;
    border-radius: 1px;
    background: linear-gradient(90deg, #625134, #c3a36b 45%, #725831);
    content: '';
}

.holiday-garland__spark {
    position: absolute;
    inset: var(--spark-y) auto auto var(--spark-x);
    inline-size: 4px;
    block-size: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: #fff2ce;
    box-shadow: 0 0 6px 2px #ffe0a3, 0 0 15px 4px #ffbc5980;
}

.holiday-snow {
    --holiday-snow-height: min(90svh, 840px);

    position: fixed;
    inset: 0 0 auto;
    z-index: 29;
    display: none;
    block-size: var(--holiday-snow-height);
    overflow: hidden;
    mask-image: linear-gradient(transparent, #000 16% 60%, transparent);
}

.holiday-snow__flake {
    position: absolute;
    inset: -20px auto auto var(--flake-x);
    inline-size: var(--flake-size);
    block-size: var(--flake-size);
    border-radius: 50%;
    background: #f5faff;
    box-shadow: 0 0 5px #def0ff80;
    opacity: var(--flake-opacity);
}

.holiday-snow__flake:nth-child(4n + 2) {
    filter: blur(.65px);
}

.holiday-snow__flake--crystal {
    background: none;
    box-shadow: none;
}

.holiday-snow__flake--crystal::before {
    display: block;
    color: #e7f4ff;
    font: var(--flake-size) / 1 sans-serif;
    text-align: center;
    text-shadow: 0 0 6px #def0ff80;
    content: '❄';
}

@media (width >= 1280px) {
    .holiday-garland {
        --holiday-branch-tail: min(30%, calc((100vw - var(--layout-shell-max)) / 2 - 8px));
    }
}

@media (width < 700px) {
    .holiday-garland {
        --holiday-band-height: 39px;
        --holiday-branch-rise: 3px;
    }

    .holiday-garland__branch {
        inline-size: 56%;
    }

    .holiday-garland__strand {
        inline-size: 54%;
        block-size: 18px;
    }

    .holiday-garland__bulb {
        inline-size: 5px;
        block-size: 8px;
        margin-inline-start: -2.5px;
    }

    .holiday-garland__spark {
        inline-size: 2.5px;
        block-size: 2.5px;
        margin: -1.25px 0 0 -1.25px;
    }

    .holiday-snow__flake:nth-child(n + 23) {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .holiday-garland__bulb,
    .holiday-garland__spark {
        animation: holiday-glow 3.8s ease-in-out var(--glow-delay) infinite alternate;
    }

    .holiday-snow {
        display: block;
    }

    .holiday-snow__flake {
        animation: holiday-fall var(--flake-duration) linear var(--flake-delay) infinite;
    }
}

@keyframes holiday-glow {
    from { opacity: .53; }
    to { opacity: 1; }
}

@keyframes holiday-fall {
    from {
        transform: translateX(calc(var(--flake-drift) * -.4)) rotate(0deg);
    }

    to {
        transform: translate(var(--flake-drift), calc(var(--holiday-snow-height) + 24px)) rotate(var(--flake-turn));
    }
}
