/* Choose one presentation before the async controllers or WebGL are ready.
   Original HTML supplies the reader and wall labels; it is never a loading
   screen over the cave. A requested chapter dialog may opt into visibility. */
html[data-site-view="journey"] #content,
html[data-site-view="journey"] #content > *,
html[data-site-view="journey"] .journey-chapter,
html[data-site-view="journey"] body > .footer {
  visibility: hidden !important;
  pointer-events: none !important;
}
html[data-site-view="journey"],
html[data-site-view="journey"] body {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Shared, deliberately small switch between two presentations of one page. */
body .experience-switch {
  position: fixed;
  inset: auto auto max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  z-index: 75;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 1px solid #d6c5a969;
  border-radius: 50%;
  background: #111c27ed;
  color: #f5e8d2;
  box-shadow: 0 6px 25px #0005, inset 0 1px #ffffff0d;
  font: 500 13px/1.4 'Onest', Arial, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body .experience-switch > svg {
  display: block;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body .experience-switch:focus-visible { outline: 3px solid #edcc91; outline-offset: 5px; }
body .experience-switch-label {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: min(250px, calc(100vw - 40px));
  padding: 9px 13px;
  border: 1px solid #d6c5a940;
  border-radius: 9px;
  background: #111c27;
  color: #f5e8d2;
  white-space: normal;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.experience-switch:focus-visible .experience-switch-label { opacity: 1; visibility: visible; }
@media (hover: hover) {
  body .experience-switch:hover { border-color: #edcc91; background: #233140; }
  .experience-switch:hover .experience-switch-label { opacity: 1; visibility: visible; }
}
.journey-page .journey-hud {
  left: calc(max(20px, env(safe-area-inset-left)) + 76px);
  bottom: max(22px, env(safe-area-inset-bottom));
}
body.reading-page .experience-switch {
  background: var(--surface);
  color: var(--action-bg);
  border-color: var(--hud-edge);
}
body.reading-page .experience-switch:hover { background: var(--surface-soft); border-color: var(--action-bg); }
body.reading-page .experience-switch:focus-visible { outline-color: var(--action-bg); }
body.reading-page .experience-switch-label { background: var(--surface); color: var(--text); border-color: var(--hud-edge); }
@media (max-width: 760px) {
  .journey-page .journey-hud {
    left: max(24px, env(safe-area-inset-left));
    bottom: calc(max(20px, env(safe-area-inset-bottom)) + 72px);
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .journey-page .journey-hud {
    left: calc(max(20px, env(safe-area-inset-left)) + 76px);
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}
@media print { body .experience-switch { display: none !important; } }

/* The reading switch belongs with navigation; leave the bottom for movement. */
body.journey-page .hero-controls > .experience-switch,
body.journey-page .hero-controls > .journey-reading-slot {
  position: relative;
  inset: auto;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
}
body.journey-page .hero-controls > .experience-switch > svg { width: 25px; height: 25px; }
body.journey-page .hero-controls .experience-switch-label {
  left: auto;
  right: 0;
  top: calc(100% + 12px);
  bottom: auto;
}
html[data-site-view="journey"] .autumn-leaves-toggle,
html[data-site-view="journey"] .autumn-offer,
html[data-site-view="journey"] .autumn-leaves-backdrop { display: none !important; }
