:root {
    --site-width: clamp(300px, 96vw, 1200px);
    --content-height: clamp(300px, calc(1200px - 55vw), 520px);

    --main-colour: #273C2C;
    --bright-colour: #25bdd1;
    --minor-colour: #e2e2e2;
    --nav-background-colour: rgba(0, 0, 0, 0.6);

    --main-font: Roboto;
    --secondary-font: "Expletus Sans";
}
nav {
    margin: 0;
    padding: 0;
    width: 100vw;

    position: fixed;
    top: -5px;
    z-index: 5;

    background-color: var(--nav-background-colour);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    transition: height 0.4s ease;
}
nav.shown {
    height: calc(var(--content-height) + 70px);
}
nav.hidden {
    height: 88px;
}
#nav-wrapper {
    width: 100%;
}
#nav-content {
    padding: 15px 3vw;
    margin: 0 auto;
    width: var(--site-width);
    z-index: 2;
    position: relative;

    display: flex;
    flex-direction: row;
    justify-content: space-between;

    content: "";
    clear: both;
}
#nav-content {
    #nav-logo {
        height: 60px;
        width: 60px;
        display: inline;

        background-image: url(../icons/square-logo-2.svg);
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }

    a {
        display: flex;
        text-decoration: none;

        color: var(--bright-colour);
    }
    a:hover {
        color: var(--minor-colour);
        #nav-logo {
            background-image: url(../icons/square-logo-highlight.svg);
        }
    }
    a ul {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        list-style: none;

        margin: 0;
        padding-left: 15px;
    }
    a ul li {
        line-height: 30px;
        font-size: 1.6rem;
        font-weight: 700;
        font-family: var(--secondary-font);
        color: inherit;
    }

    > ul {
        display: flex;
        list-style: none;
        padding-left: 20px;

        font-size: clamp(1rem, calc(1rem + 0.5vw), 1.3rem);
        font-weight: 800;
    }
    > ul li {
        display: inline-flex;
        align-self: center;
        gap: 10px;
        padding: 0 15px;

        font-family: var(--main-font);
        color: var(--bright-colour);
        transition: color 0.2s ease;
    }
    > ul li:hover {
        color: var(--minor-colour);

        div.arrow {
            border-color: var(--minor-colour);
            animation: rotate-anim 0.3s ease forwards;
        }
    }
    div.arrow {
        display: inline-block;
        align-self: center;
        width: 6px;
        height: 6px;
        border-right: 3px solid var(--bright-colour);
        border-bottom: 3px solid var(--bright-colour);
        border-bottom-right-radius: 4px;
        transform: rotate(45deg);
    }
    .has-hovered div {
        animation: rotate-anim-backwards 0.3s ease forwards;
    }
}

#li-content {
    width: var(--site-width);
    height: var(--content-height);
    padding: 0 calc(calc(100vw - var(--site-width))/2);
    margin-top: -2px;
    z-index: 1;
    transition: transform 0.5s ease;
    will-change: transform;
}
#li-content.hidden {
    transform: translateY(-200%);
}
#li-content.shown {
    transform: translateY(0%);
}
#li-content {
    .li-item {
        display: grid;
        grid-template-columns: 1fr 2fr;
        column-gap: 20px;
        grid-template-rows: 1fr;

        font-family: var(--main-font);
        color: var(--minor-colour);
             ul {
                list-style: none;
                li {
                    font-size: 1.6rem;
                    color: var(--bright-colour);
                    padding: 20px;
                    margin-right: 20px;
                    width: 20vw;
                    border-radius: 5px;
                    font-weight: 500;
                }
                li:hover {
                    background-color: rgba(240,240,240, 0.2);
                }
            }
        }
    .li-item {
        z-index: 0;
        transition: transform 0.5s ease;
    }
    .li-item.selected {
        display: grid;
        grid-template-columns: 1fr 2fr;
        grid-template-rows: 1fr;
    }
    .li-item.hidden {
        display: none;
    }

    .content-area {
        height: var(--content-height);
        overflow: hidden;
        display: flex;
        gap: 250px;
        flex-direction: column;
    } 
    .content-area p {
        text-indent: 1.5rem each-line;
        font-weight: 300;
        font-size: 1.6rem;
        width: 100%;
        height: var(--content-height);
        padding-top: 34px;
        margin-top: 120px;
        margin-bottom: 200px;

        align-self: start;
    }
    .content-area p:first-child {
        margin-top: 0;
    }
    .content-area p.selected {
        display: block;
    }

    a {
        color: var(--bright-colour);
    }
}

@keyframes rotate-anim {
    to {
        transform: rotate(-135deg);
    }
}
@keyframes rotate-anim-backwards {
    to {
        transform: rotate(45deg);
    } from {
        transform: rotate(-135deg);
    }
}
#phone-menu-screen {
    display: none;
}

@media only screen and (max-width: 800px) { 
    #nav-content {
        padding-right: 5px;
        padding-left: 5px;
    }
    #phone-menu {
        display: block;
        align-self: center;
        margin-right: 2vw;
    }
    .menu-bar {
        width: 30px;
        height: 6px;
        margin-top: 5px;
        border-radius: 5px;
        background-color: var(--bright-colour);
        overflow: hidden;
    }
    #nav-content > ul {
        display: none;
    }
    #phone-menu-screen {
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: absolute;
        top: 130px;
        width: 100%;
        transition: transform 0.3s ease;
        transform: translateY(-200%);
        

        ul {
            color: var(--bright-colour);
            list-style: none;
            font-family: var(--main-font);
            font-size: 1.9rem;
            font-weight: 800;
            justify-items: center;
            text-align: center;
            padding: 0;
            margin: auto;
        }
        ul li {
            margin-bottom: 30px;
        }
        ul li:hover {
        color: var(--minor-colour);
        div.arrow {
            border-color: var(--minor-colour);
            animation: rotate-anim 0.3s ease forwards;
            }
        }
        div.arrow {
            display: inline-block;
            align-self: center;
            width: 6px;
            height: 6px;
            border-right: 5px solid var(--bright-colour);
            border-bottom: 5px solid var(--bright-colour);
            border-bottom-right-radius: 4px;
            transform: rotate(45deg);
        }
    }
    #phone-menu-screen.shown-phone {
        transform: translateY(0%);
    }
    #phone-menu-screen .ul-content {
        z-index: -1;
        display: block;
        width: 80%;
        text-align: center;
        font-size: 1.6rem;
        color: var(--minor-colour);
    }
    #phone-menu-screen .ul-content a {
        color: var(--minor-colour);
    }
    #phone-menu-screen .ul-content.selected {
        display: block;
    }
    #phone-menu-screen .ul-content.deselected {
        display: none;
    } 
}