.nav {
  position: sticky;
  isolation: isolate;
}

.nav .menu {
  display: inline-flex;
  width: 48px;
  height: 48px;
  margin-left: auto;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #cbdce7;
  border-radius: 3px;
  background: #fff;
  color: #071424;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.nav .menu:hover,
.nav .menu:focus-visible {
  border-color: #16a8ff;
  background: #eef7fc;
}

.nav .menu:focus-visible {
  outline: 3px solid rgba(22, 168, 255, .3);
  outline-offset: 3px;
}

.nav .menu-bar {
  display: block;
  width: 23px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .22s ease, opacity .18s ease;
}

.nav .menu[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav .menu[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}

.nav .menu[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav .links,
.nav .links.open {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: clamp(1rem, 5vw, 5rem);
  left: auto;
  width: min(360px, calc(100vw - 2rem));
  margin: 0;
  padding: .65rem;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border: 1px solid #d9e6ef;
  border-top: 3px solid #16a8ff;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(1, 22, 39, .22);
  z-index: 120;
}

.nav .links.open {
  display: flex;
}

.nav .links a {
  display: flex;
  min-height: 48px;
  padding: .78rem 1rem;
  align-items: center;
  border-bottom: 1px solid #e7eff4;
  color: #15344b;
  font-size: .78rem;
  font-weight: 780;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.nav .links a:last-child {
  border-bottom: 0;
}

.nav .links a:hover,
.nav .links a:focus-visible,
.nav .links a.active {
  color: #087dd1;
  background: #eef7fc;
}

.nav > .nav-cta {
  display: none;
}

.nav .links .nav-menu-contact {
  margin-top: .45rem;
  justify-content: center;
  border: 0;
  background: #087dd1;
  color: #fff;
}

.nav .links .nav-menu-contact:hover,
.nav .links .nav-menu-contact:focus-visible,
.nav .links .nav-menu-contact.active {
  background: #16a8ff;
  color: #fff;
}

@media (max-width: 1050px) {
  .nav .links,
  .nav .links.open {
    top: calc(100% + 8px);
    right: 1rem;
    left: auto;
  }
}

@media (max-width: 650px) {
  .nav .menu {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .nav .links,
  .nav .links.open {
    right: .75rem;
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 155px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav .menu,
  .nav .menu-bar {
    transition: none;
  }
}
