.nav-root {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 250ms var(--transition), border-color 200ms var(--transition);
}
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-soft);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
.nav-logo-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.01em;
    transition: color 200ms;
}
.nav-logo:hover .nav-logo-name { color: var(--accent); }

.nav-links {
    display: none;
    align-items: center;
    gap: 2px;
}
@media (min-width: 1024px) {
    .nav-links { display: flex; }
}
.nav-link {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-2);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: color 200ms var(--transition), background 200ms var(--transition);
    position: relative;
}
.nav-link:hover { color: var(--text-1); background: var(--nav-link-hover-bg); }
.nav-link.active { color: var(--accent); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

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

.lang-pill {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}
.lang-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 16px;
    text-decoration: none;
    transition: background 200ms, color 200ms;
    color: var(--text-2);
}
.lang-btn.active {
    background: var(--accent);
    color: #fff;
}
.lang-btn:not(.active):hover { color: var(--text-1); }

.clock-widget {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 6px;
    padding: 4px 10px;
    display: none;
    align-items: center;
    letter-spacing: 0.05em;
    min-width: 80px;
    text-align: center;
}
@media (min-width: 768px) { .clock-widget { display: flex; } }

.status-dot {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 20px;
}
@media (min-width: 1024px) { .status-dot { display: flex; } }
.status-dot-circle {
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}
.status-dot-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--success);
    letter-spacing: 0.05em;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color 200ms, color 200ms, background 200ms, transform 200ms;
    flex-shrink: 0;
}
.theme-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: rotate(20deg);
}
.theme-toggle-btn i { font-size: 17px; line-height: 1; }
.theme-toggle-btn .icon-moon { display: block; }
.theme-toggle-btn .icon-sun  { display: none; }
html.light .theme-toggle-btn .icon-moon { display: none; }
html.light .theme-toggle-btn .icon-sun  { display: block; }

.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color 200ms, color 200ms;
    flex-shrink: 0;
}
.hamburger-btn:hover { border-color: var(--accent); color: var(--text-1); }
@media (min-width: 1024px) { .hamburger-btn { display: none; } }

/* ===== MOBILE OVERLAY ===== */
.mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}
.mobile-overlay.open { display: block; }
.mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3,7,18,0.9);
    backdrop-filter: blur(12px);
}
.mobile-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 100vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 300ms var(--transition);
}
.mobile-overlay.open .mobile-panel { transform: translateX(0); }

.mobile-panel-header {
    height: 56px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}
.mobile-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color 200ms, color 200ms;
}
.mobile-close-btn:hover { border-color: var(--error); color: var(--error); }

.mobile-links {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-el);
    text-decoration: none;
    color: var(--text-2);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 200ms, color 200ms, background 200ms;
}
.mobile-link:hover, .mobile-link.active { border-color: var(--accent); color: var(--text-1); background: var(--accent-soft); }
.mobile-link-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    width: 24px;
    flex-shrink: 0;
}

.mobile-footer {
    border-top: 1px solid var(--border);
    padding: 16px;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.mobile-lang-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-el);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--text-2);
    transition: border-color 200ms, background 200ms, color 200ms;
}
.mobile-lang-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mobile-lang-btn:not(.active):hover { border-color: var(--accent); color: var(--text-1); }

.mobile-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.mobile-store-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: var(--radius-el);
    background: var(--accent-soft);
    text-decoration: none;
    color: var(--accent-2);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 200ms, background 200ms;
}
.mobile-store-link:hover { border-color: var(--accent); background: rgba(99,102,241,0.2); }

/* ===== LIGHT MODE OVERRIDES ===== */
html.light .nav-logo-icon {
    background: var(--accent-soft);
    border-color: rgba(99,102,241,0.25);
}
html.light .clock-widget {
    color: var(--accent);
    background: var(--accent-soft);
}
html.light .status-dot-circle { box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
html.light .mobile-backdrop { background: rgba(248,250,252,0.92); }
html.light .mobile-panel {
    background: var(--surface);
    border-left-color: var(--border);
}

/* Back-to-top button */
#back-to-top {
    position: fixed;
    bottom: 88px;
    right: 24px;
    z-index: 50;
    transition: opacity 250ms var(--transition), transform 250ms var(--transition), background 200ms, bottom 320ms var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    font-size: 18px;
    line-height: 1;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#back-to-top:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 24px rgba(99,102,241,0.5);
    transform: translateY(-2px);
}
