/**
***** SHARED WEATHER LAYERS *****
*/

#overlay-fog,
#overlay-rain,
#overlay-snow,
#overlay-cherryBlossom,
#overlay-encounters,
#overlay-encountersFlash,
#overlay-film,
#overlay-filmGrain,
#overlay-emberVeil,
#overlay-fireflySwarm,
#overlay-inversion,
#overlay-malaysianMayhem,
#overlay-nighttime {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;
}

#overlay-fog,
#overlay-rain,
#overlay-snow,
#overlay-cherryBlossom,
#overlay-encounters,
#overlay-film,
#overlay-emberVeil,
#overlay-fireflySwarm,
#overlay-inversion,
#overlay-malaysianMayhem,
#overlay-nighttime {
    z-index: 3;
}

#overlay-encountersFlash,
#overlay-filmGrain {
    z-index: 100;
}

#panorama.weather-panorama-snow {
    filter: brightness(0.82) contrast(1.06) saturate(0.72) hue-rotate(-12deg);
}

#panorama.weather-panorama-rain {
    filter: brightness(0.78) contrast(1.12) saturate(0.72) hue-rotate(-10deg);
}

#panorama.weather-panorama-ember {
    filter: brightness(0.62) contrast(1.18) saturate(0.78) sepia(0.22) hue-rotate(-18deg);
}

#panorama.weather-panorama-firefly {
    filter: brightness(0.68) contrast(1.08) saturate(0.7) hue-rotate(-18deg);
}

#panorama.weather-panorama-inversion {
    filter: invert(1) grayscale(1) brightness(0.84) contrast(4.8);
}

#panorama.weather-panorama-malaysian {
    filter: opacity(100%) hue-rotate(0deg) saturate(250%);
    animation: weather-rotateFilter 10s linear infinite;
}

@keyframes weather-rotateFilter {
    0% {
        filter: opacity(100%) hue-rotate(0deg) saturate(250%);
    }
    100% {
        filter: opacity(100%) hue-rotate(359deg) saturate(250%);
    }
}


/**
***** FOG *****
*/

.fog {
    position: relative;
    height: 100vh;
    width: 100%;
    background-color: #000;
}

.fog__container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 100;
    pointer-events: none;
    user-select: none;
}

.fog__img {
    position: absolute;
    height: 100vh;
    width: 300vw;
}

.fog__img--first {
    background: url("../img/weather/fog-1b.png") repeat-x;
    background-size: contain;
    background-position: center;
    animation: marquee 60s linear infinite;
    filter: opacity(100%);
}

.fog__img--second {
    background: url("../img/weather/fog-3.png") repeat-x;
    background-size: contain;
    background-position: center;
    animation: marquee 40s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-200vw, 0, 0);
    }
}


/**
***** STORM RAIN *****
*/

#rain-back,
#rain-front,
#rain-mist,
#rain-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#rain-back,
#rain-front {
    overflow: hidden;
    mix-blend-mode: screen;
}

#overlay-rain .sheet {
    position: absolute;
    top: -20%;
    left: -35%;
    width: 170%;
    height: 160%;
    transform: rotate(14deg);
    background-image: repeating-linear-gradient(to right,
            rgba(205, 225, 255, 0) 0px,
            rgba(205, 225, 255, 0) 10px,
            rgba(205, 225, 255, 0.15) 10px,
            rgba(205, 225, 255, 0.15) 11px,
            rgba(205, 225, 255, 0) 12px,
            rgba(205, 225, 255, 0) 22px);
    -webkit-mask-image: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 10px,
            rgba(0, 0, 0, 1) 10px,
            rgba(0, 0, 0, 1) 24px,
            transparent 24px,
            transparent 52px);
    mask-image: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 10px,
            rgba(0, 0, 0, 1) 10px,
            rgba(0, 0, 0, 1) 24px,
            transparent 24px,
            transparent 52px);
    will-change: transform;
}

#rain-back .sheet.one {
    opacity: 0.3;
    filter: blur(0.6px);
    animation: rain-fall-back 1.35s linear infinite;
}

#rain-back .sheet.two {
    opacity: 0.22;
    filter: blur(1px);
    animation: rain-fall-back 1.8s linear infinite;
    animation-delay: -0.5s;
    -webkit-mask-position: 0 14px;
    mask-position: 0 14px;
}

