#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000000;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow-sm);
    transition: background-color 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
    width: 100%;
    height: 64px;
    display: flex;
    align-items: center;
}

nav 
{
    padding: 0 10px;
    align-items: center;
    color: #202636;
}

.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--accent-color-2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.icon i {
    font-size: 22px;
    color: var(--accent-color-2);
    line-height: 1;
}

.icon:hover {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.icon:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

nav li 
{
    list-style-type: none;
    padding: 0 10px;
    font-size: 1rem;
}

nav a 
{
    text-decoration: none;
    color: var(--accent-color-2);
}

#nav-links .nav-active > a,
#nav-links .nav-active a,
#nav-links a.nav-active {
    color: #fff;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

nav a:hover 
{
    text-decoration: none;
    color: var(--accent-color-2);
}

nav ul 
{
    display: flex;
    flex-wrap: wrap;
}

nav img 
{
    width: 100%;
    object-fit: contain;
}

#signature-logo
{
    width: 100%;
    height: auto;
    max-width: 40px;
    position: relative;
    top: 10px;
}

#signature
{
    width: 100%;
    height: auto;
    max-width: 70px;
}

#signature-desktop
{
    width: 100%;
    height: auto;
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    padding: 10px;
    display: none;
}

nav .section-container 
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#site-nav.nav-solid {
    /* nav-solid retained for compatibility; same as default now */
    background: rgba(0, 0, 0, 0.78);
}

#nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    order: 1;
}

.icon {
    order: 2;
    margin-left: auto;
}

#nav-links li {
    position: relative;
    top: 0;
}

#nav-links a {
    padding: 0 10px;
}

.navbarExpand
{
    animation: expand 0.5s forwards;
    padding: 0;
}

.navbarCollapse
{
    animation: collapsed 0.5s backwards;
    padding: 0;
}

@keyframes expand 
{
    from
    {
        max-height: 0px;
    }
    to 
    {
        max-height: 350px;
    } 
}

@keyframes collapsed
{
    from 
    {
        max-height: 350px;
    }
    to 
    {
        max-height: 0px;
    }
}

/* Mobile-first nav behavior */
@media (max-width: 900px) {
    .icon {
        display: block;
        order: 2;
    }

    #nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 64px);
        padding: 18px 16px;
        flex-direction: column;
        gap: 8px;
        background: rgba(0,0,0,0.82);
        backdrop-filter: blur(10px);
        box-shadow: 0 20px 50px rgba(0,0,0,0.6);
        transform: translateX(-110%);
        transition: transform 250ms ease;
        overflow-y: auto;
        z-index: 10000001;
    }

    #nav-links.is-open {
        transform: translateX(0);
    }

    #nav-links li {
        width: 100%;
        padding: 0;
    }

    #nav-links a {
        display: block;
        width: 100%;
        padding: 14px 12px;
        border-radius: 10px;
        background: rgba(255,255,255,0.04);
    }
}

/* Desktop */
@media (min-width: 901px) {
    .icon {
        display: none;
    }
    #nav-links {
        max-height: none;
        overflow: visible;
        flex-direction: row;
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        transform: none;
        background: transparent;
        box-shadow: none;
    }
    #nav-links.navbarExpand,
    #nav-links.navbarCollapse {
        animation: none;
    }
}
