/* HEADER
   One header, fixed to the viewport for the whole page - never contained by
   a section, so it's always exactly one element with no handoff/seam
   between sections. Its theme (background + text color) and active
   nav-link are driven by initNavHighlighting() in main.js, which watches
   each [data-nav] section via IntersectionObserver and swaps the modifier
   classes below (.site-header--dark / .site-header--muted) plus toggles
   .active on the matching nav-link as the user scrolls. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: var(--header-h);
  background: var(--white);
  padding: 0 var(--section-pad-x);
}
/* Default (no modifier) = light theme, used over white sections
   (Technologies, Applications, Contact). */
.site-header:not(.site-header--dark) .nav-link {
  color: var(--black);
}
.site-header:not(.site-header--dark) .nav-link.active {
  color: var(--orange-active);
}
.site-header:not(.site-header--dark) .menu-toggle-icon {
  color: var(--black);
}
/* --muted = light-grey bg for the --bg-light sections (Core Technologies,
   Leadership); text colors stay the same as the default light theme. */
.site-header--muted {
  background: var(--bg-light);
}
/* --dark = the hero look: transparent bg, dim/light nav text (brightens to
   white on hover, see below). */
.site-header--dark {
  background: var(--black);
}
.header-inner {
  max-width: 1920px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img {
  height: 19px;
  width: auto;
  transition: filter 0.35s ease;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}
.mobile-nav {
  display: none;
}
.nav-link {
  position: relative;
  display: inline-block;
  color: var(--nav-inactive);
  font-size: var(--fs-small);
  font-weight: 400;
  padding: 6px 2px;
  border-bottom: 3px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    font-size 0.2s ease;
}
/* Invisible ghost at the largest/boldest size this link can hit (active or
   hover) so the box is pre-sized for it - growing/bolding on hover never
   reflows neighboring nav items. */
.nav-link[data-label]::before {
  content: attr(data-label);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
  font-size: var(--fs-body);
}
.nav-link.active {
  color: var(--orange-active);
  font-weight: 700;
  font-size: var(--fs-body);
}
.site-header--dark .nav-link:not(.active):not(.nav-link--logo):hover {
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-body);
}
.site-header:not(.site-header--dark)
  .nav-link:not(.active):not(.nav-link--logo):hover {
  color: var(--black);
  font-weight: 700;
  font-size: var(--fs-body);
}
@media (max-width: 1100px) {
  body.nav-open .mobile-nav .nav-link:not(.active):not(.nav-link--logo):hover {
    color: var(--black);
    font-weight: 600;
  }
}
.nav-link--external {
  color: var(--nav-dim);
}
.nav-link--logo {
  display: flex;
  align-items: center;
  padding: 4px 0;
}
.nav-link--logo img {
  height: 1.3125rem;
  width: auto;
}

.menu-toggle {
  display: none;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--white);
}
.menu-toggle-icon {
  width: 24px;
  height: 24px;
}

@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 55%);
    background: var(--white);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: calc(var(--header-h) + 24px) 32px 32px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 102;
  }
  .mobile-nav.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-nav .nav-link:not(.active) {
    color: var(--black);
    font-weight: 500;
  }
  .mobile-nav a {
    width: 100%;
    padding: 14px 0;
    border-bottom: none;
  }
  .mobile-nav .nav-link--logo {
    margin-top: auto;
    padding-top: 40px;
  }
  .menu-toggle {
    display: flex;
    position: relative;
    z-index: 103;
  }
  .menu-toggle-icon {
    transition: opacity 0.25s ease;
  }
  .menu-toggle.open .menu-toggle-icon {
    opacity: 0;
  }
  .menu-toggle::before,
  .menu-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 2px;
    background: var(--black);
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .menu-toggle::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }
  .menu-toggle::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
  .menu-toggle.open::before,
  .menu-toggle.open::after {
    opacity: 1;
  }
  body.nav-open main,
  body.nav-open .site-footer {
    pointer-events: none;
  }
  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
  }
  body.nav-open .site-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
  }
}
