/* MacBook and iPhone frames. Every size is in cqw, so a frame scales with its own width.
   Used by the site and by the ad templates in ../ads. */

/* ---------- MacBook ---------- */
.mac { container-type: inline-size; position: relative; width: 100%; }
.mac__lid {
  width: 84cqw; margin: 0 auto; position: relative;
  background: #08080a;
  border-radius: 1.7cqw 1.7cqw .35cqw .35cqw;
  padding: 1.55cqw 1.05cqw 1.25cqw;
  box-shadow: inset 0 0 0 .14cqw #2a2c30, 0 0 0 .1cqw #9b9ea3;
}
.mac__lid::before { /* camera */
  content: ""; position: absolute; top: .58cqw; left: 50%; width: .42cqw; height: .42cqw;
  margin-left: -.21cqw; border-radius: 50%; background: #1d2026; box-shadow: inset 0 0 0 .08cqw #0c0d10;
}
.mac__screen {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  border-radius: .35cqw; background: #0d1a26;
  clip-path: inset(0 round .35cqw); /* Safari: clip the sliding screens too */
}
.mac__base {
  position: relative; height: 1.55cqw;
  background: linear-gradient(#e3e4e6 0%, #c5c7ca 18%, #a3a6aa 70%, #74777c 100%);
  border-radius: .25cqw .25cqw 1.5cqw 1.5cqw / .25cqw .25cqw 1.1cqw 1.1cqw;
}
.mac__base::before { /* lid notch */
  content: ""; position: absolute; top: 0; left: 50%; width: 12cqw; height: .5cqw; margin-left: -6cqw;
  background: linear-gradient(#85888d, #b4b7bb); border-radius: 0 0 .7cqw .7cqw;
}
.mac::after { /* contact shadow */
  content: ""; position: absolute; left: 4cqw; right: 4cqw; bottom: -1.6cqw; height: 3cqw;
  background: radial-gradient(ellipse at center, rgba(4, 16, 26, .34), rgba(4, 16, 26, 0) 68%);
  z-index: -1;
}

/* a screen holds one or more .shot layers; .is-on is the visible one */
.shot { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.shot.is-on { opacity: 1; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* a native Mac app: its window floats on the desktop */
.shot--window { background: linear-gradient(160deg, #23604c 0%, #0f3428 55%, #0a221b 100%); }
.shot--window img {
  position: absolute; left: 5%; top: 50%; width: 90%; height: auto; transform: translateY(-50%);
  object-fit: contain; filter: drop-shadow(0 1.2cqw 2.4cqw rgba(0, 0, 0, .45));
}

/* ---------- iPhone ---------- */
.phone { container-type: inline-size; position: relative; width: 100%; }
.phone__body {
  background: #08080a; border-radius: 16cqw; padding: 3.3cqw;
  box-shadow: inset 0 0 0 .8cqw #2e3035, 0 0 0 .5cqw #a4a7ac, 0 0 0 .75cqw #6d7075;
}
.phone__screen {
  aspect-ratio: 393 / 852; position: relative; overflow: hidden;
  border-radius: 12.8cqw; background: #000;
  clip-path: inset(0 round 12.8cqw);
}
.phone__screen::before { /* dynamic island */
  content: ""; position: absolute; z-index: 3; top: 2.7cqw; left: 50%;
  width: 29cqw; height: 8.4cqw; margin-left: -14.5cqw; border-radius: 5cqw; background: #000;
}
.phone::after {
  content: ""; position: absolute; left: 6cqw; right: 6cqw; bottom: -5cqw; height: 9cqw;
  background: radial-gradient(ellipse at center, rgba(4, 16, 26, .36), rgba(4, 16, 26, 0) 68%);
  z-index: -1;
}

/* a web app in the phone: status bar on top, the capture underneath */
.shot--web { background: var(--bar, #fff); }
.shot--web img { position: absolute; top: 6.925%; left: 0; height: 93.075%; }
.shot--web::before, .shot--web::after { content: ""; position: absolute; z-index: 2; }
.shot--web::before { /* status bar */
  inset: 0 0 auto 0; height: 6.925%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 393 59'%3E%3Cg fill='%23111'%3E%3Ctext x='54' y='39' text-anchor='middle' font-family='-apple-system,Helvetica Neue,Arial,sans-serif' font-size='17' font-weight='600'%3E9:41%3C/text%3E%3Crect x='291' y='35.500' width='3.200' height='4.500' rx='.9'/%3E%3Crect x='296' y='33' width='3.200' height='7' rx='.9'/%3E%3Crect x='301' y='30.500' width='3.200' height='9.500' rx='.9'/%3E%3Crect x='306' y='28' width='3.200' height='12' rx='.9'/%3E%3Cpath d='M323.500 31.200c2.600 0 5 1 6.800 2.700l-1.500 1.500a7.600 7.600 0 0 0-10.600 0l-1.500-1.500a9.700 9.700 0 0 1 6.800-2.700zm0 3.700c1.600 0 3 .6 4.200 1.600l-1.500 1.500a3.900 3.900 0 0 0-5.400 0l-1.500-1.500a6 6 0 0 1 4.200-1.600zm0 3.600c.7 0 1.300.3 1.800.7l-1.800 1.800-1.800-1.800c.5-.4 1.100-.7 1.800-.7z'/%3E%3Crect x='340' y='28' width='24' height='12' rx='3.600' fill='none' stroke='%23111' stroke-opacity='.4'/%3E%3Crect x='342' y='30' width='20' height='8' rx='2'/%3E%3Crect x='365.300' y='32' width='1.600' height='4' rx='.8' fill-opacity='.45'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.shot--web.shot--light::before { filter: invert(1) brightness(2); }
.shot--web::after, .shot--native::after { /* home indicator */
  content: ""; position: absolute; z-index: 2;
  left: 50%; bottom: .95%; width: 35%; height: .6%; margin-left: -17.5%; border-radius: 99px; background: rgba(0, 0, 0, .82);
}
.shot--light::after { background: rgba(255, 255, 255, .92); }
.shot--native.shot--bare::after { display: none; }

@media (prefers-reduced-motion: reduce) { .shot { transition: none; } }

/* a screen that slides from one program to the next (driven by main.js) */
/* a slide that is off the screen is also hidden, so no browser draws it (or a shadow of it) outside */
.slides .shot { opacity: 1; transform: translateX(101%); visibility: hidden; transition: transform .95s cubic-bezier(.72, 0, .18, 1), visibility 0s linear .95s; }
.slides .shot.is-on { transform: none; visibility: visible; transition: transform .95s cubic-bezier(.72, 0, .18, 1), visibility 0s; }
.slides .shot.is-prev { transform: translateX(-101%); }
.slides .shot.no-anim { transition: none; }
