/* ===== NAVIGATION MENU ===== */
.nav-menu {
    position: fixed;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hamburger {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.hamburger:hover .hamburger-line {
    background: #525252;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #030213;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 44px;
    margin-left: 16px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 22px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.nav-link {
    padding: 8px 0;
    color: #030213;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateX(-10px);
    white-space: nowrap;
    border-bottom: 1px solid transparent;
}

.nav-links.active .nav-link {
    opacity: 1;
    transform: translateX(0);
}

.nav-links.active .nav-link:nth-child(1) { transition-delay: 0.05s; }
.nav-links.active .nav-link:nth-child(2) { transition-delay: 0.1s; }
.nav-links.active .nav-link:nth-child(3) { transition-delay: 0.15s; }

.nav-link:hover {
    color: #525252;
    border-bottom-color: #525252;
}

/* ===== MOBILE NAV BAR - Hidden on desktop ===== */
.mobile-nav-bar {
    display: none;
}

/* ===== NAVBAR REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .hamburger-line,
    .nav-links,
    .nav-link {
        transition: none;
    }
    .mobile-nav-bar,
    .mobile-nav-name,
    .mobile-nav-links,
    .mobile-hamburger-line {
        transition: none;
    }
}

/* ===== MOBILE STYLES (767px and below) ===== */
@media (max-width: 767px) {
    /* Hide original floating nav on mobile */
    .nav-menu {
        display: none;
    }

    /* Mobile Sticky Nav Bar */
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid transparent;
        z-index: 9999;
        align-items: center;
        justify-content: center;
        padding: 0 20px;
        transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-nav-bar.visible {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    /* Name in center - hidden by default, shown when bar is visible */
    .mobile-nav-name {
        font-size: 1.265rem;
        font-weight: 500;
        color: #111;
        text-decoration: none;
        cursor: pointer;
        opacity: 0;
        transform: scale(0.95);
        pointer-events: none;
        transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-nav-bar.visible .mobile-nav-name {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

    .mobile-nav-bar.expanded .mobile-nav-name {
        opacity: 0;
        transform: scale(0.95);
        pointer-events: none;
    }

    /* Nav links (hidden by default) */
    .mobile-nav-links {
        position: absolute;
        display: flex;
        gap: 24px;
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-nav-bar.expanded .mobile-nav-links {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .mobile-nav-link {
        font-size: 0.95rem;
        color: #111;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .mobile-nav-link:hover {
        color: #059669;
    }

    /* Hamburger on left */
    .mobile-hamburger {
        position: absolute;
        left: 20px;
        width: 28px;
        height: 20px;
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 0;
    }

    .mobile-hamburger-line {
        width: 100%;
        height: 2px;
        background: #111;
        border-radius: 1px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Hamburger X animation */
    .mobile-hamburger.active .mobile-hamburger-line:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-hamburger.active .mobile-hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .mobile-hamburger.active .mobile-hamburger-line:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
    .nav-menu {
        top: 16px;
        left: 16px;
    }
    .nav-link {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
}
