/* Doorway Tour door transitions, shared by every doorwaytour.com page.
   Page to page: the door closes over this page, then opens into the next.
   In page: doors part to show the section a visitor jumped to, and each
   major section opens from a slit as it scrolls in. Off with reduced motion. */

/* Arriving from another Doorway page: the closed door is painted over the page from the first
   frame, as a pseudo-element on the root, so the page underneath stays in the accessibility tree */
html.dt-door-in::after{content:"";position:fixed;inset:0;z-index:2147483002;pointer-events:none;
  background:url(/doorwaytour/intro/door-closed.webp) center/min(56vw,300px) no-repeat,radial-gradient(80% 70% at 50% 46%,#0A2238 0%,#061C2F 42%,#031326 100%)}

.dt-door{position:fixed;inset:0;z-index:2147483001;display:grid;place-items:center;overflow:hidden;pointer-events:none}
.dt-door .dd-bg{position:absolute;inset:0;background:radial-gradient(80% 70% at 50% 46%,#0A2238 0%,#061C2F 42%,#031326 100%)}
.dt-door .dd-tile{position:relative;width:min(56vw,300px);aspect-ratio:1;transform-origin:67% 50%}
.dt-door .dd-tile img,.dt-door .dd-tile video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover}
.dt-door .dd-tile video{opacity:0;-webkit-mask-image:radial-gradient(closest-side,#000 80%,transparent 100%);mask-image:radial-gradient(closest-side,#000 80%,transparent 100%)}
.dt-door .dd-tile .dd-open{opacity:0}
.dt-door.dd-exit .dd-tile .dd-open{animation:dd-shut .36s linear both}
@keyframes dd-shut{0%,55%{opacity:1}100%{opacity:0}}
.dt-door .dd-tile video.on{opacity:1}

/* Leaving: back out through the doorway and the door closes behind you */
.dt-door.dd-exit .dd-bg{animation:dd-fade .36s cubic-bezier(.4,0,.2,1) both}
.dt-door.dd-exit .dd-tile{animation:dd-close .36s cubic-bezier(.4,0,.2,1) both}
@keyframes dd-fade{from{opacity:0}to{opacity:1}}
@keyframes dd-close{from{transform:scale(9);opacity:0}35%{opacity:1}to{transform:none;opacity:1}}

/* Arriving: the door swings open, then the camera goes through it */
.dt-door.dd-through .dd-tile{transition:transform .5s cubic-bezier(.6,0,.3,1);transform:scale(9)}
.dt-door.dd-through .dd-bg{transition:opacity .42s ease .08s;opacity:0}

/* In page: two leaves meet, the page moves, the leaves swing open on the section */
.dt-leaves{position:fixed;inset:0;z-index:2147483000;pointer-events:none;perspective:1600px;display:flex}
.dt-leaves i{flex:1;height:100%;background:linear-gradient(90deg,#0A2238,#0E2638 70%,#123A5C);transform-origin:0 50%;transform:rotateY(-92deg);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.08)}
.dt-leaves i+i{background:linear-gradient(270deg,#0A2238,#0E2638 70%,#123A5C);transform-origin:100% 50%;transform:rotateY(92deg);box-shadow:inset 1px 0 0 rgba(255,255,255,.08)}
.dt-leaves::after{content:"";position:absolute;left:50%;top:0;bottom:0;width:2px;margin-left:-1px;opacity:0;
  background:linear-gradient(180deg,transparent,#FFC53D 30%,#FFE596 50%,#FFC53D 70%,transparent);box-shadow:0 0 24px 6px rgba(255,197,61,.55)}
.dt-leaves.dl-shut i{transition:transform .24s cubic-bezier(.3,.1,.3,1);transform:none}
.dt-leaves.dl-shut::after{transition:opacity .12s ease .16s;opacity:1}
.dt-leaves.dl-open i{transition:transform .62s cubic-bezier(.2,.75,.2,1)}
.dt-leaves.dl-open::after{transition:opacity .3s ease;opacity:0}

/* Scrolling in: each major section parts open from the middle, once */
.dt-frame{clip-path:inset(0 46% 0 46% round 18px)}
.dt-frame.dt-open{clip-path:inset(0 0 0 0 round 0);transition:clip-path .9s cubic-bezier(.2,.75,.2,1)}

@media (prefers-reduced-motion:reduce){
  html.dt-door-in::after{display:none}
  .dt-door,.dt-leaves{display:none}
  .dt-frame{clip-path:none}
}
@media print{.dt-door,.dt-leaves{display:none}.dt-frame{clip-path:none}}
