#showroom-door {
  --door-release-ms: 995;
  --door-art: url("media/showroom-door-wide.webp");
  --latch-size: clamp(76px, min(32cqw, 51cqh), 215px);
  position: absolute;
  z-index: 4;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

#showroom-door:focus-visible {
  outline: 3px solid var(--hot);
  outline-offset: -5px;
}

.door-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: #242b2d;
  transform: translateX(0);
}

.door-leaf--left { left: 0; --travel: -101%; }
.door-leaf--right { right: 0; --travel: 101%; }

/* Each leaf crops the same front elevation so the bevels, lighting and seam agree. */
.door-leaf::before {
  content: "";
  position: absolute;
  inset-block: 0;
  width: 200%;
  background: var(--door-art) center / cover no-repeat;
}
.door-leaf--left::before { left: 0; }
.door-leaf--right::before { right: 0; }

.door-leaf--left::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 0 0 auto;
  width: 1px;
  opacity: .78;
  background: linear-gradient(transparent, var(--green) 29%, var(--hot) 45%, var(--green) 71%, transparent);
  filter: drop-shadow(0 0 2px var(--green));
}

.door-latch {
  position: absolute;
  z-index: 1;
  top: 48%;
  width: var(--latch-size);
  aspect-ratio: 1;
  background: url("media/showroom-latch-housing.webp") center / contain no-repeat;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 1px #020506cc) drop-shadow(2px 5px 5px #02050675);
}
.door-leaf--left .door-latch { left: 100%; }
.door-leaf--right .door-latch { left: 0; }

.door-rotor {
  position: absolute;
  inset: 0;
  background: url("media/showroom-latch-rotor.webp") center / contain no-repeat;
}
.door-brand {
  position: absolute;
  inset: 27.35%;
  border-radius: 50%;
  background: var(--green) url("media/codelincs-swept-lynx.png") center / auto 75% no-repeat;
}
.door-rotor::after {
  content: "";
  position: absolute;
  left: 48.6%;
  top: 20.9%;
  width: 2.8%;
  height: 1%;
  border-radius: 1px;
  background: var(--hot);
  box-shadow: 0 0 4px var(--green);
}

.door-caption {
  position: absolute;
  left: 50%;
  top: calc(48% + var(--latch-size) * .53);
  transform: translateX(-50%);
  padding: .3em .9em .38em;
  border: 1px solid #697474;
  border-radius: 3px;
  background: #171d1f;
  color: #ecf3f3;
  box-shadow: inset 0 1px #465052, 0 2px 4px #0406068c;
  font: 500 clamp(.87rem, 3cqh, 1rem)/1.25 var(--mono);
  letter-spacing: .035em;
  white-space: nowrap;
}
#showroom-door:is(:hover,:focus-visible) .door-caption {
  border-color: var(--hot);
  color: var(--hot);
}

/* A quarter turn aligns the latch keyways with the vertical split. */
#work:is([data-door-state="opening"],[data-door-state="open"]) .door-rotor {
  transform: rotate(90deg);
  transition: transform 305ms cubic-bezier(.37, .02, .16, 1);
}
#work:is([data-door-state="opening"],[data-door-state="open"]) .door-leaf {
  transform: translateX(var(--travel));
  transition: transform 670ms cubic-bezier(.55, .015, .18, 1) 325ms;
}
#work:is([data-door-state="opening"],[data-door-state="open"]) .door-caption {
  opacity: 0;
  transition: opacity 105ms ease-in;
}

@container (max-aspect-ratio: 5/4) {
  #showroom-door {
    --door-art: url("media/showroom-door-tall.webp");
    --latch-size: clamp(88px, min(46cqw, 42cqh), 196px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #showroom-door { --door-release-ms: 0; }
  #work #showroom-door :is(.door-leaf,.door-rotor,.door-caption) { transition: none; }
}
@media (forced-colors: active) {
  #showroom-door { forced-color-adjust: none; }
  #showroom-door .door-caption { border-color: ButtonText; background: ButtonFace; color: ButtonText; }
  #showroom-door:focus-visible { outline-color: Highlight; }
}
