:root {
    --font-mono: 'Space Mono', monospace;
    --font-serif: 'Instrument Serif', serif;
    --transition: 0.3s ease;
}

[data-theme="light"] {
    --bg: #fafafa;
    --text: #0a0a0a;
    --text-muted: #666;
    --border: rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.15);
    --nav-bg: rgba(250,250,250,0.72);
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 40px;
    background: var(--nav-bg, rgba(10,10,10,0.95));
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transition: background var(--transition), box-shadow var(--transition);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    transition: color var(--transition);
}

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

.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.theme-toggle:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="light"] .theme-toggle .sun-icon { display: block; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }


.nav-btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.nav-btn-secondary:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.nav-btn-primary {
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
}

.nav-btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    z-index: 200;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 4px auto;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 99;
    padding: 40px;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    display: block;
    padding: 16px 0;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s ease;
}

.mobile-menu a:hover {
    color: var(--accent);
}

.mobile-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.mobile-menu-buttons a {
    text-align: center;
    padding: 16px;
    border: none;
    font-size: 14px;
}

.mobile-menu-buttons .nav-btn-secondary {
    border: 1px solid var(--border);
}

.mobile-menu-buttons .nav-btn-primary {
    background: var(--accent);
    color: #000;
}

@media (max-width: 1024px) {
    nav {
        padding: 0 32px;
    }

    .nav-center {
        display: none;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .mobile-menu {
        display: flex;
    }
}

@media (max-width: 640px) {
    nav {
        padding: 0 20px;
    }

    .nav-inner {
        height: 64px;
    }

    .nav-right .nav-btn {
        display: none;
    }
}
