.topbar {
  background: var(--ink);
  color: #efe8dc;
  font-size: 13px;
}
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; min-height: 36px; align-items: center; }
.topbar a { color: var(--gold-2); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 252, 248, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 8px 24px rgba(16,24,32,0.04); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: var(--header); }
.logo { display: flex; align-items: center; flex: 0 0 auto; }
.logo img { height: 44px; width: auto; }

.site-header .wrap { width: min(1480px, calc(100% - 28px)); }
.nav { display: flex; align-items: center; gap: 0; margin-left: auto; min-width: 0; }
.nav-item { position: relative; }
.nav-link, .icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 550;
  font-size: 13.5px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.header-actions .btn { min-height: 40px; padding: 0 12px; font-size: 14px; }
.nav-link svg { width: 12px; height: 12px; transition: transform 0.2s var(--ease); }
.nav-item:hover .nav-link svg, .nav-item:focus-within .nav-link svg { transform: rotate(180deg); }

.mega, .dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  min-width: 280px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
.mega { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 6px 18px; width: min(640px, 70vw); }
.nav-item:nth-child(n+3) > .mega,
.nav-item:nth-child(n+3) > .dropdown { left: auto; right: 0; }
.nav-item:hover > .mega, .nav-item:focus-within > .mega,
.nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown,
.nav-item.is-open > .mega, .nav-item.is-open > .dropdown {
  opacity: 1; visibility: visible; transform: none;
}
.mega a, .dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
}
.mega a:hover, .dropdown a:hover, .mega a:focus-visible, .dropdown a:focus-visible { background: var(--paper); }
.mega small, .dropdown small { display: block; color: var(--muted); font-size: 12px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; justify-content: center; padding: 0; border-radius: 999px; }
.icon-btn:hover { background: var(--paper); }
.menu-toggle { display: none; }

.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 24, 32, 0.46);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.search-dialog.is-open { display: flex; }
.search-panel {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.search-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 52px;
  padding: 0 14px;
  background: var(--paper);
}
.search-results { list-style: none; margin-top: 12px; max-height: 50vh; overflow: auto; }
.search-results a { display: block; padding: 10px 8px; border-radius: 10px; }
.search-results a:hover { background: var(--paper); }
.search-results span { display: block; color: var(--muted); font-size: 13px; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(16, 24, 32, 0.45);
  display: none;
}
.drawer.is-open { display: block; }
.drawer-panel {
  margin-left: auto;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  padding: 18px 18px 40px;
  overflow: auto;
  transform: translateX(16px);
  animation: drawer-in 0.28s var(--ease) forwards;
}
@keyframes drawer-in { to { transform: none; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mobile-nav details { border-bottom: 1px solid var(--line); }
.mobile-nav summary, .mobile-nav > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav .sub a { display: block; padding: 8px 0 8px 8px; color: var(--muted); }
.mobile-nav .sub a strong { color: var(--text); font-weight: 600; }
