/* App pages (app-<slug>.html). Figma "App · Academy" (56:2) + "App · Academy · Mobile 390" (287:2202).
   Pages are generated by tools/build_app_pages.py from data/apps.json. */

/* ---------- Hero (56:68) ---------- */
.app-hero { background: var(--sky); padding: var(--hero-top) 0 80px; overflow-x: clip; }
.app-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  grid-template-areas: "crumbs shots" "icon shots" "title shots" "text shots" "stores shots";
  column-gap: 48px;
  row-gap: 24px;
}
.crumbs {
  grid-area: crumbs;
  font-weight: 600; font-size: 14px; line-height: 20px; letter-spacing: .03em;
  white-space: pre; color: #94989E;
}
.crumbs a { color: #4C96FF; }
.crumbs a:hover { text-decoration: underline; }
.app-hero__icon { grid-area: icon; width: 96px; height: 96px; border-radius: 24px; object-fit: cover; }
.app-hero__title { grid-area: title; font-weight: 700; font-size: 60px; line-height: 66px; color: var(--ink); }
.app-hero__title--long { font-size: 48px; line-height: 54px; } /* Emotions (57:2) */
.app-hero__text { grid-area: text; font-size: 20px; line-height: 28px; color: var(--text); }
.app-hero .stores { padding-top: 10px; }

/* Screens collage (56:90): spans the text column height, 44px below its top, centred in the
   area that reaches 20px past the content edge (hero has 100px right padding in Figma). */
.app-hero__shots { grid-area: shots; position: relative; container-type: size; }
.collage {
  position: absolute;
  top: 44px;
  left: 50%;
  translate: -50% 0;
  width: min(100cqw + var(--overhang, 0px), (100cqh - 44px) * var(--ar));
  aspect-ratio: var(--ar);
  container-type: inline-size;
}
.shot {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  padding: var(--p);
  transform-origin: 0 0;
  rotate: var(--rot);
  background: #fff;
  border-radius: var(--r);
  overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--ir); }
.shot__track { width: 100%; height: 100%; }
.shot__slide { display: none; } /* extra carousel slides, mobile only */


