.main-nav,
.nav-container,
.nav-logo,
.nav-logo-icon,
.nav-links,
.nav-links a,
.nav-account-actions,
.nav-account-pill,
.nav-account-meta,
.nav-toggle,
.nav-toggle span,
.nav-shell {
    transition:
        background-color 0.24s ease,
        border-color 0.24s ease,
        box-shadow 0.24s ease,
        padding 0.24s ease,
        gap 0.24s ease,
        min-height 0.24s ease,
        font-size 0.24s ease,
        width 0.24s ease,
        height 0.24s ease,
        transform 0.24s ease,
        opacity 0.24s ease;
}

.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(7, 12, 21, 0.82), rgba(7, 12, 21, 0.68));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(122, 225, 255, 0.16);
    box-shadow: 0 10px 26px rgba(4, 9, 20, 0.2);
    animation: navFadeIn 0.6s ease;
}

.main-nav.is-scrolled {
    background: linear-gradient(180deg, rgba(7, 12, 21, 0.92), rgba(7, 12, 21, 0.88));
    border-bottom-color: rgba(122, 225, 255, 0.1);
    box-shadow: 0 14px 32px rgba(4, 9, 20, 0.28);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #f6fbff !important;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    text-shadow: none;
    line-height: 1;
    flex-shrink: 0;
}

.nav-logo-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    justify-content: space-between;
    width: min(1240px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0;
    min-height: 88px;
}

.main-nav.is-scrolled .nav-container {
    padding: 0.38rem 0;
    width: min(1200px, calc(100% - 1.25rem));
    min-height: 62px;
}

.main-nav nav {
    margin-left: auto;
    flex: 1 1 auto;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    flex: 1 1 auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    align-items: center;
    flex: 0 1 auto;
}

.nav-links a {
    color: rgba(241, 246, 252, 0.86);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding: 0.45rem 0.1rem;
    padding-bottom: 2px;
    text-shadow: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
    text-shadow: none;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-account-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    min-width: 0;
}

.nav-account-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
}

.nav-account-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(241, 246, 252, 0.9) !important;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    text-shadow: none;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-account-pill:hover,
.nav-account-pill:focus {
    color: var(--accent) !important;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    text-shadow: none;
}

.nav-account-button {
    cursor: pointer;
    box-shadow: none;
}

.nav-account-meta {
    display: flex;
    justify-content: flex-end;
    max-width: 320px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: right;
    text-shadow: none;
    overflow-wrap: anywhere;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    appearance: none;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #f6fbff;
    border-radius: 999px;
    transform-origin: center;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
    border-color: rgba(122, 225, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
}

body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.main-nav.is-scrolled .nav-logo {
    gap: 0.4rem;
    font-size: 1.08rem;
}

.main-nav.is-scrolled .nav-logo-icon {
    width: 22px;
    height: 22px;
}

.main-nav.is-scrolled .nav-links {
    gap: 0.72rem;
}

.main-nav.is-scrolled .nav-links a {
    padding: 0.24rem 0.05rem;
    font-size: 0.9rem;
}

.main-nav.is-scrolled .nav-account-actions {
    gap: 0.32rem;
}

.main-nav.is-scrolled .nav-account-pill {
    min-height: 30px;
    padding: 0.22rem 0.62rem;
    font-size: 0.8rem;
}

.main-nav.is-scrolled .nav-account-meta {
    margin-top: -0.05rem;
    font-size: 0.68rem;
}

#hero,
#why,
#arsenal,
#testimonials,
#portfolio,
#pricing,
#contact,
#faq,
#finalcta,
#footer {
    scroll-margin-top: 6.5rem;
}

@media (max-width: 768px) {
    .nav-container,
    .main-nav.is-scrolled .nav-container {
        width: min(100%, calc(100% - 1rem));
        padding: 0.85rem 0;
        min-height: 72px;
    }

    .nav-shell {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: linear-gradient(180deg, rgba(8, 13, 23, 0.96), rgba(6, 11, 20, 0.98));
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        width: 280px;
        max-width: calc(100vw - 1rem);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 18px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
    }

    body.nav-open .nav-shell {
        display: flex;
    }

    .main-nav nav {
        margin-left: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.85rem;
        width: 100%;
    }

    .main-nav.is-scrolled .nav-logo,
    .nav-logo {
        font-size: 1.2rem;
    }

    .main-nav.is-scrolled .nav-logo-icon,
    .nav-logo-icon {
        width: 30px;
        height: 30px;
    }

    .nav-account-cluster {
        width: 100%;
        align-items: stretch;
        padding-top: 0.85rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-account-actions {
        width: 100%;
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-account-pill {
        width: 100%;
    }

    .nav-account-meta {
        max-width: none;
        text-align: left;
        justify-content: flex-start;
    }
}

@keyframes navFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-nav,
    .nav-container,
    .nav-logo,
    .nav-logo-icon,
    .nav-links,
    .nav-account-actions,
    .nav-account-pill,
    .nav-account-meta,
    .nav-toggle,
    .nav-toggle span,
    .nav-shell,
    .nav-links a,
    .nav-links a::after {
        transition: none;
    }
}
