.app-gallery {
  --gallery-padding: 5vw;
  padding-block: clamp(64px, 8vw, 122px);
}
.app-gallery-heading {
  width: min(90%, 900px);
  margin: 0 auto clamp(32px, 5vw, 76px);
  text-align: center;
}
.app-gallery-heading h2 {
  max-width: 19ch;
  margin-inline: auto;
  font-size: clamp(34px, 5vw, 68px);
}

.app-gallery-cards {
  --gallery-gap: clamp(14px, 1.5vw, 26px);
  --gallery-width: min(90%, 1540px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gallery-gap);
  width: var(--gallery-width);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.app-gallery-card {
  height: clamp(435px, 44vw, 720px);
  min-width: 0;
}
.app-gallery-surface {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(25px, 2.55vw, 42px);
  background: #eee8ec;
}
.app-gallery-card--wallet { --photo-position: 73%; }
.app-gallery-card--surveys { --photo-position: 54%; }
.app-gallery-card--payment { --photo-position: 67%; }
.app-gallery-art {
  position: absolute;
  inset: 0;
}
.app-gallery-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--photo-position);
}
.app-gallery-caption {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-end: clamp(14px, 2.3vw, 28px);
  translate: -50% 0;
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 10px 18px;
  border-radius: 20px;
  background: rgb(12 10 15 / 74%);
  backdrop-filter: blur(12px);
  color: #fff;
  text-align: center;
}
.app-gallery-caption h3 {
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.25;
  letter-spacing: -.02em;
}
.app-gallery-caption p {
  max-width: 26ch;
  margin-top: 3px;
  color: #f2eef4;
  font-size: 13px;
  line-height: 1.3;
}
.app-gallery-toggle { display: none; }

