.menu {
    /*width: max(50px, min(35%, 250px));*/
    /*height: calc(100dvh - 8rem);*/
    height: 100%;
    z-index: 1;
    -webkit-transition: -webkit-transform 0.3s, -webkit-background-color 0.5s;
    transition: transform 0.3s, background-color 0.5s;
    /*temporary for making viewing easier*/
    background-color: var(--bg-color);
    top: 0;
    position: relative;
    border-right:1px solid #ccc;
    font-family:"Red Hat Display", "Arsenal", arial, sans-serif;
}

/*tablets and phones*/
@media screen and (max-width: 768px) {
    .menu {
        /*-webkit-transform: translate3d(max(-15.25em, calc(-80dvw + 4.75rem)), calc(100dvh - 5rem), 0);
        transform: translate3d(max(-15.25rem, calc(-80dvw + 4.75rem)), calc(100dvh - 5rem), 0);*/
        transform: translate3d(max(calc(-80dvw + 2.5rem), -17.5rem), calc(100dvh - 5rem), 0);
        width: 80dvw;
        max-width: 20rem;
        height: calc(100dvh - 5rem);
        top: 5rem;
        position:sticky;
    }

    .menu.menu--open {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        transition: transform 0.3s, background-color 0.5s, height 0.2s ease-in-out, top 0.2s ease-in-out;
    }

    .menu .menu-nav ul li {
        -webkit-transform: translate3d(-20rem, 0, 0);
        transform: translate3d(-20rem, 0, 0);
        -webkit-transition: -webkit-transform 0.3s;
        transition: transform 0.3s;
    }
    .menu__inner {
        width: calc(100% - 2.5rem);
    }
}

