/* Phones below the hero: pre-rendered stills of the hero's 3D phone, the first paint and the fallback.
   Each still is a transparent WebP/AVIF at 280x580 (1x) and 560x1160 (2x), so the box is reserved by the width and height attributes.
   phones3d.js then lays a live canvas over the same box (position: absolute, so nothing moves) and hides the still once the canvas has its first frame. */
.steps7 picture.p3d { display: block; margin-inline: -4px; }
.steps7 picture.p3d img { display: block; width: 100%; height: auto; border: 0; background: none; transform-origin: 50% 60%; }

@media (prefers-reduced-motion: no-preference) {
  .steps7 picture.p3d img { transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.55s ease; }
  /* settle into view: phones3d.js adds .p3d-js, then .is-in once the phone is on screen */
  .p3d-js .steps7 picture.p3d img { opacity: 0; transform: perspective(900px) translateY(14px) rotateY(-9deg); }
  .p3d-js .steps7 picture.p3d.is-in img { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  /* a slight turn toward the viewer, the direction the hero wheel turns its near phones */
  .steps7 li:hover picture.p3d.is-in img { transform: perspective(900px) translateY(-6px) rotateY(7deg); }
}

/* live render: one 2D canvas per phone, fed by the shared WebGL renderer in turn.js */
.steps7 picture.p3d { position: relative; }
.steps7 picture.p3d canvas.p3d-gl {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0;
  /* the stills fade their floor shadow out over the last 3.9% of the height so it has no hard edge; the canvas does the same */
  -webkit-mask-image: linear-gradient(to bottom, #000 96.1%, transparent 100%); mask-image: linear-gradient(to bottom, #000 96.1%, transparent 100%);
}
.steps7 picture.p3d.is-3d canvas.p3d-gl { opacity: 1; }
/* the still stays in the layout (no shift) and is hidden once the canvas has faded in */
.steps7 picture.p3d.is-3d img { visibility: hidden; transition: visibility 0s linear 0.6s; }
@media (prefers-reduced-motion: no-preference) {
  /* the canvas settles into view exactly as the still does, so the hand-over between them cannot be seen */
  .steps7 picture.p3d canvas.p3d-gl { transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.55s ease; }
  .p3d-js .steps7 picture.p3d canvas.p3d-gl { transform: perspective(900px) translateY(14px) rotateY(-9deg); }
  .p3d-js .steps7 picture.p3d.is-3d canvas.p3d-gl { transform: none; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  /* on the live phones the turn toward the viewer is a real yaw (phones3d.js); the hover only lifts the canvas */
  .p3d-js .steps7 li:hover picture.p3d.is-3d canvas.p3d-gl { transform: translateY(-6px); }
}

/* turning a live phone by hand (phones3d.js): press and hold on touch, click and drag with a mouse. Only the live canvas takes part;
   a phone on its still keeps today's behaviour. No long-press callout, selection, magnifier or tap flash on the live phone. */
.steps7 picture.p3d.is-3d { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.steps7 picture.p3d.is-3d canvas.p3d-gl { pointer-events: auto; -webkit-touch-callout: none; }
@media (hover: hover) and (pointer: fine) {
  .steps7 picture.p3d.is-3d canvas.p3d-gl { cursor: grab; }
  .steps7 picture.p3d.is-3d.is-grab canvas.p3d-gl { cursor: grabbing; }
}
@media (prefers-reduced-motion: no-preference) {
  /* the grab cue: a quick lift toward the viewer */
  .p3d-js .steps7 picture.p3d.is-3d.is-grab canvas.p3d-gl { transform: scale(1.04); transition-duration: 0.18s, 0.55s; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .p3d-js .steps7 li:hover picture.p3d.is-3d.is-grab canvas.p3d-gl { transform: translateY(-6px) scale(1.04); }
}
