/* Brief, silent details that stay out of the door controls. */
.house-surprise { position: absolute; pointer-events: none; }

.surprise-koira {
  --dog-width: clamp(54px, 7.4vw, 85px);
  left: max(-64px, -6vw);
  right: max(-64px, -6vw);
  bottom: -5px;
  height: calc(var(--dog-width) * .74);
  overflow: hidden;
  z-index: 6;
}
.dog-crossing {
  position: absolute;
  inset: 0;
  animation: dog-crossing var(--scene-duration) linear both;
}
.dog-figure { position: absolute; left: 0; bottom: 0; width: var(--dog-width); height: auto; }
.dog-leg {
  transform-box: fill-box;
  transform-origin: center top;
  animation: dog-step .68s ease-in-out infinite alternate;
}
.dog-leg-far { animation-delay: -.68s; }
.dog-tail, .dog-scarf {
  transform-box: fill-box;
  transform-origin: right center;
  animation: dog-tail .8s ease-in-out infinite alternate;
}
.dog-scarf { animation-duration: 1.15s; }
@keyframes dog-crossing {
  0% { transform: translateX(calc(-1 * var(--dog-width))); }
  45% { transform: translateX(45%); }
  54% { transform: translateX(49%); }
  100% { transform: translateX(100%); }
}
@keyframes dog-step { from { transform: skewX(-14deg); } to { transform: skewX(14deg); } }
@keyframes dog-tail { from { transform: rotate(-11deg); } to { transform: rotate(9deg); } }

.surprise-tonttu {
  left: 38.38%;
  top: 49.23%;
  width: 10.6%;
  height: 30%;
  transform: translate(-50%, -50%);
  clip-path: ellipse(50% 50%);
  z-index: 5;
}
.elf-window {
  width: 100%;
  height: 100%;
  background: #071e22;
  animation: elf-window var(--scene-duration) ease-in-out both;
}
.elf-peek {
  position: absolute;
  left: 5%;
  bottom: -9%;
  width: 90%;
  height: 105%;
  animation: elf-peek var(--scene-duration) cubic-bezier(.28,.61,.32,1) both;
}
.elf-wink {
  transform-box: fill-box;
  transform-origin: center;
  animation: elf-wink var(--scene-duration) ease-in-out both;
}
@keyframes elf-window {
  0%, 100% { opacity: 0; }
  10%, 92% { opacity: .98; }
}
@keyframes elf-peek {
  0%, 7%, 100% { transform: translateY(101%) rotate(-14deg); }
  23%, 30% { transform: translate(-7%, 4%) rotate(-13deg); }
  46%, 61% { transform: translate(4%, 1%) rotate(8deg); }
  74%, 81% { transform: translate(9%, 9%) rotate(15deg); }
}
@keyframes elf-wink {
  0%, 50%, 59%, 100% { transform: scaleY(1); }
  53%, 55% { transform: scaleY(.14); }
}

