/*
 * Animated campfire night scene for the home hero.
 * Adapted from "CSS spark" by ig_design (codepen.io/ig_design/full/NeRxzj),
 * scoped under .hero-scene and made responsive. The Sally Glamping logo sits
 * in the middle of the scene.
 */

.hero-scene {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-scene .section-center {
    position: relative;
    width: 400px;
    height: 400px;
    display: block;
    overflow: hidden;
    border: 10px solid rgba(0, 0, 0, .2);
    border-radius: 50%;
    z-index: 5;
    background-color: #1d4456;
    box-shadow: 0 0 50px 5px rgba(255, 148, 0, .1);
    transition: all 500ms linear;
}

/* Sally logo in the middle of the scene */
.hero-scene .scene-logo {
    position: absolute;
    z-index: 30;
    top: 38%;
    left: 50%;
    width: 110px;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 12px rgba(255, 200, 120, .55));
}

/* --- Sky ------------------------------------------------------------------ */
.hero-scene .moon {
    position: absolute;
    top: 50px;
    left: 115px;
    width: 80px;
    display: block;
    height: 80px;
    background-color: #b2b7bc;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        inset -20px 2px 0 0px #c0c3c9,
        0 0 10px 5px rgba(228, 228, 222, .4);
    z-index: 1;
    animation: kk-brilla-moon 4s alternate infinite;
    transition: all 2000ms linear;
}

.hero-scene .moon div:nth-child(1) {
    position: absolute;
    top: 50%;
    left: 10%;
    width: 12%;
    height: 12%;
    border: 1px solid #adaca2;
    border-radius: 50%;
    box-shadow: inset 2px -1px 0 0px #85868b;
    opacity: 0.4;
}

.hero-scene .moon div:nth-child(2) {
    position: absolute;
    top: 20%;
    left: 38%;
    width: 16%;
    height: 16%;
    border: 1px solid #adaca2;
    border-radius: 50%;
    box-shadow: inset 2px -1px 0 0px #85868b;
    opacity: 0.4;
}

.hero-scene .moon div:nth-child(3) {
    position: absolute;
    top: 60%;
    left: 45%;
    width: 20%;
    height: 20%;
    border: 1px solid #adaca2;
    border-radius: 50%;
    box-shadow: inset 2px -1px 0 0px #85868b;
    opacity: 0.4;
}

@keyframes kk-brilla-moon {
    0% {
        box-shadow:
            inset -20px 2px 0 0px #c0c3c9,
            0 0 10px 5px rgba(228, 228, 222, .4);
    }
    50% {
        box-shadow:
            inset -20px 2px 0 0px #c0c3c9,
            0 0 15px 8px rgba(228, 228, 222, .4);
    }
}

.hero-scene .shooting-star {
    z-index: 2;
    width: 1px;
    height: 50px;
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    position: absolute;
    top: 0;
    left: -70px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
    animation: kk-shooting-star 6s linear infinite;
}

@keyframes kk-shooting-star {
    from {
        transform: translateY(0px) translateX(0px) rotate(-45deg);
        opacity: 1;
        height: 5px;
    }
    to {
        transform: translateY(1280px) translateX(1280px) rotate(-45deg);
        opacity: 1;
        height: 800px;
    }
}

.hero-scene .shooting-star-2 {
    z-index: 2;
    width: 1px;
    height: 50px;
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    position: absolute;
    top: 0;
    left: 200px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
    animation: kk-shooting-star-2 9s linear infinite;
}

@keyframes kk-shooting-star-2 {
    from {
        transform: translateY(0px) translateX(0px) rotate(-45deg);
        opacity: 1;
        height: 5px;
    }
    to {
        transform: translateY(1920px) translateX(1920px) rotate(-45deg);
        opacity: 1;
        height: 800px;
    }
}

.hero-scene .star {
    z-index: 2;
    position: absolute;
    top: 185px;
    left: 25px;
    background-image: url('../img/campfire/star.png');
    background-size: 15px 15px;
    width: 15px;
    height: 15px;
    opacity: 0.4;
    animation: kk-star-shine 3.5s linear infinite;
}

.hero-scene .star.snd { top: 100px; left: 310px; animation-delay: 1s; }
.hero-scene .star.trd { top: 130px; left: 100px; animation-delay: 1.4s; }
.hero-scene .star.fth { top: 20px; left: 200px; animation-delay: 1.8s; }
.hero-scene .star.fith { top: 85px; left: 220px; animation-delay: 2.2s; }

