/* hidden checkbox accessibility fix */
.nav-toggle {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
}

/* burger button */
.navbar {
  position: relative;
}

.nav-burger {
  display: none;                /* shown at <=800px */
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 1001;                /* above nav */
  transition: bg 0.25s ease;
}

.nav-burger:hover {
  background: var(--nav-hover);
}

/* burger bars */
.nav-burger span {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: #c3996b; /* tan accent */
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* "X" animation when open */
.nav-toggle:checked + .nav-burger span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav-toggle:checked + .nav-burger span:nth-child(2) {
  opacity: 0;
}
.nav-toggle:checked + .nav-burger span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* mobile dropdown menu */
@media (max-width: 800px) {
  .nav {
    display: none;
    width: 100%;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--nav-height) + 10px);
    background: var(--nav-bg);
    border: 1px solid color-mix(in oklab, #000 12%, var(--nav-bg));
    border-radius: 14px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
    padding: 8px;
  }

  .nav.is-open {
    display: block;
    animation: fadeDown 0.25s ease;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav-links a {
    height: 52px;
    padding-inline: 16px;
    border-radius: 10px;
    color: var(--nav-ink);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-burger {
    display: inline-flex;
  }
}

/* lock body scroll when menu open */
body.no-scroll {
  overflow: hidden;
}

/* optional fade-down animation */
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
