/* Health AI — the website, wearing the app's own clothes.
 *
 * Light, because that is the brand's own ground: the mark is a black H on
 * white, the app shipped light long before it learned dark, and the store
 * listing should look like the thing people recognise. The screenshots are
 * dark-mode captures, which on a white page read the way the app's own
 * showcase reads in light — a black device held against white.
 *
 * The palette is not invented here. Every colour is lifted from
 * lib/theme/section_colors.dart and the light side of app_colors.dart, and
 * Poppins is the app's own typeface, so a reviewer who opens the site and
 * then opens the app sees one product rather than two. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sunken: #f5f5f7;
  --ink: #0b0b0c;
  --muted: #6e6e73;           /* secondaryLabel, light */
  --faint: #707075;           /* systemGrey, darkened: at #8e8e93 it was
                                 3.26:1 on white, and it carries 12-13px
                                 type — the updated line, the footer's
                                 legal line, the contents numerals and the
                                 search placeholder. Now 4.93:1. */
  --line: #e5e5ea;            /* systemGrey5, light */

  /* SectionColors, exactly. */
  --nutrition: #1e8e3e;
  --train: #ff3b30;
  --run: #e2660d;
  --coach: #1d5fd1;

  /* Not a section colour. The app's paywall marks the tier in gold
   * rather than in any of the four, and this is the same gold, used
   * the same way: as a ground with ink on it, never as text. */
  --gold: #e3b341;

  /* The same four, darkened just far enough to carry small text.
   *
   * The four above are lifted exactly from section_colors.dart and stay that
   * way: they are the brand, and they are used for fills, rules, glows and
   * tints where nobody has to read them. But as 12px uppercase type on white
   * they land at 3.4-4.2:1, under the 4.5:1 that small text needs, and the
   * eyebrows, the "ONE APP" heading and the ticks are all small type. iOS
   * does the same thing with its own system colours. Coach blue already
   * passes at 5.82:1 and is therefore not in this list. */
  --nutrition-ink: #1b8138;   /* 4.95:1 on white, 4.54:1 on --sunken */
  --train-ink: #d43128;       /* 4.92:1 / 4.52:1 */
  --run-ink: #b8530a;         /* 4.91:1 / 4.51:1 */

  --radius: 20px;
  --gutter: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* height:auto is doing real work here. Every screenshot carries its true
 * width and height as attributes so the browser reserves the right box before
 * the image loads and the page does not jump — but without this the explicit
 * height wins over max-width and every phone comes out squashed. */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------------- chrome */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 17px;
}

/* The mark is a black H on a white tile, so on a white page it needs an edge
 * or it is a floating letter. The app draws the same ring around it. */
.brand img {
  border-radius: 8px;
  border: 1px solid var(--line);
}

.bar nav {
  display: flex;
  gap: 20px;
  font-size: 14.5px;
  color: var(--muted);
}

.bar nav a { text-decoration: none; }
.bar nav a:hover { color: var(--ink); }

.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.foot p { margin: 0 0 6px; }
.foot .quiet { color: var(--faint); font-size: 13px; }

/* ----------------------------------------------------------------- hero */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px var(--gutter) 24px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 7vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.hero p {
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 19px);
  max-width: 34ch;
  margin: 0 auto;
  text-wrap: balance;
}

/* The screenshot row. A grid so it reflows to two-up and then one-up rather
 * than shrinking five phones into stamps. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px var(--gutter);
  align-items: start;
}

/* Black, which is what the app's own frame is against a light page — see the
 * note in phone_mockup.dart about why that flips in the dark. */
.phone {
  border-radius: 26px;
  border: 5px solid #000000;
  overflow: hidden;
  background: #1c1c1e;
  box-shadow: 0 18px 40px rgba(11, 11, 12, 0.18);
}

/* --------------------------------------------------------------- panels */

.strip {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px var(--gutter) 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.dot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-size: 14px;
}

/* Lower alpha than the dark side would take: the same tint that reads as a
 * quiet wash on black is a shout on white. */
.dot.n { background: rgba(30, 142, 62, 0.12);  color: var(--nutrition); }
.dot.t { background: rgba(255, 59, 48, 0.12);  color: var(--train); }
.dot.r { background: rgba(226, 102, 13, 0.12); color: var(--run); }
.dot.c { background: rgba(29, 95, 209, 0.12);  color: var(--coach); }

/* ------------------------------------------------------------- long text */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px var(--gutter) 56px;
}

.prose h1 {
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  text-wrap: balance;
}

.prose .updated {
  color: var(--faint);
  font-size: 13.5px;
  margin: 0 0 32px;
}

.prose h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 36px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}

.prose h2:first-of-type { border-top: 0; padding-top: 0; }

