/* Header (scoped) */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-primary-dark);
}
.brand:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-bg-secondary), #fff 60%);
  box-shadow: var(--shadow-base);
}
.brand-svg { display: block; }
.brand-name {
  font-family: var(--font-accent);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: .5px;
}

/* Navigation */
.primary-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: var(--space-6); }
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) 0;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  position: relative;
}
.nav-link:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 4px; border-radius: var(--radius-sm); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-accent-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}
.nav-link:hover::after { transform: scaleX(1); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  align-items: center; justify-content: center;
  color: var(--color-primary);
}
.nav-toggle:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.nav-toggle-box { position: relative; width: 22px; height: 16px; }
.nav-toggle-bar {
  position: absolute; left: 0; right: 0;
  height: 2px; background: currentColor; border-radius: 1px;
  transition: transform var(--transition-base), opacity var(--transition-base), top var(--transition-base);
}
.nav-toggle-bar:nth-child(1) { top: 0; }
.nav-toggle-bar:nth-child(2) { top: 7px; }
.nav-toggle-bar:nth-child(3) { top: 14px; }

/* Open state animation */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* Responsive behavior */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav { width: 100%; }
  .nav-list { gap: 0; }

  /* Progressive enhancement: only hide if JS is enabled */
  .js-enabled .primary-nav { position: absolute; left: 0; right: 0; top: calc(var(--header-height)); background: var(--color-bg-primary); border-bottom: 1px solid var(--color-gray-200); box-shadow: var(--shadow-base); }
  .js-enabled .primary-nav { max-height: 0; opacity: 0; visibility: hidden; overflow: hidden; transition: max-height var(--transition-slow), opacity var(--transition-base), visibility var(--transition-base); }
  .js-enabled .primary-nav.is-open { max-height: 420px; opacity: 1; visibility: visible; }

  .primary-nav .nav-list { flex-direction: column; align-items: stretch; }
  .primary-nav .nav-item { border-top: 1px solid var(--color-gray-200); }
  .primary-nav .nav-link { padding: var(--space-4) var(--space-6); }
  .primary-nav .nav-link::after { display: none; }
}
