:root {
  --header: 96px;
  scroll-padding-top: var(--header);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #263a4e;
  background: #fff;
  box-shadow: 0 1px 0 #dbe3ea;
  transition: color .2s, background-color .2s, box-shadow .2s;
}

.company-front .site-header {
  position: fixed;
  inset: 0 0 auto;
}

.company-front .site-header:not(.past-hero):not(.menu-open):not(:has(.nav-group:is(:hover, :focus-within))) {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.header-inner {
  width: calc(100% - clamp(32px, 4.2vw, 80px));
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-inline: auto;
}

.home-wrap {
  width: min(1460px, 76%);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  white-space: nowrap;
  font-size: clamp(18px, 1.35vw, 25px);
  font-weight: 850;
  letter-spacing: -.05em;
}

.brand img {
  width: 47px;
  height: auto;
}

.site-header nav,
.primary-links,
.header-tools {
  display: flex;
  align-items: center;
}

.primary-links {
  position: absolute;
  inset: 0 auto 0 50%;
  transform: translateX(-50%);
  align-items: stretch;
  gap: clamp(18px, 4vw, 82px);
}

.nav-group {
  position: relative;
  display: flex;
  align-items: center;
}

.site-header nav a {
  white-space: nowrap;
  font-size: 16px;
  font-weight: 680;
}

.primary-links a:hover,
.primary-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 7px;
}

.nav-submenu {
  position: absolute;
  z-index: 1;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  min-width: 160px;
  margin: 0;
  padding: 12px 15px;
  list-style: none;
  color: #243b52;
  background: #fff;
  border: 1px solid #e2e8ee;
  box-shadow: 0 12px 24px #14203213;
}

.nav-group:is(:hover, :focus-within) > .nav-submenu {
  display: grid;
  gap: 2px;
}

.nav-submenu a {
  display: block;
  padding: 8px 4px;
}

.header-tools {
  gap: clamp(13px, 1.8vw, 34px);
}

.site-header .work-link,
.site-header .nav-contact {
  font-size: 14px;
}

.header-tools a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.nav-contact {
  padding: 10px 13px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65em;
  min-height: 46px;
  padding: .65em 1.3em;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  transition: background-color .18s, border-color .18s, color .18s;
}

.menu-toggle {
  display: none;
}

@media (max-width: 1120px) {
  :root { --header: 66px; }

  .home-wrap { width: calc(100% - 64px); }
  .brand img { width: 42px; }

  .menu-toggle {
    display: grid;
    justify-content: center;
    align-content: center;
    gap: 6px;
    width: 44px;
    height: 42px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: inherit;
  }

  .menu-toggle > span {
    width: 18px;
    height: 2px;
    background: currentColor;
  }

  .menu-open .menu-toggle > span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-open .menu-toggle > span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .site-header nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100dvh - var(--header));
    overflow-y: auto;
    padding: 8px max(16px, 4.5vw) 22px;
    color: #22374d;
    background: #fff;
    border-block: 1px solid #e1e8ee;
    box-shadow: 0 12px 18px #111e2e1f;
  }

  .site-header.menu-open nav {
    display: block;
  }

  .primary-links {
    position: static;
    transform: none;
    display: block;
  }

  .nav-group {
    display: block;
  }

  .nav-group > a {
    display: block;
    padding: 13px 6px;
    border-bottom: 1px solid #e1e8ee;
  }

  .nav-group:is(:hover, :focus-within) > .nav-submenu {
    display: none;
  }

  .header-tools {
    margin-top: 17px;
    gap: 22px;
  }
}

@media (max-width: 680px) {
  :root { --header: 62px; }
  .home-wrap { width: calc(100% - 36px); }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .home-button { transition: none; }
}