@keyframes kk-star-shine {
    0% { transform: scale(0.3) rotate(0deg); opacity: 0.4; }
    25% { transform: scale(1) rotate(360deg); opacity: 1; }
    50% { transform: scale(0.3) rotate(720deg); opacity: 0.4; }
    100% { transform: scale(0.3) rotate(0deg); opacity: 0.4; }
}

/* --- Ground & trees -------------------------------------------------------- */
.hero-scene .ground {
    position: absolute;
    z-index: 6;
    right: -300px;
    bottom: -450px;
    width: 750px;
    height: 700px;
    border-radius: 100%;
    background-color: #112630;
}

.hero-scene .tree-1,
.hero-scene .tree-2 {
    position: relative;
    width: 0;
    height: 0;
    z-index: 8;
    display: block;
    border-bottom: 90px solid #0a171d;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
}

.hero-scene .tree-1 { top: 150px; left: 50px; }
.hero-scene .tree-2 { top: 0; left: 250px; }

.hero-scene .tree-1:before,
.hero-scene .tree-2:before {
    position: absolute;
    bottom: -110px;
    left: 50%;
    margin-left: -4px;
    width: 8px;
    display: block;
    height: 30px;
    z-index: 7;
    content: '';
    background-color: #000;
}

.hero-scene .wood {
    position: absolute;
    z-index: 21;
    left: 50%;
    bottom: 12%;
    width: 100px;
    margin-left: -50px;
    height: 36px;
    background-image: url('../img/campfire/wood.png');
    background-size: 100px 36px;
}

.hero-scene .wood-circle {
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: 11%;
    width: 120px;
    margin-left: -60px;
    height: 26px;
    border-radius: 100%;
    background-color: #0a171d;
}

/* --- Fire & smoke ----------------------------------------------------------- */
.hero-scene .fire {
    position: absolute;
    z-index: 39;
    width: 2px;
    margin-left: -1px;
    left: 50%;
    bottom: 80px;
    transition: all 1200ms linear;
}

.hero-scene .fire span {
    display: block;
    position: absolute;
    bottom: -15px;
    margin-left: -20px;
    height: 0px;
    width: 0px;
    border: 30px solid #febd08;
    border-radius: 50%;
    border-top-left-radius: 0;
    left: -9px;
    box-shadow:
        0 0 10px 5px rgba(244, 110, 28, 0.8),
        0 0 20px 10px rgba(244, 110, 28, 0.6),
        0 0 30px 15px rgba(244, 110, 28, 0.3);
    transform: scale(0.45, 0.75) rotate(45deg);
    animation: kk-brilla-fire 2.5s alternate infinite;
    z-index: 9;
    transition: all 1200ms linear;
}

.hero-scene .fire span:after {
    display: block;
    position: absolute;
    bottom: -30px;
    content: '';
    margin-left: -5px;
    height: 30px;
    width: 12px;
    background-color: rgba(244, 110, 28, 0.7);
    border-radius: 80px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 0 20px 10px rgba(244, 110, 28, 0.7);
    left: -9px;
    opacity: 0.8;
    transform: rotate(-50deg);
}

.hero-scene .fire span:nth-child(2) {
    left: -22px;
    transform: scale(0.3, 0.55) rotate(15deg);
    z-index: 8;
    animation: kk-brilla-fire 1.5s alternate infinite;
}

.hero-scene .fire span:nth-child(3) {
    left: 4px;
    transform: scale(0.3, 0.55) rotate(80deg);
    z-index: 8;
    animation: kk-brilla-fire 2s alternate infinite;
}

@keyframes kk-brilla-fire {
    0%, 100% {
        box-shadow:
            0 0 10px 5px rgba(244, 110, 28, 0.8),
            0 0 20px 10px rgba(244, 110, 28, 0.6),
            0 0 30px 15px rgba(244, 110, 28, 0.3);
    }
    50% {
        box-shadow:
            0 0 14px 7px rgba(244, 110, 28, 0.8),
            0 0 28px 14px rgba(244, 110, 28, 0.6),
            0 0 42px 21px rgba(244, 110, 28, 0.3);
    }
}

