
.depth-input { position: absolute; inset: 0; z-index: 15; display: grid; grid-template-columns: repeat(9, 1fr); }
/* The scene supplies two slow rhythms. Each cutout keeps its own scroll animation. */
@property --drift { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --rise { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes breathe-across { from { --drift: -1; } to { --drift: 1; } }
@keyframes breathe-up { from { --rise: -1; } to { --rise: 1; } }

@media (prefers-reduced-motion: no-preference) {
  .chapter .scene {
    animation: breathe-across 3.7s ease-in-out -1s infinite alternate,
               breathe-up 2.9s ease-in-out -2s infinite alternate;
    transition: --look .18s ease-out;
  }
  .chapter .scene :is(.layer, .foreground, .curtain, .passing-cloud, .shore) {
    --travel: 8px;
    --across: 1.5px;
    --lift: 2px;
    translate: calc(var(--look) * var(--travel) + var(--drift) * var(--across))
               calc(var(--rise) * var(--lift));
  }
  .chapter .scene :is(.earth, .giant, .roof, .dragons, .canopy, .sun, .shore, .cloud-back) {
    --travel: 4px;
    --across: -.8px;
    --lift: 1px;
  }
  .chapter .scene :is(.fish, .rider-left, .rider-right, .human-bird, .envoys, .deity, .foreground, .curtain, .cloud-front) {
    --travel: 14px;
    --across: 2px;
    --lift: -2.5px;
  }
}
.scene:has(.depth-input > :nth-child(1):hover) { --look: -1; }
.scene:has(.depth-input > :nth-child(2):hover) { --look: -0.75; }
.scene:has(.depth-input > :nth-child(3):hover) { --look: -0.5; }
.scene:has(.depth-input > :nth-child(4):hover) { --look: -0.25; }
.scene:has(.depth-input > :nth-child(5):hover) { --look: 0; }
.scene:has(.depth-input > :nth-child(6):hover) { --look: 0.25; }
.scene:has(.depth-input > :nth-child(7):hover) { --look: 0.5; }
.scene:has(.depth-input > :nth-child(8):hover) { --look: 0.75; }
.scene:has(.depth-input > :nth-child(9):hover) { --look: 1; }

@media (hover: none) {
  .depth-input { display: block; overflow-x: auto; scrollbar-width: none; scroll-timeline: --look-swipe inline; }
  .depth-input::before { content: ""; display: block; width: calc(100% + 140px); height: 1px; }
  .depth-input i { display: none; }
  .chapter .scene { timeline-scope: --look-swipe; }
  @supports (animation-timeline: scroll()) {
    .chapter .scene .composition { animation: swipe-look linear both; animation-timeline: --look-swipe; }
  }
}
@property --look { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes swipe-look { from { --look: -1; } to { --look: 1; } }
@media (prefers-reduced-motion: reduce) {
  .depth-input { display: none; }
  .chapter .scene .composition { animation: none; }
}
