/* Adaptive floating header surface.
   Keep the navigation visibly transparent over dark sections, then deepen the
   glass only when the fixed nav is sitting over a light section. */

.site-header,
.site-header.scrolled {
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.site-header .nav {
  width: min(calc(100% - 48px), 1040px) !important;
  max-width: 1040px !important;
  height: 52px !important;
  box-sizing: border-box;
  background: rgba(64, 67, 66, .34) !important;
  border-color: rgba(235, 240, 237, .17) !important;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .09),
    inset 0 1px 0 rgba(255, 255, 255, .075) !important;
  backdrop-filter: blur(18px) saturate(108%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(108%) !important;
}

.site-header.scrolled .nav {
  background: rgba(54, 57, 56, .48) !important;
  border-color: rgba(235, 240, 237, .18) !important;
}

.site-header.is-over-light .nav {
  background: rgba(7, 11, 9, .82) !important;
  border-color: rgba(220, 235, 226, .085) !important;
  box-shadow:
    0 11px 28px rgba(0, 0, 0, .14),
    inset 0 1px 0 rgba(255, 255, 255, .02) !important;
}

@media (min-width: 981px) {
  .site-header .brand-logo {
    transform: scale(.76);
  }

  .site-header .nav-cta {
    min-height: 38px;
    padding: 8px 15px !important;
  }
}

@media (max-width: 980px) {
  .site-header .nav {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    height: 52px !important;
  }

  .site-header .mobile-nav {
    inset: 52px 0 auto !important;
  }

  .site-header .brand-logo {
    width: 120px !important;
    height: 29px !important;
  }

  .site-header .menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    color: #f5f2ed;
    font-size: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .site-header .menu-btn:hover,
  .site-header .menu-btn:active,
  .site-header .menu-btn:focus {
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
  }

  .site-header .menu-btn span {
    display: block;
    width: 22px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
  }

  .site-header .menu-btn span:nth-child(2) {
    width: 15px;
    margin-right: 7px;
  }

  .site-header .menu-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }

  .site-header.is-over-light .nav {
    background: rgba(7, 11, 9, .86) !important;
    border-color: rgba(220, 235, 226, .085) !important;
  }
}

/* A compact, full-height mobile navigation surface. */
@media (max-width: 980px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  .site-header:has(.mobile-nav.open) .nav,
  .site-header.is-over-light:has(.mobile-nav.open) .nav {
    position: relative;
    z-index: 2;
    background: #fff !important;
    border-color: #e9e8e4 !important;
    box-shadow: none !important;
    border-radius: 0 0 24px 24px;
  }

  .site-header:has(.mobile-nav.open) .brand-logo {
    filter: brightness(0);
  }

  .site-header:has(.mobile-nav.open) .menu-btn {
    color: #171717;
  }

  .site-header:has(.mobile-nav.open) .menu-btn span:first-child {
    transform: translateY(6.5px) rotate(45deg);
  }

  .site-header:has(.mobile-nav.open) .menu-btn span:nth-child(2) {
    opacity: 0;
  }

  .site-header:has(.mobile-nav.open) .menu-btn span:last-child {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .site-header .mobile-nav.open {
    display: flex;
    position: fixed;
    inset: 0 0 0 !important;
    width: 100%;
    height: 100dvh;
    padding: 104px 24px max(28px, env(safe-area-inset-bottom));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background: #fff !important;
    color: #171717;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header .mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 62px;
    font-family: var(--body);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.3;
    color: #171717 !important;
  }

  .site-header .mobile-nav a:not(:last-child) {
    justify-content: space-between;
    gap: 20px;
  }

  .site-header .mobile-nav a:not(:last-child)::after {
    content: "";
    display: block;
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    margin-right: 3px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: .7;
  }

  .site-header .mobile-nav a:last-child {
    margin-top: auto;
    min-height: 54px;
    justify-content: center;
    border-radius: 12px;
    background: #242024;
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
  }

  .site-header .mobile-nav a:focus-visible {
    outline: 2px solid #171717;
    outline-offset: 3px;
  }
}
