.sky-gate {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: #fff5dc;
  background: #000;
  text-align: center;
}
.sky-gate[open] { display: block; }
.sky-gate::backdrop { background: transparent; }
body:has(.sky-gate[open]) { overflow: hidden; }
html:has(.sky-gate[open])::view-transition-old(root) { opacity: 0; animation: none; }
html:has(.sky-gate[open])::view-transition-new(root) { animation: none; }
.sky-gate canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.gate-inscription {
  position: absolute;
  inset: 6% 0 auto;
  padding: 0 4vw;
  color: #fff5dc;
  text-shadow: 0 2px 6px #192e49, 0 0 24px #283a58;
}
.gate-inscription h2 {
  margin: 0;
  color: inherit;
  font: 400 clamp(1.65rem, 4.3vw, 3.8rem)/1.12 Marcellus, Georgia, serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-wrap: balance;
}
.gate-inscription h2:focus { outline: none; }
.gate-inscription p {
  margin: .72em 0 0;
  color: inherit;
  font: 500 clamp(.65rem, 1.1vw, .86rem)/1.5 Barlow, system-ui, sans-serif;
  letter-spacing: .19em;
  text-transform: uppercase;
}
.sky-gate button {
  position: absolute;
  right: max(1.4rem, env(safe-area-inset-right));
  bottom: max(1.4rem, env(safe-area-inset-bottom));
  min-height: 44px;
  min-width: 5rem;
  padding: 0 1.25rem;
  border: 1px solid #ded2ad;
  border-radius: 2px;
  color: #fff4d7;
  background: #18283acf;
  font: 600 .72rem/1 Barlow, system-ui, sans-serif;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
}
.sky-gate button:hover, .sky-gate button:focus-visible { background: #162738; outline: 2px solid #fff2c7; }


.sky-gate [hidden] { display: none; }
.gate-inscription { opacity: 0; transition: opacity .55s ease; pointer-events: none; }
.sky-gate[data-stage="landing"] .gate-inscription { opacity: 1; }
.sky-gate[data-stage="landing"] { background: url("img/sky-gate-doors.webp") center/auto 34% no-repeat, #72809b url("img/sky-gate-clouds.webp") center/cover; }
.sky-gate[data-stage="inside"] { background: #dee0e9; }

.sky-gate[open] .gate-skip { animation: gate-controls .4s .35s both; }
.sky-gate .gate-enter {
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
  bottom: max(7%, env(safe-area-inset-bottom));

  min-width: 10.5rem;
  padding: .8rem 2rem;
  color: #fff2d5;
  border: 1px solid #e7cb88;
  background: linear-gradient(135deg,#2a3948f5,#192336f5);
  box-shadow: inset 0 0 0 3px #25313d, inset 0 0 0 4px #9c895c, 0 4px 18px #19233170;
  font-family: Marcellus, Georgia, serif;
}
.sky-gate .gate-enter:not([hidden]) { animation: gate-controls .5s ease both; }
@keyframes gate-controls { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sky-gate *, .sky-gate[open] button { animation-duration: 0s !important; transition: none; }
}

/* The painted door and its caption activate the same native button. */
.sky-gate[data-stage="landing"] .gate-enter::before {
  content: "";
  position: fixed;
  left: var(--door-left, 0);
  top: var(--door-top, 0);
  width: var(--door-width, 0);
  height: var(--door-height, 0);
  cursor: pointer;
}
