/* The Qu App page: one stage holding the title, the four app screens and the download buttons. */
.qu-app { text-align: center; }

/* Edge to edge, so the screens can slide in from the very edge of the window. */
.page-main.qu-app { max-width: none; padding: 0; }

.qa-stage {
  position: relative; overflow: clip;           /* clips what is still off to the side, without becoming a scroll container (pinning needs that) */
  display: grid; grid-template-rows: auto 1fr; row-gap: var(--space-md, 1.5rem);
  min-height: 100svh; padding: var(--space-lg, 2.5rem) var(--gutter) var(--space-xl, 4rem);
}
.page-main .qa-title {
  margin: 0 auto; max-width: 18ch; text-wrap: balance;
  font-size: var(--text-2xl, 2.2rem); font-weight: var(--weight-bold, 700); line-height: var(--leading-tight, 1.1);
}

/* ---- phones (small screens): the screens share one spot, one showing at a time ---- */
.qu-app__phones { display: grid; justify-items: center; align-items: center; min-height: 0; }
.qu-app__phones img { grid-area: 1 / 1; height: min(62svh, 34rem); width: auto; max-width: 100%; display: block; }

/* the download block shares that same spot, so it takes over when the screens have gone */
.qu-app__outro { grid-row: 2; grid-column: 1; align-self: center; }
.qu-app__phones { grid-row: 2; grid-column: 1; }
.qu-app__get { font-size: var(--text-2xl, 1.6rem); font-weight: var(--weight-bold, 700); margin: 0 0 var(--space-xl, 4rem); }
.qu-app__stores { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md, 1rem); }
.page-main .qu-app__store {
  display: inline-flex; align-items: center; justify-content: center; min-width: 8rem; padding: 0.85rem 2.25rem;
  font-size: var(--text-lg, 1.2rem); font-weight: var(--weight-bold, 700); color: var(--color-off-white, #F8F9F0);
  background: var(--color-text, #1E3A5F); border: 1.5px solid var(--color-text, #1E3A5F); border-radius: 999px; text-decoration: none;
}
.page-main .qu-app__store:hover, .page-main .qu-app__store:focus-visible { background: var(--color-accent, #FDE358); border-color: var(--color-accent, #FDE358); color: var(--color-text, #1E3A5F); }

/* ---- wide screens: title, then four screens side by side, then the download block under them ---- */
@media (min-width: 48rem) {
  .qa-stage { grid-template-rows: auto auto auto; align-content: center; row-gap: var(--space-lg, 2.5rem); }
  .qu-app__phones { grid-row: 2; grid-template-columns: repeat(4, 1fr); gap: var(--space-md, 1.5rem);
    /* sized by the window's height as well as its width, so title + screens + buttons always fit one screenful */
    width: min(64rem, 100%, calc((100svh - 23rem) * 1.9)); margin: 0 auto; }
  .qu-app__phones img { grid-area: auto; width: 100%; height: auto; max-height: none; }
  .qu-app__outro { grid-row: 3; }
  .qu-app__get { margin-bottom: var(--space-lg, 2.5rem); }
}

.qa-cue { bottom: 1.25rem; }

/* Hidden until the script takes over; the script (or its fallback) lifts this, so nothing stays hidden. */
.qa-js:not(.qa-off) .qu-app__phones img,
.qa-js:not(.qa-off) .qu-app__outro { opacity: 0; visibility: hidden; }

/* No JavaScript or reduced motion: a plain column. */
.qa-off .qa-stage { min-height: 0; display: block; }
.qa-off .qu-app__phones { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md, 1rem); max-width: 64rem; width: auto; margin: var(--space-lg, 2.5rem) auto; }
.qa-off .qu-app__phones img { grid-area: auto; width: 100%; height: auto; }
@media (min-width: 48rem) { .qa-off .qu-app__phones { grid-template-columns: repeat(4, 1fr); } }
.qa-off .qu-app__outro { margin-top: var(--space-xl, 4rem); }
.qa-off .qa-cue { display: none; }
