/* Camera coordinates and transforms are supplied by camera.mjs. */
body.spatial-layout.motion-ready:not(.motion-off) {
  overflow-x: clip;
}

body.spatial-layout.motion-ready:not(.motion-off) .spatial-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 2;
  pointer-events: auto;
}

body.spatial-layout.motion-ready:not(.motion-off) #story.spatial-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100svh;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: auto;
}

body.spatial-layout.motion-ready:not(.motion-off) .spatial-world > .chapter,
body.spatial-layout.motion-ready:not(.motion-off) .spatial-world > .closing {
  position: absolute;
  width: 100vw;
  pointer-events: auto;
}

body.spatial-layout.motion-ready:not(.motion-off) .spatial-world > .chapter {
  height: 100svh;
}

body.spatial-layout.motion-ready:not(.motion-off) .chapter > .stage {
  position: relative;
  top: auto;
  height: 100svh;
  min-height: 0;
}

body.spatial-layout.motion-ready:not(.motion-off) .spatial-world > .closing {
  height: auto;
}

body.spatial-layout.motion-ready:not(.motion-off) .spatial-scroll {
  width: 1px;
  height: 100svh;
  visibility: hidden;
  pointer-events: none;
}

/* Static flow preserves the existing long closing section and stage fallbacks. */
body.spatial-layout:is(.motion-off,:not(.motion-ready)) .spatial-viewport {
  position: relative;
  inset: auto;
  overflow: visible;
  pointer-events: auto;
}

body.spatial-layout:is(.motion-off,:not(.motion-ready)) #story.spatial-world {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  will-change: auto;
}

body.spatial-layout:is(.motion-off,:not(.motion-ready)) .spatial-world > .chapter,
body.spatial-layout:is(.motion-off,:not(.motion-ready)) .spatial-world > .closing {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: 100%;
  height: auto;
}

body.spatial-layout:is(.motion-off,:not(.motion-ready)) .chapter > .stage {
  position: relative;
  top: auto;
  height: 100svh;
}

body.spatial-layout:is(.motion-off,:not(.motion-ready)) .spatial-scroll {
  display: none;
}