.hero-scene .smoke {
    position: absolute;
    z-index: 40;
    width: 2px;
    margin-left: -1px;
    left: 50%;
    bottom: 106px;
    opacity: 0;
    transition: all 800ms linear;
}

.hero-scene .smoke span {
    display: block;
    position: absolute;
    bottom: -35px;
    margin-left: -20px;
    height: 0px;
    width: 0px;
    border: 30px solid rgba(0, 0, 0, .6);
    border-radius: 22px;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0;
    left: -9px;
    opacity: 0;
    transform: scale(0.2, 0.2) rotate(-45deg);
}

@keyframes kk-smoke-left {
    0% { transform: scale(0.2, 0.2) translate(0, 0) rotate(-45deg) }
    10% { opacity: 1; transform: scale(0.2, 0.3) translate(0, -5px) rotate(-45deg) }
    60% { opacity: 0.6; transform: scale(0.3, 0.5) translate(-10px, -80px) rotate(-45deg) }
    100% { opacity: 0; transform: scale(0.4, 0.8) translate(-20px, -120px) rotate(-45deg) }
}

@keyframes kk-smoke-right {
    0% { transform: scale(0.2, 0.2) translate(0, 0) rotate(-45deg) }
    10% { opacity: 1; transform: scale(0.2, 0.3) translate(0, -5px) rotate(-45deg) }
    60% { opacity: 0.6; transform: scale(0.3, 0.5) translate(10px, -80px) rotate(-45deg) }
    100% { opacity: 0; transform: scale(0.4, 0.8) translate(20px, -120px) rotate(-45deg) }
}

.hero-scene .smoke .s-0 { animation: kk-smoke-left 7s 0s infinite }
.hero-scene .smoke .s-1 { animation: kk-smoke-right 7s 0.7s infinite }
.hero-scene .smoke .s-2 { animation: kk-smoke-left 7s 1.4s infinite }
.hero-scene .smoke .s-3 { animation: kk-smoke-right 7s 2.1s infinite }
.hero-scene .smoke .s-4 { animation: kk-smoke-left 7s 2.8s infinite }
.hero-scene .smoke .s-5 { animation: kk-smoke-right 7s 3.5s infinite }
.hero-scene .smoke .s-6 { animation: kk-smoke-left 7s 4.2s infinite }
.hero-scene .smoke .s-7 { animation: kk-smoke-right 7s 4.9s infinite }
.hero-scene .smoke .s-8 { animation: kk-smoke-left 7s 5.6s infinite }
.hero-scene .smoke .s-9 { animation: kk-smoke-right 7s 6.3s infinite }

/* --- Fire on/off toggle ------------------------------------------------------ */
.hero-scene .switch-wrap {
    margin-top: 1.5rem;
    z-index: 6;
}

.hero-scene #switch,
.hero-scene #circle {
    height: 31px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.54, 1.6, 0.5, 1);
}

.hero-scene #switch {
    width: 60px;
    border: 2px solid #2e2418;
    border-radius: 27px;
    background: #ff9400;
    position: relative;
    display: inline-block;
    box-shadow: 3px 3px 0 #2e2418;
}

.hero-scene #circle {
    margin-top: 5%;
    margin-left: 5%;
    width: 40%;
    height: 80%;
    border-radius: 50%;
    box-shadow: 0 4px 4px rgba(26, 53, 71, 0.25), 0 0 0 1px rgba(26, 53, 71, 0.07);
    background: #e9e5d5;
}

.hero-scene #switch.switched {
    background: #2e2418 !important;
}

.hero-scene #switch.switched #circle {
    margin-left: 55%;
}

/* Fire-off state (scoped on the scene wrapper, not on <body>) */
.hero-scene.fire-off .section-center {
    box-shadow: 0 0 50px 5px rgba(200, 200, 200, .2);
}

.hero-scene.fire-off .smoke {
    opacity: 1;
    transition-delay: 0.8s;
}

.hero-scene.fire-off .fire span {
    bottom: -35px;
    left: -9px;
    transform: scale(0.15, 0.15) rotate(45deg);
}

/* --- Responsive: shrink the fixed-size art on small screens ------------------ */
@media (max-width: 480px) {
    .hero-scene .scene-scale {
        transform: scale(0.78);
        transform-origin: top center;
        margin-bottom: -88px;
    }
}
