html {
  scroll-padding-top: var(--sticky-header-height, 108px);
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--sticky-header-height, auto);
  pointer-events: none;
}

.sticky-header > .header,
.sticky-header > .mobile-nav {
  background: white;
  pointer-events: auto;
}

.sticky-header > .mobile-nav {
  max-height: max(0px, calc(100dvh - var(--sticky-header-height, 108px)));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sticky-header:not(.is-measuring) > .header {
  box-sizing: border-box;
  height: var(--sticky-header-height);
  min-height: 0;
  transition: height 200ms ease, padding-block 200ms ease;
}

.sticky-header:not(.is-measuring) .logo {
  transition: width 200ms ease;
}

.sticky-header.is-scrolled:not(.is-measuring):where(:not(:has(:focus-visible, .menu-button[aria-expanded="true"]))) > .header {
  height: 64px;
  padding-block: 0;
  box-shadow: 0 2px 12px rgb(35 41 68 / 12%);
}

.sticky-header.is-scrolled:not(.is-measuring):where(:not(:has(:focus-visible, .menu-button[aria-expanded="true"]))) .logo {
  width: 152px;
  height: auto;
}

@media (hover: hover) {
  .sticky-header.is-scrolled:not(.is-measuring):hover > .header {
    height: var(--sticky-header-height);
    padding-block: var(--sticky-header-padding-start) var(--sticky-header-padding-end);
    box-shadow: none;
  }

  .sticky-header.is-scrolled:not(.is-measuring):hover .logo {
    width: var(--sticky-header-logo-width);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-header:not(.is-measuring) > .header,
  .sticky-header:not(.is-measuring) .logo {
    transition: none;
  }
}

/* Align the proof's navigation, page sections and footer on wide displays. */
@media (min-width: 1440px) {
  html:root { --gutter: 85px; }
  html body { max-width: 1440px; margin-inline: auto; }
}

/* Paint the wide-screen margins with each section's existing background. */
@media (min-width: 1441px) {
  #main :is(.page-hero, .results-hero, .insights-hero, .glossary-hero,
    .contact-hero, .about-purpose, .bank, .testimonial, .closing) {
    --section-wing: var(--denim);
  }

  #main :is(.help-hero, .manifesto-hero) { --section-wing: var(--linen); }
  #main .ceo-hero { --section-wing: white; }
  #main .approach-hero { --section-wing: #edf1fa; }
  #main #vip { --section-wing: #f4eee4; }
  #main :is(.next-grid, .results-next) { --section-wing: #e7f3f6; }
  #main .manifesto-invitation { --section-wing: var(--raspberry); }
  #main .media-section { --section-wing: #f4f6f8; }
  #main .coaching-results { --section-wing: #f3f4f7; }

  #main :is(.service:nth-of-type(even), .page-faq, .faq-intro,
    .manifesto-next, .client-organizations, .contact-scheduling) {
    --section-wing: #f5f4f0;
  }

  .faq-page #main .page-faq:nth-of-type(even) { --section-wing: white; }
  #main :is(.blog-hero, .blog-cta) { --section-wing: var(--blog-ink); }
  #main :is(.blog-feature, .blog-article-hero) { --section-wing: var(--blog-wash); }
  #main .glossary-index { --section-wing: #f1f5fa; }
  #main .insights-videos { --section-wing: var(--insights-wash); }
  #main .promo :is(.sheet-hero, .banner) { --section-wing: var(--d); }
  #main .promo .results-band { --section-wing: var(--l); }
  #main .promo .about-sheet { --section-wing: #f4efe6; }

  body[class] #main :is(.page-hero, .results-hero, .insights-hero, .glossary-hero,
    .contact-hero, .about-purpose, .bank, .testimonial, .closing, #vip, .next-grid,
    .results-next, .manifesto-hero, .manifesto-invitation, .media-section,
    .coaching-results, .service:nth-of-type(even), .page-faq, .faq-intro,
    .manifesto-next, .client-organizations, .contact-scheduling, .blog-hero,
    .blog-cta, .blog-feature, .blog-article-hero, .glossary-index, .insights-videos),
  #main .promo :is(.sheet-hero, .banner, .results-band, .about-sheet) {
    box-shadow: 0 0 0 100vmax var(--section-wing);
    clip-path: inset(0 -100vmax);
  }
}
