/* Shared site header/navigation component.
   Included on every page via <link rel="stylesheet" href="./nav.css">.
   Markup is injected by nav.js into <header id="site-header"></header>.
   All sizes are in rem so they scale fluidly with the root font-size. */

header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 2.2222rem;
  row-gap: 0.4444rem;
  padding: 2.2222rem;
  align-items: start;
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  /* Always black text, regardless of the footer-triggered dark-mode body
     toggle — nav links below use color: inherit, so setting it here
     (rather than leaving it to inherit from body) keeps them legible
     against the white blur fill below either way. */
  color: #000000;
}

/* Progressive-blur white fill: a decorative layer behind the header's own
   content (z-index: -1 within header's stacking context, so the logo/links
   stay perfectly crisp) rather than blurring the header itself. The
   background gradient is solid white at the true top edge fading to
   transparent by the header's bottom edge; the mask gradient keeps the
   backdrop-blur at full strength for the top half and fades it out over
   the bottom half — together they taper into whatever scrolls underneath
   instead of cutting off with a hard edge. */
header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to top, transparent, #ffffff);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, #000000 50%, transparent);
  mask-image: linear-gradient(to bottom, #000000 50%, transparent);
}

.nav-wrap { display: contents; }

.menu-toggle {
  display: none;
  grid-column: 2;
  justify-self: end;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: inherit;
  padding: 0.2222rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity .2s, color .4s ease;
}
.menu-toggle svg { display: block; width: 1.5556rem; height: 1.5556rem; }

.logo {
  grid-column: 1;
  grid-row: 1;
  font-size: 1.3333rem;
  font-weight: 400;
  letter-spacing: 0.0278rem;
  text-decoration: none;
  color: inherit;
  opacity: 1;
  transition: opacity .2s, color .4s ease;
  cursor: pointer;
}
nav { display: contents; }
nav a {
  font-size: 1.3333rem;
  font-weight: 400;
  letter-spacing: 0.0278rem;
  text-decoration: none;
  color: inherit;
  opacity: 1;
  transition: opacity .2s, color .4s ease;
  cursor: pointer;
  text-transform: capitalize;
  display: flex;
  align-items: center;
}
nav a:nth-child(1) { grid-column: 2; grid-row: 1; }
nav a:nth-child(2) { grid-column: 3; grid-row: 1; }
nav a:nth-child(3) { grid-column: 2; grid-row: 2; }
nav a::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 1.3333rem;
  opacity: 0;
  overflow: hidden;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px'%3E%3Cpath d='M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px'%3E%3Cpath d='M647-440H160v-80h487L423-744l57-56 320 320-320 320-57-56 224-224Z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 1.3333rem 1.3333rem;
  mask-size: 1.3333rem 1.3333rem;
  -webkit-mask-position: center;
  mask-position: center;
  transition: width .3s ease, opacity .3s ease, margin-right .3s ease;
}
nav a.active { opacity: 1; }
nav a.active::before { width: 1.3333rem; opacity: 1; margin-right: 0.4444rem; }

.nav-cta {
  grid-column: 4;
  grid-row: 1;
  font-size: 1.3333rem;
  font-weight: 400;
  letter-spacing: 0.0278rem;
  text-decoration: none;
  color: inherit;
  opacity: 1;
  transition: opacity .2s, color .4s ease;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.external-link::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 1.3333rem;
  margin-right: 0;
  opacity: 0;
  overflow: hidden;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px'%3E%3Cpath d='m216-160-56-56 464-464H360v-80h400v400h-80v-264L216-160Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px'%3E%3Cpath d='m216-160-56-56 464-464H360v-80h400v400h-80v-264L216-160Z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 1.3333rem 1.3333rem;
  mask-size: 1.3333rem 1.3333rem;
  -webkit-mask-position: center;
  mask-position: center;
  vertical-align: middle;
  transition: width .3s ease, opacity .3s ease, margin-right .3s ease;
}
/* Hover-only interactions — gated behind (hover: hover) so tapping a link
   on touch devices never leaves an arrow/opacity state "stuck" until the
   next unrelated tap (touch has no real hover, but :hover still activates
   on tap in most mobile browsers). */
@media (hover: hover) and (min-width: 901px) {
  .menu-toggle:hover { opacity: 1; }
  .logo:hover { opacity: 1; }
  nav a:hover { opacity: 1; }
  nav a:hover::before { width: 1.3333rem; opacity: 1; margin-right: 0.4444rem; }
  .nav-cta:hover { opacity: 1; }
  .external-link:hover::before {
    width: 1.3333rem;
    opacity: 1;
    margin-right: 0.4444rem;
  }
}

@media (max-width: 1400px) {
  header { grid-template-columns: repeat(3, 1fr); }
  .nav-cta { grid-column: 3; }
  nav a:nth-child(2) { grid-column: 2; grid-row: 2; }
  nav a:nth-child(3) { grid-column: 2; grid-row: 3; }
}

@media (max-width: 900px) {
  header { padding: 1.3333rem; grid-template-columns: repeat(2, 1fr); align-items: center; }

  .nav-wrap { display: none; }
  .nav-wrap.open {
    display: flex;
    flex-direction: column;
    gap: 1.3333rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1.3333rem;
    border-top: 1px solid rgba(10,10,10,0.1);
    z-index: 50;
  }
  .nav-wrap.open .nav-cta { grid-column: auto; justify-content: flex-start; }
  .menu-toggle { display: flex; grid-column: 2; }
}
