/* Nav — sticky top bar */
/* Clip any nav overflow so it can't contribute to horizontal scroll */
header { overflow: hidden; }

.site-nav {
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(6, 9, 32, 0.88);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  height: 22px;
  width: auto;
}

.nav-logo-divider {
  width: 1px;
  height: 16px;
  background: var(--line-2);
}

.nav-logo-tag {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--fg);
  background: var(--line);
}

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

/* ─── Custom currency dropdown ──────────────────────────────────────── */

.cur-field {
  position: relative;
  width: 140px;
}

.cur-sel {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 44px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}
.cur-sel:hover  { border-color: rgba(255,255,255,0.22); background: #1a1f43; }
.cur-sel.open   { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(46,247,199,0.18); background: #1a1f43; }

.cur-val {
  flex: 1;
  font-weight: 500;
  font-family: var(--font-head);
  letter-spacing: 0.01em;
}
.cur-caret {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 0.25s cubic-bezier(0.5,0,0.2,1.3), color 0.18s;
}
.cur-sel:hover .cur-caret { color: var(--fg); }
.cur-sel.open  .cur-caret { transform: rotate(180deg); color: var(--aqua); }
.cur-caret svg { width: 12px; height: 12px; }

/* Dropdown panel */
.cur-menu {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 6px);
  background: #0f1335;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7),
              0 0 0 1px rgba(46,247,199,0.05);
  z-index: 100;
  overflow: hidden;
  padding: 6px;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2,0.8,0.2,1.05);
}
.cur-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cur-menu ul {
  list-style: none;
  margin: 0; padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
.cur-menu ul::-webkit-scrollbar       { width: 6px; }
.cur-menu ul::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.cur-menu ul::-webkit-scrollbar-track { background: transparent; }

.cur-menu li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.18s ease;
  opacity: 0;
  transform: translateY(-4px);
}

.cur-menu.show li                  { animation: curItemIn 0.32s cubic-bezier(0.2,0.7,0.2,1) forwards; }
.cur-menu.show li:nth-child(1)     { animation-delay: 0.02s; }
.cur-menu.show li:nth-child(2)     { animation-delay: 0.05s; }
.cur-menu.show li:nth-child(3)     { animation-delay: 0.08s; }

@keyframes curItemIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cur-menu li:hover,
.cur-menu li.hl         { background: #1d2247; padding-left: 18px; }

.cur-r {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: color 0.12s ease;
}
.cur-menu li:hover .cur-r,
.cur-menu li.hl .cur-r  { color: var(--fg); }

.cur-menu li.sel        { color: var(--aqua); }
.cur-menu li.sel .cur-r { color: rgba(46,247,199,0.7); }
.cur-menu li.sel::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 18px; border-radius: 3px;
  background: var(--aqua);
  box-shadow: 0 0 8px rgba(46,247,199,0.6);
  animation: curBarIn 0.32s cubic-bezier(0.2,0.7,0.2,1.2) both;
  transform-origin: center;
}
@keyframes curBarIn {
  from { transform: translateY(-50%) scaleY(0.2); opacity: 0; }
  to   { transform: translateY(-50%) scaleY(1);   opacity: 1; }
}

/* ─── Nav compact variant ───────────────────────────────────────────── */

.cur-field--nav { width: auto; }

.cur-field--nav .cur-sel {
  height: 32px;
  padding: 0 10px;
  background: transparent;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.cur-field--nav .cur-sel:hover { background: transparent; color: var(--fg); }
.cur-field--nav .cur-sel.open  { background: transparent; color: var(--fg); }

.cur-field--nav .cur-menu {
  width: 120px;
  left: auto;
  right: 0;
}

/* ─── Hamburger button ───────────────────────────────────────────────── */

.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.nav-hamburger:hover { color: var(--fg); background: var(--line); }

.hb-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
}

.nav-hamburger.open .hb-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open .hb-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open .hb-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile nav drawer ──────────────────────────────────────────────── */

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(6, 9, 32, 0.97);
  border-bottom: 1px solid var(--line);
  z-index: 79;
  padding: 8px 20px 24px;
  transform: translateY(-6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.18s ease,
              visibility 0s 0.22s;
}

.mobile-nav-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.18s ease,
              visibility 0s 0s;
}

.mobile-nav-links {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.mobile-nav-links li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  padding: 0 4px;
  border-radius: var(--radius);
  transition: color 0.2s;
}

.mobile-nav-links li a:hover,
.mobile-nav-links li a:focus-visible { color: var(--fg); }

.mobile-nav-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-nav-cur-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.mobile-nav-footer .cur-field {
  flex: 1;
  max-width: 160px;
}

/* Mobile: hide nav links and currency in top bar; show hamburger + drawer */
@media (max-width: 767px) {
  .nav-links       { display: none; }
  .cur-field--nav  { display: none; }
  .site-nav        {
    padding: 0 16px;
    /* Remove expensive blur on mobile — save GPU */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 9, 32, 0.96);
  }
  .nav-hamburger       { display: flex; }
  .mobile-nav-drawer   { display: block; }
}
