.nav {
  background-color: var(--color-bg-base);
  color: var(--color-text-logo);
  border-bottom: 1px solid var(--color-border-subtle);
  position: relative;
  padding: 0 var(--page-gutter);
}

.nav-inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 55px;
  width: auto;
  display: block;
}

.nav-right {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-right a {
  text-decoration: none;
  color: inherit;
  font-size: 1.2rem;
  position: relative;
  padding-bottom: 3px;
}

.nav-right a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--color-highlight);
  transition: width 0.25s ease;
}

.nav-right a:hover::after,
.nav-right a.active::after {
  width: 100%;
}

.nav-right a:hover {
  text-decoration: none;
}

/* ── Burger button (hidden on desktop) ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-burger span {
  display: block;
  width: 100%;
  height: 4px;
  background-color: var(--color-text-logo);
  border-radius: 4px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Animate to X when open */
.nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-burger {
    display: flex;
  }

  .nav-right {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background-color: var(--color-bg-base);
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 1rem 0;
    z-index: 99;
  }

  .nav-right.is-open {
    display: flex;
  }

  .nav-right a {
    padding: 0.75rem var(--page-gutter);
    font-size: 1.1rem;
    transition: color 0.2s ease;
  }

  .nav-right a::after {
    display: none;
  }

  .nav-right a:hover,
  .nav-right a.active {
    color: var(--color-highlight);
  }

  /* Only apply hover on real pointer devices — prevents stuck state on touch */
  @media (hover: none) {
    .nav-right a:hover {
      color: inherit;
    }
  }
}