.prose p { margin: 0 0 14px; color: #3a3a3c; font-size: 15.5px; }
.prose strong { color: var(--ink); font-weight: 600; }

.prose ul { margin: 0 0 16px; padding-left: 20px; color: #3a3a3c; }
.prose li { margin-bottom: 9px; font-size: 15.5px; }

.prose a { color: #0b57d0; }

/* The address stub, made impossible to publish by accident. */
.todo {
  background: #ff3b30;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

/* --------------------------------------------------------------- support */

.rows { display: grid; gap: 12px; margin: 26px 0 0; }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

.row span { color: var(--muted); font-size: 14.5px; }
.row b { font-weight: 600; font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------- store badge */

/* Kept, unused, for the day there is a listing. Apple's own artwork, at the
 * size their guidelines set a floor for, and the anchor carries the padding so
 * the tap target is bigger than the image. Until then the page says .soon
 * below instead: a badge reading "Download on the App Store" that goes
 * nowhere is a worse first impression than admitting the date. */
.badge {
  display: inline-block;
  margin-top: 22px;
  padding: 6px;
  border-radius: 10px;
}

.badge img { width: 150px; height: 50px; }

.badge:focus-visible {
  outline: 2px solid var(--coach);
  outline-offset: 2px;
}

/* --------------------------------------------------- coming to the store */

/* Not a link, deliberately: there is nothing to point at, and a dead anchor
 * that looks like a button is the thing being fixed. A pill states a fact
 * instead, and the dot gives it a pulse so it reads as pending rather than
 * as a disabled control. The blanket prefers-reduced-motion rule above stops
 * the dot; the pill is legible without it. */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  padding: 11px 20px 11px 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.soon::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--run);
  animation: soonpulse 2.4s ease-in-out infinite;
}

/* From dim towards the resting state, never the other way, so the blanket
   reduced-motion rule leaves a dot that is simply on. */
@keyframes soonpulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* In the bar, where it sits beside the nav links rather than under a
   heading, and has no room for the full sentence. */
.soon-sm {
  margin-top: 0;
  padding: 7px 14px 7px 11px;
  font-size: 13px;
  gap: 7px;
}
.soon-sm::before { width: 6px; height: 6px; }

/* ------------------------------------------------------ questions */

.faq {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px var(--gutter) 56px;
}

.faq h2 {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-wrap: balance;
}

/* Collapsed by default: four answers open at once is a wall, and the point of
 * this block is that somebody can see their own question in the list. */
.qa {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2px 18px;
  margin-bottom: 10px;
  background: var(--surface);
}

.qa summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 600;
  font-size: 15.5px;
  list-style: none;
}

.qa summary::-webkit-details-marker { display: none; }

.qa summary::after {
  content: "+";
  float: right;
  color: var(--faint);
  font-weight: 400;
}

.qa[open] summary::after { content: "–"; }

.qa p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.faq .more { margin: 18px 0 0; font-size: 15px; }
.faq .more a { color: var(--coach); font-weight: 600; text-decoration: none; }
.faq .more a:hover { text-decoration: underline; }

/* Three columns at full width so six cards make two even rows. auto-fit was
 * fitting four, which left the last row half empty and the grid looking like
 * it had lost something. */
@media (min-width: 720px) {
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.badge-sm { margin-top: 0; padding: 0; }
.badge-sm img { width: 110px; height: 37px; }

/* ===================================================================== *
 * The long page: the argument, the feature rows, the bands.
 *
 * Effects are deliberately restrained and, more importantly, they never
 * hide anything. Nothing on this page starts at opacity 0 waiting for a
 * scroll listener — the first still frame is what a shared link and a
 * skimming reader both get, and a page that is blank until you scroll it
 * is a page that looks broken to anyone who does not.
 * ===================================================================== */

/* An ambient wash behind the hero, in the four section colours. Slow enough
 * to read as light rather than as animation, and behind the text, never over
 * it. */
.hero { position: relative; overflow: hidden; }

.glow {
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 460px;
  z-index: -1;
  background:
    radial-gradient(38% 50% at 22% 40%, rgba(30, 142, 62, 0.20), transparent 70%),
    radial-gradient(34% 46% at 50% 26%, rgba(255, 59, 48, 0.16), transparent 70%),
    radial-gradient(36% 48% at 76% 42%, rgba(226, 102, 13, 0.18), transparent 70%),
    radial-gradient(30% 44% at 62% 62%, rgba(29, 95, 209, 0.16), transparent 70%);
  filter: blur(18px);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.07); }
}

/* Screens lift a little under the cursor. The shadow does the work, not a
 * scale that would blur the screenshot. */
.phone {
  transition: transform 280ms cubic-bezier(.2,.7,.3,1), box-shadow 280ms ease;
}

.shots .phone:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(11, 11, 12, 0.26);
}

