.viewport { position: relative; }
.arrival { position: absolute; inset: 0; overflow: hidden; z-index: 8; isolation: isolate; }
.arrival canvas, .arrival-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.arrival-poster { background: url('/assets/saucer-hatch.webp') center/100% 100%, #080d15 url('/assets/lunar-overflight.webp') center/cover; }
/* Internal links from the model bypass the windshield, including its first paint. */
body:has(:is(#base,#site-menu,#base-contact):target) .arrival {visibility:hidden}
body:has(#site-menu:target):has(#arrival) {background:#fff}
body:has(#site-menu:target):has(#arrival) .base-shell {visibility:hidden}
.arrival[data-live] .arrival-poster { display: none; }
.arrival-skip { position: absolute; right: 2.4%; bottom: 2.6%; min-height: 36px; padding: 4px 14px; border: 1px solid #b5c3c865; border-radius: 20px; background: #0b141cee; color: #e3e8e9; font: 500 clamp(11px,1vw,15px)/1 system-ui,sans-serif; cursor: pointer; }
.arrival-skip span { margin-left: .45em; color: #edbd7b; }
.arrival-skip:focus-visible { outline: 2px solid #eac68b; }
.arrival { container-type:inline-size; }
.seat-view,.seat-room,.front-wall,.exit-wall,.door-track,.door-leaf { position:absolute; inset:0; }
.seat-view { perspective:50cqw; background:repeating-linear-gradient(90deg,#182028 0%,#363c42 12.5%,#141a20 13%,#252e33 14%,#151c22 25%); }
.seat-room { transform-style:preserve-3d; transform:translateZ(50cqw); }
.front-wall { transform:translateZ(-50cqw); background:#10151b; backface-visibility:hidden; }
.exit-wall { transform:translateX(50cqw) rotateY(-90deg); backface-visibility:hidden; }

/* The aperture stays fixed. The solid slab and its console ride on the same rail. */
.exit-wall::after { content:"";position:absolute;inset:0;pointer-events:none;
  background:url('/assets/exit-door.webp') center/100% 100%;
  clip-path:polygon(0 0,100% 0,100% 100%,0 100%,0 0,8.8% 12.8%,8.8% 85.6%,91% 85.6%,91% 12.8%,8.8% 12.8%,0 0); }
.door-track { inset:12.8% 9% 14.4% 8.8%;overflow:hidden; }
.door-leaf { background:url('/assets/exit-door.webp') 49.44% 47.06% / 121.65% 137.36% no-repeat;display:grid;place-items:center; }
.arrival:is([data-phase="terminal"],[data-phase="exit"]) .seat-view { perspective:none; background:transparent; }
.arrival:is([data-phase="terminal"],[data-phase="exit"]) .seat-room,
.arrival:is([data-phase="terminal"],[data-phase="exit"]) .exit-wall { transform:none;transform-style:flat;backface-visibility:visible; }
.arrival:is([data-phase="terminal"],[data-phase="exit"]) .front-wall { display:none; }
.front-wall,.arrival-poster,canvas {pointer-events:none;}
.door-terminal {
  box-sizing:border-box;width:min(89%,51rem);max-height:96%;min-height:0;
  display:flex;flex-direction:column;position:relative;padding:.75em .85em .55em;
  border:3px ridge #75746a;border-radius:1.1em;
  background:linear-gradient(160deg,#717774,#3e4646 14%,#303637 45%,#212526 80%,#383d3d);
  box-shadow:inset 0 2px 3px #a0a39a88,inset 0 -3px 2px #121819,0 5px 0 #171b1a,0 9px 14px #000b;
  color:#d4f1e6;font:500 clamp(13px,1.45cqw,20px)/1.2 system-ui,sans-serif;
}
.monitor-glass {display:flex;flex-direction:column;min-height:0;border:4px solid #151b1b;border-radius:.68em;
  padding:.88em;background:linear-gradient(153deg,#213d3b,#0c211f 60%,#102521);
  box-shadow:0 -2px 2px #111,0 2px 2px #848b7f,inset 0 3px 15px #000b}
.door-terminal h2 {margin:0 0 .68em;font-size:1.12em;font-weight:630;color:#d7ffec}
.language-keys {position:relative;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.37em;overflow-y:auto;
  scroll-padding:3px;overscroll-behavior:contain;scrollbar-color:#71998b #142925;scrollbar-width:thin;padding:2px}
.language-keys button {display:flex;align-items:center;gap:.42em;white-space:nowrap;font:inherit;font-size:.89em;
  text-align:start;color:#d5e9e2;background:#142e2b;border:1px solid #537f70;border-radius:5px;padding:.4em .43em}
.language-flag {width:1.48em;height:.99em;flex:none;overflow:hidden;border-radius:2px;box-shadow:0 0 0 1px #001b1a55}
.language-keys button[aria-pressed="true"] { background:#a5f5cd;color:#123428;box-shadow:0 0 10px #79ffc35c;font-weight:700; }
.door-terminal button { -webkit-appearance:none;appearance:none;touch-action:manipulation;min-height:44px;cursor:pointer; }
.door-terminal button:focus-visible {outline:2px solid white;outline-offset:2px;}
.hatch-controls {display:flex;align-items:center;justify-content:space-between;padding:.6em .35em .1em;gap:1em;}
.speaker {width:23%;height:1em;background:repeating-linear-gradient(0deg,#161b1c 0 2px,#555d5c 3px,#383e3f 4px);border-radius:3px;}
.open-hatch {min-width:6.8em;padding:.46em 1.15em;border-radius:5em;border:2px solid #ff9e91;color:white;
  font:750 .98em/1 system-ui,sans-serif;letter-spacing:.04em;
  background:linear-gradient(#fe8473,#e13c31 44%,#ab1d19 76%,#e1483b);
  box-shadow:inset 0 2px 1px #ffc5b9,0 4px 0 #711c16,0 5px 0 3px #1c1f1e,0 1px 17px 5px #ff492c99;text-shadow:0 1px 2px #6c0b09; }
.open-hatch:active:enabled {transform:translateY(2px);}
.open-hatch:disabled {background:linear-gradient(#634941,#453231);border-color:#70544d;color:#c4b8b1;box-shadow:0 3px 0 #362420,0 4px 0 2px #252525;text-shadow:none;cursor:default;}
.arrival:not([data-phase="terminal"]):not([data-phase="exit"]) .monitor-glass { filter:brightness(.60); }
@container (max-width: 1050px) {
  .language-keys button {flex-direction:column;justify-content:center;gap:.2em;padding:.25em .1em;}
}
@container (max-width: 800px) {
  .door-terminal{width:95%;padding:.45em .5em;font-size:14px}
  .monitor-glass{padding:.55em}
  .hatch-controls{padding:.38em .25em .12em}
}
@container (max-width: 550px) {
  /* Use more of the metal slab as the terminal on handheld screens. Match
     the frame cutout and texture crop so it still opens as a single door. */
  .door-track {inset:3.5% 8.8%}
  .door-leaf {background-position:50% 50%;background-size:121.36% 107.53%}
  .exit-wall::after {clip-path:polygon(0 0,100% 0,100% 100%,0 100%,0 0,8.8% 3.5%,8.8% 96.5%,91.2% 96.5%,91.2% 3.5%,8.8% 3.5%,0 0)}

  .door-terminal{width:96%;padding:.3em .4em;border-width:2px;max-height:97%}
  .monitor-glass{padding:.3em .4em;border-width:2px}
  .door-terminal h2{font-size:1em;margin:0 0 .27em}
  .language-keys {gap:3px}
  .language-keys button{justify-content:center;gap:.23em;min-height:34px;padding:.23em .14em;font-size:clamp(11px,3.15cqw,14px)}
  .door-terminal .open-hatch{min-height:32px}
  .hatch-controls {padding:.21em .15em .12em}
  .arrival-skip {bottom:1%;min-height:30px}
}
.scene-speaker,.menu-speaker{position:absolute;z-index:10;top:clamp(5px,1.4vw,18px);right:clamp(5px,1.6vw,22px)}
.guide-top {min-height:30px}
@media (max-width:550px){
  .scene-speaker[data-audio-toggle]{height:38px;width:38px;top:2px;right:2px}
}
