/* fx.css · depth/parallax-layers, shifts the layers of a scene with the pointer · owner: Lizzy East · all rights reserved */

/* Four layers share one frame: the photograph at the back, a glow, a ring, and the
   headline in front. With the pointer, the frame tilts a few degrees and each layer
   slides by its own amount, nearer layers further, so the scene opens up in depth;
   it drifts back to centre when the pointer leaves. The resting composition is the
   finished look: without script, on touch, or with motion off, it is just that. */
[data-fx~="depth/parallax-layers"] {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  overflow: clip;
  aspect-ratio: var(--fx-parallax-ratio, 16 / 9);
  border-radius: 2px;
  background: var(--fx-parallax-bg, #111117);
  transform: perspective(var(--fx-parallax-perspective, 1600px))
    rotateX(calc(var(--fx-py, 0) * var(--fx-parallax-tilt, 3deg) * -1))
    rotateY(calc(var(--fx-px, 0) * var(--fx-parallax-tilt, 3deg)));
}
[data-fx~="depth/parallax-layers"] > [data-fx-layer] {
  --fx-shift: 0px;
  grid-area: 1 / 1;
  min-width: 0;
  transform: translate3d(calc(var(--fx-px, 0) * var(--fx-shift) * -1), calc(var(--fx-py, 0) * var(--fx-shift) * -1), 0);
}
[data-fx~="depth/parallax-layers"] > [data-fx-layer="back"] {
  --fx-shift: var(--fx-parallax-back, 10px);
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.08;
}
[data-fx~="depth/parallax-layers"] > [data-fx-layer="mid"] {
  --fx-shift: var(--fx-parallax-mid, 26px);
  place-self: start end;
  width: 46%;
  aspect-ratio: 1;
  margin: -6% 2% 0 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--fx-parallax-glow, rgb(255 176 96 / 0.6)), transparent);
  mix-blend-mode: screen;
}
[data-fx~="depth/parallax-layers"] > [data-fx-layer="near"] {
  --fx-shift: var(--fx-parallax-near, 44px);
  place-self: center end;
  width: 22%;
  aspect-ratio: 1;
  margin-right: 14%;
  border: 1.5px solid var(--fx-parallax-line, rgb(255 255 255 / 0.75));
  border-radius: 50%;
}
[data-fx~="depth/parallax-layers"] > [data-fx-layer="front"] {
  --fx-shift: var(--fx-parallax-front, 64px);
  place-self: end start;
  max-width: 12ch;
  margin: 0 0 clamp(1.25rem, 5%, 3.5rem) clamp(1.25rem, 5%, 3.5rem);
  color: var(--fx-parallax-ink, #ffffff);
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.92;
  text-shadow: 0 2px 40px rgb(0 0 0 / 0.55);
}
@media (max-width: 40rem) {
  [data-fx~="depth/parallax-layers"] { aspect-ratio: var(--fx-parallax-ratio-narrow, 4 / 5); }
}
html.fx-armed [data-fx~="depth/parallax-layers"],
html.fx-armed [data-fx~="depth/parallax-layers"] > [data-fx-layer] {
  transition: transform var(--fx-parallax-dur, 700ms) var(--fx-ease);
}
