header {
    background-color: var(--color-background);
    align-items: center;
    color: var(--color-text);
    display: flex;
    justify-content: center;
    border-bottom: 4px solid var(--color-blue);
    padding-top: 1em;
}

header nav {
    display: flex;
    width: 100dvw;
    max-width: 80em;
    align-items: center;
    height: 4em;
    z-index: 2;
    padding-left: 1em;
    padding-right: 1em;
}

header a {
    padding-left: 2em;
    padding-right: 2em;
    height: 4em;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
}

header h2 {
    font-size: 1.5em;
    text-transform: capitalize;
    margin: 0;
    font-weight: 700;
    margin-left: 1em;
    margin-right: 1em;
}

header button {
    height: 4em;
    display: none;
    border: none;
    background-color: transparent;
    width: 4em;
    padding: 0;
    text-align: start;
}

header button img {
    height: 2em;

}

header nav ul {
    display: flex;
}

header nav ul li {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: -4px;
    border: 4px solid var(--color-blue);
    border-bottom-color: var(--color-background);
    border-radius: 1em 1em 0 0;
}

@supports (corner-shape: bevel) {
    header nav ul li {
        corner-shape: bevel;
    }
}

header nav>ul>li {
    white-space: nowrap;
}

header nav ul li:hover {
    background-color: var(--color-blue);
    background: linear-gradient(var(--color-blue) 0%, rgba(249, 52, 98, 0) 100%);
}

header nav ul,
header nav div {
    flex: 1;
}

#projects {
    position: relative;
    padding-left: 2em;
    padding-right: 2em;
}

#projects p {
    font-size: 1em;
    margin: 0;
    width: max-content;
}

#projectsDropdown {
    position: absolute;
    flex-direction: column;
    top: 4em;
    left: 0;
    /* background-color: var(--color-header); */
    align-items: baseline;
    display: none;
    width: max-content;
    z-index: 1;
    border-radius: 1em;
}

#projectsDropdown li {
    justify-content: flex-start;
    height: 4em;
    width: 100%;
    border: 4px solid var(--color-blue);
    background-color: var(--color-background);
    border-radius: 0;
    margin-top: -4px;
    transition: 0.3s;
}

#projectsDropdown li:hover {
    background: rgb(72, 32, 41);
    width: 110%;
}

#projectsDropdown li:first-of-type {
    border-radius: 1em 1em 0 0;
}

#projectsDropdown li:last-of-type {
    border-radius: 0 0 1em 1em;
}

#projectsDropwodn a {
    height: 3em;
    width: 100%;
}

#projects:hover #projectsDropdown {
    display: flex;
    animation-name: dropdownAnimation;
    animation-duration: 0.3s;

}

@keyframes dropdownAnimation {
    0% {
        top: 3em;
        opacity: 0;
    }

    100% {
        top: 4em;
        opacity: 1;
    }
}

@media (max-width: 1000px) {
    header nav>div {
        display: none;
    }
    
    header nav {
        justify-content: start;
    }

    header nav ul {
        flex: 0;
    }
}

/* mobile header */
@media (max-width: 600px) {
    header {
        padding-top: 0;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        transition-duration: 0.5s;
        z-index: 5;
    }
    
    header h2 {
        margin-left: 0.2em;
        margin-right: 0.2em;
    }

    header nav {
        display: grid;
        grid-template-columns: 1fr max-content 1fr;
        grid-template-rows: 4em 1fr;
        transition-duration: 0.5;
    }
    
    header.mobileExpanded a {
        padding-inline-start: 1em;
    }

    header nav>div {
        display: block;
    }

    header button {
        display: block;
        width: 2em;
        height: 2em;
    }

    header img {
        transition-duration: 0.5s;
        width: 2em;
    }

    header #navElements {
        display: none;
    }

    header.mobileExpanded nav ul li {
        border-radius: 0.5em;
    }

    header.mobileExpanded nav ul li:hover { 
        background: rgb(96, 44, 56);
        background-image: none;
    }

    header.mobileExpanded nav {
        height: max-content;
    }

    header.mobileExpanded img {
        transform: rotate(180deg);
    }

    header.mobileExpanded #navElements{
        display: block;
        flex-direction: column;
        order: 5;
        grid-column: 1/-1;
    }

    header.mobileExpanded #navElements li {
        justify-content: start;
        border: none;
        width: 100%;
        min-height: 3em;
    }

    header.mobileExpanded #navElements li a {
        padding: 0;
        display: block;
        width: 100%;
        display: flex;
        align-items: center;
    }

    header.mobileExpanded #projectsDropdown {
        position: static;
        display: flex;
        margin-left: 2em;
        width: 90%;
        text-wrap: wrap;
    }

    header.mobileExpanded #projectsDropdown li {
        border-radius: 0.5em;
        background: none;
    }

    header.mobileExpanded #projectsDropdown li:hover {
        background: rgb(96, 44, 56);

    }

    header.mobileExpanded #projects {
        display: block;
        position: static;
        padding-left: 0;
    }

    header.mobileExpanded #projects>p {
        height: 1.5em;
        margin: 0;
        filter: opacity(0.4);
    }

    header.mobileExpanded #projects:hover {
        background-color: none;
        background-image: none;
        background: none;
    }

    #projects:hover #projectsDropdown {
        display: flex;
        animation-name: none;
        animation-duration: 0.3s;
    }
}