/* The doorway is assembled from the same image, so its leaves stay aligned
   with the frame at every viewport size. Photography and its adaptations:
   Basile Morin / CC BY-SA 4.0. See /en/credits/#palace-artwork. */
.landing .palace-closing {
  padding: 82px 0 28px;
  background: #03080e;
  border-top: 1px solid #b9dfff1c;
}
.palace-introduction { position: relative; z-index: 2; pointer-events: none; }
.landing .palace-introduction .landing-kicker { color: #c5bfae; margin-inline: auto; }
.landing .palace-introduction h2 { margin: 23px 0; }
.landing .palace-introduction h2 em { color: #d4e7f3; }
.landing .palace-introduction > p:last-child { margin-bottom: 0; }
.palace-scene {
  position: relative;
  width: min(1440px, max(100%, 900px));
  aspect-ratio: 3 / 2;
  left: 50%;
  transform: translateX(-50%);
  margin-top: -132px;
  isolation: isolate;
}
.palace-art { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% 70%; transition: transform 1.4s cubic-bezier(.42,0,.18,1); }
.palace-art > .palace-facade { position: absolute; width: 100%; height: 100%; }
.palace-facade {
  clip-path: polygon(evenodd, 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 45.111% 62.833%, 45.111% 78.583%, 55% 78.583%, 55% 62.833%, 45.111% 62.833%, 0% 0%);
  filter: brightness(.66) saturate(.76);
}
.palace-beyond, .palace-doorway {
  position: absolute;
  left: 45.111%; top: 62.833%; width: 9.889%; height: 15.75%;
}
.palace-beyond { overflow: hidden; background: #c5b795; }
.palace-beyond img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%;
  transform: scale(1.15); filter: brightness(.68) saturate(.75);
  transition: transform 1.4s cubic-bezier(.22,.61,.36,1), filter 1.2s ease;
}
.palace-beyond::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 35px 10px #040912a6; }
.palace-doorway { perspective: 1100px; }
.palace-leaf {
  position: absolute; top: 0; height: 100%;
  background-image: url('/media/heungnyemun-gate.webp');
  backface-visibility: hidden;
  filter: brightness(.66) saturate(.76);
  transition: transform 1.15s .14s cubic-bezier(.3,.02,.16,1), filter 1.15s .14s ease;
}
.palace-leaf-left {
  left: 0; width: 49.438%; transform-origin: left center;
  background-size: 2045.455% 634.921%; background-position: 47.43% 74.58%;
}
.palace-leaf-right {
  right: 0; width: 50.562%; transform-origin: right center;
  background-size: 2000% 634.921%; background-position: 52.632% 74.58%;
}
.palace-seam {
  position: absolute; left: 49.438%; width: 1px; height: 100%;
  background: #ffedc7; box-shadow: 0 0 12px 2px #ffc7799c, 0 0 48px 8px #ffc77947;
  opacity: .45; transition: opacity .3s ease;
}
.palace-spill {
  position: absolute; left: 35%; top: 77%; width: 30%; height: 20%;
  background: radial-gradient(ellipse at 50% 0, #ffdca849, #ffcf9822 40%, transparent 72%);
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  opacity: .3; transition: opacity 1.1s ease, transform 1.4s ease;
}
.palace-atmosphere {
  position: absolute; inset: -1px;
  background: linear-gradient(#03080e 0%, #03080e91 13%, transparent 28%, transparent 67%, #03080e 100%), linear-gradient(90deg,#03080e 0%,transparent 15%,transparent 85%,#03080e 100%);
}
.palace-actions {
  position: absolute; z-index: 3; top: 81%; left: 50%;
  width: min(360px, 80vw); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.palace-invitation { font-size: 16px; color: #d1c6b5; margin-bottom: 18px; }
.landing .palace-actions .landing-button {
  min-width: 270px; min-height: 60px; color: #171511;
  background: #f4e8d4; border-color: #ebd3ac;
  box-shadow: 0 0 50px #e1b27114; white-space: nowrap;
}
.landing .palace-actions .landing-button:hover { background: #fff7e9; box-shadow: 0 0 40px #e1b27138; }
.landing .palace-actions a:focus-visible { outline: 2px solid #fff0d4; outline-offset: 6px; }
.landing .palace-actions .landing-text-link { font-size: 15px; color: #b8ccda; margin-top: 15px; }
.palace-colophon {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: relative; z-index: 3; margin-top: 24px;
  color: #8a9ca9; font-family: var(--small); font-size: 9px; letter-spacing: .09em;
}
.palace-colophon a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; letter-spacing: 0; font-size: 10px; }
.palace-colophon .landing-arrow { width: 13px; height: 13px; }
.palace-closing.is-opening .palace-art { transform: scale(2.4); }
.palace-closing.is-opening .palace-leaf-left { transform: rotateY(-105deg); filter: brightness(.6); }
.palace-closing.is-opening .palace-leaf-right { transform: rotateY(105deg); filter: brightness(.6); }
.palace-closing.is-opening .palace-seam { opacity: 0; }
.palace-closing.is-opening .palace-beyond img { transform: scale(1); filter: brightness(1.2) saturate(.9); }
.palace-closing.is-opening .palace-spill { opacity: 1; transform: scaleX(1.35); }
.palace-closing.is-opening .palace-actions .landing-arrow { transform: translate(3px,-3px); }
@media (max-width: 800px) {
  .landing .palace-closing { padding-top: 64px; }
  .palace-scene { margin-top: -80px; }
  .palace-actions { top: 80%; }
  .palace-colophon { margin-top: 54px; }
}
@media (max-width: 600px) {
  .landing .palace-introduction .landing-kicker { font-size: 8px; letter-spacing: .1em; }
  .landing .palace-introduction h2 { margin: 22px 0; }
  .landing .palace-introduction > p:last-child { max-width: 290px; margin-bottom: 0; }
  .palace-scene { width: 860px; margin-top: -62px; }
  .palace-colophon { flex-direction: column; gap: 1px; font-size: 8px; margin-top: 62px; }
  .palace-invitation { font-size: 14px; margin-bottom: 15px; }
  .landing .palace-actions .landing-button { font-size: 17px; min-height: 57px; min-width: 260px; }
  .landing .palace-actions .landing-text-link { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .palace-art, .palace-art *, .palace-actions .landing-arrow { transition: none !important; }
}
.motion-paused .palace-art, .motion-paused .palace-art * { transition: none !important; }
@media print {
  .landing .palace-closing { padding: 30px 0; }
  .palace-art, .palace-colophon, .palace-invitation { display: none; }
  .palace-scene { width: 100%; aspect-ratio: auto; margin: 0; left: 0; transform: none; }
  .palace-actions { position: static; transform: none; width: auto; }
}
