/* ==========================================================================
   Aspiro KIT · device.css — iPhone 17 Pro frame from Apple's official bezel.

   Geometry measured with PIL on "iPhone 17 Pro - * - Portrait.png" (1350×2760):
     screen opening   x 72, y 69, 1206 × 2622  (= a simulator screenshot, 1:1)
     opening corner   continuous curve; a circular radius of 184 px sits fully
                      inside it, so the bezel always covers the screen corner
     body             x 25…1325, y 22…2737 (buttons reach x 16 / 1333),
                      corner ≈ 237 px
   The screenshot sits UNDER the bezel PNG. The bezel artwork is never
   altered, recoloured, cropped or redrawn (Apple marketing licence).

   <figure class="device" style="--device-w: 340px">
     <div class="device__screen">
       <img src="KIT/img/demo-screen.jpg" width="1206" height="2622" alt="…">
     </div>
     <img class="device__bezel" src="KIT/img/iphone-17-pro-silver-portrait.png"
          width="1350" height="2760" alt="" aria-hidden="true">
   </figure>
   ========================================================================== */

.device {
  --device-w: 340px;
  position: relative;
  width: var(--device-w);
  max-width: 100%;
  aspect-ratio: 1350 / 2760;
  margin: 0;
  flex: none;
  isolation: isolate;
}

/* Soft dimensional shadow cast by the body shape (not the PNG box). */
.device::before {
  content: "";
  position: absolute;
  left: 1.852%; top: 0.797%; width: 96.296%; height: 98.406%;
  border-radius: 18.2% / 8.7%;
  box-shadow: var(--shadow-device);
  z-index: -1;
  pointer-events: none;
}
/* Optional contact shadow for a phone standing on the page. */
.device--grounded::after {
  content: "";
  position: absolute; left: 12%; right: 12%; bottom: -3.2%; height: 5%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(21, 21, 19, .22), rgba(21, 21, 19, 0) 70%);
  filter: blur(6px);
  z-index: -2;
  pointer-events: none;
}
.device--flat::before { box-shadow: none; }

.device__screen {
  position: absolute;
  left: 5.3333%;   /*   72 / 1350 */
  top: 2.5%;       /*   69 / 2760 */
  width: 89.3333%; /* 1206 / 1350 */
  height: 95%;     /* 2622 / 2760 */
  border-radius: 15.257% / 7.018%; /* 184 / 1206, 184 / 2622 */
  overflow: hidden;
  background: #000;
  container-type: inline-size;
  /* 1 iOS point inside the screen (402 pt wide). Use for live HTML UI:
     font-size: calc(17 * var(--pt)); */
  --pt: calc(100cqw / 402);
  z-index: 0;
}
.device__screen > img,
.device__screen > video,
.device__screen > canvas,
.device__screen > picture,
.device__screen > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Several screens in one phone (cross-fade them with Kit.pin or GSAP).
   <div class="device__stack"><img …><img …><div class="device__placeholder">…</div></div>
   Only the first layer shows until a script fades the others in. */
.device__stack, .device__stack > * { position: absolute; inset: 0; }
.device__stack > img, .device__stack > video, .device__stack > picture > img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
}
.device__stack > :not(:first-child) { opacity: 0; }

/* Live HTML screen: design at 402 × 874 pt using var(--pt). */
.device__ui {
  position: absolute; inset: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}

/* Placeholder until the real capture lands. */
.device__placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: calc(8 * var(--pt));
  background:
    radial-gradient(120% 70% at 50% 0%, var(--n-0) 0%, rgba(255, 255, 255, 0) 60%),
    var(--surface);
  color: var(--text-3);
  font: 500 calc(13 * var(--pt)) / 1.3 var(--font-body);
  text-align: center;
  letter-spacing: 0.01em;
}
.device__placeholder strong {
  font: 400 calc(40 * var(--pt)) / 1 var(--font-display);
  color: var(--text-2); letter-spacing: 0.02em;
}

.device__bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
}

/* A phone that should keep its native screen size (402 pt ≈ 1 CSS px per pt
   at --device-w: 450px). Sizes that read well on a page: */
.device--sm { --device-w: 240px; }
.device--md { --device-w: 320px; }
.device--lg { --device-w: 380px; }
.device--xl { --device-w: 440px; }
@media (max-width: 560px) {
  .device--lg, .device--xl { --device-w: min(300px, 76vw); }
}