.card {
  transition: transform 220ms cubic-bezier(.2,.7,.3,1),
              box-shadow 220ms ease,
              border-color 220ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #d5d5dd;
  box-shadow: 0 16px 34px rgba(11, 11, 12, 0.10);
}

.badge img { transition: transform 200ms cubic-bezier(.2,.7,.3,1); }
.badge:hover img { transform: scale(1.04); }

/* --------------------------------------------------------- the argument */

.argue {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px var(--gutter) 20px;
}

.argue h2,
.feature h2,
.band h2,
.close h2 {
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.1;
  margin: 0 0 14px;
  text-wrap: balance;
}

.lede {
  font-size: clamp(16px, 2.1vw, 18.5px);
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 30px;
}

.versus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.col {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--sunken);
}

/* The one this page is arguing for gets the lift and the accent; the other
 * stays flat on purpose, because the layout is part of the argument. */
.col.good {
  background: var(--surface);
  border-color: rgba(30, 142, 62, 0.35);
  box-shadow: 0 14px 34px rgba(30, 142, 62, 0.10);
}

.col h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.col.good h3 { color: var(--nutrition-ink); }

.ticks { list-style: none; margin: 0; padding: 0; }

.ticks li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 13px;
  font-size: 15px;
  color: #3a3a3c;
}

.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  font-weight: 700;
  color: var(--nutrition-ink);
}

.ticks.bad li { color: var(--muted); }
.ticks.bad li::before { content: "✕"; color: var(--faint); }

/* ------------------------------------------------------- feature rows */

.feature {
  max-width: 1080px;
  margin: 0 auto;
  padding: 46px var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 44px;
  align-items: center;
}

/* The screen changes sides down the page, so the eye is not reading the same
 * column shape six times. */
.feature.alt .ftext { order: 2; }

@media (max-width: 800px) {
  .feature { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .feature.alt .ftext { order: 0; }
  .feature .phone { max-width: 340px; margin-inline: auto; }
}

.feature .phone { justify-self: center; max-width: 300px; }

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.eyebrow.n { color: var(--nutrition-ink); }
.eyebrow.t { color: var(--train-ink); }
.eyebrow.r { color: var(--run-ink); }
.eyebrow.c { color: var(--coach); }
.eyebrow.q { color: var(--muted); }

.ftext p {
  font-size: 16px;
  color: #3a3a3c;
  max-width: 56ch;
  margin: 0 0 14px;
}

.ftext .caveat { color: var(--muted); font-size: 14.5px; }

.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; }

.pills li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface);
}

/* -------------------------------------------------------------- bands */

.band { background: var(--sunken); border-block: 1px solid var(--line); }
.band.quiet { background: var(--surface); }

.bandwrap { max-width: 1080px; margin: 0 auto; padding: 52px var(--gutter); }

.bandwrap > p {
  font-size: 16.5px;
  color: #3a3a3c;
  max-width: 62ch;
  margin: 0 0 30px;
}

.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.three div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.band.quiet .three div { background: var(--sunken); }

.three strong { display: block; font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.three span { color: var(--muted); font-size: 14.5px; }

/* --------------------------------------------------------------- close */

.close {
  text-align: center;
  padding: 56px var(--gutter) 24px;
}

.close h2 { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
  .phone, .card, .badge img { transition: none; }
}

.prose .addr { color: var(--muted); font-size: 15px; }

/* The meal-scan band leans on the nutrition accent, since it is the one
 * section here with no screenshot to carry it. */
.scanband { background: linear-gradient(180deg, #f6fbf7 0%, var(--sunken) 100%); }
.scanband .eyebrow { margin-bottom: 8px; }
.scanband .caveat { color: var(--muted); font-size: 14.5px; max-width: 70ch; margin: 24px 0 0; }

/* ----------------------------------------------------------- the mark drawn */

/* The app opens with an H inside a ring, and every ring in it fills from
 * twelve o'clock. So does this one. The resting state is the finished mark and
 * the keyframes run *from* a hidden state rather than to a visible one, which
 * is what lets the blanket prefers-reduced-motion rule above switch the
 * animation off and still leave a complete mark on the page. */

.mark {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 0 24px -3px;    /* -3px puts the ring's edge, not its box, on the
                               same line as the heading below it. */
}

.mark svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mark circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 345.6;  /* 2 pi r, r = 55 */
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-box: fill-box;
  transform-origin: center;
  animation: markdraw 1100ms cubic-bezier(0.16, 0.84, 0.34, 1) 140ms backwards;
}

@keyframes markdraw {
  from { stroke-dashoffset: 345.6; }
}

.mark img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  /* The logo is a black H on an opaque white square, and that square is wider
   * than the ring's inside, so laid on top it rubs out everything but the four
   * points where the ring pokes past its corners. Multiply is exactly the fix:
   * on a white page white multiplies away to nothing and the black H stays
   * black, with the antialiasing on its edges intact — which keying the white
   * out of the file would not manage. */
  mix-blend-mode: multiply;
  animation: markin 700ms cubic-bezier(0.2, 0.8, 0.3, 1) 470ms backwards;
}

@keyframes markin {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.84); }
}

