/* Resolution-independent hardware; the original example video stays uncropped. */
.demo-phone.iphone-mockup {
  width: 100%;
  max-width: 302px;
  aspect-ratio: 393 / 822;
  position: relative;
  isolation: isolate;
  padding: 6px;
  border: 1px solid #8c8986;
  border-radius: 47px;
  overflow: visible;
  background: linear-gradient(
    118deg,
    #eeece9 0%,
    #b6b1aa 5%,
    #f3f0ed 10%,
    #85817d 22%,
    #c1bcb6 43%,
    #77736f 62%,
    #e7e2dd 89%,
    #a39e99 98%
  );
  box-shadow:
    inset 0 0 0 1px #f9f7f2,
    inset 0 0 0 3px #393733,
    0 0 0 1px #eee8e4,
    0 28px 45px -20px #4c293d61,
    0 7px 11px -6px #2c1e2d55;
  margin: 7px auto 28px;
}
.iphone-mockup::before,
.iphone-mockup::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 3;
  width: 2px;
  background: linear-gradient(
    transparent,
    #fffc 15%,
    #ffffff24 60%,
    transparent
  );
  top: 42px;
  bottom: 46px;
  border-radius: 3px;
}
.iphone-mockup::before {
  left: 2px;
}
.iphone-mockup::after {
  right: 2px;
  opacity: 0.7;
}
.iphone-display {
  height: 100%;
  width: 100%;
  border: 3px solid #09090b;
  border-radius: 40px;
  overflow: hidden;
  position: relative;
  background: #08080a;
  display: grid;
  grid-template-rows: 43px minmax(0, 1fr) 23px;
  box-shadow:
    0 0 0 1px #080809,
    inset 0 0 0 1px #242327;
}
.iphone-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 19px 0;
  color: #f4f4f6;
  background: linear-gradient(100deg, #171619, #111114 50%, #19181c);
}
.iphone-time {
  font:
    600 11px / 1 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.2px;
}
.iphone-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 83px;
  height: 24px;
  border-radius: 18px;
  background: #030304;
  box-shadow:
    inset 0 0 1px #000,
    0 1px 0 #2c2b3026;
}
.iphone-island i {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #111115;
  background: radial-gradient(
    circle at 35% 30%,
    #334059 0,
    #172035 22%,
    #0b101a 45%,
    #060609 75%
  );
  box-shadow: 0 0 0 1px #040406;
}
.iphone-status-icons {
  width: 49px;
  height: 12px;
}
.iphone-video-viewport {
  min-height: 0;
  width: 100%;
  background: #08080a;
}
.iphone-mockup .iphone-video-viewport video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #08080a;
  border-radius: 0;
}
.iphone-home {
  display: grid;
  place-items: center;
  background: #08080a;
}
.iphone-home span {
  display: block;
  width: 35%;
  height: 4px;
  border-radius: 8px;
  background: #ececef;
}
.iphone-key {
  position: absolute;
  width: 3px;
  left: -3px;
  border: 1px solid #8b8580;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #c6c0b8, #65615d);
  box-shadow: -1px 0 1px #fff6;
}
.iphone-action {
  top: 16%;
  height: 20px;
}
.iphone-volume-up {
  top: 24%;
  height: 39px;
}
.iphone-volume-down {
  top: 33%;
  height: 39px;
}
.iphone-key.iphone-power {
  left: auto;
  right: -3px;
  top: 26%;
  height: 62px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, #55504c, #d2ccc5);
}
@media (max-width: 700px) {
  .demo-phone.iphone-mockup {
    max-width: 268px;
    border-radius: 43px;
    padding: 5px;
  }
  .iphone-display {
    border-radius: 37px;
    grid-template-rows: 40px minmax(0, 1fr) 21px;
  }
  .iphone-status {
    padding-inline: 16px;
  }
  .iphone-time {
    font-size: 10px;
  }
  .iphone-island {
    width: 74px;
    height: 22px;
    top: 7px;
  }
  .iphone-island i {
    width: 9px;
    height: 9px;
    top: 6px;
  }
  .iphone-status-icons {
    width: 44px;
  }
}
@media (max-width: 360px) {
  .demo-phone.iphone-mockup {
    border-radius: 38px;
  }
  .iphone-display {
    border-radius: 32px;
  }
  .iphone-status {
    padding-inline: 12px;
  }
  .iphone-island {
    width: 68px;
  }
  .iphone-status-icons {
    width: 39px;
  }
}

/* A single center anchor keeps the app trio balanced at every width. */
.app-section .app-phones {
  width: 100%;
  max-width: 560px;
  height: auto;
  aspect-ratio: 560 / 490;
  margin-inline: auto;
  justify-self: center;
}
.app-phones .phone {
  left: 50%;
  right: auto;
  top: 14%;
  width: 38%;
  max-width: none;
  margin-left: -19%;
  aspect-ratio: 490 / 930;
  border-width: 5px;
  border-radius: 25px;
  transform-origin: center center;
}
.app-phones .phone img {
  display: block;
  width: 100%;
  height: 100%;
  /* Original 1074px exports contain a 480px app viewport between side gutters. */
  object-fit: cover;
  object-position: center;
  border-radius: 19px;
}
.app-phones .phone-front {
  top: 5%;
  transform: translateY(14px);
}
.app-phones .phone-back {
  transform: translateX(-52%) rotate(-5deg);
}
.app-phones .phone-side {
  transform: translateX(52%) rotate(5deg);
}
.app-phones.is-visible .phone-front {
  transform: translateY(0);
}
.app-phones.is-visible .phone-back {
  transform: translateX(-65%) rotate(-9deg);
}
.app-phones.is-visible .phone-side {
  transform: translateX(65%) rotate(9deg);
}
@media (max-width: 700px) {
  .app-section .app-phones {
    max-width: 440px;
  }
  .app-phones .phone {
    border-width: 3px;
    border-radius: 19px;
  }
  .app-phones .phone img {
    border-radius: 15px;
  }
}
