/* The extension and the animated wall share the artist's 8192 × 4768 camera.
   Only the ceiling fly uses the individual translate property: the existing
   horizontal and forward cameras retain ownership of their transforms. */
.ceiling-art {
  position:absolute; z-index:-2; display:block; pointer-events:none; max-width:none;
  left:calc(50% - 4096 * var(--wing-u)); top:calc(50% - 6913 * var(--wing-u));
  width:calc(8192 * var(--wing-u)); height:calc(4628 * var(--wing-u));
  visibility:hidden;
}
html[data-reel-view] .ceiling-art {visibility:visible}
html[data-reel-view] {--ceiling-travel:calc(4450 * var(--wing-u))}
html[data-reel-view] :is(#wingCamera,#wingEmblem,#workSceneHud,#reelModal) {
  translate:0 0; transition:translate var(--vertical-pan);
}
/* The screen lives one camera journey above home. Only the common camera
   translation animates; its mounting point never slides or fades. */
html:is([data-reel-view="cue"],[data-reel-view="up"],[data-reel-view="return"]) #reelModal {
  transform:translateY(calc(-1 * var(--ceiling-travel)));
}
html[data-reel-view="up"] :is(#wingCamera,#reelModal) {translate:0 var(--ceiling-travel)}
html[data-reel-view="up"] :is(#wingEmblem,#workSceneHud) {
  translate:0 max(calc(4550 * var(--wing-u)),102dvh);
}
/* This dialog is just the physical projection screen, not a second page
   painted over the room. The actual ceiling remains visible around it. */
#reelModal.ceiling-dialog {
  --screen-width:min(73vw, 1440px, calc((100dvh - 9.5rem) * 16 / 9));
  --hardware:#e8d2ae; --gilt:#a98760;
  box-sizing:border-box; position:fixed; inset:0; margin:auto;
  width:var(--screen-width)!important; max-width:calc(100vw - 1rem)!important;
  height:fit-content; max-height:calc(100dvh - .75rem)!important; padding:0;
  overflow:visible; border:0; background:none; color:#f7ebd6;
  box-shadow:none; outline:none; opacity:1; transform:none; clip-path:none;
  transition:none; color-scheme:dark;
}
#reelModal:not([open]) {display:none}
#reelModal[open]::backdrop {
  opacity:0; background:rgba(22,12,8,.29); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  transition:opacity var(--vertical-pan); animation:none;
}
html:is([data-reel-view="up"],[data-reel-view="still"]) #reelModal[open]::backdrop {
  opacity:1;
}
#reelModal.is-closing::backdrop {opacity:0; transition-delay:0s}
.ceiling-screen {
  position:relative; isolation:isolate; box-sizing:border-box; container-type:inline-size;
  padding:clamp(5px,.48vw,9px) clamp(5px,.48vw,9px) 0;
  border:1px solid #967656; border-radius:15px;
  background:linear-gradient(158deg,#513a2d,#2d201b 45%,#37251d 82%,#4b3527);
  box-shadow:inset 0 1px 1px #ffe7b659, inset 0 -2px 2px #170e0aa1, 0 3px 2px #20130cb3, 0 18px 44px #150b0875;
}
.ceiling-projection {
  position:relative; aspect-ratio:16/9; overflow:hidden;
  border-radius:8px; background:#0e0e0e; box-shadow:0 0 0 1px #1a100c;
}
#reelModal #showreelPlayer {display:block; width:100%; height:100%; object-fit:contain; border:0}
.ceiling-console {display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:7px clamp(5px,.8vw,17px)}
.ceiling-editions {display:flex; align-items:center; gap:clamp(1px,.33vw,8px)}
.ceiling-globe {width:20px; height:20px; margin-inline-end:.6rem; color:#d5b78d}
.ceiling-console button,.ceiling-play {
  appearance:none; cursor:pointer; margin:0; text-transform:none; letter-spacing:normal;
  display:grid; place-items:center; box-sizing:border-box; outline-offset:2px;
  color:var(--hardware); border:1px solid transparent; background:none;
}
.ceiling-editions button {
  min-height:44px; padding:0 clamp(9px,.85vw,18px); border-radius:7px;
  font:500 1rem/1.2 system-ui,sans-serif;
}
.ceiling-editions button[aria-pressed="true"] {
  background:#e2cba4; color:#2c1e17; border-color:#f1dfbb;
  box-shadow:inset 0 -2px 0 #795e3e55,0 1px 4px #140d0a66;
}
.ceiling-editions abbr {display:none; text-decoration:none}
.ceiling-close {flex:none; width:44px; height:44px; border-radius:50%}
.ceiling-close svg {width:21px; height:21px}
@media(hover:hover) {
  .ceiling-console button:not([aria-pressed="true"]):hover {background:#ffffff16; color:#fff}
  .ceiling-play:hover {background:#33251fe8; border-color:#fff5de}
}
.ceiling-play {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:clamp(52px,4.7vw,78px); aspect-ratio:1; padding:0; border-radius:50%;
  background:#241a15cf; border:1px solid #f9e4c3a8; color:#fff2d8;
  box-shadow:0 3px 16px #0004;
}
.ceiling-play svg {width:35%; height:35%}
.ceiling-play[hidden],.ceiling-message[hidden] {display:none}
#reelModal :focus-visible {outline:2px solid #ffe1a4; outline-offset:2px}
.ceiling-message {
  position:absolute; inset:0; display:grid; place-items:center; margin:0; padding:1.25rem;
  font:500 1rem/1.45 system-ui,sans-serif; color:#fff6e8; text-align:center; background:#211913e8;
}
/* Keep the film wide on a phone and the entire console inside landscape
   cutouts. Container size (not language or device) decides which labels fit. */
@media(max-width:820px),(max-aspect-ratio:6/5) {
  #reelModal.ceiling-dialog {--screen-width:min(calc(100vw - max(14px,2 * env(safe-area-inset-left),2 * env(safe-area-inset-right))),calc((100dvh - 7rem) * 16 / 9))}
}
@media(max-height:600px) and (orientation:landscape) {
  #reelModal.ceiling-dialog {--screen-width:min(94vw,calc((100dvh - max(82px,calc(64px + env(safe-area-inset-bottom) + env(safe-area-inset-top)))) * 16 / 9))}
}
@container(max-width:530px) {
  .ceiling-console {padding:4px 1px; gap:2px}
  .ceiling-editions {gap:0; flex:1}
  .ceiling-globe {display:none}
  .ceiling-editions button {min-width:0; flex:1; padding:0 4px; font-size:.875rem}
  .ceiling-editions button span {display:none}
  .ceiling-editions abbr {display:inline}
}
@media(prefers-reduced-motion:reduce) {
  html[data-reel-view] :is(#wingCamera,#wingEmblem,#workSceneHud,#reelModal),
  html[data-reel-view] #reelModal[open]::backdrop {transition:none!important}
}