#rain-front .sheet.one {
    opacity: 0.42;
    filter: blur(0.2px);
    animation: rain-fall-front 0.82s linear infinite;
}

#rain-front .sheet.two {
    opacity: 0.32;
    filter: blur(0.8px);
    animation: rain-fall-front 1.08s linear infinite;
    animation-delay: -0.34s;
    -webkit-mask-position: 0 22px;
    mask-position: 0 22px;
}

#rain-mist {
    background:
        radial-gradient(circle at 50% 112%, rgba(214, 232, 255, 0.12), transparent 30%),
        linear-gradient(to top, rgba(8, 18, 28, 0.30), transparent 28%);
    mix-blend-mode: screen;
    opacity: 0.42;
    filter: blur(10px);
    animation: mist-shift 12s ease-in-out infinite alternate;
}

#rain-vignette {
    background:
        radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.58) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 14%, transparent 84%, rgba(0, 0, 0, 0.30));
}

@keyframes rain-fall-back {
    0% {
        transform: translate3d(0, -8%, 0) rotate(14deg);
    }
    100% {
        transform: translate3d(0, 38%, 0) rotate(14deg);
    }
}

@keyframes rain-fall-front {
    0% {
        transform: translate3d(0, -14%, 0) rotate(14deg);
    }
    100% {
        transform: translate3d(0, 58%, 0) rotate(14deg);
    }
}

@keyframes mist-shift {
    0% {
        transform: translate3d(-2vw, 1vh, 0) scale(1);
    }
    100% {
        transform: translate3d(2vw, -1vh, 0) scale(1.04);
    }
}


/**
***** SNOW 3 *****
*/

#snow-frostBack,
#snow-canvas,
#snow-frostFront,
#snow-grain,
#snow-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#snow-frostBack {
    background:
        radial-gradient(circle at 18% 84%, rgba(220, 238, 255, 0.08), transparent 24%),
        radial-gradient(circle at 82% 78%, rgba(210, 232, 255, 0.07), transparent 26%),
        linear-gradient(to top, rgba(8, 18, 30, 0.22), transparent 34%);
    mix-blend-mode: screen;
    opacity: 0.42;
    filter: blur(12px);
}

#snow-frostFront {
    background:
        radial-gradient(circle at 50% 112%, rgba(255, 255, 255, 0.10), transparent 30%),
        linear-gradient(to top, rgba(12, 20, 32, 0.12), transparent 28%);
    mix-blend-mode: screen;
    opacity: 0.32;
    filter: blur(10px);
}

#snow-canvas {
    mix-blend-mode: screen;
}

#snow-grain {
    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.022) 0px,
            rgba(255, 255, 255, 0.022) 1px,
            transparent 2px,
            transparent 5px);
    opacity: 0.04;
    mix-blend-mode: screen;
}

#snow-vignette {
    background:
        radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.42) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.10), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.18));
}


/**
***** ENCOUNTERS *****
*/

#overlay-encounters {
    backdrop-filter: invert(100%) contrast(300%);
}

#overlay-encountersFlash {
    background: url('../img/weather/encountersFlash.gif');
    background-size: 100%;
    top: 0;
    mix-blend-mode: difference;
    opacity: 0.3;
}


/**
***** FILM NOIR *****
*/

#overlay-film {
    backdrop-filter: saturate(100%) brightness(100%) contrast(200%) grayscale(100%) hue-rotate(0deg);
}

#overlay-filmGrain {
    background: url('../img/weather/filmGrain.gif');
    background-size: 100%;
    top: 0;
    mix-blend-mode: difference;
    opacity: 0.4;
}


/**
***** CHERRY BLOSSOM *****
*/

#overlay-cherryBlossom {
    backdrop-filter: opacity(100%) hue-rotate(270deg) saturate(250%);
}


/**
***** EMBER VEIL *****
*/

