/* Each plane is in the original drawing's local units. The lid and deck share a hinge. */
[data-hardware="laptop"] {
  --lid-pose: matrix(2.42, .8228, -.4114, 2.5652, 238, 201);
  --deck-pose: matrix(2.42, .8228, -1.7424, 1.331, 238, 201);
  --edge-pose: matrix(2.42, .8228, -1.7424, 1.331, 238, 213.1);
  --visible-deck: 1;
  --lip-delay: 0s;
}
.device-choice[aria-selected="true"] [data-hardware="laptop"] {
  /* The top surface projects to a hairline. The front edge still has its physical thickness. */
  --lid-pose: matrix(4.5, 0, 0, 4.5, 59, 376);
  --deck-pose: matrix(4.5, 0, 0, .005, 59, 376);
  --edge-pose: matrix(4.5, 0, 0, .0875, 59, 376);
  --visible-deck: 0;
  --lip-delay: .28s;
}
[data-hardware="phone"] {
  --phone-pose: matrix(2.8, .952, 0, 2.8, 233, 25);
  --rim-depth: translate(4.32px, -4.77px);
}
.device-choice[aria-selected="true"] [data-hardware="phone"] {
  --phone-pose: matrix(3.48, 0, 0, 3.48, 219, 11.64);
  --rim-depth: translate(0, 0);
}
.laptop-lid { transform: var(--lid-pose); }
.laptop-deck { transform: var(--deck-pose); }
.laptop-base-edge { transform: var(--edge-pose); }
.laptop-keys, .laptop-open-base { opacity: var(--visible-deck); }
.laptop-front-lip { opacity: calc(1 - var(--visible-deck)); }
.phone-glass-plane { transform: var(--phone-pose); }
.phone-back-rim { transform: var(--rim-depth); }
.hardware-pose { transform-origin: 0 0; transform-box: view-box; }

@media (prefers-reduced-motion: no-preference) {
  html:not([data-still]) .device-choice .hardware-pose {
    transition: transform .76s var(--ease);
  }
  html:not([data-still]) .device-choice .laptop-keys {
    transition: opacity .38s ease;
  }
  html:not([data-still]) .device-choice :is(.laptop-open-base, .laptop-front-lip) {
    transition: opacity .16s ease var(--lip-delay);
  }
}