.surprise-lyhty { inset: 0; }
.fanlight-glow {
  position: absolute;
  inset: 0;
  border-radius: 70% 70% 12% 12%;
  background: radial-gradient(ellipse at 50% 78%, #ffe0a5, #f4c09542 56%, transparent 72%);
  animation: fanlight-glow var(--scene-duration) ease-in-out both;
}
@keyframes fanlight-glow {
  0%, 100% { opacity: 0; transform: scale(.92); }
  24%, 76% { opacity: .8; transform: scale(1); }
  48% { opacity: .55; transform: scale(.97); }
}

.surprise-lintu {
  left: 89%;
  top: 39.8%;
  width: clamp(29px, 5vw, 55px);
  transform: translate(-50%, -98%);
  z-index: 5;
}
.roof-robin {
  display: block;
  width: 100%;
  animation: roof-robin var(--scene-duration) ease-in-out both;
}
.robin-wing {
  transform-box: fill-box;
  transform-origin: right bottom;
  animation: robin-wing var(--scene-duration) ease-in-out both;
}
@keyframes roof-robin {
  0% { opacity: 0; transform: translate(-155%, -115%) rotate(14deg); }
  14% { opacity: 1; transform: translate(-72%, -55%) rotate(8deg); }
  27%, 72% { opacity: 1; transform: translate(0, 0); }
  83% { opacity: 1; transform: translate(55%, -45%) rotate(-9deg); }
  100% { opacity: 0; transform: translate(116%, -165%) rotate(-17deg); }
}
@keyframes robin-wing {
  0%, 17%, 81%, 94% { transform: rotate(13deg); }
  10%, 23%, 76%, 88%, 100% { transform: rotate(-36deg); }
  31%, 71% { transform: rotate(32deg) scale(.78); }
}

.surprise-lumipyry {
  inset: -62px -12px -96px;
  z-index: 7;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 36%, #000a 59%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 45%, #000 36%, #000a 59%, transparent 75%);
  animation: flurry-arrival var(--scene-duration) ease-in-out both;
}
.flurry-print { display: block; width: 100%; height: 100%; }
.flurry-far { opacity: .52; animation: flurry-far var(--scene-duration) linear both; }
.flurry-near { opacity: .72; animation: flurry-near var(--scene-duration) linear both; }
@keyframes flurry-arrival {
  0%, 100% { opacity: 0; }
  22%, 71% { opacity: .94; }
  43% { opacity: .57; }
}
@keyframes flurry-far { to { transform: translate(254px, 88px); } }
@keyframes flurry-near { to { transform: translate(554px, 144px); } }

.surprise-poro {
  --reindeer-width: clamp(92px, 15vw, 158px);
  top: -99px;
  left: -24px;
  right: -24px;
  height: 178px;
  overflow: hidden;
  z-index: 6;
}
.reindeer-flight {
  position: absolute;
  inset: 0;
  animation: reindeer-flight var(--scene-duration) linear both;
}
.reindeer-figure { position: absolute; top: 34px; width: var(--reindeer-width); height: auto; }
.reindeer-stride, .reindeer-stride-back {
  transform-box: fill-box;
  transform-origin: center top;
  animation: reindeer-stride .58s ease-in-out infinite alternate;
}
.reindeer-stride-back { animation-delay: -.58s; }
.reindeer-spark { animation: reindeer-spark 1.35s ease-in-out infinite alternate; }
@keyframes reindeer-flight {
  0% { transform: translate(calc(-1 * var(--reindeer-width)), 40px); }
  25% { transform: translate(15%, 4px); }
  47% { transform: translate(39%, -18px); }
  72% { transform: translate(66%, 4px); }
  100% { transform: translate(100%, -32px); }
}
@keyframes reindeer-stride { from { transform: skewX(-12deg); } to { transform: skewX(14deg); } }
@keyframes reindeer-spark { from { opacity: .34; } to { opacity: 1; } }

.surprise-tahti {
  left: 71%;
  top: 5%;
  width: clamp(72px, 11vw, 132px);
  transform: translate(-50%, -50%);
  z-index: 6;
}
.roof-star {
  display: block;
  width: 100%;
  animation: star-appearance var(--scene-duration) ease-in-out both;
}
.star-core, .star-halo, .star-sparks {
  transform-box: view-box;
  transform-origin: center;
  animation-duration: var(--scene-duration);
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
}
.star-core { animation-name: star-twinkle; }
.star-halo { animation-name: star-halo; }
.star-sparks { animation-name: star-sparks; }
@keyframes star-appearance {
  0%, 100% { opacity: 0; }
  15%, 87% { opacity: 1; }
}
@keyframes star-twinkle {
  0%, 100% { transform: scale(.44, .52) rotate(-15deg); opacity: .35; }
  23%, 63% { transform: scale(1) rotate(5deg); opacity: 1; }
  42%, 83% { transform: scale(.65, .82) rotate(-8deg); opacity: .55; }
}
@keyframes star-halo {
  0%, 100% { transform: scale(.62); opacity: .2; }
  28%, 70% { transform: scale(1.08) rotate(30deg); opacity: .65; }
  49% { transform: scale(.83) rotate(15deg); opacity: .38; }
}
@keyframes star-sparks {
  0%, 44%, 100% { transform: scale(.72); opacity: 0; }
  24%, 67% { transform: scale(1.12); opacity: .88; }
  85% { transform: scale(1.02); opacity: .25; }
}

.surprise-tietajat {
  --caravan-width: clamp(204px, 66vw, 365px);
  left: max(-64px, -6vw);
  right: max(-64px, -6vw);
  bottom: -4px;
  height: calc(var(--caravan-width) * .36);
  overflow: hidden;
  z-index: 6;
}
.caravan-crossing {
  position: absolute;
  inset: 0;
  animation: caravan-crossing var(--scene-duration) linear both;
}
.caravan-figure { position: absolute; bottom: 0; width: var(--caravan-width); height: auto; }
.caravan-stepping { animation: camel-bob .91s ease-in-out infinite alternate; }
.caravan-figure > g:nth-child(2) .caravan-stepping { animation-delay: -.4s; }
.caravan-figure > g:nth-child(3) .caravan-stepping { animation-delay: -.7s; }
.camel-step, .camel-step-far {
  transform-box: fill-box;
  transform-origin: center top;
  animation: camel-step .8s ease-in-out infinite alternate;
}
.camel-step-far { animation-delay: -.8s; }
@keyframes caravan-crossing {
  0% { transform: translateX(calc(-1 * var(--caravan-width))); }
  42% { transform: translateX(calc(45% - var(--caravan-width) / 2)); }
  58% { transform: translateX(calc(55% - var(--caravan-width) / 2)); }
  100% { transform: translateX(100%); }
}
@keyframes camel-bob { to { transform: translateY(-1.6px); } }
@keyframes camel-step { from { transform: skewX(-13deg); } to { transform: skewX(13deg); } }

@media (max-width: 700px) {
  .surprise-koira { left: -10px; right: -10px; bottom: -3px; }
  .surprise-lintu { left: 87%; }
  .surprise-lumipyry { inset: -45px -4px -65px; }
  .surprise-poro { left: -8px; right: -8px; top: -66px; height: 133px; }
  .reindeer-figure { top: 26px; }
  .surprise-tietajat { left: -10px; right: -10px; bottom: -3px; }
}
@media (prefers-reduced-motion: reduce) {
  .house-surprise { display: none; }
}
