/* Phone frames around the hero and stats screenshots */
.device {
  background: var(--frame);
  border: 1px solid var(--frame-line);
}

.device__image {
  width: 100%;
  height: 100%;
  border-radius: var(--screen-radius);
  object-fit: cover;
  object-position: top;
}

.device--phone {
  --screen-radius: 32px;
  width: 250px;
  height: 520px;
  padding: 12px;
  border-radius: 42px;
  box-shadow: var(--frame-shadow);
}

.device--hero {
  --screen-radius: 34px;
  position: relative;
  width: 290px;
  height: 600px;
  padding: 14px;
  border-radius: 46px;
}

.device--offset {
  margin-top: 48px;
}

/* Devices band stage: every screen is positioned in percentages so the group scales as one */
.stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 640 / 500;
  justify-self: center;
}

.stage > * {
  position: absolute;
}

.stage > img,
.stage__tablet img,
.stage__phone img {
  height: auto;
}

.stage__tablet img,
.stage__phone img {
  width: 100%;
}

.stage__glow {
  top: 50%;
  left: 50%;
  width: 90%;
  height: 90%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 72%);
  pointer-events: none;
}

/* The Mac and Duo PNGs carry their own chrome; the iPad and iPhone get CSS frames */
.stage__mac {
  left: 9%;
  top: 0;
  width: 72%;
  z-index: 1;
}

.stage__tablet,
.stage__phone {
  background: var(--frame);
  border: 1px solid var(--frame-line);
  box-shadow: var(--frame-shadow);
}

.stage__tablet {
  right: 0;
  top: 21%;
  width: 29.5%;
  padding: 10px;
  border-radius: 24px;
  z-index: 2;
}

.stage__tablet img {
  border-radius: 14px;
}

.stage__duo-open {
  left: 30%;
  bottom: 0;
  width: 40%;
  z-index: 3;
  filter: drop-shadow(var(--float-shadow));
}

.stage__phone {
  left: 3%;
  bottom: 0;
  width: 20.5%;
  padding: 7px;
  border-radius: 30px;
  z-index: 4;
}

.stage__phone img {
  border-radius: 23px;
}

.stage__duo-closed {
  left: 71%;
  bottom: 0;
  width: 13.5%;
  z-index: 4;
  filter: drop-shadow(var(--float-shadow));
}

/* A CSS Apple Watch showing the app icon, until a real watch screenshot exists */
.watch {
  right: 0.5%;
  bottom: 1%;
  width: 12.5%;
  aspect-ratio: 1 / 1.95;
  z-index: 5;
}

.watch > * {
  position: absolute;
  display: block;
}

.watch__band {
  left: 22%;
  width: 56%;
  height: 30%;
  background: var(--watch-band);
}

.watch__band--top {
  top: 0;
  border-radius: 22% 22% 0 0;
}

.watch__band--bottom {
  bottom: 0;
  border-radius: 0 0 22% 22%;
}

.watch__case {
  left: 0;
  top: 23%;
  width: 100%;
  height: 54%;
  border-radius: 30%;
  background: var(--watch-case);
  border: 1px solid var(--watch-line);
  box-shadow: var(--float-shadow);
}

.watch__screen {
  position: absolute;
  inset: 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26%;
  background: var(--watch-screen);
}

.watch__screen img {
  width: 56%;
  height: auto;
  border-radius: 24%;
}

.watch__crown {
  right: -6%;
  top: 38%;
  width: 9%;
  height: 11%;
  border-radius: 2px;
  background: var(--watch-crown);
}

@media (max-width: 480px) {
  .stage {
    aspect-ratio: 640 / 540;
  }

  .stage .stage__duo-closed {
    display: none;
  }
}

/* Phone tops: the top of a Today screen in a frame that fades out */
.phone-top {
  aspect-ratio: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 62%, transparent);
  mask-image: linear-gradient(#000 62%, transparent);
}

.phone-top__frame {
  height: 100%;
  padding: 7px 7px 0;
  border-radius: 30px 30px 0 0;
  background: var(--frame);
  border: 1px solid var(--frame-line);
  border-bottom: 0;
  box-shadow: var(--frame-shadow);
}

.phone-top__frame img {
  width: 100%;
  height: auto;
  border-radius: 23px 23px 0 0;
}