/* -------------------------------------------------------------- FAQ search */

/* Sticky, because the point of it is to be reachable once you have scrolled
 * far enough to want it. It carries the page background so the questions
 * passing underneath do not show through. */
.findwrap {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 12px 0 14px;
  margin-bottom: 4px;
}

.find {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sunken);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.find:focus-within {
  background: var(--surface);
  border-color: var(--coach);
  box-shadow: 0 0 0 4px rgba(29, 95, 209, 0.14);
}

.find-icon {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke 180ms ease;
}

.find:focus-within .find-icon { stroke: var(--coach); }

.find input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;          /* Under 16px, iOS zooms the page on focus. */
  line-height: 1.2;
}

.find input::placeholder { color: var(--faint); }

/* WebKit's own clear button, dropped in favour of the one below it, which can
 * be reached by keyboard and named for a screen reader. */
.find input::-webkit-search-decoration,
.find input::-webkit-search-cancel-button { -webkit-appearance: none; }

.find-clear {
  display: none;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(120, 120, 128, 0.14);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}

.find.has-text .find-clear { display: inline-flex; }
.find-clear:hover { background: rgba(120, 120, 128, 0.24); }

.find-clear svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.find-key {
  flex: none;
  margin-right: 8px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--faint);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.find:focus-within .find-key,
.find.has-text .find-key { display: none; }

/* Nothing to press a key with. */
@media (hover: none) {
  .find-key { display: none; }
}

