/* ===========================================
   NAVIGATION — Nav bar + hamburger + mobile
   =========================================== */

.nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--bg);
  border: var(--border-width) solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: var(--space-2xl);
}

/* Brand block */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 18px 26px;
  background: var(--accent);
  color: var(--bg);
  text-transform: uppercase;
  font-size: 14px;
  text-decoration: none;
  transition: background var(--duration-fast) ease;
}

.brand img {
  height: 42px;
  width: 42px;
  border: 2px solid var(--bg);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* Nav links */
.nav .links {
  display: flex;
  align-items: stretch;
}

.nav .links a {
  padding: 18px 26px;
  border-left: var(--border-width) solid var(--border-subtle);
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  transition: all var(--duration-fast) ease;
}

.nav .links a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
}

@media (hover: hover) {
  .nav .links a:hover {
    background: var(--surface);
    color: var(--text);
  }
}

/* Hamburger toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 18px;
  z-index: 101;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav {
    margin-bottom: var(--space-xl);
  }

  .menu-toggle {
    display: flex;
  }

  .nav .links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    flex-direction: column;
    background: var(--bg);
    border-left: var(--border-width) solid var(--accent);
    padding: 80px 0 var(--space-lg);
    gap: 0;
    transition: right 0.3s ease;
    z-index: 99;
  }

  .nav .links.active {
    right: 0;
  }

  .nav .links a {
    border-left: none;
    border-bottom: 2px solid var(--border-subtle);
    padding: 20px 24px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brand {
    padding: 14px 18px;
    font-size: 12px;
    gap: 10px;
  }

  .brand img {
    height: 36px;
    width: 36px;
  }
}
