.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1200;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 0 30px 30px;
    padding-top: env(safe-area-inset-top, 0px);
}

@media (max-width: 900px) {
    .nav-bar {
        border-radius: 0 !important;
    }
}



.nav-bar--scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-bar--dark {
    background: rgba(0, 0, 0, 0.5) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity .3s ease
}

.nav-brand:hover {
    opacity: .8
}

.nav-logo {
    height: 32px;
    width: auto;
    filter: brightness(0);
    transition: all 0.4s ease;
}

.nav-bar--dark .nav-logo {
    filter: brightness(0) invert(1) !important;
}

.burger-menu {
    display: none;
    background: none !important;
    border: none !important;
    cursor: pointer;
    width: 32px;
    height: 32px;
    z-index: 1300;
    padding: 0;
    color: #000;
    transition: all 0.3s ease;
}

.nav-bar--dark .burger-menu {
    color: #fff !important;
}

/* Ensure active menu keeps theme coloring */
.nav-bar.active .burger-menu {
    color: #000;
    /* Default Light Menu */
}

.nav-bar--dark.active .burger-menu {
    color: #fff !important;
}

.burger-menu svg {
    width: 100%;
    height: 100%;
}

.line {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    transform-box: view-box;
    /* Гарантирует расчет от центра SVG 24x24 */
}

.line-top {
    transform: translateY(-4px);
}

.line-bottom {
    transform: translateY(4px);
}

/* Morph Animation to X */
.burger-menu.active .line-top {
    transform: rotate(45deg);
}

.burger-menu.active .line-bottom {
    transform: rotate(-45deg);
}

/* Hover Effect (Simple & Clean) */
.burger-menu:not(.active):hover .line-top {
    transform: translateY(-5px);
}

.burger-menu:not(.active):hover .line-bottom {
    transform: translateY(5px);
}




.burger-menu.active:hover .line {
    opacity: 0.7;
}

@media(max-width:1024px) {
    .nav-inner {
        padding: 0.8rem 0;
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.7rem;
        padding: 0.4rem 0;
    }
}

@media(max-width:900px) {
    .burger-menu {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.nav-desktop {
    flex: 1;
    display: flex;
    justify-content: center
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0
}

.nav-links a {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #000;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.nav-bar--dark .nav-links a {
    color: #fff !important;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease
}

.nav-bar--scrolled .nav-links a::after {
    background: #000
}

.nav-links a:hover {
    color: #6366F1 !important;
    opacity: 1;
}

.nav-links a:hover::after {
    transform: scaleX(1);
    background: #6366F1 !important;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 1rem
}

.nav-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.nav-bar--dark .nav-social a {
    color: #fff !important;
}

.nav-social a:hover {
    color: #6366F1;
    opacity: 1;
    transform: translateY(-2px) scale(1.1);
}

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center
}

.nav-cta {
    position: relative;
    padding: 10px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    border: none;
    overflow: visible;
}

.nav-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: var(--lava-gradient);
    background-size: 200% 200%;
    animation: lavaLamp 5s infinite linear;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.nav-cta:hover {
    transform: translateY(-2px) scale(1.02);
}

.nav-cta:hover::after {
    opacity: 1;
}

/* Light / Initial (Transparent Nav) */
.nav-cta.cta-audit,
.nav-cta.cta-calculate {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.nav-cta.cta-audit:hover,
.nav-cta.cta-calculate:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

.nav-cta.cta-calculate:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

/* For Scrolled (White Nav) */
.nav-bar--scrolled .nav-cta.cta-audit,
.nav-bar--scrolled .nav-cta.cta-calculate {
    background: transparent;
    color: #000;
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: none;
}

.nav-bar--scrolled .nav-cta.cta-audit:hover,
.nav-bar--scrolled .nav-cta.cta-calculate:hover {
    border-color: #000;
    background: rgba(0, 0, 0, 0.03);
    color: #000;
}

/* For Dark (Black Nav) */
.nav-bar--dark .nav-cta.cta-audit,
.nav-bar--dark .nav-cta.cta-calculate {
    background: transparent !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: none !important;
}

.nav-bar--dark .nav-cta.cta-audit:hover,
.nav-bar--dark .nav-cta.cta-calculate:hover {
    border-color: #fff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.cta-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1
}

.badge-free {
    background: #6366F1;
    color: #fff
}

.nav-bar--scrolled .nav-cta.cta-calculate {
    border-color: rgba(0, 0, 0, 0.2)
}

/* --- Expanding Mobile Menu --- */
/* Base (Light Theme) */
.nav-bar.active {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Dark Theme Adaptation */
.nav-bar--dark.active {
    background: rgba(10, 10, 10, 0.98) !important;
}

.nav-mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: inherit;
    /* Inherit from .nav-bar.active */
    backdrop-filter: inherit;
    transition: height 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    z-index: -1;
    border-bottom: 0px solid rgba(0, 0, 0, 0.05);
}

.nav-bar.active .nav-mobile-menu {
    height: calc(100vh - 100%);
    border-bottom-width: 1px;
}

.nav-bar--dark.active .nav-mobile-menu {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease 0.2s;
}

.nav-bar.active .mobile-menu-inner {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-link {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    /* Default Light */
    text-decoration: none;
    letter-spacing: 0.1em;
    padding: 1rem 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-bar--dark .mobile-link {
    color: #fff;
}

.nav-bar.active .mobile-link {
    opacity: 1;
    transform: translateX(0);
    transition-delay: calc(0.1s * var(--i));
}

.mobile-link:hover {
    color: #6366F1 !important;
    padding-left: 10px;
}

.mobile-footer {
    margin-top: auto;
    padding-top: 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.4s;
}

.nav-bar--dark .mobile-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.nav-bar.active .mobile-footer {
    opacity: 1;
    transform: translateY(0);
}

.mobile-social {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.mobile-social a {
    color: #000;
    transition: color 0.3s;
}

.nav-bar--dark .mobile-social a {
    color: #fff;
}

.mobile-social a:hover {
    color: #6366F1;
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    border-radius: 100px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.mobile-cta.cta-audit {
    background: #000;
    color: #fff;
}

.nav-bar--dark .mobile-cta.cta-audit {
    background: #fff;
    color: #000;
}

.mobile-cta.cta-calculate {
    background: transparent;
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-bar--dark .mobile-cta.cta-calculate {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.mobile-cta .badge-free {
    background: #6366F1;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

@media (max-width: 900px) {

    .nav-desktop,
    .nav-social,
    .nav-actions {
        display: none;
    }

    .burger-menu {
        display: flex;
    }

    .nav-inner {
        padding: 0.9rem 0;
    }
}

/* ------------------------------------ */