/* Have Anything Mobile (HAM) menu. Only loaded at 800px wide and below. */

:root {
    --hamMenuSliceHeight: 3px;
    --hamMenuSize: 28px;
    --hamAnimationTime: 200ms;
}

body {
    overflow-x: hidden;
}

#mLayerMenu ul {
    list-style: none;
    margin: 0;
    padding-left: 0px;
}

#mLayerMenu a {
    display: block;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background-color 200ms;
}

#mLayerMenu a:hover {
    background-color: var(--surface-2);
}

#hamMenu {
    width: var(--hamMenuSize);
    height: var(--hamMenuSize);
    position: fixed;
    top: calc((64px - var(--hamMenuSize)) / 2);
    right: 20px;
    cursor: pointer;
    z-index: 999;
}

.hamMenuSlice {
    background-color: var(--text);
    width: var(--hamMenuSize);
    height: var(--hamMenuSliceHeight);
    border-radius: var(--hamMenuSliceHeight);
    position: absolute;
    left: 50%;
    translate: -50% -50%;
}

#hamMenuMid {
    top: 50%;
    bottom: 50%;
}

.rpAnimations {
    animation-duration: var(--hamAnimationTime);
    animation-fill-mode: forwards;
}

#hamMenuTop {
    top: calc(0px + (var(--hamMenuSliceHeight) / 2));
    transform: rotate(0deg);
}

.hamMenuTopOpen {
    animation-name: hamMenuTopO;
}

@keyframes hamMenuTopO {
    0% {
        top: 50%;
        transform: rotate(45deg);
    }
    100% {
        top: calc(0px + (var(--hamMenuSliceHeight) / 2));
        transform: rotate(0deg);
    }
}

.hamMenuTopClose {
    animation-name: hamMenuTopC;
}

@keyframes hamMenuTopC {
    0% {
        top: calc(0px + (var(--hamMenuSliceHeight) / 2));
        transform: rotate(0deg);
    }
    100% {
        top: 50%;
        transform: rotate(45deg);
    }
}

#hamMenuMid {
    opacity: 1;
}

.hamMenuMidOpen {
    animation-name: hamMenuMidO;
}

@keyframes hamMenuMidO {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.hamMenuMidClose {
    animation-name: hamMenuMidC;
}

@keyframes hamMenuMidC {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#hamMenuBot {
    top: calc(var(--hamMenuSize) - (var(--hamMenuSliceHeight) / 2));
    transform: rotate(0deg);
}

.hamMenuBotOpen {
    animation-name: hamMenuBotO;
}

@keyframes hamMenuBotO {
    0% {
        top: 50%;
        transform: rotate(-45deg);
    }
    100% {
        top: calc(var(--hamMenuSize) - (var(--hamMenuSliceHeight) / 2));
        transform: rotate(0deg);
    }
}

.hamMenuBotClose {
    animation-name: hamMenuBotC;
}

@keyframes hamMenuBotC {
    0% {
        top: calc(var(--hamMenuSize) - (var(--hamMenuSliceHeight) / 2));
        transform: rotate(0deg);
    }
    100% {
        top: 50%;
        transform: rotate(-45deg);
    }
}

#mLayerMenu {
    display: block;
    position: fixed;
    width: 80vw;
    height: 100vh;
    top: 0;
    right: -80vw;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    padding-top: 64px;
    z-index: 998;
}

.mLayerMenuClose {
    animation-name: mLayerMenuC;
}

@keyframes mLayerMenuC {
    0% {
        right: -80vw;
    }
    100% {
        right: 0;
    }
}

.mLayerMenuOpen {
    animation-name: mLayerMenuO;
}

@keyframes mLayerMenuO {
    0% {
        right: 0;
    }
    100% {
        right: -80vw;
    }
}

#dMenu {
    display: none;
}

#mMenu {
    display: block;
}

#fullPageBlur {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 500;
}

.fullPageBlurOpen {
    animation-name: fullPageBlurO;
}

@keyframes fullPageBlurO {
    0% {
        backdrop-filter: blur(3px);
    }
    99% {
        backdrop-filter: blur(0px);
    }
    100% {
        width: 0px;
        height: 0px;
    }
}

.fullPageBlurClose {
    animation-name: fullPageBlurC;
}

@keyframes fullPageBlurC {
    0% {
        width: 100vw;
        height: 100vh;
    }
    1% {
        backdrop-filter: blur(0px);
    }
    100% {
        backdrop-filter: blur(3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --hamAnimationTime: 1ms;
    }
}
