.app-preview {
  --stage-ink: #40212f;
  --stage-light: #fff1e6;
  --phone-width: clamp(198px, 52vw, 324px);
  --phone-near: clamp(100px, 16vw, 200px);
  --phone-far: clamp(142px, 27vw, 326px);
  --phone-rim: 6px;
  background: var(--stage-ink);
  color: var(--stage-light);
  overflow: hidden;
  scroll-margin-top: 68px;
  text-align: center;
}

.app-preview__header h2.sec {
  margin: 0 auto 10px;
}

.app-preview__header p,
.app-preview__caption {
  color: #f2d7d2;
}

.app-preview__header p {
  max-width: 58ch;
  margin-inline: auto;
}

.app-preview button {
  appearance: none;
  min-height: 44px;
  padding: 6px 13px;
  border: 1px solid #a87d87;
  border-radius: 99px;
  color: inherit;
  background: #51303f;
  font: 500 14px/1.2 'Rubik', system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .18s, color .18s;
}

@media (hover: hover) {
  .app-preview button:hover {
    background: #6f4857;
  }
}

.app-preview button:focus-visible,
.app-preview__stage:focus-visible {
  outline: 2px solid #ffd3a2;
  outline-offset: 3px;
}

.app-preview button:active {
  border-color: #ffd3a2;
  color: var(--stage-ink);
  background: #ffd3a2;
}

.app-preview__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 990px);
  padding-block: clamp(22px, 3.5vw, 38px);
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  margin: 6px auto 0;
  background: radial-gradient(ellipse closest-side, #9d5f64 0%, #683d50 62%, transparent 100%);
  touch-action: pan-y pinch-zoom;
}

.app-preview__phone {
  grid-area: 1 / 1;
  position: relative;
  z-index: 0;
  width: var(--phone-width);
  margin: 0;
  padding: var(--phone-rim);
  border: 1px solid #a77b7e;
  border-radius: 26px;
  background: #21161d;
  box-shadow: 0 14px 32px #21101b95;
  opacity: 0;
  transform-origin: 50% 63%;
  cursor: pointer;
  user-select: none;
}

.app-preview[data-ready] .app-preview__phone {
  transition: transform .56s cubic-bezier(.25,.75,.24,1), opacity .36s ease;
}

.app-preview__phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  border-radius: 19px;
  object-fit: cover;
  pointer-events: none;
  background: #fffdfa;
}

.app-preview__throw-video {
  position: absolute;
  inset: var(--phone-rim);
  width: calc(100% - 2 * var(--phone-rim));
  height: calc(100% - 2 * var(--phone-rim));
  border-radius: 19px;
  object-fit: cover;
  pointer-events: none;
}

.app-preview__throw-video[hidden] {
  display: none;
}

.app-preview__phone[data-position="-2"],
.app-preview__phone[data-position="2"] {
  z-index: 1;
  opacity: 1;
  filter: brightness(.83);
}

.app-preview__phone[data-position="-2"] {
  transform: translateX(calc(-1 * var(--phone-far))) rotate(-14deg) scale(.61);
}

.app-preview__phone[data-position="2"] {
  transform: translateX(var(--phone-far)) rotate(14deg) scale(.61);
}

.app-preview__phone[data-position="-1"],
.app-preview__phone[data-position="1"] {
  z-index: 2;
  opacity: 1;
  filter: brightness(.94);
}

.app-preview__phone[data-position="-1"] {
  transform: translateX(calc(-1 * var(--phone-near))) rotate(-8deg) scale(.76);
}

.app-preview__phone[data-position="1"] {
  transform: translateX(var(--phone-near)) rotate(8deg) scale(.76);
}

.app-preview__phone[data-position="0"] {
  z-index: 3;
  opacity: 1;
}

.app-preview__caption {
  margin: 0 auto;
  padding-inline: 14px;
  font: 500 clamp(18px, 3.5vw, 24px)/1.3 'Oswald', sans-serif;
}

.app-preview__dialog {
  width: min(450px, calc(100% - 20px));
  max-height: calc(100dvh - 20px);
  margin: auto;
  padding: 10px;
  border: 1px solid #a87d87;
  border-radius: 18px;
  background: var(--stage-ink);
  color: var(--stage-light);
}

.app-preview__dialog::backdrop {
  background: #21101bdc;
}

.app-preview__dialog-bar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
  background: var(--stage-ink);
}

.app-preview__dialog img {
  display: block;
  width: min(100%, 390px);
  height: auto;
  margin: auto;
  border-radius: 10px;
}

.app-preview__screen-frame {
  position: relative;
  container-type: inline-size;
}

.app-preview__dialog .app-preview__screen-frame {
  width: min(100%, 390px);
  margin-inline: auto;
}

.app-preview__screen-title {
  position: absolute;
  inset: 6.8% 5.4% auto;
  height: 6%;
  display: flex;
  align-items: center;
  background: #fdfdfd;
  color: #302823;
  font: 800 8.1cqi/1 Rubik, sans-serif;
  pointer-events: none;
}

.app-preview__screen-title[hidden] { display: none; }

@media (max-width: 560px) {
  .app-preview {
    --phone-width: clamp(176px, 57vw, 284px);
    --phone-near: 29vw;
    --phone-far: 43vw;
    padding-top: 36px;
  }

  .app-preview__header p {
    font-size: 15px;
  }


}

@media (prefers-reduced-motion: reduce) {
  .app-preview[data-ready] .app-preview__phone,
  .app-preview button {
    transition: none;
  }
}

.app-preview__album-page {
  position: relative;
  aspect-ratio: 390 / 844;
  border-radius: 19px;
  overflow: hidden;
  background: #fffdfa;
}

.app-preview__album-scroll {
  overflow-y: auto;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: none;
}

.app-preview__album-scroll img {
  aspect-ratio: auto;
}

.app-preview .app-preview__album-link {
  position: absolute;
  inset-inline: 5.6%;
  min-height: 0;
  height: 10%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.app-preview .app-preview__album-link:hover:not(:disabled) {
  background: #9847340d;
}

.app-preview .app-preview__album-link:focus-visible {
  outline-color: #984734;
  outline-offset: -2px;
}

.album-link-photos { top: 30%; }
.album-link-collages { top: 41%; }
.app-preview .album-link-back { top: 0; right: auto; width: 27%; height: 6.5%; }
.app-preview .app-preview__album-link:disabled { pointer-events: none; }
