/* Phase 1.5: a camera traveling past persistent DOM objects.
   The Phase 1 material vocabulary is retained in stage.css. */
:root { --camera-distance: 1800px; }
#story { overflow-x: clip; overflow-y: visible; }
html:has(body.quiet) { scroll-behavior: auto; }
.scene { perspective: var(--camera-distance); perspective-origin: 50% 55%; }
.scene + .scene { margin-top: -6svh; }
.scene .pin {
  overflow: visible;
  transform-origin: 50% 55%;
  transform: translate3d(var(--world-x,0px),var(--world-y,0px),var(--world-z,0px)) rotateY(var(--world-yaw,0deg));
  background: linear-gradient(to bottom,transparent,var(--bg) 65px,var(--bg) calc(100% - 60px),transparent);
}
.scene-heading,.hh-title,.pack-copy { opacity: calc(.25 + var(--arrival,1)*.75); }
.stage-header,.story-hud { z-index: 35; }
.grain { opacity: .045; }
.opening-copy { top: 24%; max-width: 590px; }
.opening h1 { font-size: clamp(42px,4.3vw,62px); line-height: 1.04; letter-spacing: -.045em; margin-top: 22px; }
.opening-context { font-size: 16px; line-height: 1.6; max-width: 38ch; margin-top: 25px; color: #bfc8c2; }
.opening-promise { font-size: 14px; margin-top: 19px; }
.opening-promise br { display: none; }
.opening-promise strong { display: block; }
.opening-enter { font-size: 12px; margin-top: 10px; }
.opening-destinations { position: absolute; left: 59%; right: var(--pad); top: 32%; z-index: 4; }
.opening-destinations>.eyebrow { font-size: 9px; color: #b0b8b0; }
.opening .world-doors { position: static; width: auto; margin-top: 22px; }
.opening .world-door { padding: 17px 0; gap: 14px; min-height: 0; }
.opening .world-door strong { font-size: 25px; }
.opening .world-door small { font-size: 7px; margin-bottom: 5px; }
.opening .world-door svg { width: 42px; height: 42px; }
.opening .world-door b { font-size: 18px; margin-left: 12px; }
.opening .door-number { font-size: 8px; }
.opening .scene-foot { font-size: 8px; }

/* A nested 3D space. Perspective makes Z movement change apparent scale.
   A selected surface rotates out of the camera's pitch, not out of the scene. */
.longfield .pin { transform-style: preserve-3d; }
.matter-volume { inset: 0; width: 100%; height: 100%; perspective: 1600px; perspective-origin: 66% 54%; pointer-events: none; }
.longfield.has-object .matter-volume { z-index: 5; }
.longfield.has-object .layer-selector { z-index: 0; }
.matter-stack { left: 0; top: 0; width: 600px; height: 400px; transform-origin: 300px 200px; transform-style: preserve-3d; pointer-events: none; }
.selectable-plane { pointer-events: auto; transform-style: preserve-3d; }
.selectable-plane:not([data-plane=documents]) { pointer-events: none; }
.plane-select { position: absolute; inset: 0; z-index: 8; display: block; width: 100%; height: 100%; border: 1px solid transparent; color: #293b3d; }
.plane-select:after { content: 'OPEN THIS LAYER ↗'; position: absolute; right: 22px; bottom: 20px; font: 11px var(--mono); letter-spacing: .06em; border-bottom: 1px solid currentColor; padding-bottom: 6px; }
.plane-select:hover,.plane-select:focus-visible { border-color: #d5a571; box-shadow: inset 0 0 0 2px #d5a57155; }
.document-plate { opacity: 1; color: #26393c; }
.document-plate .plate-top { color: #4c605c; }
.document-plate .plate-top,.document-plate .document-plate-body { opacity: calc(1 - var(--object-open,0)); }
.selectable-plane.is-selected>.plane-select { pointer-events: none; visibility: hidden; }
.longfield .lf-heading { top: 17%; max-width: 330px; transform-origin: left top; transform: translateY(calc(var(--object-open,0)*-18px)) scale(calc(1 - var(--object-open,0)*.12)); }
.lf-heading .interaction-cue { font: 12px/1.7 var(--mono); color: #c5a179; margin-top: 20px; }
.layer-selector { position: absolute; left: var(--pad); right: var(--pad); bottom: 12.5%; display: flex; align-items: center; justify-content: space-between; gap: 18px; z-index: 12; border-top: 1px solid #60716d66; padding-top: 18px; }
.layer-selector>span { font: 9px var(--mono); color: #99aaa3; letter-spacing: .07em; }
.layer-selector>button { font: 11px var(--mono); color: #e0be99; display: flex; align-items: center; gap: 20px; padding: 10px 14px; border: 1px solid #c2926366; background: #1b292c; }
.layer-selector>button:hover,.layer-selector>button[aria-expanded=true] { border-color: #d1a678; background: #31403e; }
.relationship-caption { left: var(--pad); right: var(--pad); width: auto; bottom: 6.6%; display: flex; align-items: baseline; gap: 20px; }
.relationship-caption>p { font-size: 15px; margin: 0; min-height: 0; max-width: none; }
.sequence-index { font-size: 9px; white-space: nowrap; }
.bucket-resolution { font-size: 9px; margin: 0 0 0 auto; white-space: nowrap; }
.volume-label,.volume-axis,.fiction-label { display: none; }
.object-interior { position: absolute; inset: 0; background: #e6e5d9; color: #22383d; padding: 19px 23px; opacity: 0; backface-visibility: hidden; display: flex; flex-direction: column; cursor: auto; }
.object-interior[inert] { pointer-events: none; }
.object-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid #8da19566; padding-bottom: 15px; flex-shrink: 0; }
.object-heading .eyebrow { font-size: 8px; color: #65786c; }
.object-heading h3 { font-size: 26px; font-weight: 500; line-height: 1.14; margin-top: 10px; }
.object-close { font-size: 24px; width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid #9ea994; }
.object-close:hover { background: #d0d5c6; }
.feature-inspector { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.feature-modes { display: flex; border-bottom: 1px solid #9aa99a66; gap: 20px; margin-top: 10px; }
.feature-modes button { font-size: 12px; min-height: 37px; padding: 8px 0; border-bottom: 2px solid transparent; }
.feature-modes button[aria-selected=true] { border-color: #876346; font-weight: 600; }
.capability-controls { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.capability-controls button { font: 10px var(--mono); border: 1px solid #9dab99; padding: 7px 9px; background: #e9e9df; }
.capability-controls button:hover { border-color: #796244; box-shadow: inset 0 0 0 1px #796244; }
.capability-controls button[aria-pressed=true] { color: #f1ecdf; background: #2b4447; border-color: #2b4447; }
.feature-connection { display: flex; gap: 10px; align-items: center; padding: 8px 0; font: 7px var(--mono); color: #657b6c; }
.feature-connection i { height: 1px; width: 35px; background: #997b54; transform-origin: left; transition: transform .14s linear; }
.feature-reading { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: auto; padding: 7px 10px 5px 0; opacity: 1; transition: opacity .14s; }
.feature-reading:focus-visible { outline-offset: -2px; }
.feature-status { font: 7px var(--mono); letter-spacing: .04em; color: #6c6c47; }
.feature-title { font: 500 20px/1.18 var(--sans); letter-spacing: -.025em; margin: 7px 0 12px; }
.feature-copy { font-size: 13px; line-height: 1.6; }
.feature-connections { margin: 13px 0; font-size: 12px; line-height: 1.5; }
.feature-connections dt { font: 8px var(--mono); color: #667c6a; margin-bottom: 5px; text-transform: uppercase; }
.feature-connections dd { margin: 0; }
.feature-readiness { font-size: 10px; line-height: 1.5; color: #576c5a; border-top: 1px solid #a8b49f66; padding-top: 10px; }
.feature-inspector[data-phase=line] .feature-connection i { transform: scaleX(0); }
.feature-inspector[data-phase=line] .feature-reading,.feature-inspector[data-phase=panel] .feature-reading { opacity: .35; }
.object-interior :focus-visible { outline-color: #815931; }
.selection-memory { position: fixed; z-index: 34; bottom: 49px; right: var(--pad); display: flex; gap: 18px; align-items: center; color: #e2ded0; background: #1c2c30ee; border: 1px solid #8b8162; padding: 8px 12px; box-shadow: 0 8px 24px #07111630; }
.selection-memory[hidden] { display: none; }
.selection-memory>span { font: 8px var(--mono); color: #c9aa80; }
.selection-memory>button { font: 10px var(--mono); padding: 6px; }
.selection-memory>#reset-object { font-size: 19px; padding: 1px 4px; }
.file-environment { box-shadow: 5px 12px 25px #09171e24; }

/* The road relaxes into the existing care branches, rather than being redrawn. */
.world-bridge { position: absolute; top: 10%; right: var(--pad); font: 10px var(--mono); color: #897080; letter-spacing: .035em; }
.care-garden { perspective: 1400px; transform-style: preserve-3d; }
.care-inquiry { transform: translate3d(calc((1 - var(--gather,0))*var(--cx)),calc((1 - var(--gather,0))*var(--cy)),18px) rotate(calc((1 - var(--gather,0))*var(--cr))); }
.care-visit { box-shadow: 6px 13px 25px #2638421f; }
.care-family { box-shadow: 3px 7px 15px #78626310; }
.care-stem { stroke-dashoffset: 0; opacity: .78; }
.care-photo-slot { position: absolute; overflow: hidden; margin: 0; }
.care-photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.media-client { left: 38%; top: 31%; width: 22%; height: 39%; }
.media-coordinator { left: 3%; top: 35%; width: 28%; height: 30%; }
.media-family { right: 3%; top: 40%; width: 28%; height: 30%; }
.media-approach { left: 36%; top: 39%; width: 25%; height: 37%; }
.pack-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 30px; }
.pack-actions .text-link { margin-top: 0; }
.quiet-pack-link { font: 11px var(--mono); padding: 8px 0; color: #606d5e; border-bottom: 1px solid #9ca58e; }
.pack-notes { width: min(1150px,94vw); height: min(830px,92svh); padding: 0; border: 1px solid #8c957e; background: #e6e1d5; color: #263335; --fg:#263335; --bg:#e6e1d5; --muted:#677362; --copper:#94704f; }
.pack-notes::backdrop { background: #111c21aa; }
.pack-notes .pin { position: relative; height: 100%; min-height: 0; padding: 70px 55px; background: none; }
.notes-close { position: absolute; right: 20px; top: 15px; z-index: 10; }
.pack-notes .warranty-receipt { transform: rotate(3deg) scale(.85); }

@media(max-width:1180px) {
  .opening-copy { max-width: 47%; top: 24%; }
  .opening h1 { font-size: 48px; }
  .opening-context { font-size: 14px; }
  .opening-destinations { left: 58%; top: 29%; }
  .opening .world-door strong { font-size: 23px; }
  .opening .world-door svg { width: 30px; height: 30px; }
  .longfield .lf-heading { top: 14%; max-width: 300px; }
  .lf-heading h2 { font-size: 43px; }
  .lf-heading>p:not(.eyebrow) { font-size: 14px; }
  .layer-selector { gap: 12px; bottom: 12%; }
  .layer-selector>span { font-size: 7px; }
  .layer-selector>button { font-size: 9px; }
  .relationship-caption { bottom: 6.7%; }
  .relationship-caption>p { font-size: 12px; }
  .bucket-resolution { display: none; }
}
@media(max-width:800px) {
  .opening-copy { top: 17%; max-width: 70%; }
  .opening h1 { font-size: 45px; }
  .opening-context { font-size: 14px; max-width: 39ch; }
  .opening-promise { font-size: 13px; }
  .opening-enter { display: none; }
  .opening-destinations { left: var(--pad); right: var(--pad); top: auto; bottom: 15%; }
  .opening .world-doors { display: grid; grid-template-columns: 1fr 1fr; column-gap: 25px; margin-top: 15px; }
  .opening .world-door { padding: 12px 0; }
  .opening .world-door svg { margin-left: auto; }
  .opening .world-door strong { font-size: 23px; }
  .opening .world-door small { font-size: 6px; }
  .opening .world-door b { display: none; }
  .matter-volume { perspective-origin: 50% 56%; }
  .longfield .lf-heading { top: 13%; max-width: 90%; }
  .longfield .lf-heading h2 { font-size: 42px; }
  .longfield.has-object .lf-heading { opacity: .45; transform: translateY(-20px) scale(.78); }
  .lf-heading .interaction-cue { font-size: 11px; }
  .layer-selector { bottom: 12%; flex-wrap: wrap; justify-content: flex-start; gap: 12px 18px; }
  .layer-selector>button { order: -1; width: 100%; justify-content: space-between; min-height: 43px; }
  .layer-selector>span { font-size: 7px; }
  .longfield.has-object .layer-selector { opacity: .45; }
  .relationship-caption { bottom: 6.5%; gap: 10px; }
  .sequence-index { font-size: 7px; }
  .relationship-caption>p { font-size: 11px; }
  .object-interior { padding: 17px 18px; }
  .object-heading { padding-bottom: 11px; }
  .object-heading h3 { font-size: 25px; }
  .object-heading .eyebrow { font-size: 7px; }
  .feature-modes { margin-top: 6px; }
  .feature-modes button { min-height: 40px; font-size: 12px; }
  .capability-controls { margin-top: 10px; gap: 6px; }
  .capability-controls button { padding: 9px 10px; font-size: 10px; min-height: 36px; }
  .feature-copy { font-size: 13px; }
  .feature-title { font-size: 20px; }
  .feature-readiness { font-size: 11px; }
  .selection-memory { left: 20px; right: 20px; justify-content: space-between; gap: 8px; padding: 7px 10px; }
  .selection-memory>span { font-size: 7px; }
  .selection-memory>button { font-size: 9px; }
  .world-bridge { top: 10%; font-size: 8px; }
  .pack-notes { width: 96vw; }
  .pack-notes .pin { overflow: auto; padding: 70px 30px 35px; display: block; }
  .pack-notes .warranty-receipt { position: relative; right: auto; bottom: auto; margin: 30px auto 0; transform: rotate(2deg); }
}
@media(max-width:540px) {
  .scene .pin { min-height: 740px; }
  .opening-copy { top: 17%; max-width: calc(100% - 48px); }
  .opening h1 { font-size: 35px; margin-top: 15px; }
  .opening .eyebrow { font-size: 7px; }
  .opening-context { font-size: 12px; margin-top: 20px; max-width: 33ch; }
  .opening-promise { font-size: 12px; margin-top: 13px; }
  .opening-destinations { bottom: 13%; }
  .opening .world-doors { margin-top: 12px; gap: 0 20px; }
  .opening .world-door { gap: 8px; padding: 12px 0; }
  .opening .world-door strong { font-size: 19px; }
  .opening .world-door small { font-size: 5px; max-width: 120px; }
  .opening .world-door svg { display: none; }
  .opening .scene-foot { bottom: 61px; font-size: 6px; }
  .longfield .lf-heading h2 { font-size: 36px; }
  .longfield .lf-heading { top: 13%; }
  .lf-heading>p:not(.eyebrow) { font-size: 12px; }
  .lf-heading .interaction-cue { margin-top: 15px; font-size: 10px; }
  .longfield.has-object .lf-heading { opacity: .22; }
  .layer-selector { bottom: 13%; padding-top: 11px; }
  .layer-selector>span { font-size: 6px; }
  .relationship-caption { display: block; bottom: 7%; }
  .relationship-caption>p { margin-top: 6px; font-size: 10px; }
  .object-heading h3 { font-size: 23px; }
  .object-close { width: 34px; height: 34px; }
  .feature-modes { gap: 17px; }
  .feature-modes button { font-size: 11px; }
  .capability-controls button { font-size: 9px; min-height: 35px; padding: 8px; }
  .feature-title { font-size: 20px; }
  .feature-copy { font-size: 13px; }
  .feature-connections { font-size: 12px; }
  .feature-reading { padding-right: 5px; }
  .world-bridge { top: 10.5%; left: var(--pad); right: auto; font-size: 7px; }
  .hollyhock .hh-title { padding-top: 10px; }
  .pack-actions { margin-top: 24px; gap: 13px; max-width: 165px; }
  .pack-actions .text-link { font-size: 10px; max-width: 165px; }
  .quiet-pack-link { font-size: 8px; text-align: left; }
  .pack-notes .tools-left h2 { font-size: 36px; }
}
body.quiet .scene + .scene { margin-top: 0; }
body.quiet .scene .pin { transform: none; }
body.quiet .capability-controls button:hover { transform: none; }
