/* ==================== NAVIGATION ==================== */
nav {
    position: fixed;
    top: 2rem;
    left: 3rem;
    right: 3rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    mix-blend-mode: normal;
}

.nav-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.nav-name:hover {
    opacity: 0.8;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.contrast-toggle {
    width: 28px;
    height: 28px;
    padding: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.contrast-toggle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border-color: rgba(255, 255, 255, 0.3);
}

.contrast-icon {
    width: 16px;
    height: 16px;
    display: block;
    position: relative;
}

.contrast-icon svg {
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.7);
}

.contrast-toggle:hover .contrast-icon svg {
    color: #ffffff;
}

.nav-menu {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-menu a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 0.25rem;
    white-space: nowrap;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-1), var(--color-2));
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: #ffffff;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a.active {
    color: #ffffff;
    font-weight: 700;
}

.nav-menu a.active::after {
    width: 100%;
}

/* Hamburger menu - hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    padding: 6px;
    transition: all 0.3s ease;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.hamburger:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.25));
    border-color: rgba(255, 255, 255, 0.3);
}

.hamburger span {
    display: block;
    width: 16px;
    height: 2px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger:hover span {
    background: #ffffff;
}

/* Hamburger animation when active */
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

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

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    nav {
        left: 1.5rem;
        right: 1.5rem;
        padding: 0.65rem 1.5rem;
    }

    .nav-right {
        gap: 1.5rem;
    }

    .contrast-toggle {
        width: 26px;
        height: 26px;
    }

    .contrast-icon {
        width: 14px;
        height: 14px;
    }

    .nav-menu {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    nav {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        padding: 0.75rem 1.25rem;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }
    
    .nav-name {
        font-size: 0.8rem;
    }

    .nav-right {
        gap: 0.75rem;
    }

    /* Show hamburger, hide desktop menu */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 6rem;
        left: 1rem;
        right: 1rem;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 1.5rem;
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        display: flex;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

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

    .nav-menu a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
    }

    .nav-menu li:last-child a {
        border-bottom: none;
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu a:hover {
        padding-left: 1rem;
    }

    .mobile-menu-overlay {
        display: block;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.65rem 1rem;
    }
    
    .nav-name {
        font-size: 0.75rem;
    }
    
    .contrast-toggle,
    .hamburger {
        width: 26px;
        height: 26px;
    }
    
    .contrast-icon {
        width: 13px;
        height: 13px;
    }
    
    .nav-menu {
        top: 5.5rem;
        padding: 1.25rem;
    }
    
    .nav-menu a {
        font-size: 0.95rem;
        padding: 0.875rem 0;
    }
}