/*!
 * "Spooky" dressing for a solution page (/solutions/ghost-hunting-camera):
 * a night-sky hero with cobwebs, bats, a ghost, a scythe and jack-o'-lanterns,
 * plus a few touches further down. Decoration only - every piece is
 * aria-hidden, ignores the pointer and sits behind the copy. Artwork is in
 * /img/spooky. The hero keeps its own dark colours on every site palette.
 */

/* ── Hero ────────────────────────────────────────────────────────── */
#header-btm.spooky-hero {
    position: relative;
    overflow: hidden;
    background-color: #150b26 !important;
    background-image:
        radial-gradient(circle at 82% 8%, rgba(255, 221, 140, .22), transparent 38%),
        linear-gradient(180deg, #120920 0%, #24123f 55%, #3a1b45 100%);
}

/* Ground mist */
#header-btm.spooky-hero::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 38%;
    background: linear-gradient(180deg, transparent, rgba(190, 170, 235, .16));
    pointer-events: none;
}

#header-btm.spooky-hero > .container-xxl {
    position: relative;
    z-index: 2;
}

#header-btm.spooky-hero h1 {
    text-shadow: 0 0 18px rgba(255, 157, 46, .35);
}

.spooky-decor {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.spooky-decor > * {
    position: absolute;
}

.spooky-moon {
    top: -34px;
    right: 9%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #fff8dc, #f1cf78 70%, #d9ac4c);
    box-shadow: 0 0 60px 18px rgba(255, 221, 140, .28);
    opacity: .85;
}

/* Cobwebs: the artwork is a top-left corner, used as a mask so it takes any colour */
.spooky-web {
    top: 0;
    width: 190px;
    height: 190px;
    background-color: rgba(255, 255, 255, .34);
    -webkit-mask: url(/img/spooky/cobweb.svg?v=1) no-repeat 0 0 / contain;
    mask: url(/img/spooky/cobweb.svg?v=1) no-repeat 0 0 / contain;
}

.spooky-web-l { left: 0; }
.spooky-web-r { right: 0; transform: scaleX(-1); }

/* Spider on its thread, let down from the top edge */
.spooky-spider {
    top: 0;
    left: 46%;
    width: 22px;
    padding-top: 74px;
    background: linear-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, .4)) no-repeat 50% 0 / 1px 78px;
    transform-origin: 50% 0;
    filter: drop-shadow(0 0 2px rgba(210, 180, 255, .9)) drop-shadow(0 0 5px rgba(190, 150, 255, .6));
    animation: spooky-dangle 7s ease-in-out infinite alternate;
}

.spooky-spider img,
.spooky-bat img {
    display: block;
    width: 100%;
    height: auto;
}

.spooky-bat {
    left: 0;
    width: 46px;
    filter: drop-shadow(0 0 3px rgba(190, 150, 255, .55));
    animation: spooky-fly 19s linear infinite;
}

.spooky-bat img {
    animation: spooky-flap .32s ease-in-out infinite alternate;
}

.spooky-bat-1 { top: 10%; }
.spooky-bat-2 { top: 30%; width: 30px; animation-duration: 27s; animation-delay: -9s; }
.spooky-bat-3 { top: 5%;  width: 36px; animation-duration: 23s; animation-delay: -15s; }
.spooky-bat-4 { top: 52%; width: 24px; animation-duration: 31s; animation-delay: -22s; }

.spooky-ghost {
    left: 50%;
    bottom: 10px;
    width: 52px;
    height: auto;
    opacity: .8;
    filter: drop-shadow(0 0 10px rgba(200, 190, 255, .6));
    animation: spooky-float 5.5s ease-in-out infinite alternate;
}

.spooky-scythe {
    right: 6px;
    bottom: -14px;
    width: 104px;
    height: auto;
    transform: rotate(9deg);
    opacity: .9;
}

.spooky-pumpkin {
    bottom: 4px;
    height: auto;
    filter: drop-shadow(0 0 9px rgba(255, 150, 40, .65));
    animation: spooky-flicker 2.6s ease-in-out infinite;
}

