:root{
  --header-height:84px;
  --header-blur:14px;
  --header-surface-opacity:.12;
  --header-saturation:120%;
  --header-shadow:none;
  --stage-gap:24px;
  --stage-fade-size:12px;
  --stage-top:calc(var(--header-height) + var(--stage-gap));
}

.content-stage{
  position:relative;
  z-index:1;
  min-height:100%;
  overflow:visible;
}

.content-stage main{
  position:relative;
  z-index:1;
}

.header-glass{
  --header-surface:244 240 232;
  position:fixed;
  z-index:62;
  inset:0 0 auto;
  height:var(--header-height);
  pointer-events:none;
  background:rgb(var(--header-surface)/var(--header-surface-opacity));
  box-shadow:none;
  border:0;
  -webkit-backdrop-filter:blur(var(--header-blur)) saturate(var(--header-saturation));
  backdrop-filter:blur(var(--header-blur)) saturate(var(--header-saturation));
  transition:background-color .24s var(--ease),opacity .18s var(--ease);
}

.header-glass[data-theme="dark"]{--header-surface:17 24 39;--header-surface-opacity:.14}

.stage-fade{
  --stage-surface:244 240 232;
  position:fixed;
  z-index:61;
  inset:calc(var(--stage-top) - var(--stage-fade-size)) 0 auto;
  height:var(--stage-fade-size);
  pointer-events:none;
  background:linear-gradient(to top,transparent 0%,rgb(var(--stage-surface)/.025) 55%,rgb(var(--stage-surface)/.07) 100%);
  box-shadow:none;
  filter:none;
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
  transition:background-color .24s var(--ease),opacity .18s var(--ease);
}

.stage-fade[data-theme="dark"]{--stage-surface:17 24 39}

.content-stage-mode .top-blur{
  opacity:0;
  visibility:hidden;
}

.content-stage-mode [data-stage-clip]{
  clip-path:inset(var(--stage-clip-top,0px) 0 0 0);
}

.content-stage-mode.menu-open .stage-fade,
.content-stage-mode.menu-open .header-glass{opacity:0}

@media(max-width:760px){
  :root{
    --header-height:calc(72px + env(safe-area-inset-top));
    --stage-gap:18px;
    --stage-fade-size:10px;
  }
}

@media(prefers-reduced-motion:reduce){
  .stage-fade,.header-glass{transition:none}
}
