/* Phenome redesign, the App page (2026-09-29): the whole app, tab by tab, on
   3D phones (apple/phone3d.js) with the app's own screens (apple/app/harness*,
   rendered to assets/app-screens). Black chapters carry the phones: fans that
   turn in as they arrive, and pinned phones whose screen follows the text
   beside them (apple/app-page.js). White chapters carry the grids. Tiffany's
   privacy, questions and closing card follow, restyled by apple/type.css.

   The heading pair: a small line in the brand's navy over one 600 headline,
   the size the Ring, Band and testing pages use. */

.apx .ax-hero,
.apx .ax-show,
.apx .ax-fanned { background: #000; color: #f5f5f7; }
.apx .ax-wrap { max-width: 1200px; margin: 0 auto; }

.apx .ax-h {
  margin: 0; text-align: center; font-size: clamp(44px, 5.6vw, 80px); line-height: 1.05;
  font-weight: 600; letter-spacing: -0.022em; color: #f5f5f7;
}
.apx .ax-lead {
  display: block; margin: 0 0 14px; font-size: clamp(19px, 1.7vw, 24px); line-height: 1.2;
  font-weight: 500; letter-spacing: -0.02em; color: inherit;
}
.apx .ax-h.is-ink { color: #1d1d1f; }
.apx .ax-h.is-ink .ax-lead { color: #203a85; }
.apx .ax-lede {
  max-width: 34em; margin: 24px auto 0; text-align: center; font-size: clamp(19px, 1.5vw, 21px);
  line-height: 1.5; color: #86868b;
}

/* an app icon from the app's own files, drawn in the ink of its text */
.apx .ax-ic {
  display: block; width: 30px; height: 30px; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}

/* ---- hero ------------------------------------------------------------------ */
.apx .ax-hero { padding: clamp(88px, 7.5vw, 112px) 20px 40px; text-align: center; }
.apx .ax-hero .ax-lede { max-width: 40em; }
.apx .ax-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
/* the five phones stand a little lower than the chapters' fans, so most of
   them show on a laptop's first screen */
.apx .ax-hero .ax-fan { margin-top: clamp(28px, 3vw, 44px); }
.apx .ax-hero .ax-fan.is-five { height: clamp(400px, 36vw, 540px); }

/* ---- the fans: the host is the stage the phones stand in ------------------- */
.apx .ax-fan {
  position: relative; width: min(1040px, 100%); height: clamp(420px, 38vw, 560px);
  margin: clamp(40px, 4vw, 64px) auto 0;
}
.apx .ax-fan.is-five { width: min(1320px, 100%); height: clamp(440px, 40vw, 620px); }
.apx .ax-fan.is-three { width: min(1100px, 100%); }
.apx .ax-fan.is-pair { width: min(860px, 100%); }
.apx .ax-fan > img {
  position: absolute; left: 50%; top: 0; width: auto; height: 100%; aspect-ratio: 390 / 844;
  transform: translateX(-50%); border-radius: 36px;
}
.apx .ax-fanned { padding: clamp(96px, 10vw, 150px) 20px clamp(64px, 7vw, 110px); }
.apx .ax-fanned .ax-fan { margin-top: clamp(48px, 5vw, 80px); }

/* the four (or two, or three) lines under a fan */
.apx .ax-points {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px);
  margin-top: clamp(56px, 6vw, 96px); text-align: left;
}
.apx .ax-points.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 860px; margin-left: auto; margin-right: auto; }
.apx .ax-points.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.apx .ax-point { padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .18); }
.apx .ax-point h3 { margin: 0; font-size: clamp(19px, 1.5vw, 21px); line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; color: #f5f5f7; }
.apx .ax-point p { margin: 10px 0 0; font-size: 17px; line-height: 1.5; color: #86868b; }

/* ---- the five tabs ------------------------------------------------------------ */
.apx .ax-tabs { padding: clamp(96px, 10vw, 160px) 20px; background: #fff; color: #1d1d1f; }
.apx .ax-tab-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: clamp(48px, 5vw, 80px); }
.apx .ax-tab {
  display: flex; flex-direction: column; min-height: 250px; padding: 30px 26px 32px; border-radius: 24px;
  background: #f5f5f7; color: #1d1d1f; text-decoration: none;
}
.apx .ax-tab:hover { background: #ebebef; }
.apx .ax-tab .ax-ic { color: #203a85; }
.apx .ax-tab h3 { margin: auto 0 0; padding-top: 40px; font-size: 24px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.apx .ax-tab p { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: #6e6e73; }
.apx .ax-tab-grid > :nth-child(2) { --ap-delay: .08s; }
.apx .ax-tab-grid > :nth-child(3) { --ap-delay: .16s; }
.apx .ax-tab-grid > :nth-child(4) { --ap-delay: .24s; }
.apx .ax-tab-grid > :nth-child(5) { --ap-delay: .32s; }

/* ---- one pinned phone, a tab's screens passing it --------------------------- */
.apx .ax-show { padding: clamp(96px, 10vw, 150px) 20px 40px; }
.apx .ax-show .ax-h { margin-bottom: clamp(20px, 3vw, 60px); }
.apx .ax-stage { display: grid; grid-template-areas: "s"; }
.apx .ax-device,
.apx .ax-items { grid-area: s; }
.apx .ax-device { display: flex; justify-content: center; align-items: flex-start; pointer-events: none; }
.apx .ax-phone {
  position: sticky; top: calc(var(--ap-nav-h, 44px) + max(24px, (100vh - var(--ap-nav-h, 44px) - 630px) / 2));
  width: 300px; height: 623px;
}
.apx .ax-phone > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 44px; }
.apx .ax-items { position: relative; z-index: 1; padding-bottom: 180px; }
.apx .ax-item { display: flex; min-height: 600px; padding-top: 150px; box-sizing: border-box; }
.apx .ax-item.is-right { justify-content: flex-end; }
.apx .ax-text { width: calc(50% - 190px); max-width: 380px; padding: 0 20px; box-sizing: border-box; }
.apx .ax-item.is-right .ax-text { margin-right: 60px; width: calc(50% - 250px); }
.apx .ax-name {
  margin: 0; font-size: clamp(28px, 2.4vw, 36px); line-height: 1.1; font-weight: 600;
  letter-spacing: -0.02em; color: #f5f5f7;
}
.apx .ax-desc { margin: 20px 0 0; font-size: clamp(18px, 1.35vw, 20px); line-height: 1.55; color: #86868b; }

/* ---- the ten readings and the two devices ------------------------------------ */
.apx .ax-metrics { padding: clamp(96px, 10vw, 160px) 20px; background: #fff; color: #1d1d1f; }
.apx .ax-metric-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(20px, 2.4vw, 36px);
  margin-top: clamp(56px, 6vw, 96px);
}
.apx .ax-metric .ax-ic { width: 34px; height: 34px; color: #203a85; }
.apx .ax-metric h3 { margin: 18px 0 0; font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.apx .ax-metric p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: #6e6e73; }
.apx .ax-metric-grid > :nth-child(5n + 2) { --ap-delay: .06s; }
.apx .ax-metric-grid > :nth-child(5n + 3) { --ap-delay: .12s; }
.apx .ax-metric-grid > :nth-child(5n + 4) { --ap-delay: .18s; }
.apx .ax-metric-grid > :nth-child(5n) { --ap-delay: .24s; }
.apx .ax-devices { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 20px; margin-top: clamp(72px, 8vw, 120px); }
.apx .ax-devices > .ax-dev:only-child { aspect-ratio: 21 / 9; }
.apx .ax-dev {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 28px;
  background: #000; color: #f5f5f7; text-decoration: none;
}
.apx .ax-dev img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ap-spring);
}
.apx .ax-dev:hover img { transform: scale(1.03); }
.apx .ax-dev::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .7) 100%); }
.apx .ax-dev-t {
  position: absolute; left: clamp(24px, 3vw, 40px); bottom: clamp(22px, 3vw, 36px); z-index: 1;
  font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em;
}
.apx .ax-dev-k { display: block; margin-bottom: 8px; font-size: 15px; line-height: 1.2; font-weight: 500; letter-spacing: 0; color: #fff; }

/* ---- the six tests ---------------------------------------------------------------- */
.apx .ax-tests { padding: clamp(96px, 10vw, 160px) 20px; background: #fff; color: #1d1d1f; }
.apx .ax-test-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) 20px;
  margin-top: clamp(56px, 6vw, 96px);
}
.apx .ax-test { display: block; color: #1d1d1f; text-decoration: none; }
.apx .ax-test-img {
  display: block; overflow: hidden; aspect-ratio: 1; border-radius: 24px;
  background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.apx .ax-test-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ap-spring); }
.apx .ax-test:hover .ax-test-img img { transform: scale(1.035); }
.apx .ax-test h3 { margin: 22px 0 0; font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.apx .ax-test p { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: #6e6e73; }
.apx .ax-test-grid > :nth-child(3n + 2) { --ap-delay: .08s; }
.apx .ax-test-grid > :nth-child(3n) { --ap-delay: .16s; }

/* ---- the reel: screen after screen, two rows drifting opposite ways. Each row
   holds its screens twice and moves by half its width, so it loops without a
   seam; every screen carries its own right margin so the halves match. ---- */
.apx .ax-reel { padding: clamp(96px, 10vw, 150px) 0 clamp(80px, 8vw, 120px); background: #000; color: #f5f5f7; overflow: hidden; }
.apx .ax-reel .ax-wrap { padding: 0 20px; }
.apx .ax-reel-rows { margin-top: clamp(48px, 5vw, 80px); }
.apx .ax-reel-row { display: flex; width: max-content; animation: ax-reel 100s linear infinite; }
.apx .ax-reel-row + .ax-reel-row { margin-top: 24px; animation-duration: 120s; animation-direction: reverse; }
.apx .ax-reel-rows:hover .ax-reel-row { animation-play-state: paused; }
.apx .ax-reel-row img {
  display: block; flex: none; width: clamp(170px, 15vw, 230px); height: auto; aspect-ratio: 390 / 844;
  margin-right: 24px; border-radius: clamp(22px, 2vw, 30px);
}
.apx .ax-note { margin: clamp(40px, 4vw, 56px) 0 0; text-align: center; font-size: 14px; line-height: 1.4; color: #6e6e73; }
@keyframes ax-reel { to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .apx .ax-reel-row { animation: none; } }

/* ---- the figures ---------------------------------------------------------------- */
.apx .ax-stats { padding: clamp(96px, 10vw, 150px) 20px; background: #fff; color: #1d1d1f; }
.apx .ax-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 4vw, 64px); }
.apx .ax-stat { padding-top: 22px; border-top: 1px solid rgba(0, 0, 0, .14); }
.apx .ax-stat b {
  display: block; font-size: clamp(56px, 6.4vw, 96px); line-height: 1; font-weight: 600;
  letter-spacing: -0.03em; color: #1d1d1f; font-variant-numeric: tabular-nums;
}
.apx .ax-stat p { margin: 14px 0 0; font-size: clamp(17px, 1.4vw, 21px); line-height: 1.35; color: #6e6e73; }
.apx .ax-stat-grid > :nth-child(2) { --ap-delay: .08s; }
.apx .ax-stat-grid > :nth-child(3) { --ap-delay: .16s; }
.apx .ax-stat-grid > :nth-child(4) { --ap-delay: .24s; }

/* the closing card's phone is the page's own 3D phone on the Home screen (it
   was a film of the app on a phone); where the 3D phone rests, the flat
   screen stands in its place */
.apx .ax-end-phone > img {
  left: 50%; right: auto; width: auto; height: 100%; aspect-ratio: 390 / 844;
  transform: translateX(-50%); border-radius: 40px; object-fit: cover;
}

/* Tiffany's privacy, questions and closing card were drawn on a white page;
   the dark bar's body class (apple.css) paints the page black, so they carry
   their white themselves */
.apx .ap-privacy,
.apx .ap-faq,
.apx .ap-start { background: #fff; }

/* ---- narrower windows -------------------------------------------------------------- */
@media (max-width: 1068px) {
  .apx .ax-tab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .apx .ax-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .apx .ax-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* phones and small tablets keep the 3D phones. A pinned phone sticks near the
   top of the window and each passage rises into the band under it, fading
   as it reaches the phone (apple/app-page.js). The fans stand on a stage
   wider than the window, so their phones keep a readable size and the outer
   ones run off the edges (each section clips its own canvas). */
@media (max-width: 900px) {
  .apx .ax-phone { top: calc(var(--ap-nav-h, 44px) + 12px); width: auto; height: min(56vh, 140vw); aspect-ratio: 300 / 623; }
  .apx .ax-phone > img { border-radius: 32px; }
  .apx .ax-items { padding: 62vh 0 18vh; }
  .apx .ax-item,
  .apx .ax-item.is-right { min-height: 0; height: 36vh; padding: 0; align-items: center; justify-content: center; }
  .apx .ax-text,
  .apx .ax-item.is-right .ax-text { width: 100%; max-width: 560px; margin: 0; padding: 0 4px; text-align: center; }
  .apx .ax-name { font-size: 26px; }
  .apx .ax-desc { margin-top: 12px; font-size: 17px; line-height: 1.5; }
  .apx .ax-fan.is-five,
  .apx .ax-hero .ax-fan.is-five { width: 180vw; max-width: none; margin-left: calc(50% - 90vw); height: clamp(340px, 60vw, 480px); }
  .apx .ax-fan.is-three { width: 130vw; max-width: none; margin-left: calc(50% - 65vw); height: clamp(380px, 56vw, 480px); }
  .apx .ax-fan.is-pair { height: clamp(360px, 52vw, 480px); }
  .apx .ax-test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apx .ax-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apx .ax-devices { grid-auto-flow: row; grid-template-columns: 1fr; }
  .apx .ax-devices > .ax-dev:only-child { aspect-ratio: 4 / 3; }
}
@media (max-width: 733px) {
  .apx .ax-tab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apx .ax-tab { min-height: 210px; padding: 24px 20px 26px; }
  .apx .ax-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apx .ax-points,
  .apx .ax-points.is-two,
  .apx .ax-points.is-three { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .apx .ax-hero,
  .apx .ax-show,
  .apx .ax-fanned,
  .apx .ax-tabs,
  .apx .ax-metrics,
  .apx .ax-tests,
  .apx .ax-stats { padding-left: 16px; padding-right: 16px; }
  .apx .ax-test-grid { grid-template-columns: 1fr; }
}