.app-store-callout {
  width: min(90%, 680px);
  margin: clamp(50px, 6vw, 88px) auto 0;
  text-align: center;
}
.app-store-callout h3 {
  font-size: clamp(25px, 3.1vw, 43px);
  text-wrap: balance;
}
.app-store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.4vw, 18px);
  margin-top: clamp(23px, 3vw, 34px);
}
.alpine-copy .app-store-buttons { justify-content: flex-start; }
.alpine-copy .app-store-button { pointer-events: auto; }
@media (max-width: 880px) {
  .alpine-copy .app-store-buttons {
    justify-content: center;
    margin-top: 18px;
  }
}
.app-store-button {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1vw, 13px);
  min-width: clamp(128px, 13vw, 170px);
  min-height: clamp(52px, 5vw, 62px);
  padding: 8px clamp(12px, 1.4vw, 18px);
  border: 1px solid #49434d;
  border-radius: 999px;
  background: #141218;
  color: #fff;
  text-align: start;
}
.app-store-button:hover { background: #2a2331; }
.app-store-button svg {
  flex: none;
  width: clamp(22px, 2.2vw, 28px);
  height: auto;
}
.app-store-button small, .app-store-button strong { display: block; }
.app-store-button small { color: #e3dbe9; font-size: 11px; line-height: 1.25; }
.app-store-button strong {
  font-size: clamp(15px, 1.55vw, 20px);
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}
.app-store-dialog {
  --store-motion-duration: 220ms;
  --store-slide-ease: cubic-bezier(.17, .8, .28, 1);
  width: min(88%, 400px);
  padding: clamp(26px, 5vw, 42px);
  border-radius: 24px;
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity var(--store-motion-duration) ease,
    transform var(--store-motion-duration) var(--store-slide-ease);
}
.app-store-dialog[data-apple-mobile] {
  --store-motion-duration: 320ms;
  will-change: opacity, transform;
}
.app-store-dialog[open][data-visible] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.app-store-dialog::backdrop {
  background: rgb(21 15 29 / 56%);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--store-motion-duration) ease;
}
.app-store-dialog[open][data-visible]::backdrop { opacity: 1; }
/* On iOS, keep the full-screen dimmer static while the small panel moves. */
.app-store-dialog[data-apple-mobile]::backdrop {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1;
  transition: none;
}
.app-store-brand { margin-bottom: 20px; pointer-events: none; }
.app-store-brand img {
  margin: 0;
  max-height: none;
  border-radius: 0;
}
.app-store-dialog h3 { font-size: clamp(29px, 5vw, 39px); }
.app-store-dialog h3:focus { outline: none; }
.app-store-dialog p { margin-top: 10px; font-size: 16px; }
.app-store-dialog form { margin-top: 24px; }

@media (min-width: 720px) {
  .app-gallery-cards {
    --card-min-width: 150px;
    display: flex;
    gap: 0;
    width: calc(var(--gallery-width) + var(--gallery-gap));
  }
  .app-gallery-card {
    flex: var(--card-grow, 1) 1 0;
    min-width: calc(var(--card-min-width) + var(--gallery-gap));
    /* Keep hover continuous in the gutter as the cards exchange width. */
    padding-inline: calc(var(--gallery-gap) / 2);
    transition: flex-grow 560ms cubic-bezier(.3, .04, .25, 1);
  }
  .app-gallery-card[data-expanded] {
    --card-grow: var(--expanded-card-grow, 3);
    --caption-height: 72px;
    --caption-copy-max-width: var(--caption-copy-width);
    --caption-copy-gap: 13px;
    --caption-copy-opacity: 1;
    --caption-copy-delay: .32s;
    --caption-copy-visibility: visible;
  }
  @media (hover: hover) {
    .app-gallery-cards:not(:has([data-expanded])) .app-gallery-card:hover {
      --card-grow: var(--expanded-card-grow, 3);
      --caption-height: 72px;
      --caption-copy-max-width: var(--caption-copy-width);
      --caption-copy-gap: 13px;
      --caption-copy-opacity: 1;
      --caption-copy-delay: .32s;
      --caption-copy-visibility: visible;
    }
  }
  .app-gallery-toggle {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
  }
  .app-gallery-toggle:focus-visible {
    outline: 3px solid #b78af3;
    outline-offset: -4px;
  }
  @supports (width: 1cqw) {
    .app-gallery-art { container-type: size; }
    .app-gallery-card--wallet { --photo-position: 63%; }
    .app-gallery-card--surveys { --photo-position: 49%; }
    .app-gallery-card--payment { --photo-position: 61%; }
    .app-gallery-art img {
      /* Give every pixel of card growth the same amount of zoom, including at the end. */
      position: absolute;
      inset: var(--photo-position) auto auto 50%;
      width: calc(100cqh + (100cqw - var(--card-min-width)) * var(--photo-zoom-rate, .3));
      height: auto;
      max-width: none;
      translate: -50% calc(-1 * var(--photo-position));
    }
  }
  .app-gallery-caption {
    --caption-ease: 560ms cubic-bezier(.3, .04, .25, 1);
    grid-auto-flow: column;
    align-items: center;
    min-block-size: 43px;
    block-size: var(--caption-height, 43px);
    overflow: hidden;
    border-radius: 999px;
    text-align: start;
    transition: block-size var(--caption-ease);
  }
  .app-gallery-card { --caption-copy-width: clamp(166px, 22vw, 300px); }
  .app-gallery-caption p {
    width: var(--caption-copy-width);
    max-width: var(--caption-copy-max-width, 0px);
    margin: 0 0 0 var(--caption-copy-gap, 0px);
    opacity: var(--caption-copy-opacity, 0);
    visibility: var(--caption-copy-visibility, hidden);
    overflow: hidden;
    transition: max-width var(--caption-ease), margin-inline-start var(--caption-ease), opacity .16s ease;
    transition-delay: 0s, 0s, var(--caption-copy-delay, 0s);
  }
  .app-gallery-caption p span {
    display: block;
    width: var(--caption-copy-width);
  }
}

@media (min-width: 720px) and (max-width: 1700px) and (max-height: 950px) {
  .app-gallery { padding-block: clamp(44px, 8svh, 76px); }
  .app-gallery-heading { margin-bottom: clamp(26px, 5svh, 48px); }
  .app-gallery-heading h2 { font-size: clamp(38px, 6.3svh, 60px); }
  .app-gallery-cards {
    --gallery-width: min(90%, max(730px, 140svh));
    --expanded-card-grow: 2.4;
    --photo-zoom-rate: .39;
  }
  .app-gallery-card { height: clamp(370px, 61svh, 580px); }
  .app-gallery-card--wallet { --photo-position: 55%; }
  .app-store-callout { margin-top: clamp(62px, 9svh, 88px); }
}

@media (720px <= width <= 1366px) and (any-pointer: coarse) {
  .app-gallery-cards { --photo-zoom-rate: .39; }
  .app-store-callout { margin-top: clamp(65px, 9svh, 88px); }
  .app-store-callout h3 {
    max-inline-size: 21ch;
    margin-inline: auto;
  }
  @media (min-height: 951px) {
    .app-gallery-card { height: clamp(475px, 48vw, 610px); }
  }
}

@media (720px <= width <= 900px) and (any-pointer: coarse) {
  .app-gallery-cards { --photo-zoom-rate: .50; }
}

@media (width < 720px) {
  .app-gallery { padding-block: 42px; }
  .app-gallery-heading { margin-bottom: 22px; }
  .app-gallery-cards {
    width: 100%;
    grid-template-columns: none;
    grid-auto-columns: min(77vw, 390px);
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0 var(--gallery-padding) 12px;
    scroll-padding-inline: var(--gallery-padding);
    scroll-snap-type: inline mandatory;
  }
  .app-gallery-card {
    height: clamp(340px, 98vw, 440px);
    scroll-snap-align: start;
  }
  .app-store-callout { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-store-dialog, .app-store-dialog::backdrop,
  .app-gallery-card,
  .app-gallery-caption,
  .app-gallery-caption p { transition: none !important; }
}
