.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 244, 236, 0.8);
  border-bottom: 1px solid rgba(33, 49, 42, 0.08);
}

@media (min-width: 641px) {
  .site-header {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px dashed rgba(63, 116, 94, 0.45);
  background: rgba(63, 116, 94, 0.06);
  color: var(--accent);
  font-size: 0;
}

.brand-logo::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px dashed currentColor;
  opacity: 0.55;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.icon-menu {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.icon-menu::before,
.icon-menu::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.icon-menu::before {
  top: -6px;
}

.icon-menu::after {
  top: 6px;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 28, 22, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 50;
}

.nav-close {
  display: none;
}

.site-nav a {
  position: relative;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

.site-nav a.is-active {
  color: var(--accent);
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(82vw, 320px);
    height: var(--nav-viewport-height, 100vh);
    max-height: var(--nav-viewport-height, 100vh);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 5.2rem 1rem 1rem;
    background: rgba(255, 253, 249, 0.98);
    border-left: 1px solid var(--line);
    box-shadow: -14px 0 30px rgba(18, 31, 25, 0.18);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.2s ease;
    z-index: 70;
  }

  .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    border-radius: 11px;
    width: 42px;
    height: 42px;
    padding: 0;
    font: inherit;
    font-weight: 700;
    margin-bottom: 0.4rem;
    cursor: pointer;
  }

  .icon-close {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
  }

  .icon-close::before,
  .icon-close::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    width: 2px;
    height: 16px;
    background: currentColor;
    border-radius: 999px;
  }

  .icon-close::before {
    transform: rotate(45deg);
  }

  .icon-close::after {
    transform: rotate(-45deg);
  }

  .site-nav a {
    width: 100%;
    display: block;
    padding: 0.7rem 0.4rem;
    border-bottom: 1px solid rgba(33, 49, 42, 0.08);
  }

  .site-nav a.is-active {
    background: rgba(63, 116, 94, 0.08);
    border-radius: 10px;
    border-bottom-color: transparent;
  }

  .site-nav a.is-active::after {
    left: 0.4rem;
    right: 0.4rem;
    bottom: 0.32rem;
  }

  html.nav-open,
  body.nav-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.nav-open .site-nav {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }

  body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}