#ember-smokeBack,
#ember-smokeFront,
#ember-heatGlow,
#ember-canvas,
#ember-grain,
#ember-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#ember-smokeBack {
    background:
        radial-gradient(circle at 18% 88%, rgba(255, 184, 122, 0.08), transparent 24%),
        radial-gradient(circle at 82% 84%, rgba(255, 140, 84, 0.08), transparent 24%),
        linear-gradient(to top, rgba(20, 10, 8, 0.42), transparent 34%);
    mix-blend-mode: screen;
    opacity: 0.56;
    filter: blur(14px);
    animation: smoke-back-drift 24s ease-in-out infinite alternate;
}

#ember-smokeFront {
    background:
        radial-gradient(circle at 50% 112%, rgba(255, 206, 148, 0.14), transparent 32%),
        linear-gradient(to top, rgba(28, 12, 8, 0.30), transparent 28%);
    mix-blend-mode: screen;
    opacity: 0.46;
    filter: blur(16px);
    animation: smoke-front-drift 15s ease-in-out infinite alternate;
}

#ember-heatGlow {
    background:
        radial-gradient(circle at 50% 108%, rgba(255, 112, 36, 0.16), transparent 30%),
        radial-gradient(circle at 32% 92%, rgba(255, 188, 94, 0.08), transparent 22%),
        radial-gradient(circle at 70% 88%, rgba(255, 136, 70, 0.08), transparent 24%);
    mix-blend-mode: screen;
    opacity: 0.72;
}

#ember-canvas {
    mix-blend-mode: screen;
}

#ember-grain {
    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.025) 0px,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 2px,
            transparent 5px);
    opacity: 0.05;
    mix-blend-mode: screen;
}

#ember-vignette {
    background:
        radial-gradient(circle at center, transparent 46%, rgba(0, 0, 0, 0.58) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.20), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.34));
}

@keyframes smoke-back-drift {
    0% {
        transform: translate3d(-2vw, 1vh, 0) scale(1);
        opacity: 0.48;
    }
    100% {
        transform: translate3d(2vw, -1vh, 0) scale(1.06);
        opacity: 0.62;
    }
}

@keyframes smoke-front-drift {
    0% {
        transform: translate3d(2vw, 0, 0) scale(1);
        opacity: 0.34;
    }
    100% {
        transform: translate3d(-3vw, -1vh, 0) scale(1.08);
        opacity: 0.54;
    }
}


/**
***** FIREFLY SWARM *****
*/

#firefly-nightHaze,
#firefly-canvas,
#firefly-grain,
#firefly-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#firefly-nightHaze {
    background:
        radial-gradient(circle at 50% 112%, rgba(168, 214, 255, 0.12), transparent 34%),
        linear-gradient(to top, rgba(5, 12, 18, 0.30), transparent 32%);
    mix-blend-mode: screen;
    opacity: 0.54;
    filter: blur(8px);
    animation: haze-drift 22s ease-in-out infinite alternate;
}

#firefly-canvas {
    mix-blend-mode: screen;
}

#firefly-grain {
    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.025) 0px,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 2px,
            transparent 5px);
    opacity: 0.05;
    mix-blend-mode: screen;
}

#firefly-vignette {
    background:
        radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.56) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 16%, transparent 82%, rgba(0, 0, 0, 0.26));
}

@keyframes haze-drift {
    0% {
        transform: translate3d(-2vw, 1vh, 0) scale(1);
        opacity: 0.46;
    }
    100% {
        transform: translate3d(2vw, -1vh, 0) scale(1.05);
        opacity: 0.6;
    }
}


/**
***** INVERSION *****
*/

#inversion-scanlines,
#inversion-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#inversion-scanlines {
    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 2px,
            transparent 5px);
    mix-blend-mode: screen;
    opacity: 0.07;
}

#inversion-vignette {
    background:
        radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.58) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.32), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.34));
}


/**
***** MALAYSIAN MAYHEM *****
*/

#overlay-malaysianMayhem {
    background:
        radial-gradient(circle at 50% 112%, rgba(255, 196, 98, 0.08), transparent 28%),
        radial-gradient(circle at 50% 0%, rgba(88, 255, 190, 0.06), transparent 36%);
    mix-blend-mode: screen;
    opacity: 0.55;
}


/**
***** NIGHT TIME *****
*/

#overlay-nighttime {
    background:
        radial-gradient(circle at center, transparent 24%, rgba(0, 0, 0, 0.20) 56%, rgba(0, 0, 0, 0.42) 100%);
}
