/* Licensed to account 52c7da1aea3f, 2026-10-19. Moving parts. */
/* Image parallax, the mechanics.
   Moving parts. A frame that cuts what leaves it, a picture given the room it travels in, and the scroll timeline that moves it.
   Readable source: components/image-parallax/image-parallax.css */

/* File layout: required mechanics, then the optional look.
   The rules before the line "look, left out of the Webflow Embed" are what
   the effect needs: they read the attributes and the custom properties the
   script writes, and set no font and no colour. Without the script none of
   them applies, and every picture stays as the page wrote it. */

/* The frame: the window the picture is seen through.
   It cuts what leaves it, and it is the subject of the timeline: the travel
   runs from the moment its top edge comes in at the foot of the window to
   the moment its bottom edge leaves at the top. clip rather than hidden, so
   the frame is not a scroll container of its own; paint containment keeps
   the picture's margins from leaking through the frame's edges. */
[data-image-parallax-frame] {
  overflow: hidden;
  overflow: clip;
  contain: paint;
  view-timeline-name: --image-parallax;
  view-timeline-axis: block;
}

/* The picture, given its room.
   It is made taller by the distance it travels and pulled back by half of
   that distance above and below, so the frame keeps the size the page gave
   it. The file fills that taller box with object-fit, which uses the part
   of the photograph the frame was hiding before it enlarges anything.
   These win over the classes of the page, which set a height of their own
   on nearly every picture; the display is left to the page, and an inline
   picture only loses the gap under its baseline. */
[data-image-parallax-fitted] {
  height: var(--image-parallax-size) !important;
  max-height: none !important;
  margin-top: var(--image-parallax-pull) !important;
  margin-bottom: var(--image-parallax-pull) !important;
  object-fit: cover !important;
  vertical-align: top !important;
}

/* The travel, from one end of the room to the other. */
@keyframes image-parallax {
  from {
    translate: 0px var(--image-parallax-from);
  }
  to {
    translate: 0px var(--image-parallax-to);
  }
}

@supports (animation-timeline: view()) {
  /* Timed by the frame crossing the window, on the compositor. */
  [data-image-parallax-moving="view"] {
    animation-name: image-parallax;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: --image-parallax;
    animation-range: cover;
  }

  /* A layer has no frame: it is timed by its own crossing. */
  [data-image-parallax-layer][data-image-parallax-moving="view"] {
    animation-timeline: view(block);
  }

  /* Under an ancestor that cuts its overflow: timed by the page's own scroll. */
  [data-image-parallax-moving="root"] {
    animation-name: image-parallax;
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: scroll(root block);
    animation-range: var(--image-parallax-start) var(--image-parallax-end);
  }
}

/* Moved by the script, where the browser has no scroll timeline. */
[data-image-parallax-moving="script"] {
  will-change: translate;
}

/* ---------- look, left out of the Webflow Embed ---------- */

/* Clinix Studio: the look of the preview (the image-parallax-* classes of
   the quarterly, set in Instrument Sans and Geist Mono on #f4ece0) is left
   out of this copy on purpose. The case page is built in that layout on the
   site's own design tokens in src/pages/cases/[slug].astro. The mechanics
   above are the file as shipped. */
