.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 18px 60px;
    background: linear-gradient(90deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
    background-size: 200% 100%;
    animation: gradientShift 15s ease-in-out infinite;

    border-bottom: 2px solid #125267;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* LOGO */
.nav-logo img {
    height: 70px;
    width: 300px;
}

/* LINKS */
.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    transition: 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* ACTION BUTTONS */
.nav-actions {
    display: flex;
    gap: 12px;
}

/* Ensure in-page anchors scroll below sticky navbar */
section {
    scroll-margin-top: 110px;
}

/* Elegant gradient animation for navbar background */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
/* ================= MOBILE DRAWER ================= */

/* On desktop the wrapper is transparent to layout, so .nav-links and
   .nav-actions stay direct flex children of .navbar exactly as before. */
.nav-menu {
    display: contents;
}

/* Focusable but invisible - the label is the visible control. */
.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-burger span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: #125267;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle:focus-visible + .nav-burger {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Burger morphs into an X while the drawer is open. */
.nav-toggle:checked + .nav-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .nav-burger span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked + .nav-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1100px) {
    .navbar {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    /* Fixed 300x70 does not fit a phone; cap it and keep the aspect ratio. */
    .nav-logo img {
        height: auto;
        width: auto;
        max-height: 46px;
        max-width: 190px;
    }

    .nav-burger {
        display: flex;
    }

    .nav-menu {
        display: none;
        order: 3;
        flex-direction: column;
        gap: 14px;
        width: 100%;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
        /* Never let a long menu run past the viewport on a short screen. */
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .nav-toggle:checked ~ .nav-menu {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 13px 4px;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        padding-bottom: 4px;
    }

    .nav-actions .btn {
        width: 100%;
    }

    /* Sticky navbar is shorter now, so anchors need less clearance. */
    section {
        scroll-margin-top: 84px;
    }
}
