/* ==========================================================================
   MARK One – Apps Store page. Builds on style.css + hardware.css (same layers, tokens, header, footer, bands).
   Mobile-first; from 1100px up it is the 1920px design scaled with --u.
   ========================================================================== */
body.as-page { --bg: #ddd; }

@layer components {

  /* ---------- shared bits ---------- */
  .as-sec { position: relative; background: var(--bg); padding: clamp(56px, 16vw, 110px) 0 0; text-align: center; isolation: isolate; }
  .as-tx { padding: 0 var(--pad); }
  .as-tx .hw-label { margin: 0 0 14px; }
  .as-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; padding: var(--gap) var(--gap) 0; text-align: left; }
  .as-wrap--end { padding-bottom: var(--gap); }
  .as-band-sec .as-wrap:first-of-type { margin-top: clamp(40px, 11vw, 96px); }
  .as-intro .as-tx + .as-wrap { margin-top: clamp(36px, 10vw, 80px); }
  .panel { --r: 16px; }

  /* solid text panels */
  .as-cent { display: grid; place-items: center; text-align: center; padding: clamp(40px, 11vw, 72px) 22px; color: #262626; }
  .as-h48 { font-size: clamp(21px, 6.2vw, 34px); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
  .as-cta .as-h48 { font-size: clamp(22px, 6.6vw, 36px); }
  .as-photo, .as-m { aspect-ratio: var(--ar, 1 / 1); }
  .as-lead { margin: 0 auto; }

  /* two-column gradient bands: the "top" render on phones, the full render on desktop */
  .as-bg-d { display: none; }
  .as-bg-m .bgimg { object-position: var(--op, 50% 0%); }

  /* tiles ("New Tasks" ...) */
  .as-tile { display: grid; place-items: center; align-content: center; aspect-ratio: 16 / 7; --r: 12px; }
  .as-tt { font-size: clamp(25px, 7.4vw, 38px); line-height: 1.1; letter-spacing: -.02em; margin: 0; position: relative; z-index: 1; }

  /* panels whose text is a scaled copy of the design (text positioned in % of the panel, size scaled by its width) */
  .as-rp { container-type: inline-size; aspect-ratio: calc(var(--pw) / var(--ph)); }
  .rt { position: absolute; margin: 0; white-space: nowrap; z-index: 1; text-align: left; letter-spacing: calc(var(--ls, 0) * 1em);
    font-size: max(13px, calc(var(--s) / var(--pw) * 100cqw)); line-height: calc(var(--l) / var(--pw) * 100cqw);
    left: calc(var(--x, 0) / var(--pw) * 100%); top: calc((var(--b) - var(--l) / 2 - .432 * var(--s)) / var(--ph) * 100%); }
  .rt.c { left: calc(var(--cx) / var(--pw) * 100%); transform: translateX(-50%); text-align: center; }
  .rt br.d { display: inline; }

  /* photo captions */
  .as-m .pt { font-size: clamp(19px, 5.4vw, 28px); }
  .as-m--w .pt, .as-m--l .pt { top: 14px; left: 14px; }

  /* mosaic */
  .as-mgrid { grid-template-columns: 1fr 1fr; margin-top: clamp(30px, 9vw, 64px); }
  .as-mgrid .span2 { grid-column: 1 / -1; }
  .as-m--f { aspect-ratio: auto; }   /* stretches to the height of the bottle tile beside it */
  .as-m--f img { object-position: 62% 50%; }
  .as-m--l img { object-position: 46% 50%; }
  .as-m--w img { object-position: 60% 50%; }

  /* marketplace diagram */
  .as-world { aspect-ratio: 9 / 19; color: #fff; }
  .as-world .bgimg { object-position: 50% 50%; }
  .wt { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--tp) * 1%); width: 88%; margin: 0; z-index: 1; text-align: center;
    font-size: clamp(15px, 4.3vw, 19px); line-height: 1.3; letter-spacing: 0; white-space: normal; }
  .wt br.d { display: inline; }
  .wt--h { font-size: clamp(28px, 8vw, 38px); line-height: 1.1; letter-spacing: -.02em; }
  .wt--c { font-size: clamp(17px, 4.7vw, 22px); line-height: 1.2; letter-spacing: -.01em; }

  /* "Through the MARK One App Store" */
  .as-lead2 { font-size: clamp(15px, 4vw, 19px); margin: 0; color: #0f0f0f; }
  .as-gl { display: grid; gap: 10px; padding: 26px var(--pad) 42px; }
  .gl { display: block; margin: 0; font-size: clamp(22px, 6.3vw, 34px); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance;
    color: transparent; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
    background-image: linear-gradient(90deg, #0e1929 4%, #152236 32%, #1e2e47 50%, #293e5d 66%, #375076 82%, #3d5982 90%); }
  .pill { display: none; }

  /* hero: keep both rings in view on a tall phone screen */
  .as-page .hw-hero__img img { inset: auto; width: 175vw; height: auto; max-width: none; left: -26vw; top: calc(44% - 49.2vw); object-fit: fill; }

  /* open architecture */
  .as-agrid { grid-template-columns: 1fr; }
  .as-a { --r: 12px; }
  .as-cards { grid-template-columns: 1fr; }
  .as-card { --r: 14px; }
}

@layer desktop {
  @media (min-width: 1100px) {
    .as-sec { padding: 0; text-align: initial; }
    .as-tx, .as-wrap, .as-gl { display: contents; padding: 0; margin: 0; }
    .as-band-sec .as-wrap:first-of-type, .as-intro .as-tx + .as-wrap { margin: 0; }
    .as-bg-m { display: none; }
    .as-bg-d { display: block; }
    .as-photo, .as-m, .as-world, .as-tile, .as-rp { aspect-ratio: auto; container-type: normal; }
    .as-cent { display: block; padding: 0; }
    .as-h48, .as-tt, .gl { text-wrap: nowrap; margin: 0; }
    .as-lead, .as-lead2 { margin: 0; padding: 0; max-width: none; }
    .as-lead2 { font-size: calc(var(--u) * var(--s)); }
    .as-m .pt { font-size: calc(var(--u) * var(--s)); }
    .wt { width: auto; transform: translateX(-50%); top: calc(var(--u) * (var(--b) - var(--l) / 2 - .432 * var(--s))); font-size: calc(var(--u) * var(--s)); line-height: calc(var(--u) * var(--l)); letter-spacing: calc(var(--ls, 0) * 1em); white-space: nowrap; }
    .wt--h, .wt--c { font-size: calc(var(--u) * var(--s)); line-height: calc(var(--u) * var(--l)); letter-spacing: calc(var(--ls, 0) * 1em); }
    .gl { -webkit-text-fill-color: transparent; }
    .pill { display: block; position: absolute; z-index: 0; left: calc(var(--u) * var(--px)); top: calc(var(--u) * var(--py)); width: calc(var(--u) * var(--pw)); height: calc(var(--u) * var(--ph));
      border-radius: 999px; background: linear-gradient(90deg, #9fa2ab 0%, #a5a7b0 13%, #afb2bb 26%, #b5b8c2 39%, #b8bbc5 51%, #b9bcc6 62%, #bec1ca 74%, #c7cad3 87%, #ccced7 100%); }
    .as-tile .t, .rt, .rt.c { z-index: 1; }
    .rt { font-size: calc(var(--u) * var(--s)); line-height: calc(var(--u) * var(--l)); letter-spacing: calc(var(--ls, 0) * 1em);
      left: calc(var(--u) * var(--x, 0)); top: calc(var(--u) * (var(--b) - var(--l) / 2 - .432 * var(--s))); text-align: left; }
    .rt.c { left: calc(var(--u) * var(--cx)); transform: translateX(-50%); text-align: center; }
    .as-tile .as-tt { position: absolute; }
    /* TeX Gyre Heros sits ~.035em higher than Helvetica Now in the same line box: nudge baselines onto the designer's */
    body.as-page .t, body.as-page .rt, body.as-page .wt { top: calc(var(--u) * (var(--b) - var(--l) / 2 - .397 * var(--s))); }
  }
}

@layer components {
  @media (max-width: 1099.98px) and (orientation: landscape) and (max-height: 520px) {
    .as-page .hw-hero__img img { inset: 0; width: 100%; height: 100%; left: auto; top: auto; object-fit: cover; }
  }
}