.find-count {
  margin: 10px 4px 0;
  min-height: 20px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ------------------------------------------------------------ the FAQ list */

.qa-item[hidden] { display: none; }

/* Wrapping each pair in its own element costs the h2 rule its :first-of-type
 * exemption, since every heading is now first inside its own article. The
 * separator is put back here, and faq.js moves the exemption to whichever
 * question is first once a search has hidden the ones above it. */
.prose .qa-item h2 {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.prose .qa-item:first-of-type h2,
.prose .qa-item.lead h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h2.tail {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.qa-item mark {
  background: rgba(29, 95, 209, 0.16);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* ===================================================================== *
 * The interior pages.
 *
 * About, the FAQ, Support, the policy and the terms were plain documents
 * under a plain bar while the landing page had been given a hero, colour
 * and motion. These are the pages an App Store reviewer actually opens,
 * so they get the same care: one page header for all of them, a bar that
 * stays put, a footer that is a footer, and movement between them.
 *
 * Every effect here is additive. Nothing on any of these pages waits for
 * a scroll listener to become visible, and every animation runs *from* a
 * hidden state towards the resting one, so the blanket reduced-motion
 * rule above switches them all off and leaves the pages intact.
 * ===================================================================== */

:root { --barh: 68px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

:where(a, button, summary, input):focus-visible {
  outline: 2px solid var(--coach);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------- moving between pages */

/* Browsers that have it do the whole crossfade themselves, document to
 * document, with no script involved. Everything else gets the leaving half
 * from site.js. */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-out 140ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: vt-in 300ms cubic-bezier(0.16, 0.84, 0.34, 1) both;
}

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* The mark and the wordmark are on every page in the same place, so they are
 * carried across rather than crossfaded with everything else. */
.bar .brand img { view-transition-name: brandmark; }
.bar .brand span { view-transition-name: brandword; }

/* ::view-transition-* are pseudo-elements on the root, which the blanket
 * `*` rule does not reach. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* The fallback, for browsers without the API. Opacity only: a transform here
 * would make the body a containing block and take the fixed reading bar with
 * it. */
.no-vt body { animation: pagein 260ms ease backwards; }
@keyframes pagein { from { opacity: 0; } }

.no-vt.leaving body {
  opacity: 0;
  transition: opacity 160ms ease;
}

/* ------------------------------------------------------------- the bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

/* The rule under the bar earns its place once there is something above it. */
.scrolled .bar {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(11, 11, 12, 0.05);
}

.bar nav { align-items: center; }

/* An underline that grows from the middle, and stays put on the page you are
 * already on. */
.bar nav > a,
.drop > summary {
  position: relative;
  padding: 4px 0;
  transition: color 180ms ease;
}

.bar nav > a::after,
.drop > summary::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.bar nav > a:hover::after,
.drop > summary:hover::after { transform: scaleX(1); }

.bar nav > a[aria-current="page"],
.drop > summary.here {
  color: var(--ink);
  font-weight: 600;
}

.bar nav > a[aria-current="page"]::after,
.drop > summary.here::after { transform: scaleX(1); }

.bar .badge-sm::after { display: none; }

/* ------------------------------------------------------- the Legal menu */

.drop { position: relative; }

.drop > summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.drop > summary::-webkit-details-marker { display: none; }

.drop > summary::before {
  content: "";
  order: 2;
  width: 5px;
  height: 5px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.drop[open] > summary::before { transform: translateY(1px) rotate(225deg); }
.drop > summary:hover { color: var(--ink); }

.dropmenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  translate: -50% 0;
  min-width: 152px;
  display: grid;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(11, 11, 12, 0.14);
  animation: dropin 200ms cubic-bezier(0.16, 0.84, 0.34, 1) backwards;
}

@keyframes dropin {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
}

.dropmenu a {
  padding: 9px 12px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 14.5px;
  color: var(--muted);
  transition: background 150ms ease, color 150ms ease;
}

.dropmenu a:hover { background: var(--sunken); color: var(--ink); }

.dropmenu a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--sunken);
}

/* -------------------------------------------------------- the page head */

.pagehead {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* The landing page's wash, turned right down. Enough for the page to have a
 * temperature; not enough to compete with a legal document. */
.wash {
  position: absolute;
  inset: -60% -10% auto -10%;
  height: 340px;
  z-index: -1;
  background:
    radial-gradient(36% 52% at 18% 44%, rgba(30, 142, 62, 0.13), transparent 70%),
    radial-gradient(32% 46% at 46% 26%, rgba(255, 59, 48, 0.10), transparent 70%),
    radial-gradient(34% 48% at 74% 44%, rgba(226, 102, 13, 0.12), transparent 70%),
    radial-gradient(30% 44% at 60% 66%, rgba(29, 95, 209, 0.11), transparent 70%);
  filter: blur(22px);
}

.pagehead-in {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px var(--gutter) 40px;
}

.pagehead h1 {
  font-size: clamp(30px, 5.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 12px;
  text-wrap: balance;
}

.pagehead .lede {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18.5px);
  line-height: 1.55;
  max-width: 54ch;
  margin: 0;
  text-wrap: pretty;
}

.pagehead .updated {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 13.5px;
}

/* Arrival, staggered. `backwards` holds each one hidden through its own delay
 * and hands back a completely ordinary element afterwards. */
.pagehead .eyebrow,
.pagehead .mark { animation: rise 620ms cubic-bezier(0.16, 0.84, 0.34, 1) 40ms backwards; }
.pagehead h1    { animation: rise 620ms cubic-bezier(0.16, 0.84, 0.34, 1) 110ms backwards; }
.pagehead .lede { animation: rise 620ms cubic-bezier(0.16, 0.84, 0.34, 1) 180ms backwards; }
.pagehead .pill,
.pagehead .updated { animation: rise 620ms cubic-bezier(0.16, 0.84, 0.34, 1) 250ms backwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}

/* The mark already animates itself; it must not be given a second transform
 * to fight over. */
.pagehead .mark { animation-name: fadein; }
@keyframes fadein { from { opacity: 0; } }

/* -------------------------------------------------------- the reading bar */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 30;
  pointer-events: none;
}

.progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg,
    var(--nutrition) 0%, var(--train) 38%, var(--run) 68%, var(--coach) 100%);
}

/* ------------------------------------------------------- contents list */

.toc {
  margin: 30px 0 8px;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
}

.tochead {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: 26px;
}

.toc li {
  counter-increment: toc;
  break-inside: avoid;
  margin: 0 0 3px;
}

.toc a {
  display: block;
  padding: 5px 8px 5px 30px;
  position: relative;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.toc a::before {
  content: counter(toc);
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 600;
}

.toc a:hover { background: var(--surface); color: var(--ink); }

/* Set by site.js as you read past each heading. */
.toc a.here {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--coach);
}

@media (max-width: 560px) {
  .toc ol { columns: 1; }
}

/* An anchored heading has to clear the sticky bar. */
.prose h2 { scroll-margin-top: calc(var(--barh) + 18px); }

/* The FAQ's search box sticks below the bar rather than under it. */
.findwrap { top: var(--barh); }

/* ------------------------------------------------------------- support */

.pill {
  display: inline-block;
  margin-top: 22px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 200ms ease;
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(11, 11, 12, 0.22);
}

.row {
  background: var(--surface);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.3, 1),
              border-color 200ms ease,
              box-shadow 200ms ease;
}

