/* Header styles (scoped) */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
  background: var(--color-background);
  border-bottom: var(--border-width) solid var(--color-border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.brand-name {
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-primary);
}

/* Navigation */
.primary-nav {
  display: block;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-2);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-border-focus);
  outline-offset: var(--focus-ring-offset);
}

/* Menu toggle (hamburger) */
.menu-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
}

.menu-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-border-focus);
  outline-offset: var(--focus-ring-offset);
}

.menu-toggle-box {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 20px;
  height: 16px;
}

.menu-toggle .bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
  transition: transform var(--transition-base) var(--transition-ease), opacity var(--transition-base) var(--transition-ease);
}

/* Toggle active (turn into X) */
.menu-toggle.is-active .bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.menu-toggle.is-active .bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-active .bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Responsive behavior */
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .nav-list { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .primary-nav { padding: var(--space-4) 0; border-top: var(--border-width) solid var(--color-border); }
  /* Progressive enhancement: hide only when JS is enabled */
  .site-header.js-enabled .primary-nav { display: none; }
  .site-header.js-enabled .primary-nav.is-open { display: block; width: 100%; }
}
