.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 100;
  background: rgba(251, 252, 250, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition:
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.site-header.is-scrolled {
  border-color: var(--lasea-line);
  box-shadow: 0 12px 24px -20px rgba(13, 58, 45, 0.5);
}

.navbar {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.85rem var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  text-decoration: none;
}

.navbar__brand img {
  height: 40px;
  width: auto;
}

.navbar__brand .name {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1rem, 0.9rem + 0.6vw, 1.3rem);
  letter-spacing: 0.04em;
  color: var(--lasea-forest);
  line-height: 1;
  text-decoration: none;
}

.navbar__menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

.navbar__menu a {
  position: relative;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--lasea-ink);
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  transition: color 0.2s ease;
}

.navbar__menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--lasea-leaf);
  transition: right 0.25s ease;
}

.navbar__menu a:hover {
  color: var(--lasea-forest);
}

.navbar__menu a:hover::after {
  right: 0;
}

.navbar__menu a.is-active {
  color: var(--lasea-forest);
  font-weight: 600;
}

.navbar__menu a.is-active::after {
  right: 0;
}

.navbar__cta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--lasea-white);
  background: var(--lasea-forest);
  border: 1px solid var(--lasea-forest);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.4rem;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.navbar__cta:hover {
  background: var(--lasea-forest-dark);
  transform: translateY(-2px);
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.navbar__toggle span {
  width: 24px;
  height: 2px;
  background: var(--lasea-forest);
  border-radius: var(--radius-pill);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

@media (max-width: 780px) {
  .navbar {
    flex-wrap: wrap;
    row-gap: 0.65rem;
    padding: 0.75rem var(--space-sm);
  }

  .navbar__brand img {
    height: 34px;
  }

  .navbar__brand .name {
    font-size: 1.05rem;
  }

  .navbar__toggle {
    display: flex;
    order: 2;
  }

  .navbar__cta {
    order: 3;
    flex-basis: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }

  .navbar__menu {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.3s ease,
      opacity 0.2s ease;
  }

  .navbar__menu a {
    width: 100%;
    padding: 0.65rem var(--space-2xs);
  }

  .navbar__menu a::after {
    display: none;
  }

  .navbar__menu a.is-active {
    background: var(--lasea-mint);
    border-radius: 10px;
  }

  .navbar.is-open .navbar__menu {
    max-height: 320px;
    opacity: 1;
    margin-top: 0.25rem;
  }

  .navbar.is-open .navbar__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .navbar.is-open .navbar__toggle span:nth-child(2) {
    opacity: 0;
  }

  .navbar.is-open .navbar__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* The spacer follows the actual header height, including responsive wrapping. */
html { scroll-padding-top: calc(var(--site-header-height, 88px) + 16px); }
.site-header-spacer { height: var(--site-header-height, 88px); }
.navbar :is(a, button):focus-visible {
  outline: 3px solid var(--lasea-leaf);
  outline-offset: 3px;
}
@media (max-width: 780px) {
  .navbar__toggle { width: 44px; height: 44px; flex-shrink: 0; }
  .navbar__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    visibility: hidden;
    background: var(--lasea-white);
    box-shadow: 0 12px 24px -16px rgba(13, 58, 45, .5);
  }
  .navbar.is-open .navbar__menu {
    visibility: visible;
    max-height: calc(100vh - var(--site-header-height, 130px));
    max-height: calc(100dvh - var(--site-header-height, 130px));
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 0;
    padding-block: .5rem;
  }
  .navbar__menu li { width: 100%; }
  .navbar__menu a { display: block; box-sizing: border-box; padding-inline: var(--space-sm); }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .navbar__menu, .navbar__toggle span, .navbar__menu a,
  .navbar__menu a::after, .navbar__cta { transition: none; }
}
