/* The landing's dark band (site.ts `showcase`): four stages, each pinned
   while the visitor scrolls through it. static/site/scenes.ts sets the step
   (`data-stage`), `is-on` on what shows in it, and `--sp`, how far the step
   has gone. Only transforms, opacity and clip move. A stage that is not live
   (no script, or less motion asked for) is a still picture of its last step
   with every caption listed. */

:root { --show-nav-h: 52px; }

.showcase {
  position: relative; margin-top: clamp(40px, 6vw, 72px); color: var(--scene-ink);
  background: var(--scene-bg); box-shadow: 0 0 0 100vmax var(--scene-bg); clip-path: inset(0 -100vmax);
}

/* The band's own nav: the four stages, the one in view marked. */
.show-nav {
  position: sticky; top: 0; z-index: 5; height: var(--show-nav-h);
  display: flex; align-items: center; gap: var(--s5); overflow-x: auto; scrollbar-width: none;
  font-size: 14px; background: color-mix(in srgb, var(--scene-bg) 86%, transparent);
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--scene-bg) 86%, transparent); clip-path: inset(0 -100vmax);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
/* Its lower edge, across the window. */
.show-nav::after { content: ''; position: absolute; left: -100vmax; right: -100vmax; bottom: 0; height: 1px; background: var(--scene-line); pointer-events: none; }
.show-nav::-webkit-scrollbar { display: none; }
.show-nav a { flex: none; padding: 14px 0; color: var(--scene-ink-2); white-space: nowrap; transition: color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.show-nav a:hover { color: var(--scene-ink); text-decoration: none; }
.show-nav a[aria-current="true"] { color: var(--scene-ink); box-shadow: inset 0 -2px 0 var(--scene-accent); }

/* ---------------------------------------------------------------- a stage */

.scene { position: relative; --glow: rgba(58, 154, 110, 0.55); }
/* About a screen of scroll per step past the pinned one, so one fling of a trackpad does not cross two steps. */
.scene.is-live.is-3 { height: 460svh; }
.scene.is-live.is-4 { height: 580svh; }
.scene-pin {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(56px, 8vw, 104px) 0;
  /* The drifting light and a step's scale stay inside, so the page never scrolls sideways (clip makes no scroll box: the pin still sticks). */
  overflow-x: clip; overflow-clip-margin: var(--gutter);
}
.scene.is-live .scene-pin { position: sticky; top: var(--show-nav-h); height: calc(100svh - var(--show-nav-h)); padding: 0; }

.scene-pill {
  display: inline-block; margin: 0 0 var(--s4); padding: 4px 12px; border-radius: 999px;
  font-size: 13px; line-height: 1.4; color: var(--scene-ink); background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--scene-line);
}
.site-main .scene h2 { margin: 0; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -0.035em; color: var(--scene-ink); }
.site-main .scene-lead { margin: var(--s4) 0 0; font-size: 18px; line-height: 1.5; color: var(--scene-ink-2); max-width: 44ch; }
.scene-steps { list-style: none; margin: var(--s6) 0 0; padding: 0; display: grid; gap: var(--s3); max-width: 46ch; counter-reset: step; }
.scene-steps li { counter-increment: step; position: relative; padding-inline-start: 34px; font-size: 16px; line-height: 1.45; color: var(--scene-ink-2); }
.scene-steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--scene-line);
  transition: background-color var(--t) ease, color var(--t) ease;
}
.scene.is-live .scene-steps li { color: var(--scene-ink-3); transition: color var(--t) ease; }
.scene.is-live .scene-steps li.is-on { color: var(--scene-ink); }
.scene.is-live .scene-steps li.is-on::before { background: var(--scene-ink); color: var(--scene-bg); box-shadow: none; }

.scene-pic { margin: 0; min-width: 0; }
.scene-pic figcaption { margin: var(--s3) 0 0; font-size: 13px; line-height: 1.4; color: var(--scene-ink-3); text-align: center; }
.scene-stage { position: relative; height: min(72svh, 640px); isolation: isolate; }
/* A soft light behind the picture, drifting. */
.scene-stage::before {
  content: ''; position: absolute; inset: 6% 2%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent); filter: blur(48px);
  animation: glow-drift 14s ease-in-out infinite alternate;
}
@keyframes glow-drift { from { transform: translate(-5%, -3%) scale(1); } to { transform: translate(5%, 4%) scale(1.1); } }
#header { --glow: rgba(120, 196, 150, 0.45); }
#feature { --glow: rgba(1, 135, 95, 0.5); }
#icon { --glow: rgba(242, 165, 65, 0.38); }

