.phone {
  position: relative;
}

.phone-frame {
  position: absolute;
  inset: 0;
  border-radius: 15% / 7.3%;
  background: var(--phone-frame);
  padding: 3.6%;
  box-shadow:
    0 0 0 1.5px var(--phone-bezel),
    0 0 0 3px var(--phone-edge),
    0 30px 60px rgb(25 31 40 / 22%),
    0 8px 18px rgb(25 31 40 / 12%);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12% / 5.8%;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    var(--phone-wallpaper-top) 0%,
    var(--phone-wallpaper-middle) 55%,
    var(--phone-wallpaper-bottom) 100%
  );
  text-align: center;
  color: var(--white);
}

.phone-screen::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2.4%;
  width: 30%;
  height: 3.6%;
  transform: translateX(-50%);
  border-radius: 99px;
  background: var(--black);
  z-index: 3;
  transition: opacity 0.2s ease;
}

.phone-date {
  margin-top: 16%;
  font-size: calc(var(--phone-width) * 0.062);
  font-weight: 600;
  color: rgb(25 31 40 / 55%);
}

.phone-time {
  margin-top: 1%;
  font-size: calc(var(--phone-width) * 0.25);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: rgb(25 31 40 / 78%);
}

.phone-ripple {
  position: absolute;
  left: 50%;
  top: 49%;
  width: 40%;
  aspect-ratio: 1;
  margin: -20% 0 0 -20%;
  border-radius: 50%;
  background: rgb(255 255 255 / 85%);
  box-shadow: 0 0 0 2px rgb(255 255 255 / 60%);
  pointer-events: none;
  opacity: var(--ripple-opacity, 0);
  transform: scale(var(--ripple-scale, 0));
}

.phone-app {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--white);
  text-align: left;
  color: var(--ink);
  opacity: var(--letter-open, 0);
  transform: translateY(calc((1 - var(--letter-open, 0)) * 14%));
}

.phone-app > * {
  opacity: var(--letter-content-opacity, 1);
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5.2% 9% 0 11%;
  font-size: calc(var(--phone-width) * 0.044);
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.phone-status-icons {
  width: calc(var(--phone-width) * 0.15);
  height: 100%;
  display: block;
  overflow: visible;
}

.phone-app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6% 6% 3%;
}

.phone-app-icon {
  width: calc(var(--phone-width) * 0.07);
  height: 100%;
  display: block;
  overflow: visible;
  color: var(--ink-2);
}

.phone-app-title {
  font-size: calc(var(--phone-width) * 0.052);
  letter-spacing: -0.02em;
}

.phone-app-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.phone-app-scroll::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14%;
  background: linear-gradient(rgb(255 255 255 / 0%), var(--white));
}

.phone-app-letter {
  --letter-unit: var(--phone-width);

  padding: 5% 8.5% 8%;
}

.phone-home-bar {
  position: absolute;
  left: 50%;
  bottom: 1.8%;
  width: 36%;
  height: 1%;
  min-height: 3px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: rgb(25 31 40 / 45%);
}

.phone[data-frameless] .phone-frame {
  background: var(--white);
  box-shadow: none;
}

.phone[data-frameless] .phone-screen::before,
.phone[data-frameless] .phone-status-bar {
  opacity: 0;
}
