.calendar-scene-frame {
  position: relative;
  isolation: isolate;
}

.calendar-scene-frame > #trade-calendar-image-link {
  display: block;
}

.calendar-scene {
  --atlas-x: 0%;
  --atlas-y: 0%;
  --scene-effect-color: #d8a063;
  --work-lift: -4%;
  --work-tilt: -2deg;
  position: absolute;
  z-index: 1;
  inset: 49% 1px 1px;
  overflow: hidden;
  border-radius: 0 0 var(--radius, 10px) var(--radius, 10px);
  pointer-events: none;
  user-select: none;
}

.calendar-scene[data-trade="hochbau"] {
  --atlas-x: 50%;
  --scene-effect-color: #ac9e87;
  --work-tilt: -1.5deg;
}

.calendar-scene[data-trade="storenbau"] {
  --atlas-x: 100%;
  --scene-effect-color: #e1b553;
  --work-lift: -2%;
  --work-tilt: -1deg;
}

.calendar-scene[data-trade="sanitaer"] {
  --atlas-y: 100%;
  --scene-effect-color: #70b7cc;
  --work-tilt: 1.5deg;
}

.calendar-scene[data-trade="bodenlegen"] {
  --atlas-x: 50%;
  --atlas-y: 100%;
  --scene-effect-color: #ba8c59;
  --work-lift: -2.5%;
  --work-tilt: 2deg;
}

.calendar-scene[data-trade="solarbau"] {
  --atlas-x: 100%;
  --atlas-y: 100%;
  --scene-effect-color: #e9bd50;
  --work-lift: -2%;
  --work-tilt: -1.5deg;
}

.calendar-scene .scene-vehicle,
.calendar-scene .scene-work {
  position: absolute;
  bottom: -4%;
  aspect-ratio: 1;
  opacity: .9;
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: var(--atlas-x) var(--atlas-y);
  filter: drop-shadow(0 5px 6px rgb(15 26 44 / 22%));
}

.calendar-scene .scene-vehicle {
  left: 20%;
  width: clamp(4.5rem, 19%, 13rem);
  background-image: url("assets/vehicle-atlas.png");
}

.calendar-scene .scene-work {
  right: 11%;
  width: clamp(5.5rem, 24%, 16rem);
  transform-origin: 50% 77%;
  background-image: url("assets/work-atlas.png");
}

.calendar-scene .scene-effect {
  position: absolute;
  right: 17%;
  bottom: 24%;
  width: clamp(1.8rem, 6%, 4.5rem);
  aspect-ratio: 1;
  opacity: 0;
  background:
    radial-gradient(circle at 18% 70%, var(--scene-effect-color) 0 4%, transparent 6%),
    radial-gradient(circle at 42% 43%, var(--scene-effect-color) 0 5%, transparent 7%),
    radial-gradient(circle at 70% 67%, var(--scene-effect-color) 0 4%, transparent 6%),
    radial-gradient(circle at 80% 34%, var(--scene-effect-color) 0 3%, transparent 5%);
}

.calendar-scene.is-playing .scene-vehicle {
  animation: hammerplan-vehicle-arrival 5.3s both;
}

.calendar-scene.is-playing .scene-work {
  animation: hammerplan-site-work 4.25s .65s both;
}

.calendar-scene.is-playing .scene-effect {
  animation: hammerplan-work-effect 1s 1.1s 3 both;
}

[data-replay-scene][hidden] {
  display: none;
}

@keyframes hammerplan-vehicle-arrival {
  0% { opacity: 0; transform: translateX(-225%); }
  8% { opacity: 1; }
  39% { opacity: 1; transform: translateX(4%); }
  48%, 77% { opacity: 1; transform: translateX(0); }
  100% { opacity: .9; transform: translateX(0); }
}

@keyframes hammerplan-site-work {
  0% { opacity: 0; transform: translateY(6%); }
  16%, 38%, 60%, 86% { opacity: 1; transform: none; }
  30%, 52%, 74% { opacity: 1; transform: translateY(var(--work-lift)) rotate(var(--work-tilt)); }
  100% { opacity: .9; transform: none; }
}

@keyframes hammerplan-work-effect {
  0%, 28% { opacity: 0; transform: translateY(10%) scale(.75); }
  55% { opacity: .72; }
  100% { opacity: 0; transform: translateY(-15%) scale(1.2); }
}

@media (max-width: 680px) {
  .calendar-scene-frame > #trade-calendar-image-link {
    overflow-x: auto;
    border-radius: var(--radius, 10px);
  }

  .calendar-scene .scene-vehicle {
    left: 16%;
  }

  .calendar-scene .scene-work {
    right: 13%;
  }

  .calendar-scene .scene-effect {
    right: 18%;
    bottom: 15%;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-replay-scene] {
    display: none;
  }

  .calendar-scene.is-playing :is(.scene-vehicle, .scene-work, .scene-effect) {
    animation: none;
  }
}
