/* Little Wardrobe follows the art through the in-flow sections. */
.world-intro[data-scroll-active] .world-opening-friend {
  --portrait-travel: 22px;
  translate: 0 calc((1 - 2 * var(--scene-progress, 0)) * var(--portrait-travel));
  scale: calc(.96 + .07 * var(--scene-progress, 0));
}

@media (max-width: 560px) {
  .world-intro[data-scroll-active] .world-opening-friend {
    --portrait-travel: clamp(5px, 1.5svh, 9px);
  }
}

.world-companion[data-scroll-active] .world-friend-art {
  isolation: isolate;
}

.world-companion[data-scroll-active] .world-friend-art::before {
  position: absolute;
  z-index: -1;
  inset: 15% 13% 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--sage), transparent 48%), transparent 72%);
  translate: 0 calc(-26px + 56px * var(--scene-progress, 0));
  scale: calc(.89 + .17 * var(--scene-progress, 0));
  pointer-events: none;
  content: "";
}

.world-companion[data-scroll-active] .world-friend-art > :is(img, video) {
  translate: 0 calc(15px - 35px * var(--scene-progress, 0));
}

.world-cabinet[data-scroll-active] figure > img {
  transform-origin: center bottom;
  translate: 0 calc(10px - 22px * var(--scene-progress, 0));
  scale: calc(.96 + .04 * var(--scene-progress, 0));
}

/* The fitting room and companion move only the scenery. Touch targets,
   changing garments and the approved greeting keep their existing positions. */
[data-wardrobe-scene="creator"][data-scroll-active] .room-character::before {
  translate: 0 calc(13px - 33px * var(--scene-progress, 0));
  scale: calc(.90 + .16 * var(--scene-progress, 0));
}

[data-wardrobe-scene="companion"][data-mode="home"][data-scroll-active] .companion-stage::before {
  translate: 0 calc(-9px + 29px * var(--scene-progress, 0));
  scale: calc(.92 + .13 * var(--scene-progress, 0));
}

[data-wardrobe-scene="companion"][data-mode="home"][data-scroll-active] .companion-window {
  translate: 0 calc(8px - 24px * var(--scene-progress, 0));
  scale: calc(.98 + .07 * var(--scene-progress, 0));
}

/* In portrait, let the companion have a full-width stage before the doors. */
@media (min-width: 761px) and (max-width: 1100px) and (orientation: portrait) {
  [data-wardrobe-scene="companion"][data-mode="home"] {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 4svh, 2.75rem);
  }

  [data-wardrobe-scene="companion"][data-mode="home"] .friend-column {
    position: static;
    width: min(100%, 36rem);
    margin-inline: auto;
  }

  [data-wardrobe-scene="companion"][data-mode="home"] .companion-stage {
    width: min(100%, 36rem, 52svh);
  }
}

@media (min-width: 1120px) and (min-height: 950px) {
  [data-wardrobe-scene="companion"][data-mode="home"] .companion-stage {
    width: min(100%, 36rem, 56svh);
  }
}
