/* Scope the fixed header-nav styles to the site header only. `.footer-nav`
   (Footer.astro) is also a <nav>, so a bare `nav {}` selector would pin the
   footer's links + its border-top line to the top-left of every page. */
nav:not(.footer-nav) {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: flex;
  width: 100%;
  padding: 2rem;
  mix-blend-mode: difference;
}

.nav-logo,
.nav-icon,
.nav-toggler {
  flex: 1;
}

.nav-logo a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  padding: 0.5rem;
  font-family: var(--f-h);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--l);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.nav-icon svg {
  width: auto;
  height: 1.75rem;
  color: var(--l);
}

.nav-toggler {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 0.5rem;
  cursor: pointer;
  /* button reset (was a <div>) */
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
}

.nav-toggler:focus-visible {
  outline: 2px solid var(--l);
  outline-offset: 4px;
}

.nav-toggle-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 1.4rem;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  cursor: pointer;
}

.open-label,
.close-label {
  position: relative;
  margin: 0;
  padding: 0.1rem;
  font-family: var(--f-nm);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.125;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--l);
  user-select: none;
  cursor: pointer;
  transform: translateY(0);
  will-change: transform;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background-color: var(--d);
  color: var(--l);
  clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
  -webkit-clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
  will-change: clip-path;
}

.menu-overlay .menu-content {
  position: absolute;
  top: 35%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  padding: 0 2.5rem;
  transform: translateY(-50%);
  will-change: transform, opacity;
}

.menu-overlay .menu-content p,
.menu-overlay .menu-content a {
  display: inline-block;
  font-family: var(--f-nm);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.125;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--l);
}

.menu-overlay .menu-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.menu-overlay .menu-col:nth-child(2) {
  text-align: right;
}

.menu-overlay .menu-col a,
.menu-overlay .menu-col p {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.menu-overlay .split-line {
  position: relative;
  display: block;
  overflow: hidden;
  will-change: transform;
}

.menu-overlay .split-line-mask {
  display: block;
  overflow: hidden;
}

.menu-overlay .menu-img {
  position: absolute;
  top: 35%;
  left: 50%;
  width: 150px;
  aspect-ratio: 5/7;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.menu-overlay .menu-img img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  transform: translateY(0);
  will-change: transform;
}

.menu-overlay .menu-links-wrapper {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: max-content;
  padding: 2rem;
  will-change: transform;
}

.menu-overlay .menu-link {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  will-change: transform;
}

.menu-overlay .menu-link a {
  position: relative;
  display: inline-block;
  overflow: hidden;
  font-family: var(--f-h);
  font-size: 20rem;
  font-weight: 900;
  line-height: 0.85;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--l);
}

.menu-overlay .menu-link a span:nth-child(2) {
  position: absolute;
  top: 0;
  left: 0;
}

.menu-overlay .link-highlighter {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 400px;
  height: 0.75rem;
  background-color: var(--l);
  will-change: transform, width;
}

.menu-overlay .char {
  position: relative;
  display: inline-block;
  will-change: transform;
}

@media (max-width: 1000px) {
  nav:not(.footer-nav) {
    padding: 1.5rem;
  }

  .nav-logo a {
    font-size: 2rem;
  }

  .nav-icon {
    display: none;
  }

  .nav-toggler {
    transform: translateY(0.1rem);
  }

  .menu-overlay .menu-content {
    display: none;
  }

  .menu-overlay .menu-img,
  .menu-overlay .link-highlighter {
    display: none;
  }

  .menu-overlay .menu-links-wrapper {
    flex-direction: column;
    gap: 0;
    padding: 2rem;
  }

  .menu-overlay .menu-link a {
    font-size: 7rem;
  }
}
