
.navbar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    position: fixed;
    top: 1vh;
    left: 0;
    background: none;
    box-shadow: none;
    z-index: 2000;
}

.nav-toggle {
    display: none;
}

.navbar ul {
    background: rgba(255, 245, 232, 0.85);
    border-radius: 1.0rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    list-style-type: none;
    margin: 0 auto;
    padding: 0.5rem 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem; 
    max-width: 1100px; 
    width: calc(100% - 40px);
}

.navbar li {
    margin: 0;
    font-family: 'IBM Plex Sans Condensed';
    transition: transform 160ms ease;
}

.navbar li:hover {
    transform: scale(1.03); 
}

.navbar li:first-child:hover {
    transform: none;
}

.navbar a {
    text-decoration: none;
    color: rgb(16,71,85);
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.15s ease, transform 0.12s ease;
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: transparent; 
    border-radius: 0;
}

.navbar a:hover {
        color: rgba(44, 68, 94, 0.86);
}

.navbar a.active {
    color: rgba(16, 71, 85, 1);
    border-bottom: 2px solid rgba(16, 71, 85, 0.7);
    padding-bottom: calc(0.35rem - 2px);
}

.navbar.active ul {
    display: flex;
}

.navbar ul { display: flex; }

.navbar.mobile-device ul,
body.is-mobile-device .navbar ul {
    padding: 0.4rem 0.75rem;
    gap: 0.4rem;
    width: calc(100% - 16px);
}

.navbar.mobile-device a,
body.is-mobile-device .navbar a {
    font-size: 0.82rem;
    padding: 0.25rem 0.45rem;
}

.navbar.mobile-device li,
body.is-mobile-device .navbar li {
    font-size: 0.82rem;
}

.navbar.mobile-device li:first-child img,
body.is-mobile-device .navbar li:first-child img {
    height: 28px;
    width: auto;
}

.navbar.mobile-device.small-screen ul,
body.is-mobile-device.is-small-screen .navbar ul {
    padding: 0.3rem 0.5rem;
    gap: 0.2rem;
}

.navbar.mobile-device.small-screen a,
body.is-mobile-device.is-small-screen .navbar a {
    font-size: 0.72rem;
    padding: 0.2rem 0.3rem;
}

@media (max-width: 750px) {
    .navbar {
        top: 0.45rem;
        justify-content: flex-end;
        padding: 0 0.55rem;
        box-sizing: border-box;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 245, 232, 0.92);
        color: rgb(16, 71, 85);
        font-size: 1.35rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.12);
        cursor: pointer;
    }

    .nav-toggle:focus-visible {
        outline: 2px solid rgba(16, 71, 85, 0.65);
        outline-offset: 2px;
    }

    .navbar ul,
    .navbar.mobile-device ul,
    body.is-mobile-device .navbar ul {
        position: absolute;
        top: calc(100% + 0.4rem);
        right: 0.55rem;
        left: auto;
        width: min(78vw, 290px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
        padding: 0.5rem;
        border-radius: 0.9rem;
        background: rgba(255, 248, 238, 0.97);
        border: 1px solid rgba(16, 71, 85, 0.12);
        box-shadow: 0 12px 28px rgba(0,0,0,0.2);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        transform-origin: top right;
    }

    .navbar.nav-open ul,
    .navbar.mobile-device.nav-open ul,
    body.is-mobile-device .navbar.nav-open ul {
        display: flex;
    }

    .navbar li,
    .navbar.mobile-device li,
    body.is-mobile-device .navbar li {
        font-size: 0.95rem;
        transform: none !important;
    }

    .navbar li:first-child {
        display: none;
    }

    .navbar a,
    .navbar.mobile-device a,
    body.is-mobile-device .navbar a {
        font-size: 1rem;
        min-height: 44px;
        padding: 0.62rem 0.75rem;
        border-radius: 0.6rem;
        display: inline-flex;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        color: rgb(16,71,85);
    }

    .navbar a:hover {
        background: rgba(0, 90, 160, 0.1);
    }

    .navbar a.active {
        border-bottom: none;
        padding-bottom: 0.62rem;
        background: rgba(0, 90, 160, 0.16);
        color: rgba(10, 53, 66, 1);
    }

    .navbar li {
        width: 100%;
    }

    .navbar ul::before {
        content: "";
        position: absolute;
        top: -8px;
        right: 16px;
        width: 14px;
        height: 14px;
        background: rgba(255, 248, 238, 0.97);
        border-left: 1px solid rgba(16, 71, 85, 0.12);
        border-top: 1px solid rgba(16, 71, 85, 0.12);
        transform: rotate(45deg);
    }
}
