#mainNav {
  --bg: #000000;
  --bg-2: #050505;
  --bg-3: #080808;
  --surface: #0a0a0a;
  --surface-2: #0f0f0f;
  --border: rgba(255,255,255,0.07);
  --border-blue: rgba(255,255,255,0.28);
  --blue: #ececec;
  --blue-light: #ffffff;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --muted-2: #5c5c5c;
  --red: #8c8c8c;
  --red-dim: rgba(140,140,140,0.12);
  --ease: cubic-bezier(0.16,1,0.3,1);
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(860px, calc(100% - 32px));
  height: 52px;
  padding: 0 20px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}
#mainNav:hover { border-color: rgba(255,255,255,0.14); box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.1); }
#mainNav *, #mainNav *::before, #mainNav *::after { box-sizing: border-box; }
#mainNav .logo {
  display: flex; align-items: center; gap: 9px; flex: none;
  color: var(--text); text-decoration: none; white-space: nowrap;
  font: 700 15px 'Space Grotesk', sans-serif; letter-spacing: -0.02em;
}
#mainNav .logo svg { flex-shrink: 0; transition: transform .5s var(--ease), filter .5s ease; }
#mainNav .logo:hover svg { transform: rotate(-8deg) scale(1.12); filter: drop-shadow(0 0 8px rgba(255,255,255,.7)); }
#mainNav .logo-dot { color: var(--blue-light); }
#mainNav .nav-right { display: flex; align-items: center; gap: 16px; }
#mainNav .nav-links { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
#mainNav .nav-links a {
  position: relative; display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: color .25s ease, background .2s ease;
}
#mainNav .nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: #fff; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
#mainNav .nav-links a:hover { color: #fff; background: rgba(255,255,255,.05); }
#mainNav .nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
#mainNav .nav-links a[aria-current="page"] { color: #fff; }
#mainNav .nav-links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
#mainNav .nav-auth-out { display: flex; align-items: center; }
#mainNav .nav-auth-in { position: relative; display: none; align-items: center; }
#mainNav .btn-login {
  display: flex; align-items: center; gap: 7px; padding: 8px 16px;
  color: #fff; background: var(--blue); border: 0; border-radius: 100px;
  font: 600 13px 'Inter', sans-serif; text-decoration: none;
  transition: background .2s, box-shadow .2s, transform .15s;
}
#mainNav .btn-login:hover { background: var(--blue-light); box-shadow: 0 0 20px rgba(255,255,255,.45); transform: translateY(-1px); }
#mainNav .nav-user-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: border-color .2s, background .2s;
}
#mainNav .nav-user-btn:hover { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.04); }
#mainNav .nav-user-avatar { width: 26px; height: 26px; flex: none; border: 1.5px solid var(--border-blue); border-radius: 50%; object-fit: cover; }
#mainNav .nav-user-name { max-width: 110px; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#mainNav .nav-chevron { width: 13px; height: 13px; flex: none; color: var(--muted); transition: transform .2s; }
#mainNav .nav-auth-in.open .nav-chevron { transform: rotate(180deg); }
#mainNav .nav-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 300; min-width: 200px; padding: 8px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
#mainNav .nav-auth-in.open .nav-dropdown { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#mainNav .nav-dropdown-header { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
#mainNav .nav-dropdown-avatar { width: 34px; height: 34px; flex: none; border: 2px solid var(--border-blue); border-radius: 50%; object-fit: cover; }
#mainNav .nav-dropdown-name { color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.2; }
#mainNav .nav-dropdown-tag { margin-top: 1px; color: var(--muted); font-size: 12px; }
#mainNav .nav-dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px;
  color: var(--text); background: none; border: 0; border-radius: 8px; cursor: pointer;
  font: 500 13px 'Inter', sans-serif; text-align: left; text-decoration: none;
  transition: background .15s, color .15s;
}
#mainNav .nav-dropdown-item:hover { color: #fff; background: rgba(255,255,255,.05); }
#mainNav .nav-dropdown-item svg { flex-shrink: 0; opacity: .7; }
#mainNav .nav-dropdown-item.signout { margin-top: 4px; padding-top: 11px; color: var(--red); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
#mainNav .nav-dropdown-item.signout:hover { color: #a0a0a0; background: var(--red-dim); }
#mainNav .menu-toggle { display: none; }
.jp-main-nav-spacer { height: 68px; }

@media (max-width: 700px) {
  #mainNav { top: 10px; height: 48px; padding: 0 14px; }
  #mainNav .nav-links { display: none; }
  #mainNav .nav-right { gap: 0; }
  #mainNav .nav-dropdown { right: -8px; min-width: 180px; }
}