/* The layers of a picture: one step's at a time, settling from a little larger as a lens finds its focus.
   The one leaving fades where it is; the next waits for it, so the two never show at once, and settles on a
   curve that starts and ends gently. At most 1.05, so the pin's gutter still holds it. */
.scene-stage > [data-show] { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scene:not(.is-live) .scene-stage > [data-show]:not([data-final]) { display: none; }
.scene.is-live .scene-stage > [data-show] {
  opacity: 0; visibility: hidden; transform: scale(1.04);
  transition: opacity 400ms ease, transform 0s linear 400ms, visibility 0s linear 400ms;
}
.scene.is-live .scene-stage > [data-show].is-on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 800ms ease 320ms, transform 1200ms cubic-bezier(0.4, 0, 0.2, 1) 320ms, visibility 0s;
}

/* A drawing of the app's (storeView.ts, playView.ts), scaled to the stage by the script; until then, its plain pictures. */
.draw-fallback { display: flex; gap: 14px; height: 82%; align-items: center; justify-content: center; max-width: 100%; }
.draw-fallback img { display: block; max-height: 100%; max-width: 100%; width: auto; height: auto; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.draw .as-phone, .draw .gp-phone { box-shadow: 0 0 0 2px #3A3A3D, 0 40px 90px rgba(0, 0, 0, 0.6); }
.draw .as-phone.is-duo { box-shadow: 0 0 0 6px #C9C9CC, 0 40px 90px rgba(0, 0, 0, 0.6); }
/* A phone shown from its top, larger, fading out at the stage's foot: the header is what this step is about. */
.scene-stage > .draw.is-top { justify-content: flex-start; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%); mask-image: linear-gradient(180deg, #000 72%, transparent 98%); }
.draw.is-top > * { margin-top: 4px; }
/* The step moves the shots, not a finger: no snapping back. */
.scene .as-shots { scroll-snap-type: none; }

/* ---------------------------------------------------------------- iPhone Duo */

.dev { display: flex; padding: 9px; border-radius: 34px; background: #121214; box-shadow: 0 0 0 1.5px #3A3A3D, 0 40px 90px rgba(0, 0, 0, 0.6); position: relative; }
.dev img { display: block; height: 100%; width: auto; border-radius: 26px; }
.dev.is-outer { height: 74%; }
.dev.is-inner { height: 92%; }
.hinge {
  position: absolute; top: 9px; bottom: 9px; left: 50%; width: 2px; margin-left: -1px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22) 15%, rgba(0, 0, 0, 0.3) 50%, rgba(255, 255, 255, 0.22) 85%, transparent);
}
/* Opening: the folded phone grows away as the inner display spreads from its hinge. */
/* At most 1.05, so a phone's gutter still holds it and the page never scrolls sideways. */
.scene.is-live .duo-folded:not(.is-on) { transform: scale(1.05); transition: opacity 400ms ease, transform 400ms var(--ease-out), visibility 0s linear 400ms; }
/* The inner moves wait for their layer (320 ms), so they are seen. */
.scene.is-live .duo-open .dev { clip-path: inset(0 50% 0 50% round 34px); transition: clip-path 1200ms var(--ease-out) 400ms; }
.scene.is-live .duo-open.is-on .dev { clip-path: inset(0 0 0 0 round 34px); }
/* On the Duo's product page the shots pass by as the step goes on. */
.scene[data-stage="2"] .duo-store .as-shots > img { transform: translateX(calc(var(--sp, 0) * -112%)); }

.duo-both { align-content: center; gap: var(--s6); }
.duo-set { display: grid; justify-items: center; gap: var(--s3); }
.duo-row { display: flex; gap: 12px; }
/* A picture of a set, in a holder that keeps the light passing over it inside its corners. */
.duo-shot { position: relative; display: block; overflow: hidden; border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.duo-row img { display: block; height: clamp(110px, 21svh, 210px); width: auto; border-radius: 8px; }
.site-main .duo-set p { margin: 0; font-size: 14px; color: var(--scene-ink-2); }
/* The six come in one after another (`--d`), the folded set first; once each has landed, a light passes over it,
   so it runs across the folded set and then the open one; soon enough to be seen in a quick pass. */
.scene.is-live .duo-shot { --d: 320ms; opacity: 0; transform: translateY(16px); transition: opacity 500ms ease var(--d), transform 800ms var(--ease-out) var(--d); }
.scene.is-live .duo-both.is-on .duo-shot { opacity: 1; transform: none; }
.scene.is-live .duo-row .duo-shot:nth-child(2) { --d: 400ms; }
.scene.is-live .duo-row .duo-shot:nth-child(3) { --d: 480ms; }
.scene.is-live .duo-row.is-inner .duo-shot { --d: 560ms; }
.scene.is-live .duo-row.is-inner .duo-shot:nth-child(2) { --d: 640ms; }
.scene.is-live .duo-row.is-inner .duo-shot:nth-child(3) { --d: 720ms; }
.duo-shot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
}
.scene.is-live .duo-both.is-on .duo-shot::after { animation: duo-sheen 900ms ease-in-out calc(var(--d) + 500ms) both; }
@keyframes duo-sheen { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

/* ---------------------------------------------------------------- the App Store header */

.hdr-crop { align-content: center; gap: var(--s4); }
.crop { position: relative; width: 100%; aspect-ratio: 1600 / 686; overflow: hidden; border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.crop img { display: block; width: 100%; height: 100%; }
/* What a device keeps of the picture (docs/lessons.md, measured on App Store Connect's preview): its middle at the device's shape. */
.crop-frame {
  position: absolute; left: 50%; top: 50%; width: 63.6%; height: 100%; transform: translate(-50%, -50%); box-sizing: border-box;
  border: 2px solid #FFFFFF; border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.58);
  transition: width 650ms var(--ease-out), height 650ms var(--ease-out);
}
.crop[data-at="duo"] .crop-frame { width: 98.3%; }
.crop[data-at="ipad"] .crop-frame { width: 100%; height: 70.7%; }
/* Apple's art safe area: the centre 1646 × 661 of 3840 × 1646. */
.crop-safe { position: absolute; left: 50%; top: 50%; z-index: 1; width: 42.9%; height: 40.2%; transform: translate(-50%, -50%); border: 1.5px dashed rgba(255, 255, 255, 0.95); border-radius: 6px; }
.crop-label {
  position: absolute; left: 50%; bottom: 12px; z-index: 2; transform: translateX(-50%); padding: 3px 11px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.66); color: #FFFFFF; font-size: 13px; line-height: 1.4; opacity: 0; transition: opacity 300ms ease;
}
.crop[data-at="iphone"] .crop-label[data-for="iphone"], .crop[data-at="duo"] .crop-label[data-for="duo"], .crop[data-at="ipad"] .crop-label[data-for="ipad"] { opacity: 1; }
.site-main .crop-note { margin: 0; font-size: 13px; color: var(--scene-ink-2); }

/* ---------------------------------------------------------------- the Play feature graphic */

.ft-art { position: relative; width: 100%; aspect-ratio: 1024 / 500; overflow: hidden; border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.ft-art img { display: block; width: 100%; height: 100%; }
/* Google's cutoff zones (its listing guidance, measured 29 Oct 2026): the outer 14.8% of the width, 15.2% of the height. */
.ft-zone { position: absolute; background: repeating-linear-gradient(135deg, rgba(255, 59, 48, 0.52) 0 8px, rgba(255, 59, 48, 0.24) 8px 16px); opacity: 0; transition: opacity 450ms ease, transform 650ms var(--ease-out); }
.ft-zone.is-top { top: 0; left: 0; right: 0; height: 15.2%; transform: translateY(-100%); }
.ft-zone.is-bottom { bottom: 0; left: 0; right: 0; height: 15.2%; transform: translateY(100%); }
.ft-zone.is-start { top: 0; bottom: 0; left: 0; width: 14.8%; transform: translateX(-100%); }
.ft-zone.is-end { top: 0; bottom: 0; right: 0; width: 14.8%; transform: translateX(100%); }
.ft-safe { position: absolute; inset: 15.2% 14.8%; border: 1.5px dashed #FFFFFF; border-radius: 6px; opacity: 0; transition: opacity 450ms ease 250ms; }
.scene[data-stage="1"] .ft-zone, .scene[data-stage="1"] .ft-safe { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- the icon */

.scene-stage > .ic-cands { display: grid; grid-template-columns: repeat(2, auto); gap: clamp(24px, 4vw, 56px); align-content: center; justify-content: center; }
.ic-cand {
  --ic: clamp(84px, 11vw, 140px);
  position: relative; isolation: isolate; margin: 0; display: grid; justify-items: center; gap: var(--s2);
  transition: opacity 400ms ease, transform 550ms var(--ease-out), filter 400ms ease;
}
.ic-cand img { display: block; width: var(--ic); height: auto; border-radius: 22.5%; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5); transition: box-shadow 400ms ease; }
.ic-cand figcaption { font-size: 14px; color: var(--scene-ink-2); }
.scene.is-live .ic-cand { opacity: 0; transform: scale(0.6); }
.scene.is-live .ic-cands.is-on .ic-cand { opacity: 1; transform: none; }
.ic-cand:nth-child(2) { transition-delay: 90ms; }
.ic-cand:nth-child(3) { transition-delay: 180ms; }
.ic-cand:nth-child(4) { transition-delay: 270ms; }
/* Picked: the rest step back (after the pop-in's rule, which they must beat). */
.scene[data-stage="1"] .ic-cand { transition-delay: 0ms; }
.scene.is-live[data-stage="1"] .ic-cands.is-on .ic-cand:not(.is-picked) { opacity: 0.26; transform: scale(0.9); filter: saturate(0.4); }
.scene.is-live[data-stage="1"] .ic-cands.is-on .ic-cand.is-picked { transform: scale(1.1); }
.scene[data-stage="1"] .ic-cand.is-picked img { box-shadow: 0 0 0 3px var(--scene-bg), 0 0 0 6px var(--scene-accent), 0 18px 44px rgba(0, 0, 0, 0.5); }
/* The moment it is picked, two rings of light leave the icon's edge, once, behind it. */
.ic-cand::before, .ic-cand::after {
  content: ''; position: absolute; top: 0; left: 50%; z-index: -1; width: var(--ic); aspect-ratio: 1; margin-left: calc(var(--ic) / -2);
  border-radius: 22.5%; box-shadow: 0 0 0 1.5px var(--scene-accent), 0 0 22px 3px color-mix(in srgb, var(--scene-accent) 40%, transparent), inset 0 0 18px 2px color-mix(in srgb, var(--scene-accent) 30%, transparent);
  opacity: 0; pointer-events: none;
}
.scene.is-live[data-stage="1"] .ic-cands.is-on .ic-cand.is-picked::before { animation: ic-ring 1300ms var(--ease-out) 100ms both; }
.scene.is-live[data-stage="1"] .ic-cands.is-on .ic-cand.is-picked::after { animation: ic-ring 1300ms var(--ease-out) 350ms both; }
@keyframes ic-ring { 0% { opacity: 0; transform: scale(1); } 12% { opacity: 0.9; } 100% { opacity: 0; transform: scale(1.6); } }

/* A search in the App Store, as the Icon step's comparison draws it; the candidate in the app's row changes as the step goes on. */
.ic-screen {
  width: min(100%, 380px); padding: 18px 16px 20px; border-radius: 30px; display: grid; gap: 12px;
  background: #FFFFFF; color: #000000; box-shadow: 0 0 0 9px #121214, 0 0 0 10.5px #3A3A3D, 0 40px 90px rgba(0, 0, 0, 0.6);
  font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif;
}
.ic-searchbar { height: 38px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; background: #EEEEF0; font-size: 16px; color: #3C3C43; }
.ic-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ic-row > img { display: block; width: 56px; height: 56px; border-radius: 22.5%; }
.ic-slot { position: relative; display: block; width: 56px; height: 56px; border-radius: 22.5%; overflow: hidden; }
.ic-slot img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 250ms ease; }
.ic-slot[data-at="1"] img:nth-child(1), .ic-slot[data-at="2"] img:nth-child(2), .ic-slot[data-at="3"] img:nth-child(3), .ic-slot[data-at="4"] img:nth-child(4) { opacity: 1; }
.ic-row.is-you { padding: 8px; margin: -8px; border-radius: 14px; background: rgba(0, 122, 255, 0.08); box-shadow: inset 0 0 0 1.5px rgba(0, 122, 255, 0.5); }
.ic-meta { display: grid; gap: 6px; min-width: 0; }
.ic-meta b { font-size: 16px; font-weight: 600; }
.ic-meta small { font-size: 13px; color: #8A8A8E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-bar { display: block; height: 10px; border-radius: 5px; background: #E5E5EA; }
.ic-bar.w60 { width: 60%; }
.ic-bar.w40 { width: 40%; }
.ic-get { padding: 6px 16px; border-radius: 999px; background: #EEF0F7; color: #007AFF; font-size: 14px; font-weight: 600; }

/* A home screen in light, dark and tinted as the step goes on, and Android's masks beside it. */
.scene-stage > .ic-home { display: grid; grid-template-columns: auto auto; gap: clamp(20px, 3vw, 40px); align-items: center; justify-content: center; }
.ic-ios {
  display: grid; grid-template-columns: repeat(4, 56px); gap: 22px 18px; padding: 34px 24px; border-radius: 40px;
  background: linear-gradient(160deg, #CFE6D9, #86B39D); box-shadow: 0 0 0 9px #121214, 0 0 0 10.5px #3A3A3D, 0 40px 90px rgba(0, 0, 0, 0.6);
  transition: background 500ms ease;
}
.ic-home[data-at="dark"] .ic-ios { background: linear-gradient(160deg, #1C2924, #050807); }
.ic-home[data-at="tinted"] .ic-ios { background: linear-gradient(160deg, #241C10, #0B0A08); }
.ic-tile img { display: block; width: 56px; height: 56px; border-radius: 22.5%; transition: filter 400ms ease; }
/* iOS tints every icon with the person's colour; the others have no tinted file here, so their light one is greyed and tinted. */
.ic-home[data-at="tinted"] .ic-tile:not(.is-you) img { filter: grayscale(1) sepia(1) saturate(3) hue-rotate(-10deg) brightness(0.85); }
.ic-tile.is-you { filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.4)); }
.ic-modes { position: relative; display: block; width: 56px; height: 56px; }
.ic-modes img { position: absolute; inset: 0; opacity: 0; transition: opacity 400ms ease; }
.ic-home[data-at="light"] .ic-modes img:nth-child(1), .ic-home[data-at="dark"] .ic-modes img:nth-child(2), .ic-home[data-at="tinted"] .ic-modes img:nth-child(3) { opacity: 1; }
.ic-home[data-at="tinted"] .ic-modes img:nth-child(3) { filter: sepia(1) saturate(3) hue-rotate(-10deg) brightness(1.05); }
.ic-android { display: grid; gap: 16px; justify-items: center; }
/* A launcher shows the middle two thirds of the adaptive layer through its mask. */
.ic-mask { position: relative; display: block; width: 64px; height: 64px; overflow: hidden; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45); }
.ic-mask img { position: absolute; left: -25%; top: -25%; width: 150%; height: 150%; max-width: none; display: block; }
.ic-mask.is-circle { border-radius: 50%; }
.ic-mask.is-squircle { border-radius: 30%; }
.ic-mask.is-themed { border-radius: 50%; background: #D3E8DA; }
.ic-mask.is-themed img { opacity: 0.82; }

/* ---------------------------------------------------------------- a phone */

@media (max-width: 760px) {
  .show-nav { gap: var(--s4); font-size: 13px; }
  .scene-pin { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .scene.is-live .scene-pin { grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: var(--s3); padding: var(--s4) 0 var(--s3); }
  .scene-pill { margin-bottom: var(--s2); font-size: 12px; }
  .site-main .scene h2 { font-size: 30px; }
  .scene.is-live .scene-lead { display: none; }
  /* One caption at a time: the step's own. */
  .scene.is-live .scene-steps { position: relative; margin-top: var(--s3); min-height: 4.4em; }
  .scene.is-live .scene-steps li { position: absolute; inset: 0 0 auto 0; font-size: 15px; opacity: 0; transition: opacity var(--t) ease; }
  .scene.is-live .scene-steps li.is-on { opacity: 1; }
  .scene.is-live .scene-pic { display: flex; flex-direction: column; min-height: 0; }
  .scene.is-live .scene-stage { flex: 1; min-height: 0; height: auto; }
  .scene:not(.is-live) .scene-stage { height: 64svh; }
  .scene-pic figcaption { font-size: 12px; }
  .scene-stage > .ic-home { grid-template-columns: auto; }
  .ic-android { grid-auto-flow: column; }
  .ic-ios { grid-template-columns: repeat(4, 44px); gap: 16px 14px; padding: 24px 18px; border-radius: 32px; }
  .ic-tile img, .ic-modes { width: 44px; height: 44px; }
  .ic-mask { width: 48px; height: 48px; }
  .duo-row img { height: clamp(90px, 17svh, 160px); }
}

@media (prefers-reduced-motion: reduce) {
  .scene-stage::before { animation: none; }
}
