/* LS.GRAPHICS body, 1612 × 3340. The display aperture is measured in the source PNG. */
.app-phone {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1612 / 3340;
  background: url("./assets/devices/iphone-body.png") center / contain no-repeat;
}

.phone-glass {
  position: absolute;
  left: 3.8462%;
  top: 1.527%;
  width: 92.345%;
  height: 96.8533%;
  border-radius: 13.436% / 6.183%;
  clip-path: inset(0 round 13.436% / 6.183%);
  /* Clip the composited navigation bars inside the nested app as well. */
  mask-image: linear-gradient(white, white);
  transform: translateZ(0);
  contain: paint;
  overflow: hidden;
  isolation: isolate;
  background: #f6f6f6;
}

.phone-glass > .phone-poster,
.phone-glass > .phone-app {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
}

.phone-glass > .phone-poster {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.phone-glass > .phone-app {
  max-width: none;
  transform-origin: top left;
}

.phone-glass > [hidden] {
  display: none;
}

.work-card:has([data-phone-preview]) {
  --phone-inset: clamp(16px, 1.5vw, 24px);
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  column-gap: clamp(26px, 3vw, 48px);
  padding: var(--phone-inset) var(--phone-inset) var(--phone-inset) clamp(32px, 4vw, 64px);
}

.work-card:has([data-phone-preview]) > .work-copy {
  padding-block: clamp(12px, 2vw, 32px);
}

#selected-work [data-phone-preview] {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  touch-action: auto;
}

#selected-work [data-phone-preview] > .work-preview-frame {
  position: static;
  height: auto;
}

#selected-work [data-phone-preview] .work-phone-pair,
.cover-phone-pair > .work-phone-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 32px;
  width: 100%;
  height: auto;
}

.case-cover-art:has(.cover-phone-pair) {
  padding: clamp(14px, 2vw, 30px);
}

.cover-phone-pair {
  max-width: 860px;
  margin-inline: auto;
}

.portrait-images .detail-art:has(> .app-phone) {
  height: auto;
  aspect-ratio: auto;
  align-items: center;
}

.detail-art > .app-phone {
  max-width: 402px;
}

@media (max-width: 900px) {
  .work-card:has([data-phone-preview]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: clamp(22px, 4vw, 32px) 12px 12px;
  }

  .work-card:has([data-phone-preview]) > .work-copy {
    padding: 0 clamp(10px, 2vw, 20px);
  }
}
