/* Google Play download for app projects (Tiny Island Empire). */

/* Phone screenshots: three in a row, wider than the text column, on desktop;
   a swipeable strip on tablets and phones. Never cropped. */
.app-screens {
  --screens-width: min(1080px, calc(100vw - 64px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  inline-size: var(--screens-width);
  margin-block: clamp(48px, 7vw, 88px);
  margin-inline: calc((100% - var(--screens-width)) / 2);
}

.app-screens figure {
  margin: 0;
  text-align: center;
}

.app-screens img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 26px 60px rgb(20 30 25 / 20%);
}

.app-screens figcaption {
  margin-top: 16px;
  color: #4f5752;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 820px) {
  .app-screens {
    display: flex;
    gap: 16px;
    inline-size: 100vw;
    margin-inline: calc(50% - 50vw);
    padding: 4px 16px 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
  }

  .app-screens::-webkit-scrollbar {
    display: none;
  }

  .app-screens figure {
    flex: 0 0 68%;
    scroll-snap-align: start;
  }

  .app-screens img {
    border-radius: 22px;
    box-shadow: 0 16px 36px rgb(20 30 25 / 20%);
  }
}

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-block-size: 58px;
  padding: 9px 22px 9px 16px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 14px;
  background: #0b0f0d;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgb(0 0 0 / 28%);
  transition: transform 200ms var(--ease-out, ease), box-shadow 200ms var(--ease-out, ease), border-color 200ms ease;
}

[dir="rtl"] .play-button {
  padding: 9px 16px 9px 22px;
}

.play-button:hover {
  transform: translateY(-2px);
  border-color: #efa64c;
  box-shadow: 0 16px 36px rgb(0 0 0 / 34%);
}

.play-button:focus-visible {
  outline: 3px solid #efa64c;
  outline-offset: 3px;
}

.play-button__icon {
  flex-shrink: 0;
}

.play-button__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: start;
}

.play-button__text small {
  font-size: .72rem;
  letter-spacing: .04em;
  opacity: .85;
}

.play-button__text strong {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -.01em;
  direction: ltr;
}

.play-button--large {
  min-block-size: 66px;
}

.play-button--large .play-button__text strong {
  font-size: 1.55rem;
}

.app-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 34px;
}

.app-download__soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9d7cf;
  font-size: .9rem;
}

.app-download__soon::before {
  content: "";
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: #efa64c;
}

/* Download panel after the story */

.app-download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 48px);
  margin-block: clamp(48px, 7vw, 88px) 0;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, rgb(239 166 76 / 26%), transparent 42%),
    radial-gradient(circle at 8% 100%, rgb(56 184 209 / 22%), transparent 46%),
    #1f2925;
  color: #fff;
}

[dir="rtl"] .app-download-card {
  background:
    radial-gradient(circle at 12% 12%, rgb(239 166 76 / 26%), transparent 42%),
    radial-gradient(circle at 92% 100%, rgb(56 184 209 / 22%), transparent 46%),
    #1f2925;
}

.app-download-card__main {
  display: flex;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 28px);
  min-width: 0;
}

.app-download-card__icon {
  flex-shrink: 0;
  inline-size: clamp(72px, 9vw, 96px);
  block-size: auto;
  border-radius: 22%;
  box-shadow: 0 10px 26px rgb(0 0 0 / 35%);
}

.project-story__body .app-download-card h2 {
  margin: 0 0 10px;
  color: #fff;
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.03em;
}

.project-story__body .app-download-card p {
  margin: 0;
  color: #d9d7cf;
  font-size: 1rem;
  line-height: 1.55;
}

.project-story__body .app-download-card .app-download-card__eyebrow {
  margin-bottom: 10px;
  color: #efa64c;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

[dir="rtl"] .project-story__body .app-download-card .app-download-card__eyebrow {
  font-size: .88rem;
  letter-spacing: 0;
}

.app-download-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 24px;
}

/* The story's link styles must not reach the button. */
.project-story__body .app-download-card a.play-button,
.project-story__body .app-download-card a.play-button:hover,
.project-story__body .app-download-card a.play-button:focus-visible {
  color: #fff;
  text-decoration: none;
}

.app-download-card__qr {
  flex-shrink: 0;
  margin: 0;
  text-align: center;
}

.app-download-card__qr img {
  display: block;
  inline-size: 132px;
  block-size: 132px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
}

.app-download-card__qr figcaption {
  margin-top: 10px;
  color: #d9d7cf;
  font-size: .82rem;
}

/* Phones open the store directly, so the QR code is only useful on larger screens. */
@media (max-width: 820px) {
  .app-download-card {
    flex-direction: column;
    align-items: stretch;
  }

  .app-download-card__qr {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-download-card__main {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .play-button {
    transition: none;
  }

  .play-button:hover {
    transform: none;
  }
}
