/* Phone layout: one document scroller with native snap-aligned story pages. */
html.mobile-stack {
  --stack-screen:100lvh;
  --stack-safe:100svh;
  --stack-page:var(--stack-safe);
  --stack-safe-mid:50svh;
  --stack-underlay:max(0px,calc(var(--stack-screen) - var(--stack-safe)));
  --stack-inline:calc(20px + env(safe-area-inset-left));
  --stack-inline-end:calc(20px + env(safe-area-inset-right));
  --stack-copy-bottom:max(68px,env(safe-area-inset-bottom));
  min-height:100%;
  overflow-x:hidden;
  overflow-y:auto;
  scroll-snap-type:y mandatory;
}

.mobile-stack body {
  min-height:100%;
  overflow-x:clip;
  overflow-y:visible;
  scroll-snap-type:y mandatory;
}

.mobile-stack .journey,
.mobile-stack .stage {
  height:auto;
}

.mobile-stack .stage {
  position:relative;
  top:auto;
  overflow:visible;
  isolation:auto;
}

.mobile-stack .stage::after,
.mobile-stack .motion-field,
.mobile-stack .grain,
.mobile-stack .story-snaps,
.mobile-stack .final-anchor,
.mobile-stack .scroll-cue { display:none; }

.mobile-stack .scene {
  position:relative;
  z-index:auto;
  inset:auto;
  display:block;
  width:100%;
  height:var(--stack-page);
  min-height:0;
  overflow:visible;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto;
  mask-image:none!important;
  -webkit-mask-image:none!important;
  scroll-snap-align:start;
  scroll-snap-stop:always;
  will-change:auto;
}

.mobile-stack .scene.is-stack-active { z-index:5; }

.mobile-stack .plate-rig {
  z-index:0;
  inset:0;
  bottom:calc(0px - var(--stack-underlay));
  transform:none!important;
  will-change:auto;
}

.mobile-stack .plate-rig img { object-position:center; }

.mobile-stack .scene-shade {
  z-index:1;
  bottom:calc(0px - var(--stack-underlay));
  background:linear-gradient(0deg,#050505 0,rgba(5,5,5,.9) 16%,rgba(5,5,5,.68) 36%,rgba(5,5,5,.2) 60%,transparent 77%),linear-gradient(180deg,rgba(5,5,5,.3),transparent 20%);
}

.mobile-stack .scene-copy--welcome,
.mobile-stack .scene-copy--speed,
.mobile-stack .scene-copy--intelligence,
.mobile-stack .scene-copy--malleable {
  position:absolute;
  z-index:2;
  top:auto;
  right:0;
  bottom:var(--stack-copy-bottom);
  left:0;
  width:100%;
  padding:96px var(--stack-inline-end) 0 var(--stack-inline);
  opacity:1!important;
  text-shadow:0 3px 24px rgba(0,0,0,.92);
  transform:none!important;
  will-change:auto;
}

.mobile-stack .scene-copy h1,
.mobile-stack .scene-copy h2 { max-width:20ch; font-size:clamp(16px,4.2vw,18px); }
.mobile-stack .scene-copy .essay-folio { gap:14px; font-size:11px; }
.mobile-stack .scene-copy .essay-folio--intro { font-size:16px; }
.mobile-stack .scene-copy .essay-folio span { font-size:11px; }
.mobile-stack .scene-copy>p.essay-copy { max-width:none; font-size:clamp(12px,3.35vw,13px); line-height:1.48; letter-spacing:-.035em; }
.mobile-stack .scene-copy>p.essay-copy--opening { margin-top:18px; }
.mobile-stack .scene-copy>p.essay-copy--body { margin-top:1.35em; }
.mobile-stack .course-menu { display:none; }

.mobile-stack .welcome-greeting {
  z-index:2;
  top:30%;
  right:calc(28px + env(safe-area-inset-right));
  color:rgba(238,232,220,.62);
  font-size:10px;
  letter-spacing:.24em;
}

.mobile-stack .headlight-bloom { display:none; }

.mobile-stack .scene--final {
  display:block;
  height:var(--stack-page);
  padding:0;
}

.mobile-stack .final-field {
  inset:calc(68px + env(safe-area-inset-top)) var(--stack-inline-end) var(--stack-copy-bottom) var(--stack-inline);
  opacity:.34;
  transform:none;
}

.mobile-stack .final-lockup {
  position:absolute;
  top:var(--stack-safe-mid);
  left:50%;
  width:calc(100% - var(--stack-inline) - var(--stack-inline-end));
  opacity:1;
  transform:translate(-50%,-50%);
}

.mobile-stack .story-nav {
  opacity:var(--stack-nav-opacity,0);
  transform:none;
  transition:opacity .2s ease;
}

.mobile-stack .watch,
.mobile-stack .site-footer {
  scroll-snap-align:start;
  scroll-snap-stop:always;
}

@supports not (height:100svh) {
  html.mobile-stack {
    --stack-screen:100vh;
    --stack-safe:100vh;
    --stack-page:var(--stack-safe);
    --stack-safe-mid:50vh;
  }
}

@media (prefers-reduced-motion:reduce) {
  .mobile-stack { scroll-behavior:auto; }
}
