/* Keep navigation available without removing the header from document flow. */
html {
  --site-header-height: 93px;
  scroll-padding-top: calc(var(--site-header-height) + 24px);
}
.mountain-site .site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: block;
  width: 100%;
  padding: 0;
  background: #142a24;
  border-bottom: 1px solid #52625880;
  box-shadow: 0 5px 18px #07141026;
}
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
}
.site-header .brand-lockup {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}
/* Preserve the selected mountain silhouette in the wordmark's ivory color. */
.brand-symbol {
  display: block;
  flex: 0 0 60px;
  width: 60px;
  height: 52px;
  background: currentColor;
  -webkit-mask: url('brand-shared-ascent.png') center / 60px 60px no-repeat;
  mask: url('brand-shared-ascent.png') center / 60px 60px no-repeat;
  mask-mode: alpha;
}
.site-header .primary-nav { flex-wrap: wrap; max-width: 100%; }
.mountain-site .reading-progress { top: var(--site-header-height); z-index: 51; }
@media (max-width: 1100px) {
  html { --site-header-height: 88px; }
  .site-header .brand-lockup { gap: 10px; }
  .brand-symbol { flex-basis: 50px; width: 50px; height: 47px; -webkit-mask-size: 50px 50px; mask-size: 50px 50px; }
}
@media (max-width: 800px) {
  html { --site-header-height: 160px; }
  html.js { --site-header-height: 92px; }
  .site-header-inner { flex-wrap: wrap; gap: 12px 20px; }
  /* Without scripts, every link remains available in a compact scrolling row. */
  .site-header .primary-nav {
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    padding-block: 6px;
    scrollbar-width: thin;
  }
  .js .site-header .primary-nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    padding: 18px 6% max(22px, env(safe-area-inset-bottom));
    max-height: calc(100vh - var(--site-header-height) - 12px);
    max-height: calc(100dvh - var(--site-header-height) - 12px);
    overflow: auto;
    background: #142a24;
    border-bottom: 1px solid #829488;
    box-shadow: 0 12px 20px #07141040;
  }
  .js .site-header .primary-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
  }
  .site-header .primary-nav a { min-height: 44px; display: flex; align-items: center; }
  .js .site-header .primary-nav a { white-space: normal; }
  .site-header .primary-nav .nav-invite { justify-content: center; }
}
@media (max-width: 370px) {
  .site-header-inner { column-gap: 12px; }
  .site-header .brand-lockup { gap: 8px; }
  .site-header .wordmark { font-size: 28px; }
  .brand-symbol { flex-basis: 40px; width: 40px; -webkit-mask-size: 40px 40px; mask-size: 40px 40px; }
  .site-header .menu-toggle { padding-inline: 10px; font-size: 14px; }
}

/* Hold the opening landscape below the header, with the same scroll interval. */
@media (prefers-reduced-motion: no-preference) {
  .mountain-site[data-motion="full"] .hero-scene {
    top: var(--site-header-height);
    height: calc(100vh - var(--site-header-height));
    height: calc(100lvh - var(--site-header-height));
  }
  .mountain-site[data-motion="full"] .hero-inner {
    min-height: calc(100vh - var(--site-header-height));
    min-height: calc(100svh - var(--site-header-height));
  }
  .mountain-site[data-motion="full"] .hero-foreground {
    min-height: calc(142vh - var(--site-header-height));
    min-height: calc(100lvh + 42svh - var(--site-header-height));
  }
  @media (max-width: 800px) {
    .mountain-site[data-motion="full"] .hero-foreground {
      min-height: calc(135vh - var(--site-header-height));
      min-height: calc(100lvh + 35svh - var(--site-header-height));
    }
  }
}
@media print {
  html { scroll-padding-top: 0; }
  .mountain-site .site-header { display: none !important; }
}