.row:hover {
  transform: translateY(-2px);
  border-color: #d5d5dd;
  box-shadow: 0 12px 26px rgba(11, 11, 12, 0.08);
}

/* The path through the app, set apart from the thing it achieves. */
.row b {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--sunken);
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 460px) {
  .row b { white-space: normal; }
}

/* -------------------------------------------------------------- footer */

.foot {
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--sunken);
  border-top: 1px solid var(--line);
}

.footwrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
  gap: 40px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px var(--gutter) 36px;
}

.footbrand p {
  margin: 14px 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.footcols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footcols div { display: grid; align-content: start; gap: 9px; }

.foothead {
  margin: 0 0 3px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.footcols a {
  color: var(--muted);
  font-size: 14.5px;
  text-decoration: none;
  width: fit-content;
  transition: color 160ms ease, transform 160ms ease;
}

.footcols a:hover { color: var(--ink); transform: translateX(2px); }

.footlaw {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .footwrap {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 40px;
  }
  .footcols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Centred under "Legal" is fine until "Legal" is near the edge of a phone. */
@media (max-width: 560px) {
  .dropmenu { left: auto; right: 0; translate: none; }
}

/* The bar is sticky now, so its height is a tax on every screenful. Left
 * alone it wrapped to two lines on a phone and took a sixth of the viewport
 * with it, so below this width it tightens until the nav fits on one line:
 * closer spacing, then the store badge (which appears twice more down the
 * page), then the wordmark beside the mark. */
@media (max-width: 720px) {
  /* site.js measures the real height; this is what the sticky search box uses
     until it has, and if it never does. */
  :root { --barh: 53px; }
  .bar { padding: 11px var(--gutter); }
  .bar nav { gap: 16px; font-size: 14px; }
  .bar .badge-sm, .bar .soon-sm { display: none; }
}

@media (max-width: 420px) {
  .bar nav { gap: 13px; }
  .bar .brand span { display: none; }
}

/* ------------------------------------------------------------ skip link */

/* The bar is sticky and carries five things, so without this a keyboard user
 * tabs past About, FAQ, Legal, Terms, Privacy and Support before reaching a
 * word of the page — on every page, every time. Off-screen until focused,
 * which is the one case where hiding something from the mouse is right. */
.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 40;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: top 180ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* The shadow goes on with the link. Parked above the fold it would still
 * cast 38px downwards, which puts a dark smudge in the top-left corner of
 * every page. */
.skip:focus {
  top: 12px;
  box-shadow: 0 10px 28px rgba(11, 11, 12, 0.24);
}

#main { scroll-margin-top: calc(var(--barh) + 12px); }

/* --------------------------------------------------- more contrast asked */

/* Increase Contrast on iOS and macOS, and the Windows equivalent. The wash
 * and the frosted bar are the two things here that put text on something
 * other than a flat colour, so those are what go. */
@media (prefers-contrast: more) {
  :root {
    --muted: #4a4a4f;
    --faint: #56565b;
    --line: #b8b8c0;
  }

  .wash, .glow { display: none; }

  .bar {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: var(--line);
  }

  .card, .row, .qa, .toc, .find, .dropmenu, .phone { border-color: var(--line); }

  .bar nav > a[aria-current="page"]::after,
  .drop > summary.here::after { height: 3px; }
}



/* ===================================================================== *
 * Pricing.
 *
 * The section a reader jumps to when they have decided they might want
 * this, so it has to answer the two things they are actually weighing:
 * what do I get, and what happens to me if I try it. The price card
 * carries the first, the trial column the second.
 *
 * Its motion is the one place on this site that waits for a scroll — and
 * it still never hides anything. The resting state of every part is the
 * finished one; site.js adds .inview and the keyframes run *from* a
 * hidden state towards where the element already was. Script blocked,
 * observer unsupported, reduced motion asked for: the section is simply
 * there, complete.
 * ===================================================================== */

.pricegrid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 34px 0 26px;
}

@media (max-width: 860px) {
  .pricegrid { grid-template-columns: 1fr; gap: 24px; }
}

/* ------------------------------------------------------------ the card */

.plan {
  position: relative;
  overflow: hidden;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.3, 1),
              box-shadow 260ms ease;
}

.plan.lead {
  border-color: var(--ink);
  box-shadow: 0 14px 40px rgba(11, 11, 12, 0.10);
}

/* The gold seam along the top edge, the app's tier marking in the one
 * place on this page that is asking for money. */
.plan.lead::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #f0d089, var(--gold), #c8952c);
}

.plan:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 52px rgba(11, 11, 12, 0.14);
}

