.stage {
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  justify-content: center;
  background: var(--color-page);
}

.desktop-plate {
  display: contents;
}

.desktop-scroll-track {
  display: none;
}

.phone-frame {
  position: relative;
  width: 100%;
  max-width: var(--frame-mobile-width);
  min-height: 100vh;
  min-height: 100svh;
  overflow: clip;
  background: #fff;
  box-sizing: content-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.status-bar {
  display: none;
}

.messages-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 0;
}

.top-veil {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 128px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.62) 20%,
    rgba(255, 255, 255, 0.38) 44%,
    rgba(255, 255, 255, 0.18) 68%,
    rgba(255, 255, 255, 0.06) 86%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

.header-controls {
  position: absolute;
  top: calc(9px + env(safe-area-inset-top));
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 0 13px;
}

.glass-surface,
.glass-control {
  background: var(--glass-background);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  backdrop-filter: blur(30px) saturate(200%);
}

.glass-control {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.back-chevron {
  display: block;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid var(--color-ink);
  border-left: 2px solid var(--color-ink);
  border-radius: 1px;
  transform: rotate(45deg) translate(2px, -2px);
}

.contact {
  display: flex;
  align-items: center;
  flex-direction: column;
  margin-top: -2px;
}

.contact-avatar {
  position: relative;
  z-index: 2;
  display: flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--color-blaze);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.contact-avatar .brand-wedge {
  position: relative;
}

.contact-name {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: -10px;
  padding: 6px 15px 7px;
  border-radius: 100px;
  color: var(--color-ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.disclosure-chevron {
  display: block;
  width: 6px;
  height: 6px;
  border-top: 1.8px solid rgba(0, 0, 0, 0.4);
  border-right: 1.8px solid rgba(0, 0, 0, 0.4);
  transform: rotate(45deg);
}

.facetime-control {
  justify-self: end;
}

.facetime-icon {
  width: 26px;
  height: 26px;
  opacity: 0.78;
}

.messages-composer {
  position: sticky;
  bottom: 0;
  z-index: 30;
  height: 0;
}

.bottom-veil {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 138px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.55) 22%,
    rgba(255, 255, 255, 0.32) 46%,
    rgba(255, 255, 255, 0.14) 70%,
    rgba(255, 255, 255, 0.04) 88%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

.composer-row {
  position: absolute;
  right: 0;
  bottom: calc(11px + env(safe-area-inset-bottom));
  left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.composer-add {
  flex: none;
  width: 44px;
  height: 44px;
  padding-bottom: 3px;
  color: rgba(0, 0, 0, 0.6);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.composer-field {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px 12px 18px;
  border-radius: 100px;
  color: rgba(0, 0, 0, 0.36);
  font-size: 17px;
  letter-spacing: -0.01em;
}

.microphone-icon {
  width: 22px;
  height: 26px;
  flex: none;
  opacity: 0.48;
}

.text-cta {
  position: fixed;
  z-index: 40;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  height: 61px;
  align-items: center;
  gap: 8px;
  padding: 0 5px 0 26px;
  border-radius: 100px;
  background: var(--color-blaze);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
  color: var(--color-bone);
  text-decoration: none;
  transform: translateX(-50%);
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.text-cta__label {
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.text-cta__logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.text-cta:hover {
  background: #ff7a12;
  color: var(--color-bone);
}

.text-cta:active {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%) scale(0.97);
}

.text-cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.qr-fallback[hidden] {
  display: none;
}

.qr-fallback {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 13, 11, 0.18);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.qr-fallback__card {
  position: relative;
  width: min(248px, calc(100vw - 48px));
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 28px;
  background: rgba(255, 248, 239, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  color: var(--color-ink);
  text-align: center;
}

.qr-fallback__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-ink);
  cursor: pointer;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
}

.qr-fallback__close:focus-visible {
  outline: 3px solid var(--color-blaze);
  outline-offset: 2px;
}

.qr-fallback__eyebrow {
  margin: 0 0 2px;
  color: var(--color-blaze);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.qr-fallback__card h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.qr-fallback__code {
  padding: 14px;
  border-radius: 18px;
  background: #fff;
}

.qr-fallback__code svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 860px) {
  html {
    height: 100%;
    scrollbar-width: none;
  }

  body {
    min-height: 100%;
    overflow-x: hidden;
  }

  body::-webkit-scrollbar {
    display: none;
  }

  .stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
    background: #ad8258;
  }

  .desktop-plate {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: max(100vw, calc(100svh * 16 / 9));
    height: max(100svh, calc(100vw * 9 / 16));
    background: url("../assets/desktop-iphone-table.webp") center / 100% 100% no-repeat;
    transform: translate(-50%, -50%);
  }

  .desktop-scroll-track {
    display: block;
    width: 1px;
    min-height: 100svh;
    pointer-events: none;
  }

  .phone-frame {
    position: absolute;
    top: 4%;
    left: 37.89%;
    width: 22.71%;
    max-width: none;
    height: 92.1%;
    min-height: 0;
    overflow-x: clip;
    overflow-y: hidden;
    border-radius: 11.8% / 5.2%;
    background: #fff;
    box-shadow: none;
    container-type: inline-size;
    overscroll-behavior: contain;
    pointer-events: none;
  }

  .status-bar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    height: 0;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px 0 34px;
  }

  .status-time,
  .status-icons,
  .dynamic-island {
    position: absolute;
  }

  .status-time {
    top: 14px;
    left: 34px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .dynamic-island {
    top: 11px;
    left: 50%;
    width: 120px;
    height: 35px;
    border-radius: 20px;
    background: #000;
    transform: translateX(-50%);
  }

  .status-icons {
    top: 17px;
    right: 31px;
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 1.5px;
  }

  .signal-bars span {
    width: 3px;
    border-radius: 1px;
    background: var(--color-ink);
  }

  .signal-bars span:nth-child(1) { height: 4px; }
  .signal-bars span:nth-child(2) { height: 6px; }
  .signal-bars span:nth-child(3) { height: 8px; }
  .signal-bars span:nth-child(4) { height: 10px; }

  .battery {
    position: relative;
    display: block;
    width: 24px;
    height: 12px;
    padding: 1.5px;
    border: 1.5px solid var(--color-ink);
    border-radius: 4px;
  }

  .battery::after {
    position: absolute;
    top: 2px;
    right: -4px;
    width: 1.5px;
    height: 5px;
    border-radius: 0 1px 1px 0;
    background: var(--color-ink);
    content: "";
  }

  .battery span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 1.5px;
    background: var(--color-ink);
  }

  .header-controls {
    top: 58px;
  }

  .text-cta {
    top: 30px;
    right: auto;
    bottom: auto;
    left: 30px;
    height: 70px;
    gap: 10px;
    padding: 0 13px 0 30px;
    transform: none;
  }

  .text-cta__logo {
    width: 58px;
    height: 58px;
  }

  .text-cta:active {
    transform: scale(0.97);
  }
}
