/*!
 * "Barn" dressing for a solution page (/solutions/barn-camera): the hero as a
 * farm at night - stars, a crescent moon, hills, a fence and a barn with the
 * light left on. Decoration only: aria-hidden, ignores the pointer and sits
 * behind the copy. Artwork is in /img/barn. The hero keeps its own dark colours
 * on every site palette. Quieter than solution-spooky.css on purpose: this page
 * leads with the subscription, so nothing moves except the stars and the lamp.
 */

#header-btm.barn-hero {
    position: relative;
    overflow: hidden;
    background-color: #0a1230 !important;
    background-image:
        radial-gradient(circle at 86% 12%, rgba(200, 215, 255, .16), transparent 34%),
        linear-gradient(180deg, #050917 0%, #0c1636 55%, #1c2c58 100%);
}

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

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

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

/* Two star fields that fade against each other, so the sky twinkles */
.barn-stars {
    inset: 0 0 30% 0;
    animation: barn-twinkle 5s ease-in-out infinite alternate;
}

.barn-stars-1 {
    background-image:
        radial-gradient(2.2px 2.2px at 6% 22%, #fff, transparent),
        radial-gradient(1.7px 1.7px at 14% 64%, #dfe8ff, transparent),
        radial-gradient(2.6px 2.6px at 23% 12%, #fff, transparent),
        radial-gradient(1.7px 1.7px at 34% 44%, #dfe8ff, transparent),
        radial-gradient(2.2px 2.2px at 47% 18%, #fff, transparent),
        radial-gradient(1.7px 1.7px at 58% 70%, #dfe8ff, transparent),
        radial-gradient(2.6px 2.6px at 66% 9%, #fff, transparent),
        radial-gradient(1.7px 1.7px at 74% 52%, #dfe8ff, transparent),
        radial-gradient(2.2px 2.2px at 93% 62%, #fff, transparent);
}

.barn-stars-2 {
    animation-delay: -5s;
    animation-duration: 7s;
    background-image:
        radial-gradient(1.7px 1.7px at 10% 40%, #fff, transparent),
        radial-gradient(2.2px 2.2px at 19% 82%, #dfe8ff, transparent),
        radial-gradient(1.7px 1.7px at 29% 30%, #fff, transparent),
        radial-gradient(2.6px 2.6px at 40% 8%, #dfe8ff, transparent),
        radial-gradient(1.7px 1.7px at 52% 48%, #fff, transparent),
        radial-gradient(2.2px 2.2px at 62% 34%, #dfe8ff, transparent),
        radial-gradient(1.7px 1.7px at 71% 80%, #fff, transparent),
        radial-gradient(2.2px 2.2px at 80% 26%, #dfe8ff, transparent),
        radial-gradient(1.7px 1.7px at 97% 14%, #fff, transparent);
}

/* Crescent: a pale disc with a sky-coloured bite out of it */
.barn-moon {
    top: 18px;
    right: 7%;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    box-shadow: inset -15px 7px 0 0 #f3f0dc;
    filter: drop-shadow(0 0 14px rgba(230, 235, 255, .55));
    transform: rotate(-18deg);
}

.barn-hills {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 64px;
}

.barn-fence {
    left: 0;
    bottom: 3px;
    width: 58%;
    height: 22px;
    background: url(/img/barn/fence.svg?v=1) repeat-x 0 0 / 44px 22px;
    -webkit-mask: linear-gradient(90deg, #000 70%, transparent);
    mask: linear-gradient(90deg, #000 70%, transparent);
}

.barn-barn {
    right: 9%;
    bottom: 10px;
    width: 152px;
}

.barn-barn img {
    display: block;
    width: 100%;
    height: auto;
}

/* The light left on in the loft, breathing a little */
.barn-barn::after {
    content: '';
    position: absolute;
    left: 38.9%;
    top: 38.5%;
    width: 46%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 207, 107, .5), rgba(255, 207, 107, 0) 68%);
    animation: barn-lamp 6s ease-in-out infinite;
}

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

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

    .barn-moon {
        top: 10px;
        right: 14px;
        width: 44px;
        height: 44px;
        box-shadow: inset -10px 5px 0 0 #f3f0dc;
        opacity: .7;
    }

    .barn-hills { height: 50px; }
    .barn-barn { right: 18px; width: 104px; }
    .barn-fence { width: 62%; }
}

@keyframes barn-twinkle {
    from { opacity: 1; }
    to   { opacity: .25; }
}

@keyframes barn-lamp {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .barn-decor *,
    .barn-barn::after {
        animation: none !important;
    }
}
