:root {
  --site-header-height: 84px;
}

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--site-header-height);
  padding-inline: 4vw;
  color: #fff;
  transition: color .4s;
}

.bar::before,
.bar::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  transition: opacity .5s;
}

.bar::before {
  background: linear-gradient(180deg, rgba(7, 20, 38, .82), transparent);
}

.bar.st::before {
  background: linear-gradient(180deg, rgba(46, 55, 68, .96), rgba(24, 33, 46, .9) 65%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}

.bar::after {
  background: linear-gradient(180deg, #fbfcfe, #d6dfe9);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .3);
  opacity: 0;
}

.bar:is(:hover, :focus-within)::after {
  opacity: 1;
}

.bar .logo {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 175px;
  height: 38px;
}

.logo .wordmark {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity .45s;
}

.wordmark {
  overflow: hidden;
}

.bar .ld,
.bar:is(:hover, :focus-within) .lw {
  opacity: 0;
}

.bar:is(:hover, :focus-within) .ld {
  opacity: 1;
}

#primary-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
}

#primary-navigation a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  color: inherit;
  font: 500 .9rem/1.4 "Hanken Grotesk", system-ui, sans-serif;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
}

#primary-navigation a::after {
  position: absolute;
  inset: auto 16px 6px;
  height: 2px;
  background: var(--nav-underline, #6f8ba6);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s;
}

.bar:is(:hover, :focus-within) {
  --nav-active: #2c6aa0;
  --nav-underline: #0b1d36;
  color: #0b1d36;
}

#primary-navigation a:is(:hover, :focus-visible, [aria-current="page"]) {
  color: var(--nav-active, #cfe3f5);
}

#primary-navigation a:is(:hover, :focus-visible, [aria-current="page"])::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 400 1.7rem/1 system-ui, sans-serif;
  cursor: pointer;
}

@media (max-width: 900px) {
  .bar .logo {
    width: 150px;
    height: 34px;
  }

  .has-nav-menu .nav-toggle {
    display: block;
  }

  #primary-navigation {
    --nav-active: #fff;
    --nav-underline: #6f8ba6;
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100svh - var(--site-header-height));
    overflow-y: auto;
    padding: 10px 4vw 20px;
    border-radius: 0 0 24px 24px;
    background: #101a2a;
    color: #fff;
  }

  #primary-navigation.open {
    display: flex;
  }

  #primary-navigation a {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bar,
  .bar::before,
  .bar::after,
  .logo .wordmark,
  #primary-navigation a::after {
    transition: none;
  }
}

footer .wordmark {
  display: block;
  width: min(175px, 100%);
  height: auto;
  margin-bottom: 16px;
}

.service-line[id],
.card[id],
#markets,
#who-we-serve,
.home-close section[id] {
  scroll-margin-top: 100px;
}

.contact-preview-note {
  color: #c9d6e3;
}
