/* Opening overlay; main/map styles remain independent. */
#christmas-intro {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  color: #f2ddca;
  background: radial-gradient(ellipse at 50% 42%, #241a2b 0%, #171523 57%, #14131e 100%);
  --ci-length: 8750ms;
  --ci-flight-length: 5100ms;
  --ci-drop-delay: 5500ms;
  --ci-drop-length: 1900ms;
}
#christmas-intro[hidden] { display: none !important; }
html.ci-playing, html.ci-playing body { overflow: hidden; }
#christmas-intro .ci-stage {
  position: relative;
  width: min(100%, 54vh);
  width: min(100%, 54dvh);
  height: 100%;
  overflow: hidden;
}
#christmas-intro .ci-art {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#christmas-intro .ci-skip {
  position: absolute;
  z-index: 2;
  top: max(11px, env(safe-area-inset-top));
  right: 13px;
  min-height: 44px;
  min-width: 60px;
  padding: 0 9px;
  margin: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #efd4c0;
  font: 500 11px/1 "Noto Sans CJK SC", "PingFang SC", system-ui, sans-serif;
  letter-spacing: .1em;
  cursor: pointer;
}
#christmas-intro .ci-skip span { padding-left: .28em; }
#christmas-intro .ci-skip:hover { color: #fff1e3; }
#christmas-intro .ci-skip:focus-visible { outline: 1px solid #e6ad96; outline-offset: -2px; }
#christmas-intro .ci-flight, #christmas-intro .ci-delivery,
#christmas-intro .ci-caption, #christmas-intro .ci-exit-trail,
#christmas-intro .ci-descent-trail { opacity: 0; transform-box: view-box; }
#christmas-intro.ci-running {
  animation: ci-close var(--ci-length) linear both;
}
#christmas-intro.ci-running .ci-flight {
  transform-origin: 205px 310px;
  animation: ci-flight var(--ci-flight-length) linear both;
}
#christmas-intro.ci-running .ci-exit-trail {
  animation: ci-afterglow 1480ms ease-in-out 4740ms both;
}
#christmas-intro.ci-running .ci-descent-trail {
  animation: ci-afterglow 2300ms ease-in-out 5260ms both;
}
#christmas-intro.ci-running .ci-delivery {
  transform-origin: 215px 429px;
  animation: ci-float-in var(--ci-drop-length) both var(--ci-drop-delay);
}
#christmas-intro.ci-running .ci-caption-one { animation: ci-title-out 5050ms linear both; }
#christmas-intro.ci-running .ci-caption-two { animation: ci-title-in 580ms ease-out 6680ms both; }
@keyframes ci-close {
  0%, 91% { opacity: 1; }
  100% { opacity: 0; }
}
/* The object enters left edge at distance; there are no visibility or scale jumps on screen. */
@keyframes ci-flight {
  0%   { opacity: 1; transform: translate(-348px,-72px) scale(.66) rotate(-2deg); }
  18%  { opacity: 1; transform: translate(-246px,-58px) scale(.73) rotate(-1.3deg); }
  35%  { opacity: 1; transform: translate(-140px,-31px) scale(.86) rotate(-.6deg); }
  55%  { opacity: 1; transform: translate(0,0) scale(1); }
  70%  { opacity: 1; transform: translate(108px,9px) scale(1.04) rotate(1deg); }
  84%  { opacity: 1; transform: translate(231px,-1px) scale(1.06) rotate(-.2deg); }
  100% { opacity: 1; transform: translate(450px,-35px) scale(1.08) rotate(-1.5deg); }
}
@keyframes ci-float-in {
  0%   { opacity: 0; transform: translate(8px,-600px) rotate(6deg); animation-timing-function: cubic-bezier(.32,.08,.66,.55); }
  18%  { opacity: 1; transform: translate(5px,-405px) rotate(4deg); animation-timing-function: cubic-bezier(.18,.56,.23,1); }
  84%  { opacity: 1; transform: translate(-1.4px,4px) rotate(-.7deg); animation-timing-function: ease-out; }
  100% { opacity: 1; transform: translate(0,0) rotate(0); }
}
@keyframes ci-afterglow {
  0%,100% { opacity:0; }
  35% { opacity:.82; }
}
@keyframes ci-title-out {
  0%,9% { opacity:0; }
  27%,85% { opacity:1; }
  100% { opacity:0; }
}
@keyframes ci-title-in {
  from { opacity:0; transform:translateY(7px); }
  to { opacity:1; transform:translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #christmas-intro { display: none !important; }
}
