/* iPhone 18 Pro Max artwork: 1440 x 2988, aperture 60,60 / 1320 x 2868.
   Source: https://tryhoverify.com/tools/device-frames/iphone-18-pro-max/
   Commercial website use: https://tryhoverify.com/tools/device-frames/license/ */
.iphone17-device {
  --iphone-depth: 15px;
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1440 / 2988;
  border-radius: 16.4% / 7.9%;
  transform-style: preserve-3d;
  transform: perspective(1800px) rotateX(var(--iphone-rx,0deg)) rotateY(var(--iphone-ry,-7deg)) rotateZ(var(--iphone-rz,0deg));
  transform-origin: 50% 56%;
  backface-visibility: hidden;
}
/* Thin physical sidewall behind the unaltered, detailed bitmap bezel. */
.iphone17-depth {
  position: absolute;
  inset: .28% .6%;
  display: block;
  border: .65px solid #8c8f92;
  border-radius: 16.2% / 7.8%;
  background: linear-gradient(100deg,#676a6d,#a0a2a5 7%,#babcbf 45%,#75787c 94%,#595c61);
  transform: translateZ(calc(var(--iphone-depth) * var(--layer) / -6));
  pointer-events: none;
}
/* Opaque front chassis seals the aperture even while screen layers crossfade.
   The native silver rim remains completely untouched above this backing. */
.iphone17-backplate {
  position: absolute;
  inset: .85% 1.45%;
  z-index: 1;
  display: block;
  border-radius: 15.1% / 7.3%;
  background: #030506;
  transform: translateZ(.1px);
  backface-visibility: hidden;
  pointer-events: none;
}
.iphone17-body {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  border: 0;
  border-radius: 0;
  background: url('./assets/iphone18/iphone18-pro-max-silver.webp') center / 100% 100% no-repeat;
  transform: translateZ(1px);
  backface-visibility: hidden;
  pointer-events: none;
}
.iphone17-body::before,.iphone17-body::after,.iphone17-button,.iphone17-island { display: none !important; }
.iphone17-screen {
  position: absolute;
  z-index: 2;
  /* Two native pixels of underlap remove subpixel seams beneath the bezel. */
  left: 4.0277778%;
  right: 4.0277778%;
  top: 1.9410977%;
  bottom: 1.9410977%;
  overflow: hidden;
  border-radius: 14.199396% / 6.545961%;
  background: #07090b;
  isolation: isolate;
  transform: translateZ(.7px);
  backface-visibility: hidden;
}
.iphone17-screen > svg,.iphone17-screen > img,.iphone17-screen > video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  border: 0;
  border-radius: 0;
  user-select: none;
}
.iphone17-screen > svg { overflow: hidden; }
/* Cover only the previous handset cutout, underneath the new native Island. */
.iphone17-device[data-iphone-status] > .iphone17-screen::after {
  content: '';
  position: absolute;
  z-index: 3;
  left: 34.5%;
  top: .9%;
  width: 31%;
  height: 4.7%;
  border-radius: 28% / 50%;
  background: var(--iphone-status-fill,#f5f5f5);
  pointer-events: none;
}
.iphone17-device[data-iphone-status='dark'] { --iphone-status-fill: linear-gradient(100deg,#0f222b,#10232c); }
.iphone17-device[data-iphone-status='nearby'] { --iphone-status-fill: linear-gradient(100deg,#07232c,#09252e); }
.iphone17-device[data-iphone-status='video'] { --iphone-status-fill: linear-gradient(100deg,#0d1e24,#0e2126); }
.iphone17-device[data-iphone-status='video'] > .iphone17-screen::after { left:28%;width:43%;top:1.1%;height:4.6%; }
.iphone17-device[data-iphone-status='black'] { --iphone-status-fill:#000; }
.iphone17-device[data-iphone-status='none'] > .iphone17-screen::after,
.iphone17-device[data-iphone-status='camera'] > .iphone17-screen::after { display:none; }
.motion-paused .iphone17-device { transform:none!important; }
@media(prefers-reduced-motion:reduce) { .iphone17-device { transform:none!important; } }
