header {
    background-image: linear-gradient(
        to bottom,
        rgba(23, 1, 20, 0.94) 0%,
        rgba(23, 1, 20, 0.78) 55%,
        rgba(23, 1, 20, 0.35) 100%
    );
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    max-height: 6.5rem;
    overflow: hidden;
    transition: max-height 0.35s ease;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 82%, rgba(0, 0, 0, 0) 100%);
}

header.open {
    max-height: 25rem;
}

.top-bar {
    display: flex;
    justify-content: space-evenly;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    align-self: flex-end;
    position: fixed;
    top: 4.5rem;
    right: 1rem;
    z-index: 20;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: transform 0.3s, opacity 0.3s;
    font-size: unset;
    color: unset;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

nav {
    opacity: 0;
    transform: translateY(-16px);
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: visible;
}

nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    nav {
        background-color: rgba(23, 1, 20, 0.72);
    }
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: background 0.3s;
}

nav a.active {
    border-bottom: 3px solid var(--highlight-color);
    box-shadow: inset;
}



@media (min-width: 700px) {

    header {
        max-height: none;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
        flex-direction: row;
        align-items: center;
    }

    .top-bar {
        gap: 1rem;
    }

    .hamburger {
        display: none;
    }

    nav {
        opacity: 1;
        transform: none;
        pointer-events: auto;
        flex-direction: row;
        position: static;
        width: auto;
        overflow: visible;
        background-color: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-top: none;
        border-bottom: none;
    }

    nav ul {
        flex-direction: row;
    }

    nav a:hover,
    nav a.active, .btn:hover {
    border-bottom: 3px solid var(--highlight-color);
    box-shadow: inset;
}

}

@media (min-width: 1000px) {
    header {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}