.threshold{position:fixed;inset:0;z-index:30;display:grid;place-items:center;overflow:hidden;background:#100b08}
#door{position:relative;height:min(100dvh,133.333vw);aspect-ratio:3/4;border:0;padding:0;background:transparent;cursor:pointer;transform-origin:50% 59%}
#door:focus-visible{outline:2px solid #ffe3a4;outline-offset:-3px}
#door img{display:block;width:100%;height:100%}
.doorway{position:absolute;inset:0;overflow:hidden;clip-path:inset(33.3% 31.2% 15.4% 31.2%);perspective:95vh;perspective-origin:50% 59%;background:#211810 url(assets/room-day.png) 50% 52% / auto 54% no-repeat}
.door-leaf{position:absolute;inset:0;background:url(assets/door.webp) center/100% 100% no-repeat;backface-visibility:hidden}
.door-leaf.left{clip-path:inset(33% 49% 15% 31%);transform-origin:31.2% 59%;--open:83deg}
.door-leaf.right{clip-path:inset(33% 31% 15% 50.9%);transform-origin:68.8% 59%;--open:-83deg}
.opening .door-leaf{animation:swingIn 1.55s cubic-bezier(.4,.03,.18,1) both}
.opening #door{animation:walkInside 2.15s ease-in both}
.threshold.opening{animation:revealInterior 2.15s both}
@keyframes swingIn{from{transform:rotateY(0)}to{transform:rotateY(var(--open));filter:brightness(.63)}}
@keyframes walkInside{0%,48%{transform:scale(1)}100%{transform:scale(1.48)}}
@keyframes revealInterior{0%,72%{opacity:1}100%{opacity:0}}
@media(max-width:720px) and (orientation:portrait){#door{width:max(100vw,75dvh);height:auto;justify-self:center}}
@media(prefers-reduced-motion:reduce){.opening #door,.opening .door-leaf{animation:none}.threshold.opening{animation:revealInterior .16s both}}
.threshold{grid-template-columns:minmax(0,1fr)}
@media(orientation:portrait) and (max-width:1024px){
  #door{width:max(100vw,75vh);width:max(100vw,75dvh);height:auto;justify-self:center}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:540px){
  .hotspots .hotspot{width:32px;height:32px}
}