/* ---------- Key Features (56:116) ---------- */
.features { padding: 50px 0 100px; }
.features__list { display: flex; gap: 20px; margin-top: 44px; }
.feature {
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px 24px 28px;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.feature__num {
  flex: none;
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  font-weight: 800; font-size: 24px; line-height: 30px;
  background: var(--tint); color: var(--tone);
}
.feature:nth-child(5n+1) { --tint: #E2F4D7; --tone: #599E2E; }
.feature:nth-child(5n+2) { --tint: #EEFCFF; --tone: #4C96FF; }
.feature:nth-child(5n+3) { --tint: #FFF5CC; --tone: #C97A03; }
.feature:nth-child(5n+4) { --tint: #FFCCE0; --tone: #DF1263; }
.feature:nth-child(5n+5) { --tint: #E0CEFD; --tone: #5008C4; }
.feature__body { display: flex; flex-direction: column; gap: 14px; }
.feature__title { font-weight: 700; font-size: 20px; line-height: 28px; color: var(--ink); }
.feature__text { font-size: 16px; line-height: 24px; letter-spacing: .03em; color: var(--text); }


/* ---------- Full Description (56:163) ---------- */
.about-app { background: var(--green-10); padding: 60px 0 100px; }
.about-app .container { display: flex; flex-direction: column; gap: 24px; }
.about-app__title {
  max-width: 1000px; margin: 0 auto;
  font-weight: 700; font-size: 40px; line-height: 44px;
  text-align: center; color: var(--ink);
}
.about-app__text { font-size: 20px; line-height: 30px; color: var(--text); }


/* ---------- Gameplay (56:186) ---------- */
.app-gameplay { padding: 50px 0 110px; }
.app-gameplay .container { display: flex; flex-direction: column; align-items: center; }
.app-gameplay__sub { max-width: 820px; }
.player-card {
  display: block;
  width: 100%; max-width: 1000px;
  margin-top: 56px; /* 20px gap + 16px spacer + 20px gap */
  padding: 16px;
  border-radius: 40px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .15s ease;
}
.player-card:hover { box-shadow: 0 0 40px rgba(0, 0, 0, .1); }
.player-card__video {
  position: relative;
  display: block;
  aspect-ratio: 968 / 544;
  border-radius: 30px;
  overflow: hidden;
  background: #FEEACD;
}
.player-card__shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* SVG includes a 40px drop-shadow margin around the 96×68 button */
.player-card__play {
  position: absolute; left: 50%; top: 50%;
  width: 176px; height: 148px;
  translate: -50% -50%;
  transition: scale .15s ease;
}
.player-card__play { z-index: 1; }
.player-card__play picture, .player-card__play img { display: block; width: 100%; height: 100%; max-width: none; }
.player-card:hover .player-card__play { scale: 1.06; }
.video-link {
  margin-top: 20px;
  font-weight: 700; font-size: 16px; line-height: 24px; letter-spacing: .03em;
  color: #4C96FF;
}
.video-link:hover { text-decoration: underline; }


/* ================= Responsive ================= */
@media (min-width: 1240px) {
  /* the widest Figma collages (630px) overhang the 612px column a little */
  .app-hero__shots { margin-right: -20px; }
  .collage { --overhang: 60px; }
}

@media (max-width: 1100px) {
  .app-hero__title { font-size: 48px; line-height: 54px; }
  .features__list { flex-wrap: wrap; justify-content: center; }
  .feature { flex: 0 1 calc((100% - 40px) / 3); }
}

/* Mobile layout — Figma "App · Academy · Mobile 390" (287:2202) */
@media (max-width: 899px) {
  .app-hero { padding: var(--hero-top) 0 36px; }
  .app-hero__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "crumbs" "icon" "title" "shots" "text" "stores";
    row-gap: 18px;
    justify-items: center;
    max-width: 600px;
    text-align: center;
  }
  .app-hero__icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-hero__title { font-size: 32px; line-height: 40px; }
  .app-hero__text { font-size: 16px; line-height: 24px; }
  .app-hero .stores { justify-content: center; padding-top: 4px; }
  .app-hero .store { height: 50px; }
  .app-hero .store--apple { width: 148px; }
  .app-hero .store--google { width: 170px; }
  .app-hero .store--amazon { width: 159px; }

  .app-hero__shots { width: 100%; margin: 0; container-type: inline-size; }
  .collage { position: relative; top: auto; left: auto; translate: none; width: 100%; }
  /* screenshots: only the front shot, full width (287:2261) */
  .collage--screens { aspect-ratio: auto; }
  .collage--screens .shot--1, .collage--screens .shot--3 { display: none; }
  .collage--screens .shot--2 {
    position: relative; left: auto; top: auto;
    width: 100%; height: auto;
    aspect-ratio: var(--mar);
    padding: var(--mp);
    border-radius: var(--mr);
  }
  .collage--screens .shot--2 img { border-radius: var(--mir); }
  /* carousel: the screenshots slide through the front frame, ~2.5s each */
  .collage--screens .shot__track { display: flex; overflow: hidden; border-radius: var(--mir); }
  .collage--screens .shot__track img {
    flex: 0 0 100%; display: block; border-radius: 0;
    animation: shot-carousel 10s ease-in-out infinite;
  }

  .features { padding: 32px 0 48px; }
  .features .container, .about-app .container, .app-gameplay .container { max-width: 600px; }
  .features .section-title { font-size: 26px; line-height: 34px; }
  .features__list { flex-direction: column; gap: 12px; margin-top: 24px; }
  .feature { flex: none; flex-direction: row; align-items: flex-start; gap: 16px; padding: 20px; border-radius: 24px; }
  .feature__num { width: 48px; height: 48px; border-radius: 14px; }
  .feature__body { flex: 1 1 auto; min-width: 0; gap: 4px; }
  .feature__title { font-size: 18px; line-height: 28px; }
  .feature__text { font-size: 15px; line-height: 24px; }

  .about-app { padding: 32px 0 48px; }
  .about-app .container { gap: 16px; }
  .about-app__title { margin: 0; font-size: 24px; line-height: 32px; text-align: left; }
  .about-app__text { font-size: 16px; line-height: 24px; }

  .app-gameplay { padding: 32px 0 48px; }
  .app-gameplay .section-title { font-size: 24px; line-height: 32px; }
  .app-gameplay .section-sub { margin-top: 16px; }
  .player-card { margin-top: 16px; padding: 8px; border-radius: 22px; }
  .player-card__video { border-radius: 16px; }
  .player-card__play { width: 144px; height: 125.333px; }
  .video-link { margin-top: 16px; }
}

@keyframes shot-carousel {
  0%, 25% { transform: translateX(0); }
  32%, 57% { transform: translateX(-100%); }
  64%, 89% { transform: translateX(-200%); }
  96%, 100% { transform: translateX(-300%); } /* = first slide again, then jumps back unnoticed */
}
@media (prefers-reduced-motion: reduce) {
  .collage--screens .shot__track img { animation: none; }
}

/* Tablet (601–899px): wider column, features in 2 columns */
@media (min-width: 601px) and (max-width: 899px) {
  .app-hero__inner { max-width: 720px; }
  .app-hero__title { font-size: 40px; line-height: 1.1; }
  .app-hero__text { max-width: 640px; font-size: 18px; line-height: 28px; }
  .features .container, .about-app .container, .app-gameplay .container { max-width: none; }
  .features__list { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .feature { flex: 0 1 calc((100% - 16px) / 2); }
}
