.wp-block-cover:has(.respekt-splash-slot),
.wp-block-column:has(.respekt-splash-slot) {
  overflow: visible;
}

/* Outer box: reserves layout space; positive margin = padding outward, negative = pull neighbors */
.respekt-splash-slot {
  --splash-size: 300px;
  --splash-margin-top: -180px;
  --splash-margin-right: 0px;
  --splash-margin-bottom: -180px;
  --splash-delay-first: 1500ms;
  --splash-delay-gap: 500ms;
  --splash-z: 100;

  position: relative;
  z-index: var(--splash-z);
  box-sizing: content-box;
  width: var(--splash-size);
  height: var(--splash-size);
  margin-top: min(0px, var(--splash-margin-top));
  margin-right: min(0px, var(--splash-margin-right));
  margin-bottom: min(0px, var(--splash-margin-bottom));
  margin-left: auto;
  padding-top: max(0px, var(--splash-margin-top));
  padding-right: max(0px, var(--splash-margin-right));
  padding-bottom: max(0px, var(--splash-margin-bottom));
  overflow: visible;
  pointer-events: none;
}

@media (max-width: 781px) {
  .respekt-splash-slot {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Inner canvas: fixed splash coordinate system; images may overflow */
.respekt-splash-trigger {
  --splash-meet: 25%;
  --splash-overlap: calc(var(--splash-size) * 0.23);
  --splash-pink-x: 5%;
  --splash-blue-x: -18%;

  position: relative;
  width: var(--splash-size);
  height: var(--splash-size);
  overflow: visible;
}

.respekt-splash-slot--debug::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: calc(min(0px, var(--splash-margin-top)) - max(0px, var(--splash-margin-top)));
  right: calc(min(0px, var(--splash-margin-right)) - max(0px, var(--splash-margin-right)));
  bottom: calc(min(0px, var(--splash-margin-bottom)) - max(0px, var(--splash-margin-bottom)));
  left: 0;
  border: 1px dashed rgba(220, 50, 47, 0.75);
  pointer-events: none;
}

.respekt-splash-slot--debug .respekt-splash-trigger {
  position: relative;
  z-index: 1;
  background-color: rgba(31, 57, 93, 0.08);
  box-shadow: inset 0 0 0 1px rgba(31, 57, 93, 0.45);
}

.respekt-splash-slot--debug .respekt-splash-img {
  opacity: 1;
  transform: none;
  filter: none;
  animation: none !important;
}

.respekt-splash-img {
  --throw-tx: 0px;
  --throw-ty: 0px;
  --throw-scale-start: 0.003;

  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  opacity: 0;
  transform: translate(var(--throw-tx), var(--throw-ty)) scale(var(--throw-scale-start)) rotate(12deg);
  will-change: transform, opacity;
}

.respekt-splash-img--pink {
  width: var(--splash-size);
  height: var(--splash-size);
  left: var(--splash-pink-x);
  bottom: calc(100% - var(--splash-meet) - var(--splash-overlap));
  object-position: center bottom;
  transform-origin: center center;
  z-index: calc(var(--splash-z) + 2);
}

.respekt-splash-img--blue {
  width: calc(var(--splash-size) * 1.25);
  height: calc(var(--splash-size) * 1.25);
  left: var(--splash-blue-x);
  top: calc(var(--splash-meet) - var(--splash-overlap));
  object-position: center top;
  transform-origin: center center;
  z-index: calc(var(--splash-z) + 1);
}

.respekt-splash-trigger.respekt-splash-is-active .respekt-splash-img--blue {
  animation-name: respekt-splash-throw-in;
  animation-duration: 620ms;
  animation-timing-function: cubic-bezier(0.42, 0, 0.95, 0.12);
  animation-delay: var(--splash-delay-first);
  animation-fill-mode: both;
}

.respekt-splash-trigger.respekt-splash-is-active .respekt-splash-img--pink {
  animation-name: respekt-splash-throw-in;
  animation-duration: 620ms;
  animation-timing-function: cubic-bezier(0.42, 0, 0.95, 0.12);
  animation-delay: calc(var(--splash-delay-first) + var(--splash-delay-gap));
  animation-fill-mode: both;
}

@keyframes respekt-splash-throw-in {
  0% {
    opacity: 0;
    transform: translate(var(--throw-tx), var(--throw-ty)) scale(var(--throw-scale-start)) rotate(12deg);
    filter: blur(4px);
  }

  18% {
    opacity: 0.25;
    transform: translate(calc(var(--throw-tx) * 0.92), calc(var(--throw-ty) * 0.92)) scale(0.035) rotate(9deg);
    filter: blur(3px);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .respekt-splash-trigger.respekt-splash-is-active .respekt-splash-img {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}