/* A slow pass of light across the card, once, as it arrives. Decoration
 * with a job: it is what makes the eye stop here rather than scroll by. */
.inview .plan.lead::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(227, 177, 65, 0.16) 50%,
    transparent 62%
  );
  animation: sheen 1500ms ease-out 500ms both;
}

@keyframes sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.planflag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan h3 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.planprice {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0 0 12px;
}

.planprice strong {
  font-size: clamp(38px, 6vw, 48px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.planprice .per { color: var(--muted); font-size: 16px; font-weight: 500; }

.planwhy {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* What you actually get, in the place where somebody is deciding whether
 * it is worth it — a reader who jumped straight here has not seen the
 * feature rows above. */
.included {
  list-style: none;
  margin: 0 0 22px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}

.included li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 11px;
  font-size: 14.5px;
  line-height: 1.45;
  color: #3a3a3c;
}

.included li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  font-weight: 700;
  color: var(--nutrition-ink);
}

.plan .badge { margin: 0; }

/* --------------------------------------------------------- the trial */

.trial {
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.trialhead {
  margin: 0 0 20px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.steps {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

/* The rail, behind the dots and stopping at the last one. */
.steps::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 34px;
  width: 2px;
  background: var(--line);
  transform-origin: top;
}

.steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 22px 30px;
}

.steps li:last-child { padding-bottom: 0; }

.steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
}

/* The one you are standing on. */
.steps li:first-child::before {
  border-color: var(--run);
  background: var(--run);
}

.steps strong {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 2px;
}

.steps span {
  display: block;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* The three things somebody hesitating is actually hesitating about. */
.assure {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}

.assure li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.assure li::before {
  content: "✓";
  color: var(--nutrition-ink);
  font-weight: 700;
}

.pricing .caveat {
  max-width: 76ch;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ------------------------------------------------- arrival, on scroll */

/* Every rule below animates FROM a hidden state TO where the element
 * already is, so the un-animated page is the finished page. */

.inview .plan.lead,
.inview .trial {
  animation: liftin 620ms cubic-bezier(0.16, 0.84, 0.34, 1) backwards;
}

.inview .trial { animation-delay: 90ms; }

@keyframes liftin {
  from { opacity: 0; transform: translateY(18px); }
}

.inview .steps::before {
  animation: raildraw 760ms cubic-bezier(0.3, 0, 0.2, 1) 320ms backwards;
}

@keyframes raildraw {
  from { transform: scaleY(0); }
}

.inview .steps li {
  animation: stepin 520ms cubic-bezier(0.16, 0.84, 0.34, 1) backwards;
}

.inview .steps li:nth-child(1) { animation-delay: 380ms; }
.inview .steps li:nth-child(2) { animation-delay: 520ms; }
.inview .steps li:nth-child(3) { animation-delay: 660ms; }

@keyframes stepin {
  from { opacity: 0; transform: translateX(-10px); }
}

.inview .assure li {
  animation: popin 420ms cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

.inview .assure li:nth-child(1) { animation-delay: 780ms; }
.inview .assure li:nth-child(2) { animation-delay: 860ms; }
.inview .assure li:nth-child(3) { animation-delay: 940ms; }

@keyframes popin {
  from { opacity: 0; transform: scale(0.9); }
}

.inview .included li {
  animation: stepin 440ms cubic-bezier(0.16, 0.84, 0.34, 1) backwards;
}

.inview .included li:nth-child(1) { animation-delay: 300ms; }
.inview .included li:nth-child(2) { animation-delay: 360ms; }
.inview .included li:nth-child(3) { animation-delay: 420ms; }
.inview .included li:nth-child(4) { animation-delay: 480ms; }
.inview .included li:nth-child(5) { animation-delay: 540ms; }
.inview .included li:nth-child(6) { animation-delay: 600ms; }


/* ===================================================================== *
 * Four apps, or this one.
 *
 * The same card the app's paywall opens with, in the section where this
 * page makes the same argument in words. The words stay: the picture is
 * what a skimming reader takes, the two columns under it are what a
 * reading one takes.
 *
 * At rest the four are already struck and already faded — so with no
 * script, an old browser, or reduced motion, the card still says what it
 * means. The entrance brightens and un-draws them and plays forwards.
 * ===================================================================== */

.swap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px 44px;
  margin: 34px 0 6px;
  padding: 34px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.swapapps {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.swapapp {
  display: grid;
  justify-items: center;
  gap: 9px;
  /* The resting state is the retired one. */
  opacity: 0.58;
}

.swapicon {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  /* The iOS icon corner, so it reads as an app rather than as a button. */
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #e8e8ee);
  border: 1px solid rgba(11, 11, 12, 0.07);
  box-shadow: 0 4px 12px rgba(11, 11, 12, 0.10);
}

.swapicon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One hairline, corner to corner and inset from both, rounded at each end.
 * A thick line to the very corners reads as an error state. */
.cross {
  position: absolute;
  left: 12px;
  top: 50px;
  width: 54px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform-origin: left center;
  transform: rotate(-45deg);
}

.swaplabel {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--muted);
}

.swaparrow svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.swapone {
  display: flex;
  align-items: center;
  gap: 14px;
}

.swapmark {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  flex: none;
}

.swapmark svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.swapmark circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 5;
}

/* The logo is a black H on an opaque white square wider than the ring's
 * inside; multiply drops the white on a white page and keeps the mark's
 * antialiasing, which keying the file would not. Same trick as the About
 * page's mark. */
.swapmark img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
}

.swapone strong {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.swapone em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 14px;
  color: var(--muted);
}

/* Stacked, with the arrow turned down, once there is no room for a row. */
@media (max-width: 720px) {
  .swap { flex-direction: column; gap: 18px; padding: 26px 18px; }
  .swapapps { gap: 14px; }
  .swaparrow svg { transform: rotate(90deg); width: 26px; height: 26px; }
}

@media (max-width: 420px) {
  .swapicon { width: 50px; height: 50px; border-radius: 13px; }
  .swapicon svg { width: 23px; height: 23px; }
  .cross { left: 10px; top: 40px; width: 44px; }
  .swapapps { gap: 10px; }
}

/* ---------------------------------------------------- arrival, on scroll */

/* From bright and unstruck, towards the struck and faded state the card is
 * already in. Nothing here can leave anything hidden. */
.inview .swapapp {
  animation: retire 620ms ease backwards;
}

.inview .swapapp:nth-child(1) { animation-delay: 60ms; }
.inview .swapapp:nth-child(2) { animation-delay: 200ms; }
.inview .swapapp:nth-child(3) { animation-delay: 340ms; }
.inview .swapapp:nth-child(4) { animation-delay: 480ms; }

@keyframes retire {
  from { opacity: 1; }
}

.inview .cross {
  animation: crossdraw 420ms cubic-bezier(0.3, 0, 0.2, 1) backwards;
}

.inview .swapapp:nth-child(1) .cross { animation-delay: 60ms; }
.inview .swapapp:nth-child(2) .cross { animation-delay: 200ms; }
.inview .swapapp:nth-child(3) .cross { animation-delay: 340ms; }
.inview .swapapp:nth-child(4) .cross { animation-delay: 480ms; }

@keyframes crossdraw {
  from { width: 0; }
}

.inview .swapone {
  animation: onein 620ms cubic-bezier(0.16, 0.84, 0.34, 1) 680ms backwards;
}

@keyframes onein {
  from { opacity: 0; transform: translateX(-14px) scale(0.94); }
}

.inview .swaparrow {
  animation: onein 500ms cubic-bezier(0.16, 0.84, 0.34, 1) 600ms backwards;
}

/* ------------------------------------------------------- phone and watch */

/* The one row on the page that claims two devices. The watch overlaps the
 * phone's lower-left corner at about a third its width — the composition
 * everyone recognises — and it costs the page no extra height, because it
 * goes in the image cell that row already had. */
.pair {
  position: relative;
  display: flex;
  justify-content: center;
  padding-left: 42px;
}

.pair .phone { width: 100%; max-width: 330px; }

.pair .watch {
  position: absolute;
  left: 0;
  bottom: 8%;
  width: 34%;
  max-width: 128px;
  height: auto;
  /* The same black frame the phones wear, with the watch's much rounder
   * corner and its own shadow so it sits in front rather than on. */
  border: 5px solid #000000;
  border-radius: 26px;
  background: #000000;
  box-shadow: 0 16px 34px rgba(11, 11, 12, 0.30);
  /* The capture ends part way through the fat bar, because TodayView scrolls
   * and that row is below the fold of a 46mm screen. True to the app, but at
   * 128px a sliced bar reads as a rendering fault rather than as "there is
   * more below" — so the bottom is cropped here rather than in the file,
   * which stays the untouched capture.
   *
   * 460 is not a guess: scanning the capture for rows that are entirely black
   * finds a 21px band at y=446-466, immediately under the carbs bar. The fat
   * bar never fitted on a 46mm screen at all — only its label did, which is
   * what made the full-height version look wrong. */
  aspect-ratio: 416 / 460;
  object-fit: cover;
  object-position: top;
}

@media (max-width: 800px) {
  .pair { padding-left: 34px; }
  .pair .watch { max-width: 104px; border-radius: 22px; }
}

@media (max-width: 420px) {
  .pair .watch { border-width: 4px; border-radius: 18px; }
}
