

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(12, 7, 6, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 178, 31, 0.12);
    transition: background 0.2s;
}

.main-nav.nav-scrolled {
    background: rgba(12, 7, 6, 0.97);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

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

.nav-chip {
    height: 36px;
    padding: 0 10px 0 8px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #27160d;
    border: 1px solid rgba(255, 178, 31, 0.28);
    color: #e8d7a8;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.nav-chip-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

.nav-chip-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
}

.nav-chip:hover {
    transform: translateY(-1px);
}

.nav-chip-chat:hover {
    background: #5865f2;
    border-color: #5865f2;
    color: #fff;
}

.nav-chip-chat:hover .nav-chip-icon {
    filter: brightness(0) invert(1);
}

.nav-chip-media:hover {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

.nav-chip-media:hover .nav-chip-icon {
    filter: brightness(0) invert(1);
}

@media (max-width: 480px) {
    .nav-chip-label { display: none; }
    .nav-chip { width: 36px; padding: 0; }
}

.nav-drawer-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.nav-drawer-toggle:hover {
    background: rgba(255, 178, 31, 0.12);
}

.drawer-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--light-gray);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s, width 0.25s;
}

.nav-drawer-toggle.is-open .drawer-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-drawer-toggle.is-open .drawer-bar:nth-child(2) {
    opacity: 0;
    width: 0;
}
.nav-drawer-toggle.is-open .drawer-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
    min-height: 40px;
}

.brand-link:hover { opacity: 0.85; }

.site-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
}

.site-logo--missing,
.site-logo[hidden] {
  display: none !important;
}

.site-logo--nav {
    height: 38px;
    width: auto;
    max-width: min(42vw, 180px);
}

.site-logo--drawer {
    height: 34px;
    width: auto;
    max-width: 160px;
}

.brand-fallback {
    display: flex;
    flex-direction: column;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.02em;
    line-height: 1;
}

.brand-subtitle {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--gray);
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.nav-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1099;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.nav-drawer-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1100;
    width: 300px;
    background: #1a0e08;
    border-right: 1px solid rgba(255, 178, 31, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

.nav-drawer.is-open {
    transform: translateX(0);
}

.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.nav-drawer-logo {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-drawer-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.nav-drawer-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0 24px;
}

.nav-drawer-body::-webkit-scrollbar { width: 4px; }
.nav-drawer-body::-webkit-scrollbar-track { background: transparent; }
.nav-drawer-body::-webkit-scrollbar-thumb { background: #3a2414; border-radius: 4px; }

.nav-drawer-category {
    margin-bottom: 2px;
}

.nav-drawer-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 5px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--gray);
    user-select: none;
}

.nav-drawer-category-title .cat-icon {
    font-size: 0.8rem;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px 9px 28px;
    color: #bbb;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.nav-drawer-link:hover {
    color: #fff;
    background: rgba(255, 178, 31, 0.08);
}

.nav-drawer-link.is-active {
    color: var(--white);
    border-left-color: var(--primary-blue);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
}

.nav-drawer-link .link-icon {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    justify-content: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.nav-drawer-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 8px 20px;
}

body { padding-top: 64px; }
@media (max-width: 480px) { body { padding-top: 56px; } }

#nav-auth-area {
    display: flex;
    align-items: center;
    margin-left: 0;
}

@media (max-width: 480px) {
    .nav-container { height: 56px; }
    .nav-drawer-header { height: 56px; }
    .brand-text { font-size: 1.4rem; }
    .nav-drawer { width: 280px; }
}