/* A brass-bound cabinet with a recessed miniature landscape, visible thickness
   and a projecting sill. All camera travel is local to the physical object. */
.gateArea {perspective:950px}
.gate {--thickness:clamp(15px,1.65vw,24px);--camera-pitch:0deg;--camera-yaw:0deg;
 transform:translateZ(0);
 animation:door-suspension 9s ease-in-out infinite alternate;transform-style:preserve-3d}
.gate:before {inset:0;transform:translateZ(calc(0px - var(--thickness)));background:#312938;
 box-shadow:14px 25px 35px #06050a80,28px 40px 65px #08041088}
.gate:after {transform:translateZ(.7px);backface-visibility:hidden;
 filter:drop-shadow(1.1px 1.2px .75px #21151b) brightness(1.10)}
.gate-depth {position:absolute;inset:0;transform-style:preserve-3d;pointer-events:none}
.gate-side {position:absolute;box-sizing:border-box;border:1px solid #bc975b;backface-visibility:visible;
 background:repeating-linear-gradient(90deg,#91744b 0 1px,#e7c27e 1.5px 2.5px,#806542 3px 4px,#40343b 4.5px 6px)}
.gate-left,.gate-right {top:0;height:100%;width:var(--thickness);transform-origin:left center}
.gate-left {left:0;transform:rotateY(90deg)}
.gate-right {left:100%;transform:rotateY(90deg)}
.gate-head,.gate-foot {left:0;width:100%;height:var(--thickness);transform-origin:center top;
 background:repeating-linear-gradient(0deg,#1c1820 0 2px,#746147 2px 3px,#a68d68 3px 4px,#332c34 4px 7px)}
.gate-head {top:0;transform:rotateX(-90deg)}
.gate-foot {top:100%;transform:rotateX(-90deg)}
.gate .view {inset:33.6% 32.6% 32.3%;overflow:hidden;transform:translateZ(1.2px);
 background:transparent;box-shadow:none;filter:none;pointer-events:none}
.gate .view>span {position:absolute;display:block;pointer-events:none}
.gate-air {inset:0;box-shadow:inset 4px 3px 7px #19121bd1,inset -2px -1px 5px #37212c75;
 background:radial-gradient(ellipse at 53% 34%,#fff1c19c 0%,#f7bc5b60 3%,#f9bc6e20 15%,transparent 40%);
 animation:gate-embers 4.6s ease-in-out infinite alternate}
.gate-light {inset:6% -45% -20% 15%;transform-origin:42% 24%;
 background:conic-gradient(from 140deg at 42% 24%,transparent 0deg,#f3c57c3d 7deg,transparent 14deg,#e2a26329 24deg,transparent 37deg);
 mix-blend-mode:screen;animation:lamplight 6.8s ease-in-out infinite alternate}
.gate-dust {inset:5% 0 2%;
 background:radial-gradient(circle at 24% 60%,#f8df9c 0 .8px,transparent 1.7px),radial-gradient(circle at 67% 72%,#fff5bb 0 .7px,transparent 1.6px),radial-gradient(circle at 47% 62%,#e7be81 0 .7px,transparent 1.4px),radial-gradient(circle at 56% 32%,#fff3cf 0 .6px,transparent 1.5px);
 animation:motecurrent 4.8s ease-in-out infinite alternate}
.card:not(.chosen):not(.other) .plate {box-shadow:2px 2px 0 #9d8057,3px 4px 0 #29222b,4px 5px 0 #896d49,5px 6px 0 #201c25,8px 16px 23px #0706119c}
.card:not(.chosen):not(.other) .world {animation:portal-window 6.4s ease-in-out infinite alternate}
.card:nth-child(2):not(.chosen) .world {animation-delay:-3s}.card:nth-child(3):not(.chosen) .world {animation-delay:-4.7s}
.card .glass {background:radial-gradient(ellipse at 62% 25%,#fff4d410,transparent 52%),linear-gradient(114deg,#efddbd14 2%,transparent 34% 55%,#ffe9bb24 57%,transparent 66%);
 box-shadow:inset 4px 4px 11px #0a0611bb,inset -1px -1px 2px #f9de9b8c}
.card:not(.chosen):not(.other) .glass:after {content:'';position:absolute;inset:-40% -60%;background:linear-gradient(119deg,transparent 40%,#e8caa814 46%,#fff3cb2b 47%,transparent 50%);
 transform:translateX(-13%);animation:glass-current 6s ease-in-out infinite alternate}
.card:nth-child(2) .glass:after {animation-delay:-1.7s}
.card:nth-child(3) .glass:after {animation-delay:-3.2s}
.card .seal-ring {background:linear-gradient(150deg,#3a2e36,#181620 61%,#534132);box-shadow:1px 1px 0 #100e18,2px 2px 0 #8c714e}
.halls .hall {border-color:#98826c;border-bottom-color:#41313a;box-shadow:inset 2px 2px 1px #ffdea73d,2px 3px 0 #211927,3px 4px 0 #79644c77,7px 16px 28px #0807158c}
.halls .hall:after {background:radial-gradient(ellipse at 65% 32%,#ffdfa76e,transparent 38%);animation:room-lamplight 7s ease-in-out infinite alternate}
.halls .day-hall:after {animation-delay:-3.5s}.halls .folio-hall:after {animation-delay:-5.2s}
@keyframes door-suspension{
 from{transform:translate3d(-2px,3px,0) }
 to{transform:translate3d(3px,-6px,0) }
}
@keyframes gate-embers{from{opacity:.40}to{opacity:.94}}
@keyframes lamplight{from{transform:rotate(-8deg);opacity:.43}to{transform:rotate(6deg);opacity:.94}}
@keyframes motecurrent{from{transform:translate(-1%,6%);opacity:.35}to{transform:translate(3%,-7%);opacity:.94}}
@keyframes portal-window{from{translate:-2.5% 1.8%;scale:1}to{translate:2.4% -1.6%;scale:1.055}}
@keyframes glass-current{from{transform:translateX(-19%);opacity:.38}to{transform:translateX(17%);opacity:.94}}
@keyframes room-lamplight{from{opacity:.36;transform:translate(-8%,2%)}to{opacity:.91;transform:translate(7%,-3%)}}
.stage[data-depth-asleep] :is(.gate,.gate-light,.gate-air,.gate-dust,.world,.glass:after),.hall[data-depth-asleep]::after,.hall[data-depth-asleep] .scene-art{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){
 .gate,.gate .view>*,.card:not(.chosen):not(.other) .world,.card:not(.chosen):not(.other) .glass:after,.halls .hall:after{animation:none}
 .gate{transform:none}
}
/* The reflected threshold fixes the floating cabinet at a readable height. */
.gateArea::before,.gateArea::after{content:"";position:absolute;pointer-events:none}
.gateArea::before{
 left:-24%;right:-24%;top:104%;height:13%;border-radius:50%;
 background:radial-gradient(ellipse at 51% 48%,#fff2b89e 0%,#edc48348 6%,#ae886e36 18%,#78657e28 34%,transparent 70%);
 transform:perspective(200px) rotateX(44deg);animation:sill-reflection 6.8s ease-in-out infinite alternate
}
.gateArea::after{
 left:20%;right:20%;top:93%;height:17%;
 background:conic-gradient(from 163deg at 50% 0%,transparent 0deg,#ded0ab24 10deg,#daa8780c 27deg,transparent 42deg);
 mask-image:linear-gradient(transparent,#000 62%,transparent);animation:gate-embers 4.6s ease-in-out infinite alternate
}
@keyframes sill-reflection{from{opacity:.53;scale:.86 .88}to{opacity:.98;scale:1.1 1.07}}
@media(min-width:701px) and (min-height:560px){.stage .gateArea{width:clamp(185px,20.3vw,310px)}}
@media(max-width:700px) and (min-height:640px) and (orientation:portrait){.stage .gateArea{width:clamp(145px,min(48vw,24vh),230px)}}
.stage[data-depth-asleep] .gateArea::before,.stage[data-depth-asleep] .gateArea::after,.stage[data-depth-asleep] .card .glass::after{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.gateArea::before,.gateArea::after{animation:none}}
.gate-depth::after{
 content:"";position:absolute;left:99.7%;top:.15%;height:99.65%;
 width:clamp(5px,.68vw,10px);transform:translateZ(-1px) skewY(-14deg);transform-origin:left top;
 border-block:1px solid #c3a472;background:linear-gradient(90deg,#e5c994 0%,#9b7b4f 14%,#57463a 28%,#9b805d 43%,#302631 60%,#736047 76%,#bda376 100%);
 box-shadow:2px 3px 6px #0d0b1888;animation:metal-edge 9s ease-in-out infinite alternate
}
@keyframes metal-edge{from{scale:1 1}to{scale:.48 1}}
.stage[data-depth-asleep] .gate-depth::after{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.gate-depth::after{animation:none}}

/* Each printing sits in the same straight-edged sleeve. The original copperplate
   has its own engraved double border, complete with the four register marks. */
.card .back,
.stage .reading .portrait,
.halls .scene-art {
  border:1px solid #b39768;
  border-radius:0;
  background-color:#101319;
  box-shadow:inset 0 0 0 2px #191820,inset 0 0 0 3px #a58b563d,
             1px 1px #ad925f,2px 2px #453c32,3px 3px #b89a62,5px 12px 20px #09081388;
}
.stage .gate::after {background-position:center;background-size:contain;background-repeat:no-repeat}
.stage .gateArea,.stage .card,.stage .reading .portrait,.halls .scene-art {aspect-ratio:var(--deck-ratio,5 / 7)}
.card .plate {border-radius:0}
.card .front::before,.card .front::after {content:none}
.card .window {inset:0;border-radius:0}
.card .window::after {
  content:'';position:absolute;inset:0;
  background:url('portal-print.webp') center/contain no-repeat;
  pointer-events:none;
}
.card .world {display:none}
.card .glass {z-index:1;box-shadow:none;opacity:.72}
.card .back img,.halls .scene-art img {
  display:block;width:100%;height:100%;object-fit:contain;
}
.card .seal-ring {width:14%;bottom:5.2%}
.card .seal-ring b {font-size:clamp(9px,.85vw,13px)}
.stage .reading .portrait {height:auto;object-fit:contain}
.aurora {background-size:cover;background-position:center}
.halls .hall {
  display:grid;grid-template-rows:auto 1fr;align-items:start;min-height:0;
  padding:clamp(18px,2.2vw,32px);gap:clamp(19px,2.2vw,32px);
  background:linear-gradient(160deg,#201f2a 0%,#181822 52%,#110f18 100%);
}
.halls .hall::before {
  background:radial-gradient(ellipse at 50% 32%,#c5af7840,transparent 63%);
}
.halls .scene-art {
  position:relative;inset:auto;z-index:0;display:block;justify-self:center;
  width:min(70%,200px);background:#11131b;animation:none;transform:none;
}
.halls .hall:hover .scene-art,.halls .hall:focus-visible .scene-art {transform:none}
.halls .hall-words {align-self:start;max-width:100%}
@media(max-width:700px) {
  .halls .hall {grid-template:1fr / clamp(82px,24vw,120px) minmax(0,1fr);align-items:center;gap:clamp(14px,3.5vw,22px);padding:18px}
  .halls .scene-art {width:100%}
  .halls .hall-words {align-self:center;padding-top:16px}
  .halls .hall-words strong {font-size:clamp(24px,6vw,32px)}
  .halls .hall>b {width:24px;height:24px;top:7px;right:8px;font-size:16px}
}

.halls .scene-art img {position:absolute;inset:0}

.stage .home-register {
  position:absolute;inset:0;pointer-events:none;z-index:3;
  border:0;box-shadow:none;background:none;
}
.stage .reading .portrait-print {
  display:block;width:100%;aspect-ratio:var(--deck-ratio,5 / 7);padding:0;
}
.stage .reading .portrait-print .portrait {
  display:block;position:absolute;inset:0;width:100%;height:100%;
  border:0;background:none;box-shadow:none;
}
@media(max-width:700px) {
  .stage .reading .portrait-print {width:min(55vw,19svh);flex:none}
}
@media(max-width:700px) and (max-height:639px) and (orientation:portrait){
  .stage .reading .portrait-print {width:14.28svh}
}
@media(max-height:500px) and (orientation:landscape){
  .stage .reading .portrait-print {width:100%}
}

/* The four instances use precisely the same mount as an interior reading. */
.stage .card .back img,.halls .scene-art img,.stage .reading .portrait-print .portrait {
  position:absolute;inset:var(--deck-art-inset);width:var(--deck-art-size);height:var(--deck-art-size);object-fit:contain;
}

/* The portal print brings its own brass lines and four register marks.
   Only its exposed right edge casts a shadow. Open faces keep the deck mount. */
.stage .gate,.stage .card .front {border:0;border-radius:0;background:transparent;box-shadow:none}
.stage .gate,.stage .card:not(.chosen):not(.other) .plate {box-shadow:var(--portal-fore-edge)}
.stage .gate::before,.stage .gate .gate-depth,
.stage .gate .home-register,.stage .card .front .home-register {display:none}
.stage .card .front .window {border:0;box-shadow:none}
