/* Top header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(133, 160, 120, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-avatar { border-radius: 50%; border: 2px solid rgba(255,255,255,0.6); }

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
}

.nav a:hover { color: #fff; }
.nav-cross { margin-left: 14px; color: var(--muted); white-space: nowrap; }
.nav-cross .alt-nav { color: var(--muted); text-decoration: none; margin: 0 6px; }
.nav-cross .alt-nav:hover { color: #fff; }
.nav-cross .sep { opacity: 0.5; }

/* Enhanced burger button */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  gap: 8px;
  margin-left: 12px;
  z-index: 120;
  padding: 8px;
  transition: background 180ms ease, transform 200ms ease;
}
.burger:hover { background: rgba(132,204,22,0.06); transform: scale(1.03); }
.burger span {
  display: block;
  width: 26px;
  height: 3.6px;
  background: #fff;
  border-radius: 3px;
  transition: transform 260ms cubic-bezier(.4,2,.3,1), opacity 180ms ease;
  transform-origin: center;
}
.burger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile nav overlay with slide panel */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
  background: linear-gradient(180deg, rgba(2,6,4,0.42), rgba(2,6,4,0.6));
  backdrop-filter: blur(6px) saturate(1.1);
}
.mobile-nav[aria-hidden="false"] { opacity: 1; pointer-events: auto; }

.mobile-nav-inner {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, transparent), color-mix(in srgb, var(--bg-elev) 94%, transparent));
  border-radius: 16px 0 0 16px;
  padding: 36px 28px;
  width: min(360px, 84vw);
  height: 100vh;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  transform: translateX(var(--nav-x));
  transition: transform 420ms cubic-bezier(.2,.9,.2,1), box-shadow 220ms;
  position: absolute;
  right: 0; top: 0; bottom: 0;
  --nav-x: 110%;
}
.mobile-nav[aria-hidden="false"] .mobile-nav-inner { --nav-x: 0%; }

.mobile-nav-close {
  background: rgba(255,255,255,0.04);
  color: #fff;
  border: none;
  font-size: 22px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 140ms, color 140ms;
}
.mobile-nav-close:hover { background: rgba(132,204,22,0.12); color: #08130a; }

.mobile-nav-inner .brand-mini { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mobile-nav-inner .brand-mini img { width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 6px 18px rgba(0,0,0,0.35); }

.mobile-nav nav { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.mobile-nav nav a {
  color: #fff; font-size: 20px; text-decoration: none; font-weight: 700; letter-spacing: 0.4px;
  padding: 12px 14px; border-radius: 10px; transition: background 140ms, color 140ms, transform 140ms;
}
.mobile-nav nav a:hover { color: #08130a; background: linear-gradient(90deg, rgba(132,204,22,0.95), rgba(101,163,13,0.9)); transform: translateX(6px); }

.mobile-nav .mobile-cta { margin-top: 12px; display: flex; gap: 12px; justify-content: center; }
.mobile-nav .mobile-cta .btn { padding: 10px 14px; font-size: 15px; }
.mobile-nav .mobile-cta .btn.primary { box-shadow: none; }
/* Cross-link block in mobile panel (pinned to bottom) */
.mobile-nav .nav-cross { margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(133, 160, 120, 0.18); text-align: center; color: var(--muted); }
.mobile-nav .nav-cross .alt-nav { display: inline-block; font-size: 16px; margin: 0 6px; color: var(--muted); }
.mobile-nav .nav-cross .alt-nav:hover { color: #fff; }

/* Sidebar: stack links and push cross-links to the right at the bottom */
.sidebar .sidebar-nav { display: flex; flex-direction: column; }
.sidebar .nav-cross { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(133, 160, 120, 0.18); text-align: center; }
.sidebar .nav-cross .alt-nav { margin: 0 6px; color: var(--muted); }

/* Accessibility */
.mobile-nav nav a, .mobile-nav-close, .burger { touch-action: manipulation; }

/* Responsive visibility */
@media (max-width: 1000px), (orientation: portrait) {
  .burger { display: flex; }
  .site-header .nav { display: none; }
}

@media (min-width: 1000px) {
  .site-header { display: none; }
}

@media (orientation: portrait) {
  .site-header { display: block; }
}
