/* Phone frames and a three-phone fan, drawn only in CSS. Copy this file into any OpenApp.

   Markup (one phone):
     <div class="pf-phone">
       <div class="pf-screen">
         <div class="pf-status"><span class="pf-time">9:41</span>
           <span class="pf-icons"><i class="pf-signal"></i><i class="pf-wifi"></i><i class="pf-battery"></i></span></div>
         <img src="/screenshots/phone-1.webp" alt="..." width="780" height="1688">
       </div>
     </div>

   Markup (a fan): wrap three phones in <div class="pf-fan"> and add pf-left, pf-mid, pf-right to them.

   Knobs, set on .pf-fan (or any ancestor):
     --pf-w       width of the front phone (default 300px); every size scales from it
     --pf-spread  how far the side phones sit from the middle, in front-phone widths (default .58)
     --pf-side    size of the side phones compared with the front one (default .8)
     --pf-drop    how much lower the side phones sit, in front-phone widths (default .07)
     --pf-tilt    how far the side phones lean out (default 3deg)
   The side phones may reach past the fan's box; clip the page area around it if you need to (overflow-x: clip).
   The screenshot is shown below a status bar strip, so the picture itself stays a plain screen
   (the strip assumes the picture starts with plain white at the top, like Lingo's). */

.pf-phone {
  --pf-scale: 1;
  /* 1em is one thirtieth of this phone's width, so the frame scales as a whole */
  font-size: calc(var(--pf-w, 300px) * var(--pf-scale) / 30);
  width: 30em;
  position: relative;
  padding: .55em;
  border-radius: 4.5em;
  background: #101216;
  box-shadow:
    inset 0 0 0 1px #3b3f48,
    inset 0 0 0 .22em #1a1c22,
    0 .4em 1em rgba(24, 34, 70, .12),
    0 2.6em 4.6em -1.8em rgba(24, 34, 70, .30);
}
.pf-screen {
  position: relative;
  overflow: hidden;
  border-radius: 3.95em;
  background: #fff;
  color: #111;
}
.pf-screen > img { display: block; width: 100%; height: auto; max-width: none; }
.pf-screen::before { /* the island */
  content: "";
  position: absolute;
  z-index: 2;
  top: .85em;
  left: 50%;
  width: 7.6em;
  height: 2.2em;
  margin-left: -3.8em;
  border-radius: 1.1em;
  background: #05060a;
}
.pf-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.3em;
  padding: .55em 2.3em 0 2.6em;
  font: 650 1.12em/1 -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.01em;
  user-select: none;
}
.pf-icons { display: flex; align-items: center; gap: .45em; }
.pf-icons i { display: block; flex: none; font-style: normal; }
.pf-signal {
  width: 1.5em;
  height: .95em;
  background:
    linear-gradient(#111, #111) 0 100% / .27em 38% no-repeat,
    linear-gradient(#111, #111) .41em 100% / .27em 60% no-repeat,
    linear-gradient(#111, #111) .82em 100% / .27em 80% no-repeat,
    linear-gradient(#111, #111) 1.23em 100% / .27em 100% no-repeat;
}
.pf-wifi {
  width: 1.5em;
  height: 1.1em;
  background: radial-gradient(circle at 50% 100%, #111 0 .22em, transparent .23em .46em, #111 .47em .72em, transparent .73em .96em, #111 .97em 1.22em, transparent 1.23em);
  clip-path: polygon(50% 100%, -6% 18%, 106% 18%);
}
.pf-battery {
  position: relative;
  width: 2.2em;
  height: 1.05em;
  border: .09em solid rgba(17, 17, 17, .4);
  border-radius: .36em;
}
.pf-battery::before { content: ""; position: absolute; inset: .12em; border-radius: .2em; background: #111; }
.pf-battery::after { content: ""; position: absolute; right: -.3em; top: .26em; width: .16em; height: .34em; border-radius: 0 .12em .12em 0; background: rgba(17, 17, 17, .4); }

/* The fan: the middle phone in front, the other two tucked behind it and a little lower */
.pf-fan {
  --pf-w: 300px;
  --pf-spread: .58;
  --pf-side: .8;
  --pf-drop: .07;
  --pf-tilt: 3deg;
  position: relative;
  width: 100%;
  height: calc(var(--pf-w) * 2.32);
}
.pf-fan > .pf-phone {
  position: absolute;
  top: 0;
  left: 50%;
  margin: 0;
}
.pf-fan > .pf-mid { z-index: 3; transform: translateX(-50%); }
.pf-fan > .pf-left,
.pf-fan > .pf-right { --pf-scale: var(--pf-side); z-index: 1; top: calc(var(--pf-w) * var(--pf-drop)); transform-origin: 50% 100%; }
.pf-fan > .pf-left { transform: translateX(calc(-50% - var(--pf-w) * var(--pf-spread))) rotate(calc(var(--pf-tilt) * -1)); }
.pf-fan > .pf-right { transform: translateX(calc(-50% + var(--pf-w) * var(--pf-spread))) rotate(var(--pf-tilt)); }
