/* Site nav header. Used on every page. */

.site-nav { padding: 1.4rem 2rem; }

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-grad);
  color: #14100A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.primary-nav {
  display: flex;
  gap: 1.6rem;
  margin: 0 auto;
}

.primary-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--text); }
.primary-nav a[aria-current="page"] { color: var(--text); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: none;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.nav-toggle:hover, .nav-toggle:focus-visible { color: var(--text); border-color: var(--border-strong); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-inner.menu-open .nav-toggle .icon-bars { display: none; }
.nav-inner.menu-open .nav-toggle .icon-close { display: block; }

.nav-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.nav-icon:hover, .nav-icon:focus-visible { color: var(--text); border-color: var(--border-strong); }
.nav-icon svg { width: 18px; height: 18px; }

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  flex-shrink: 0;
}

.lang-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.lang-btn:hover, .lang-btn:focus-visible { color: var(--text); }
.lang-btn.active { background: var(--surface-hover); color: var(--text); }

@media (max-width: 860px) {
  .nav-inner { flex-wrap: wrap; }

  .primary-nav,
  .nav-controls {
    display: none;
    width: 100%;
  }

  .nav-toggle { display: flex; margin-left: auto; }

  .nav-inner.menu-open .primary-nav,
  .nav-inner.menu-open .nav-controls {
    display: flex;
  }

  .primary-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    order: 5;
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }

  .nav-controls {
    order: 6;
    justify-content: space-between;
    margin-top: 0.9rem;
    padding-bottom: 0.2rem;
  }
}
