.top-contact,
.top-project {
  display: none;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.top-contact {
  gap: 10px;
  background: var(--primary);
  color: var(--paper);
}

.top-contact svg {
  width: 23px;
  height: 23px;
}

.top-project {
  background: var(--primary);
  color: var(--yellow);
}

/* Stays at the top of the screen while the page scrolls (below the menu
   overlay and the intro). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(4.25vw, 24px);
  background: var(--stage);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / 8%);
  transition: background-color 400ms ease, box-shadow 400ms ease;
}

/* A filament along the bottom edge glows on as the page is read
   (--scroll-progress, 0–1, set in header.js). */
.site-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, rgb(252 204 12 / 35%), var(--yellow));
  box-shadow: 0 0 10px rgb(252 204 12 / 70%);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left;
  pointer-events: none;
}

/* Off the top of the page the header turns to smoked glass over the content
   and the logo settles a little smaller; its height doesn't change, so
   nothing below it moves. */
.site-header.is-scrolled {
  background: rgb(24 27 26 / 90%);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / 6%), 0 14px 30px -18px rgb(0 0 0 / 70%);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.brand {
  display: inline-flex;
  width: clamp(120px, 15vw, 120px);
  /* height: clamp(44.6px, 5.73vw, 55.7px); */
  flex: 0 0 auto;
  transform-origin: left center;
  transition: scale 400ms var(--ease-out);
}

.site-header.is-scrolled .brand {
  scale: .86;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  margin-left: auto;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.45vw, 1.3rem);
  font-weight: 600;
  text-transform: uppercase;
}

/* Each link has an underline that sweeps in on hover and stays under the
   section being read (.is-active, from header.js) or the current page. */
.desktop-nav a {
  position: relative;
  padding-block: 6px;
  color: var(--paper);
  transition: color 180ms ease;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--yellow);
  box-shadow: 0 0 8px rgb(252 204 12 / 60%);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 450ms var(--ease-out);
}

.desktop-nav a:hover::after,
.desktop-nav a.is-active::after,
.desktop-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.desktop-nav a.is-active {
  color: var(--yellow);
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--yellow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.project-link {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: var(--yellow);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  transition: background-color 180ms ease, color 180ms ease;
}

.project-link:hover {
  background: var(--primary);
  color: var(--yellow);
}

.menu-toggle,
.menu-close {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.menu-toggle {
  /* display: none; */
  background: var(--primary);
  color: var(--paper);
}

.menu-toggle:hover {
  background: var(--yellow);
  color: var(--primary);
}

.menu-icon {
  width: 27px;
  height: 27px;
  overflow: visible;
}

.menu-icon line {
  transform-origin: center;
  transition: transform 300ms cubic-bezier(.5, .85, .25, 1.1);
}

.menu-toggle[aria-expanded="true"] .menu-icon line:first-child {
  transform: translateY(6px) rotate(45deg);
}

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

.menu-toggle[aria-expanded="true"] .menu-icon line:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1024px) {
  .top-contact,
  .top-project {
    display: flex;
  }

  .desktop-nav {
    display: none;
  }

  .project-link {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }
}

@media (max-width: 680px) {
  .top-contact,
  .top-project {
    min-height: 42px;
    font-size: 1.18rem;
  }

  .site-header {
    min-height: 82px;
    gap: 12px;
    padding: 5px 20px;
  }

  .brand {
    width: 120px;
  }

  .header-actions {
    gap: 12px;
  }

  .project-link {
    min-height: 48px;
    padding: 0 11px;
    font-size: 1.15rem;
  }

  .menu-toggle,
  .menu-close {
    width: 48px;
    height: 48px;
  }
}
