*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;background:#fff;color:#111;overflow:hidden}body{font-family:Arial,Helvetica,sans-serif;-webkit-font-smoothing:antialiased}button{font:inherit}button{background:none;color:inherit;border:0;cursor:pointer}button:focus-visible{outline:1px solid #c70721;outline-offset:7px}button{touch-action:manipulation}
#experience,#stage{position:fixed;inset:0}
#experience {-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#experience img {-webkit-user-drag:none}
#experience :is(input,textarea,[contenteditable]:not([contenteditable=false])) {-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
#stage{touch-action:none;cursor:grab}
#stage.dragging{cursor:grabbing}
#stage.action{cursor:pointer}
#stage canvas{width:100%;height:100%;display:block}
#header{z-index:4;mix-blend-mode:multiply;position:absolute;top:30px;left:40px;right:40px;display:flex;align-items:center;justify-content:space-between;pointer-events:none;transition:opacity .35s}
.brand{width:55px;height:50px;object-fit:contain;mix-blend-mode:multiply}
#header[inert]{opacity:var(--shell-sound,0);transition:none}
#header[inert] .brand{visibility:hidden}
#sound{display:grid;place-items:center;width:44px;height:44px;padding:0;pointer-events:auto;color:#666}
#sound svg{width:23px;height:23px}
#footer{position:absolute;bottom:28px;left:40px;right:40px;display:flex;justify-content:space-between;align-items:center;gap:20px;transition:opacity .35s}
.instruction{display:flex;align-items:center;gap:14px;font-size:8px;color:#777;letter-spacing:.13em;margin:0}
.gesture{font-size:22px;color:#555;letter-spacing:0}
#loading{position:absolute;inset:0;background:#fff;z-index:5;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:24px;transition:opacity .6s}
#loading img{width:75px;height:85px;object-fit:contain}
#loading span{font-size:9px;letter-spacing:.23em;color:#777}
#loading i{width:70px;height:1px;background:#eee;position:relative;overflow:hidden}
#loading i:after{content:'';position:absolute;inset:0;background:#111;transform:translateX(-100%);animation:load 1.3s infinite}
@keyframes load{to{transform:translateX(100%)}}
#loading.ready{opacity:0;pointer-events:none}#loading.ready i:after{animation:none}
#error{position:absolute;inset:100px 0;background:white;z-index:4;text-align:center}
#error img{height:70%;max-width:90%;object-fit:contain}
#error p{font-size:13px;color:#666}
#error button{font-size:11px;letter-spacing:.15em;text-decoration:underline}
#screen-access button{position:fixed;opacity:0;pointer-events:none;border:0;z-index:3;color:transparent}
#screen-access button:focus-visible{outline:none}
#flash{position:fixed;inset:0;background:#fff;pointer-events:none;opacity:0;z-index:6}
.travel #header .brand,.travel #footer{opacity:0;pointer-events:none}
.travel #footer button{pointer-events:none}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
@media(max-width:700px){#header{top:20px;left:20px;right:20px}
.brand{width:44px;height:42px}
#footer{bottom:22px;left:20px;right:20px;flex-wrap:wrap}
.instruction{font-size:7px;gap:7px}
}
@media(prefers-reduced-motion:reduce){#loading i:after{animation:none}*{scroll-behavior:auto}}

#control-access button{position:fixed;opacity:0;pointer-events:none;border:1px solid #444;z-index:3;border-radius:50%;color:transparent}
#control-access button:focus-visible{opacity:1;outline:1px solid #222;outline-offset:3px}
#control-hint{position:fixed;left:50%;bottom:72px;transform:translateX(-50%);font-size:9px;color:#777;letter-spacing:.14em;pointer-events:none}
.travel #control-hint{opacity:0}
@media(max-width:700px){#control-hint{bottom:107px}}

body[data-theme=dark] #header .brand{filter:invert(1);mix-blend-mode:screen}
body[data-theme=dark] #header{mix-blend-mode:screen}
body[data-theme=dark] #sound,body[data-theme=dark] #footer button,body[data-theme=dark] .instruction,body[data-theme=dark] .gesture,body[data-theme=dark] #control-hint{color:#c2c0c0}

html,body{background:#000}
#loading{background:#000}
#loading img{filter:invert(1);mix-blend-mode:screen}
#loading span{color:#aaa}
#loading i{background:#292929}
#loading i:after{background:#bbb}

.fold-control{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:40px;padding:0 14px;border:1px solid rgba(50,50,50,.24);border-radius:3px;color:#555;font-size:9px;letter-spacing:.12em;text-transform:uppercase;transition:border-color .16s,background-color .16s}
@media (hover:hover) {.fold-control:hover{border-color:currentColor}}
body[data-theme=dark] .fold-control{border-color:rgba(255,255,255,.26)}
@media (hover:hover) {body[data-theme=dark] .fold-control:hover{border-color:#aaa;background:rgba(255,255,255,.05)}}
@media(max-width:700px){
  #footer{bottom:max(12px,env(safe-area-inset-bottom));left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));gap:10px}
  .fold-control{min-height:44px}
  .fold-control{min-width:60px;font-size:8px}
}

/* Place the entry action directly beneath the closed object at either aspect. */
body:not([data-ready="true"]) #footer{visibility:hidden}
body[data-lid-ui=closed] #footer{
  top:min(calc(50% + min(30dvh,29vw) + 20px),calc(100% - 58px - env(safe-area-inset-bottom)));
  bottom:auto;
  justify-content:center;
  pointer-events:none;
}
body[data-lid-ui=closed] #fold{margin:0}
body[data-lid-ui=closed] #footer #fold{
  pointer-events:auto;
  min-width:108px;
  min-height:44px;
  border:1px solid currentColor;
  border-radius:3px;
  background:var(--scene-ink,#f5f4f0);
  color:var(--scene-bg,#000);
  font-size:10px;
  letter-spacing:.16em;
}
body[data-lid-ui=closed].travel #footer #fold{pointer-events:none}
body[data-lid-ui=closed] #stage{cursor:default}
body[data-lid-ui=closed] .instruction{display:none}


.software-console{position:absolute;inset:0;pointer-events:none;transform-origin:0 0;will-change:transform}
/* Keep the painted casing above the native video when the floating layer moves. */
.software-console>canvas{position:absolute;inset:0;z-index:1;transform:translateZ(0);backface-visibility:hidden}
.software-lcd{position:absolute;left:0;top:0;z-index:0;width:640px;height:560px;transform-origin:0 0;pointer-events:none;overflow:hidden;background:#f9faf6;isolation:isolate}
.software-lcd>video{display:block;width:100%;height:100%;object-fit:fill;mix-blend-mode:multiply}
.software-lcd::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,transparent 22%,rgba(75,80,75,.12) 100%),repeating-linear-gradient(to bottom,transparent 0 2px,rgba(52,61,55,var(--lcd-scanline,0)) 2px 3px)}
