/* Page content dissolves under the fixed navigation, not the navigation itself. */
@supports ((mask-image: linear-gradient(black, transparent)) or (-webkit-mask-image: linear-gradient(black, transparent))) {
  body.n-site .nx-header-fade-target {
    -webkit-mask-image: linear-gradient(to bottom, transparent var(--nx-hfade-start), #000 var(--nx-hfade-end));
    mask-image: linear-gradient(to bottom, transparent var(--nx-hfade-start), #000 var(--nx-hfade-end));
  }
  body.n-site .nx-header-fade-target:has(:focus-visible) { -webkit-mask-image: none; mask-image: none; }
}
@media (forced-colors: active) {
  body.n-site .nx-header-fade-target { -webkit-mask-image: none; mask-image: none; }
}

/* Blur remains behind the navigation and fades out with the content. */
.nx-header-fade-blur { position: fixed; inset: 0 0 auto; height: var(--nx-blur-height, 140px); z-index: 50; pointer-events: none; opacity: 0; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); -webkit-mask-image: linear-gradient(to bottom,#000 var(--nx-blur-solid, 60px),transparent 100%); mask-image: linear-gradient(to bottom,#000 var(--nx-blur-solid, 60px),transparent 100%); }
@media (forced-colors: active) { .nx-header-fade-blur { display: none } }


/* The decorative backdrop must stay crisp: blur only content entering the fade. */
.nx-header-fade-blur { -webkit-backdrop-filter:none; backdrop-filter:none; }
body.n-site .nx-hfade-blur-text { filter:blur(var(--nx-hfade-text-blur, 0px)); }
@media (forced-colors:active) { body.n-site .nx-hfade-blur-text { filter:none; } }

/* Keep keyboard-focused controls legible while their section crosses the header. */
body.n-site .nx-hfade-blur-text:focus-visible, body.n-site .nx-hfade-blur-text:has(:focus-visible) { filter:none; }

/* Masks clip transformed descendants; suspend only while NGIN cards are expanded. */
body.n-site .nx-header-fade-target:has(.ng-motion-card:hover),
body.n-site .nx-header-fade-target:has(.ng-motion-card:focus-within) { -webkit-mask-image:none; mask-image:none; }
@media(max-width:760px) {
 html[data-theme] body.n-site.nx-ngin-v21 header.nav .nx-section-dock {
  padding:5px!important; height:auto!important; min-height:0!important; max-width:calc(100vw - 24px); box-sizing:border-box;
 }
 html[data-theme] body.n-site.nx-ngin-v21 header.nav .nx-section-dock a {
  min-height:40px; padding:6px 10px; box-sizing:border-box; white-space:nowrap;
 }
}

/* Blur only the local content, inside its own mask/backdrop root. */
body.n-site .nx-hfade-positioned { position:relative; top:auto!important; left:auto!important; right:auto!important; bottom:auto!important; }
body.n-site .nx-local-blur { position:absolute; left:0; right:0; z-index:20; pointer-events:none; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 25%,transparent 100%); mask-image:linear-gradient(to bottom,#000 0%,#000 25%,transparent 100%); }
body.n-site .nx-header-fade-target:has(.ng-motion-card:hover),body.n-site .nx-header-fade-target:has(.ng-motion-card:focus-within),body.n-site .nx-header-fade-target:has(:focus-visible) { opacity:.9999; }
@media(forced-colors:active){body.n-site .nx-local-blur { display:none }}

/* Atlas: inline badge and tight name spacing, matching the shared plugin hero hierarchy. */
body.n-site main.atlas-page { padding-top:24px!important; }
body.n-site .atlas-hero-card h1 { font-size:clamp(32px,3.4vw,44px); line-height:1.2; margin-top:8px!important; }
body.n-site .atlas-hero-card .atlas-tagline { font-size:22px; margin-top:14px!important; }
@media(max-width:760px){
  body.n-site main.atlas-page { padding-top:18px!important; }
  body.n-site .atlas-hero-card h1 { font-size:32px; }
  body.n-site .atlas-hero-card .atlas-tagline { font-size:20px; }
}

/* Compact chapter nav on small screens so the links read as links, not buttons. */
@media (max-width:850px) {
  #main.atlas-grid .atlas-section-nav { height:auto !important; padding:5px !important; }
  #main.atlas-grid .atlas-section-nav a { min-height:0 !important; height:auto !important; line-height:1.6 !important; padding:6px 10px !important; }
}
