/* Scroll-linked depth. Native scrolling, no animation runtime or scroll handlers. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero { view-timeline: --hero-depth block; }
    .hero-media {
      scale: 1.12;
      animation: hero-depth linear both;
      animation-timeline: --hero-depth;
      animation-range: exit 0% exit 100%;
    }

    .portfolio { view-timeline: --portfolio-depth block; }
    .insights { view-timeline: --insights-depth block; }
    .service-photo, .about-image, .collage-image {
      view-timeline: --photo-depth block;
    }
    .image-frame {
      --depth: 4%;
      --image-scale: 1.1;
    }
    .image-frame img {
      scale: var(--image-scale);
      animation: photo-depth linear both;
      animation-timeline: --photo-depth;
      animation-range: cover 0% cover 100%;
    }
    /* Use the section timeline outside the horizontal scroll containers. */
    .property .image-frame img { animation-timeline: --portfolio-depth; }
    .insight .image-frame img { animation-timeline: --insights-depth; }
    .property:nth-child(even) .image-frame { --depth: 2.5%; }
    .about-image { --depth: 2.5%; --image-scale: 1.07; }
    .collage-top { --depth: 5%; --image-scale: 1.12; }
    .collage-left { --depth: 3%; --image-scale: 1.08; }
    .collage-right { --depth: 4.5%; --image-scale: 1.11; }
    .collage-bottom { --depth: 3.5%; --image-scale: 1.09; }

    @keyframes hero-depth {
      from { translate: 0 -1%; }
      to { translate: 0 5%; }
    }
    @keyframes photo-depth {
      from { translate: 0 var(--depth); }
      to { translate: 0 calc(-1 * var(--depth)); }
    }
    @media (max-width: 760px) {
      .hero-media { scale: 1.07; }
      .image-frame { --depth: 2%; --image-scale: 1.06; }
      @keyframes hero-depth {
        from { translate: 0 -0.5%; }
        to { translate: 0 2.5%; }
      }
    }
  }
}
/* Also covers a preference changed while the page is open. */
@media (prefers-reduced-motion: reduce) {
  .hero-media, .image-frame img { animation: none !important; scale: none; translate: none; }
}