.spooky-pumpkin-1 { right: 118px; width: 62px; }
.spooky-pumpkin-2 { right: 184px; width: 42px; animation-delay: -1.1s; }

@media (min-width: 992px) {
    /* Room on the ground for the pumpkins under the hero chat */
    #header-btm.spooky-hero {
        padding-bottom: 3.75rem !important;
    }
}

@media (max-width: 991.98px) {
    #header-btm.spooky-hero {
        padding-bottom: 4rem !important;
    }

    .spooky-moon {
        top: -50px;
        right: -30px;
        width: 120px;
        height: 120px;
        opacity: .5;
    }

    .spooky-web {
        width: 120px;
        height: 120px;
    }

    .spooky-spider,
    .spooky-bat-4 {
        display: none;
    }

    .spooky-ghost { left: 14px; width: 40px; }
    .spooky-scythe { width: 70px; right: 0; }
    .spooky-pumpkin-1 { right: 74px; width: 48px; }
    .spooky-pumpkin-2 { right: 126px; width: 32px; }
}

/* ── Page body ───────────────────────────────────────────────────── */
/* A web in the corner of the feature panels */
.spooky-body .ai-card-cloud {
    position: relative;
    overflow: hidden;
}

.spooky-body .ai-card-cloud::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 84px;
    height: 84px;
    background-color: currentColor;
    opacity: .16;
    -webkit-mask: url(/img/spooky/cobweb.svg?v=1) no-repeat 0 0 / contain;
    mask: url(/img/spooky/cobweb.svg?v=1) no-repeat 0 0 / contain;
    transform: scaleX(-1);
    pointer-events: none;
}

/* Either side of the closing call to action */
.spooky-cta-art {
    width: 44px;
    height: auto;
    margin: 0 .9rem;
    vertical-align: middle;
}

img.spooky-cta-art[src*=pumpkin] {
    filter: drop-shadow(0 0 8px rgba(255, 150, 40, .55));
    animation: spooky-flicker 2.6s ease-in-out infinite;
}

img.spooky-cta-art[src*=ghost] {
    width: 34px;
    filter: drop-shadow(0 0 8px rgba(200, 190, 255, .5));
    animation: spooky-float 5.5s ease-in-out infinite alternate;
}

@media (max-width: 575.98px) {
    .spooky-cta-art {
        display: none;
    }
}

/* ── Motion ──────────────────────────────────────────────────────── */
@keyframes spooky-fly {
    0%   { transform: translate(-60px, 0); }
    20%  { transform: translate(20vw, -16px); }
    40%  { transform: translate(40vw, 14px); }
    60%  { transform: translate(60vw, -10px); }
    80%  { transform: translate(80vw, 18px); }
    100% { transform: translate(calc(100vw + 60px), 0); }
}

@keyframes spooky-flap {
    from { transform: scaleY(1); }
    to   { transform: scaleY(.4); }
}

@keyframes spooky-float {
    from { transform: translateY(0) rotate(-3deg); opacity: .55; }
    to   { transform: translateY(-16px) rotate(3deg); opacity: .9; }
}

@keyframes spooky-dangle {
    from { transform: translateY(-34px) rotate(-2deg); }
    to   { transform: translateY(0) rotate(2deg); }
}

@keyframes spooky-flicker {
    0%, 100% { filter: drop-shadow(0 0 9px rgba(255, 150, 40, .65)) brightness(1); }
    42%      { filter: drop-shadow(0 0 4px rgba(255, 150, 40, .4)) brightness(.9); }
    50%      { filter: drop-shadow(0 0 13px rgba(255, 170, 60, .8)) brightness(1.08); }
    63%      { filter: drop-shadow(0 0 6px rgba(255, 150, 40, .5)) brightness(.94); }
}

/* Still life for anyone who asked for less motion: the bats perch in view */
@media (prefers-reduced-motion: reduce) {
    .spooky-decor *,
    .spooky-cta-art {
        animation: none !important;
    }

    .spooky-bat-1 { left: 62%; }
    .spooky-bat-2 { left: 30%; }
    .spooky-bat-3 { left: 78%; }
    .spooky-bat-4 { display: none; }
}