/*desktops*/
@media screen and (min-width: 769px) {
    .menu {
        /*-webkit-transform: translate3d(-100%, 50%, 0);
        transform: translate3d(-90%, 0%, 0);*/
        display: flex;
        background: none;
        border-right:none;
    }

    .menu__handle,
    .morph-shape {
        display: none;
    }

    .menu__inner {
        /*width: 100% !important;*/
        max-width:15rem;
    }

    .menu .menu-nav ul li {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/*large desktops*/
@media screen and (min-width: 1280px) {
    .menu {
        /*-webkit-transform: translate3d(-100%, 50%, 0);
        transform: translate3d(-90%, 0%, 0);*/
        display: flex;
        background: none;
        border-right:none;
    }

    .menu__handle,
    .morph-shape {
        display: none;
    }

    .menu__inner {
        width:100%;
        max-width:20rem;
    }

    .menu .menu-nav ul li {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

.menu__inner {
    padding: 1rem 1rem 1rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    height: calc(100dvh - 5rem);
    position: sticky;
    z-index: 1;
    /*not sure why I even made pointer events none but I'll keep it in case it was there for a reason*/
    /*pointer-events: none;*/
    scrollbar-gutter: stable;
    top: 5rem;
    transition: height 0.2s ease-in-out, top 0.2s ease-in-out;
}

.menu .menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    pointer-events: all;
}

.menu .menu-nav ul li {
    margin: 0 0 1rem 0;
}

.menu .menu-nav a {
    clip-path: polygon(0 27%, 2% 11%, 5% 0, 95% 0, 98% 9%, 100% 26%, 100% 70%, 98% 91%, 94% 100%, 7% 100%, 2% 90%, 0 71%);

}

/*adds a delay to each item in sidebar for a "staggered" effect*/

.menu .menu-nav ul li:first-child {
    -webkit-transition-delay: 0.1s;
    transition-delay: 0.1s;
}

.menu .menu-nav ul li:nth-child(2) {
    -webkit-transition-delay: 0.2s;
    transition-delay: 0.2s;
}

.menu .menu-nav ul li:nth-child(3) {
	-webkit-transition-delay: 0.3s;
	transition-delay: 0.3s;
}

.menu .menu-nav ul li:nth-child(4) {
	-webkit-transition-delay: 0.4s;
	transition-delay: 0.4s;
}

.menu--open .menu-nav ul li {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    position: relative;
    margin: 0 0 1rem 0;
}

.menu .menu-nav ul li a {
    display: block;
    outline: none;
    color: #B24E51;
    text-decoration: none;
}

.menu ul li .fa {
    font-size: 3.5em;
    display: block;
    margin: 0 auto;
    background-color: #5f656f;
}

.menu .menu-nav ul li img,
.menu .menu-nav ul li svg,
.menu .menu-nav ul li image,
.svg-container {
    max-width:100%;
    display: block;
    margin:0 auto;
    left:0;
    right:0;
}

.menu .menu-nav ul li img.selected {
    filter: hue-rotate(165deg);
}

.menu .menu-nav ul li img:hover {
    filter: hue-rotate(165deg);
    transition: filter 0.15s;
}

.menu .menu-nav ul li img.selected:hover {
    filter: hue-rotate(90deg);
    transition: filter 0.15s;
}

.svg-container {
    width: auto;
    height: auto;
    margin:0 auto;
}

.menu ul li span {
    font-weight: 500;
    font-size: 1em;
    font-family: 'Red Hat Display', 'Arsenal', arial, sans-serif !important;
    text-transform: capitalize;
    text-align: center;
    display: block;
}

.arrow {
    height: 50%;
    width: 50%;
    border-left: 0.4rem solid color-mix(in srgb, var(--font-color) 50%, transparent);
    border-bottom: 0.4rem solid color-mix(in srgb, var(--font-color) 50%, transparent);
    transform-origin: center;
    /*set to -135deg*/
    transform: rotate3d(0, 0, 1, -180deg);
    position: relative;
    margin: 0 auto;
    transition: transform 0.5s ease-in-out, border-color 0.5s linear;
}

.menu--open .arrow {
    transform: rotate3d(0, 0, 1, 45deg);
    transform: scale3d(-1, 1, 1) rotate3d(0, 0, 1, -90deg);
    border-color: var(--font-color);
}


/*Closed handle and what happens when hovering over it*/

.menu__handle {
    background: color-mix(in srgb, var(--bg-color) 30%, transparent);
    border: 1px solid color-mix(in srgb, var(--font-color) 50%, transparent);
    width: 2rem;
    height: 2rem;
    /*width: 5vw;
    height: 5vw;
    max-width: 50px;
    max-height:50px;
    min-width: 40px;
    min-height: 40px;*/
    border-radius: 100%;
    padding: 0;
    outline: none;
    position: absolute;
    /*top: max(calc(0% - 7.5vw), calc(0% - 75px));*/
    /*top:max(calc(-10% - 75px), calc(-10% - 60px));*/
    top: -2.5rem;
    right: 0.25rem;
    z-index: 1;
    transition: width 0s, height 0s, background 0.5s linear, border-color 0.8s linear, opacity 0.3s linear;
}

.menu--open .menu__handle {
    position: absolute;
    /*transform: translate3d(0px, calc(50vh + 5vw), 0);*/
    top: calc(50% - 1.5rem);
    transition: transform 0.5s !important;
}

.morph-shape {
    position: absolute;
    width: 5rem;
    height: 100%;
    top: 0;
    right: 0px;
    pointer-events: none;
}

.morph-shape svg path {
    /*stroke: #ece3e3;*/
    stroke: transparent;
    stroke-width: 5px;
}

.menu--open .morph-shape svg path {
    stroke: #c93535;
}

/*media query for iPhone6+ in portrait*/
/*@media only screen and (min-device-width: 414px) and (max-device-width: 736px) and (orientation: portrait) {
    .menu__handle {
        opacity: 0.2;
    }

    .menu--open .menu__handle {
        opacity: 1;
    }
}*/

@media only screen and (min-device-width: 1224px) {
    .menu__handle:hover {
        background: rgba(255, 255, 255, 0.8);
        transition: background 0.5s linear;
    }

    .menu__handle:hover>.arrow {
        border-color: #e10e0e;
    }
}


/*Opened handle and what happens when hovering over it*/

.menu--open .menu__handle {
    background: rgba(0, 0, 0, 0);
    /*border: 1px solid black;*/
    transition: all 1.2s;
}


@media only screen and (min-device-width: 1224px) {
    .menu--open .menu__handle:hover {
        /*background: rgba(0, 0, 0, 0.9);*/
        /*border: 1px solid transparent;*/
    }

    .menu--open .menu__handle:hover>.arrow {
        border-color: #e10e0e;
    }
}

@media screen and (max-width: 768px) {
    .main {
        padding: 0 2em;
        -webkit-transition: opacity 0.6s;
        transition: opacity 0.6s;
    }

    .menu {
        /*-webkit-transform: translate3d(-170px, 0, 0);
        transform: translate3d(-170px, 0, 0);*/
    }

    .menu.menu--open+.content {
        /*opacity: 0.05;*/
        filter:blur(4px);
    }
}