header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-header);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

header.scrolled {
    background: rgba(0, 0, 0, 0.95);
    padding: 0.75rem 2rem;
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--border-color-hover);
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

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

.nav-links li {
    margin: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-links a:hover::before {
    width: 80%;
}

.nav-links a.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.15);
}

.nav-links a.active::before {
    width: 80%;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    position: absolute;
    right: 4rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 1.1rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: var(--z-header);
    position: absolute;
    right: 1rem;
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 10px;
    transition: all var(--transition-base);
    position: relative;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    z-index: calc(var(--z-header) + 1);
    transition: top var(--transition-base);
}

.skip-to-content:focus {
    top: 1rem;
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }
    
    header.scrolled {
        padding: 0.75rem 1.5rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 6rem 2rem 2rem;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        transition: right var(--transition-slow);
        border-left: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-links a {
        display: block;
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        text-align: left;
        border-radius: var(--radius-md);
    }
    
    .nav-links a::before {
        display: none;
    }
    
    .theme-toggle {
        right: 4rem;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-slow);
        z-index: calc(var(--z-header) - 1);
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem 1rem;
    }
    
    header.scrolled {
        padding: 0.5rem 1rem;
    }
    
    .nav-links {
        width: 100%;
        right: -100%;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .theme-toggle {
        right: 3rem;
    }
}

