/* The devices, drawn in CSS, with no images: a metal band
   swept left to right and lit from above, a crisp dark outer edge and a bright inner one, a black bezel, the
   Dynamic Island with its lens, and side buttons proud of the band. True size, 1 pt = 1 px, scaled with `zoom`.
   Silver on a light page, graphite on a dark one. */

.ph {
  --metal: linear-gradient(90deg, #a7a9ae 0%, #eceef1 3.5%, #c7c9ce 9%, #e2e4e8 30%, #f4f5f7 50%, #e2e4e8 70%, #c7c9ce 91%, #eceef1 96.5%, #a7a9ae 100%);
  --metal-edge: rgba(0, 0, 0, 0.28);
  --dev-shadow: 0 50px 90px -40px rgba(17, 17, 26, 0.32), 0 18px 36px -24px rgba(17, 17, 26, 0.22);
  --sheen: rgba(255, 255, 255, 0.7);
  --outer: rgba(60, 62, 68, 0.55);
  --inner: rgba(255, 255, 255, 0.85);
}
[data-theme='dark'] .ph {
  --metal: linear-gradient(90deg, #2b2c2f 0%, #6c6e73 3.5%, #3c3d41 9%, #535459 30%, #6a6b70 50%, #535459 70%, #3c3d41 91%, #6c6e73 96.5%, #2b2c2f 100%);
  --metal-edge: rgba(255, 255, 255, 0.10);
  --dev-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  --sheen: rgba(255, 255, 255, 0.16);
  --outer: rgba(0, 0, 0, 0.9);
  --inner: rgba(255, 255, 255, 0.22);
}

/* iPhone: a 402 × 874 screen with 55 px corners, a 5 px bezel and a 5.5 px band. */
.ph {
  --band: 5.5px;
  --bezel: 5px;
  --r: 55px;
  position: relative;
  flex: none;
  width: calc(402px + 2 * (var(--band) + var(--bezel)));
  zoom: var(--zoom, 1);
}
.ph-band {
  position: relative;
  padding: var(--band);
  border-radius: calc(var(--r) + var(--bezel) + var(--band));
  background: linear-gradient(180deg, var(--sheen) 0%, transparent 14%), var(--metal);
  box-shadow: var(--dev-shadow), 0 0 0 0.5px var(--outer), inset 0 0 0 0.5px var(--metal-edge), inset 0 1px 0 var(--inner);
}
.ph-bezel {
  padding: var(--bezel);
  border-radius: calc(var(--r) + var(--bezel));
  background: #050506;
  box-shadow: inset 0 0 0 0.75px rgba(255, 255, 255, 0.07), 0 0 0 0.5px rgba(0, 0, 0, 0.6);
}
.ph-screen {
  position: relative;
  height: 874px;
  border-radius: var(--r);
  overflow: hidden;
  isolation: isolate;
  background: var(--c-canvas);
  color: var(--c-label);
}
.ph-btn { position: absolute; width: 3px; border-radius: 2px; background: var(--metal); box-shadow: inset 0 0 0 0.5px var(--metal-edge); }
.ph-action { left: -2.5px; top: 118px; height: 30px; }
.ph-vol-up { left: -2.5px; top: 176px; height: 58px; }
.ph-vol-down { left: -2.5px; top: 246px; height: 58px; }
.ph-side { right: -2.5px; top: 196px; height: 92px; }
.ph-island { position: absolute; z-index: 20; top: 11px; left: 50%; width: 125px; height: 37px; margin-left: -62.5px; border-radius: 19px; background: #000; }
.ph-lens {
  position: absolute; top: 12.5px; right: 15px; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #2b3a55 0%, #121a2a 45%, #05070c 75%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.ph-status {
  position: absolute; z-index: 19; top: 0; left: 0; right: 0; height: 54px;
  display: grid; grid-template-columns: 1fr 125px 1fr; align-items: center; padding-top: 4px;
  color: var(--c-label);
  transition: color 450ms ease;
}
.ph[data-status='light'] .ph-status { color: #fff; }
.ph-time { grid-column: 1; justify-self: center; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; padding-left: 10px; }
.ph-icons { grid-column: 3; justify-self: center; display: inline-flex; align-items: center; gap: 6px; padding-right: 4px; fill: currentColor; }
.ph-batt-line { stroke: currentColor; stroke-opacity: 0.38; stroke-width: 1; }
.ph-batt-cap { opacity: 0.45; }
.ph-home { position: absolute; z-index: 19; bottom: 8px; left: 50%; width: 140px; height: 5px; margin-left: -70px; border-radius: 3px; background: var(--c-label); opacity: 0.9; transition: background 450ms ease; }
.ph[data-status='light'] .ph-home { background: #fff; }

/* The screens a phone can show, stacked; one at a time, crossfading. */
.scr { position: absolute; inset: 0; transition: opacity 520ms ease, transform 700ms cubic-bezier(0.19, 1, 0.22, 1), filter 520ms ease; }
.scr:not(.on) { opacity: 0; transform: scale(0.985); filter: blur(3px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .scr { transition: opacity 200ms ease; } .scr:not(.on) { transform: none; filter: none; } }
