.top_menu_bg {
    visibility: hidden;
    opacity: 0;
    height: 4.5rem;
    background-color: var(--tb-mint);
    transition: background-color .4s ease;
    z-index: 4500;
}


.top_logo {
    visibility: hidden;
    opacity: 0;
    color: var(--tb-charcoal);
    position: fixed;
    width: 2.5rem;
    top: .8rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5000;
}

.burger {
    visibility: hidden;
    opacity: 0;
    /* The lines sit low inside their own box, so the control is nudged up to put
       the glyph's optical centre on the bar's centre line. */
    top: 1.375rem;
    right: 1rem;
    z-index: 5000;
    cursor: pointer;
}

.desk_menu a {
    color: #fff;
    text-decoration: none;
}

.desk_menu a:hover {
    color: #fff;
    text-decoration: none !important;
}

.top_menu_bg.active,
.top_logo.active,
.burger.active {
    visibility: visible;
    opacity: 1;
}

@media (min-width: 768px) {
    .burger {
        top: 1.375rem;
        right: 4rem;
    }
}

.desk_menu {
    visibility: hidden;
    z-index: 4000;
    transition: left .8s cubic-bezier(0.855, 0.300, 0.245, 0.820);
    transition: visibility .8s;
}

.desk_menu.active {
    visibility: visible;
}

.deskmenu_inner {
    margin-top: 4.5rem;
    width: 100%;
    height: calc(100dvh - 4.5rem);
}

@media (min-width: 768px) {
    .deskmenu_inner {
        height: 100vh;
    }
}

.menu_section {
    background-color: #fff;
    color: #fff;
    text-decoration: none;
    width: 100%;
    height: 20%;
    font-size: 1.7rem;
    transform: translateX(100%);
}

.desk_menu.active .menu_section {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .menu_section {
        width: 20%;
        height: 100%;
        font-size: 2rem;
        transform: translateY(100%);
    }

    .desk_menu.active .menu_section {
        transform: translateY(0);
    }
}

.menu_section:hover {
    background-color: #49484A;
}

.menu1 {
    background-color: #3D3D3F;
    transition: transform .5s .0s, background-color .5s .0s;
}

.menu2 {
    background-color: #323135;
    transition: transform .5s .1s, background-color .5s .0s;
}

.menu3 {
    background-color: #262529;
    transition: transform .5s .2s, background-color .5s .0s;
}

.menu4 {
    background-color: #1A1A1D;
    transition: transform .5s .3s, background-color .5s .0s;
}

.menu5 {
    background-color: #080808;
    transition: transform .5s .4s, background-color .5s .0s;
}



/* Burger button */
#nav_button {
    cursor: pointer;
    display: inline-block;
}

#nav_button a {
    z-index: 3000;
    display: block;
    width: 2.5rem;
    height: 1.7rem;
    padding-top: 0;
}

#nav_button a span {
    position: relative;
    top: .8rem;
    display: block;
    -webkit-transition-duration: 0s;
    transition-duration: 0s;
}

#nav_button a span:before,
#nav_button a span:after {
    position: absolute;
    content: '';
}

#nav_button a span,
#nav_button a span:before,
#nav_button a span:after {
    width: 2.4rem;
    height: 0;
    border-top: .15rem solid var(--tb-charcoal);
    display: block;
}

#nav_button a:hover span,
#nav_button a:hover span:before,
#nav_button a:hover span:after {
    background-color: var(--tb-charcoal);
}

#nav_button a span:before {
    margin-top: -1rem;
    transition: all 0.2s;
}

#nav_button a:hover span:before {
    margin-top: -1.2rem;
}

#nav_button a span:after {
    margin-top: .75rem;
    transition: all 0.2s;
}

#nav_button a:hover span:after {
    margin-top: 1rem;
}

#nav_button a.open span {
    border-top: none;
    -webkit-transition-delay: 0.2s;
    transition-delay: 0.2s;
}

#nav_button a span:before {
    -webkit-transition-property: margin, -webkit-transform;
    transition-property: margin, transform;
    -webkit-transition-duration: 0.2s;
    transition-duration: 0.2s;
    -webkit-transition-delay: 0.2s, 0s;
    transition-delay: 0.2s, 0s;
}

#nav_button a.open span:before {
    border-top: .15rem solid #fff;
    margin-top: 0;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    -webkit-transition-delay: 0s, 0.2s;
    transition-delay: 0s, 0.2s;
}

#nav_button a span:after {
    -webkit-transition-property: margin, -webkit-transform;
    transition-property: margin, transform;
    -webkit-transition-duration: 0.2s;
    transition-duration: 0.2s;
    -webkit-transition-delay: 0.2s, 0s;
    transition-delay: 0.2s, 0s;
}

#nav_button a.open span:after {
    border-top: .15rem solid #fff;
    margin-top: 0;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
    -webkit-transition-delay: 0s, 0.2s;
    transition-delay: 0s, 0.2s;
}

/* Burger button */

/* While the menu is open the bar goes charcoal to sit with the dark panels
   below it, and the logo and the burger's X stay white against it.
   Note the stacking: .desk_menu is z-index 4000 but .top_menu_bg is 4500, so the
   bar covers the menu's top edge - the marks on it are never against the panels. */
body:has(.desk_menu.active) .top_menu_bg {
    background-color: var(--tb-charcoal);
}

body:has(.desk_menu.active) .top_logo {
    color: #fff;
}
