/* iPhone mockup v2. Markup:
   <div class="phone"><div class="iphone"><div class="screen light" style="--sb:#f5f7fd">
     <div class="sb"><span class="t">9:41</span><span class="ic">(svg x3)</span></div>
     <div class="island"></div>
     <div class="shot"><img></div>
   </div></div></div>
   All sizes are in cqw, relative to .phone's width. */
.phone { container-type: inline-size; position: relative; }
.phone .iphone {
  position: relative; width: 100%; aspect-ratio: 430 / 880; padding: 1.6cqw; box-sizing: border-box;
  border-radius: 13.2cqw;
  background: linear-gradient(150deg, #5a5b62 0%, #2b2c31 22%, #17181c 50%, #26272c 78%, #4a4b52 100%);
  box-shadow: 0 0 0 0.3cqw rgba(255,255,255,.18) inset, 0 20cqw 32cqw -18cqw rgba(10,20,50,.45), 0 1.2cqw 3cqw rgba(0,0,0,.18);
}
.phone .iphone::before { /* black bezel */
  content: ""; position: absolute; inset: 1.5cqw; border-radius: 11.9cqw; background: #000;
  box-shadow: 0 0 0 0.25cqw #000 inset;
}
.phone .iphone::after { /* rim gloss */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(118deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,0) 26%, rgba(255,255,255,0) 72%, rgba(255,255,255,.14) 100%);
}
/* side buttons */
.phone .side { position: absolute; width: 0.9cqw; border-radius: 0.5cqw; background: linear-gradient(90deg, #3b3c42, #1a1b1f); }
.phone .side.l1 { left: -0.8cqw; top: 20cqw; height: 6cqw; }
.phone .side.l2 { left: -0.8cqw; top: 30cqw; height: 11cqw; }
.phone .side.l3 { left: -0.8cqw; top: 44cqw; height: 11cqw; }
.phone .side.r1 { right: -0.8cqw; top: 34cqw; height: 17cqw; background: linear-gradient(90deg, #1a1b1f, #3b3c42); }

.phone .screen {
  position: absolute; inset: 3.6cqw; width: auto; height: auto; border-radius: 10.2cqw; box-shadow: inset 0 0 0 0.3cqw rgba(255,255,255,.08); overflow: hidden; background: var(--sb, #000);
  transform: translateZ(0);
}
.phone .screen.light { color: #0b0b0f; }
.phone .screen.dark, .phone .screen.photo { color: #fff; }

/* status bar */
.phone .sb { position: absolute; left: 0; right: 0; top: 0; height: 12.5cqw; user-select: none; -webkit-user-select: none; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 0 7.5cqw 0 8.5cqw; background: var(--sb, transparent); }
.phone .screen.photo .sb { background: linear-gradient(rgba(0,0,0,.35), transparent); }
.phone .sb .t { font-family: var(--display), -apple-system, system-ui, sans-serif; font-weight: 600; font-size: 4cqw; letter-spacing: -0.01em; }
.phone .sb .ic { display: flex; align-items: center; gap: 1.6cqw; }
.phone .sb .ic svg { height: 3.2cqw; width: auto; display: block; fill: currentColor; }

/* dynamic island */
.phone .island { position: absolute; top: 2.9cqw; left: 50%; transform: translateX(-50%); width: 29cqw; height: 8.4cqw; border-radius: 99cqw; background: #000; z-index: 4; box-shadow: 0 0 0 0.3cqw rgba(0,0,0,.6); }

/* content */
.phone .shot { position: absolute; left: 0; right: 0; top: 12.5cqw; bottom: 0; overflow: hidden; }
.phone .screen.photo .shot { top: 0; }
.phone .shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone .shot.crop img { height: 106.2%; margin-top: -6.2%; }
.phone .shot.fill { display: flex; flex-direction: column; }

/* screen gloss */
.phone .screen::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 24%, rgba(255,255,255,0) 44%); }

/* home indicator */
.phone .screen .hi { position: absolute; left: 50%; bottom: 2cqw; transform: translateX(-50%); width: 32cqw; height: 1.2cqw; border-radius: 1cqw; background: currentColor; opacity: .55; z-index: 4; }

/* chat inside a phone, sized in cqw */
.phone .chat { height: 100%; background: linear-gradient(180deg, #fbfbfd, #f1f2f7); padding: 3cqw 5cqw 6cqw; display: flex; flex-direction: column; gap: 2.4cqw; font-family: var(--font); }
.phone .chat .t { font-size: 3.2cqw; color: #86868b; text-align: center; margin-bottom: 1cqw; }
.phone .bub { font-size: 3.6cqw; line-height: 1.35; padding: 2.6cqw 3.6cqw; border-radius: 5cqw; max-width: 84%; }
.phone .bub.them { background: #fff; color: #111; border-bottom-left-radius: 1.4cqw; box-shadow: 0 0.3cqw 0.8cqw rgba(0,0,0,.06); }
.phone .bub.me { background: linear-gradient(180deg, #4d8bff, #1e63ff); color: #fff; margin-left: auto; border-bottom-right-radius: 1.4cqw; }
.phone .chat .composer { margin-top: auto; display: flex; align-items: center; gap: 2cqw; border: 0.3cqw solid #e3e3e8; background: #fff; border-radius: 99cqw; padding: 2.2cqw 3.6cqw; font-size: 3.4cqw; color: #a1a1a6; }
.phone .chat .composer i { margin-left: auto; width: 5.4cqw; height: 5.4cqw; border-radius: 50%; background: #1e63ff; display: block; }

/* neutralise the old frame rules from apple.css / glass.css when .phone wraps */
.phone .iphone .screen img { object-position: top; }

.phone, .phone * { -webkit-user-select: none; user-select: none; }
.phone .sb .t { padding-top: 0.2cqw; }
.phone .sb .ic svg { height: 3cqw; }
