/* ─────────────────────────────────────────────────────────────
   STAGES · each section is its own full-screen, scrollable level.
   Section stylesheets must NOT set position/inset/overflow on the
   section itself, or scrolling inside the stage breaks.
   ───────────────────────────────────────────────────────────── */
main#stages { position: fixed; inset: 0; z-index: 1; }

main#stages > .stage-sec {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: none;
  scrollbar-width: thin; scrollbar-color: rgba(233,189,103,.5) transparent;
}
main#stages > .stage-sec.on { display: block; }
main#stages > .stage-sec::-webkit-scrollbar { width: 8px; }
main#stages > .stage-sec::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold), var(--magenta)); border-radius: 8px; }

/* content stages: clear the header at the top, leave room at the bottom */
main#stages > .stage-sec:not(.hero) {
  padding-top: calc(var(--header-h) + clamp(28px, 5vw, 64px) + env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
main#stages > .stage-sec.hero { overflow: hidden; }

/* "climb to the next stage" button at the foot of every stage */
.next-wrap { display: flex; justify-content: center; padding-block: 64px 72px; }
.next-stage { position: relative; cursor: pointer; border: 0; background: none; display: grid; justify-items: center; gap: 10px; color: var(--gold-soft); font: italic 800 .96rem/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; }
.next-stage small { font: italic 600 .72rem/1 var(--f-ui); letter-spacing: .28em; color: var(--mist); }
.next-stage .chev { width: 48px; height: 48px; border: 1.5px solid var(--gold); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(233,189,103,.08), 0 0 22px rgba(233,189,103,.3); animation: chev 1.8s ease-in-out infinite; }
.next-stage .chev svg { width: 18px; height: 18px; }
.next-stage.up .chev { transform: rotate(180deg); animation: none; }
.next-stage:hover .chev { background: rgba(233,189,103,.15); }
@keyframes chev { 50% { transform: translateY(6px); box-shadow: 0 0 0 10px rgba(233,189,103,.05), 0 0 30px rgba(233,189,103,.5); } }

/* the gauge that fills when you keep scrolling at the end of a stage */
#edgeHint { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 45; transform: translate(-50%, 20px); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  display: grid; justify-items: center; gap: 8px; padding: 12px 22px; background: rgba(17,9,38,.85); border: 1px solid var(--line); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  font: italic 800 .78rem/1 var(--f-ui); letter-spacing: .2em; color: var(--gold-soft); text-shadow: 0 2px 0 #1c0838; white-space: nowrap; }
#edgeHint.show { opacity: 1; transform: translate(-50%, 0); }
#edgeHint .bar { width: 200px; height: 5px; background: rgba(233,189,103,.2); overflow: hidden; clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
#edgeHint .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--magenta), var(--gold-soft)); box-shadow: 0 0 10px var(--gold); transition: width .12s; }
