/* The landing page. Motion rules are in docs/DESIGN.md. States that start hidden only apply
   under .js, which landing.js sets, so the page reads fine without the script. */

.landing main { overflow-x: clip; }
.num { font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:root[data-state="live"] [data-soon], :root:not([data-state="live"]) [data-live] { display: none !important; }
html:not(.js) [data-needs-js] { display: none !important; }
.landing .foot .wrap { padding-bottom: max(112px, env(safe-area-inset-bottom)); }

/* Hero */
.hero { padding-block: 28px 12vh; }
.kicker { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--tint-wash); color: var(--tint-on-wash); font-weight: 700; font-size: 15px; }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.5); opacity: .5; } }
.hero h1 { font-size: clamp(68px, 18vw, 180px); margin: 18px 0; }
.lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--secondary); max-width: 34ch; margin: 0 0 28px; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cta { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--tint); color: var(--on-tint); font-weight: 800; font-size: 18px; text-decoration: none; cursor: pointer; transition: transform .25s var(--spring); }
.cta:hover { transform: translateY(-2px); }
.cta:active { transform: scale(.97); }
.cta:focus-visible { outline-color: var(--label); border-radius: 999px; }
.cta2:focus-visible { border-radius: 999px; }
.cta .play { width: 14px; height: 16px; fill: currentColor; }
.cta2 { display: inline-flex; white-space: nowrap; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px; border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--rule); color: var(--label); font-weight: 700; font-size: 17px; text-decoration: none; transition: transform .25s var(--spring); }
.cta2:hover { transform: translateY(-2px); }
.cta2:active { transform: scale(.97); }
.cta2 svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--tint-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctas.center { justify-content: center; margin-bottom: 4px; }
.cta-note { margin: 10px 0 0; font-size: 15px; color: var(--secondary); }

/* Headlines rise word by word out of a mask */
.split .w { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--out); transition-delay: calc(var(--i) * 70ms + 120ms); }
.split.in .w > span { transform: none; }
.split em { font-style: normal; color: var(--tint-text); }

/* Odometer digits */
.odo { display: inline-flex; line-height: 1; height: 1em; overflow: hidden; vertical-align: bottom; }
.odo .col { display: block; height: 1em; overflow: hidden; }
.odo .strip { display: block; transform: translateY(calc(var(--d, 0) * -1em)); transition: transform 1.2s var(--out); transition-delay: calc(var(--k, 0) * 90ms); }
.odo .strip span { display: block; height: 1em; }

/* Section headers */
.exhead { padding-top: 14vh; max-width: 760px; scroll-margin-top: 60px; }
.exhead h2 { font-size: clamp(48px, 11vw, 104px); margin: 0 0 16px; }
.exhead h2 .w > span { transition-delay: calc(var(--i) * 60ms); }
.exhead p { margin: 0; font-size: clamp(18px, 2.2vw, 22px); color: var(--secondary); max-width: 38ch; }
.js .exhead p { opacity: 0; transform: translateY(16px); transition: opacity .7s .25s, transform .9s .25s var(--out); }
.js .exhead.in p { opacity: 1; transform: none; }

/* Exercise cards */
.ex { display: grid; gap: 28px; align-items: center; padding-block: 5vh 4vh; }
.xcard { background: var(--card); border-radius: 28px; padding: 22px 16px 14px; max-width: 520px; width: 100%; box-shadow: 0 1px 0 var(--rule); }
.xh { padding: 0 6px 10px; }
.xh h3 { margin: 0; font-size: clamp(22px, 3.4vw, 26px); line-height: 1.15; }
.xh .sub { display: block; margin-top: 4px; color: var(--secondary); font-size: 15px; }
.xh .sub b { color: var(--label); font-weight: 750; }
.dotc { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: 2px; }
.dotc.chest { background: #3478F6; }
.dotc.back { background: #AF52DE; }
.dotc.start { background: #34C759; }
.xnote { display: grid; grid-template-columns: 18px 1fr; gap: 8px; margin: 0 6px 6px; padding: 10px 12px; border-radius: 14px; background: var(--card2); font-size: 15px; line-height: 1.35; }
.xnote svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--tint-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xnote small { display: block; color: var(--secondary); font-size: 13px; margin-top: 2px; }

/* Set rows. The whole row toggles, and the check is a real button. */
.setrow { display: grid; grid-template-columns: 36px 1fr 44px; align-items: center; gap: 10px; min-height: 56px; padding: 4px 6px; border-radius: 16px; position: relative; transition: background-color .4s; }
.js .setrow { cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.setrow + .setrow { margin-top: 2px; }
.setrow.next { background: var(--tint-wash); }
@media (hover: hover) { .js .setrow:hover { background: var(--fill); } .js .setrow.next:hover { background: var(--tint-wash); } }
.setrow .badge { width: 30px; height: 30px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; font-weight: 750; font-size: 14px; color: var(--secondary); }
.setrow .badge.e { background: var(--tint-wash); font-size: 16px; }
.setrow p { margin: 0; font-weight: 600; font-size: 17px; line-height: 1.3; transition: color .4s; }
.setrow:not(.on) p { color: var(--secondary); }
.setrow p .num { font-size: 21px; color: var(--label); transition: color .3s; }
.setrow:not(.on) p .num { color: inherit; }
.setrow p small { font-size: 15px; font-weight: 600; color: var(--secondary); }
.setrow .tick { justify-self: center; width: 36px; height: 36px; padding: 0; margin: 0; border-radius: 50%; border: 2.5px solid var(--tertiary); background: none; position: relative; appearance: none; transition: border-color .3s, transform .35s var(--spring); }
.setrow button.tick { cursor: pointer; }
.setrow button.tick::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.setrow.next .tick { border-color: var(--tint); }
.setrow .tick::before { content: ""; position: absolute; inset: -2.5px; border-radius: 50%; background: var(--tint); transform: scale(0); transition: transform .45s var(--spring); }
.setrow .tick svg { position: absolute; inset: 22%; width: 56%; height: 56%; fill: none; stroke: var(--on-tint); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s .18s ease-out; }
.setrow.on .tick { border-color: transparent; }
.setrow.on .tick::before { transform: scale(1); }
.setrow.on .tick svg { stroke-dashoffset: 0; }
.setrow:active .tick { transform: scale(.86); }
.setrow .tick.pop { animation: pop .45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.2); } }
.setrow .prb { display: inline-block; margin-left: 8px; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--red); color: #fff; font: 800 12px/22px var(--sys); letter-spacing: .05em; vertical-align: 2px; transform: scale(0); transition: transform .5s var(--spring) .15s; }
.setrow.on .prb { transform: scale(1); }
.setrow .burst { position: absolute; right: 28px; top: 50%; }
.setrow .burst i { position: absolute; left: -2px; top: -8px; width: 4px; height: 16px; border-radius: 4px; background: var(--red); opacity: 0; }
.setrow .burst i:nth-child(even), .setrow[data-go] .burst i { background: var(--tint); }
.setrow.on .burst i { animation: ray .8s var(--out) forwards; }
@keyframes ray { 0% { opacity: 1; transform: rotate(calc(var(--a) * 1deg)) translateY(-18px) scaleY(.4); } 60% { opacity: 1; } 100% { opacity: 0; transform: rotate(calc(var(--a) * 1deg)) translateY(-54px) scaleY(1); } }
.num.flash { color: var(--tint-text) !important; }

/* Each section's own motion */
.js [data-hint] .setrow.next .tick { animation: ring 1.6s ease-out infinite; }
.js .tapped [data-hint] .setrow.next .tick { animation: none; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .6); } 80%, 100% { box-shadow: 0 0 0 14px rgba(255, 176, 32, 0); } }
.spark { margin: 10px 6px 4px; padding: 12px 12px 8px; border-radius: 16px; background: var(--card2); }
.spark-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.spark-h b { font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--label); }
.spark-h .nv, .xcard.pr .spark-h .ov { display: none; }
.xcard.pr .spark-h .nv { display: inline; color: var(--red-text); }
.spark svg { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.spark .old { fill: none; stroke: var(--secondary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark .od { fill: var(--secondary); }
.js .spark .old { stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 1.4s var(--out); }
.js .spark.in .old { stroke-dashoffset: 0; }
.js .spark .od { opacity: 0; transition: opacity .3s; }
.js .spark.in .od { opacity: 1; }
.js .spark.in .od:nth-of-type(2) { transition-delay: .26s; }
.js .spark.in .od:nth-of-type(3) { transition-delay: .52s; }
.js .spark.in .od:nth-of-type(4) { transition-delay: .78s; }
.js .spark.in .od:nth-of-type(5) { transition-delay: 1.04s; }
.spark .new { stroke: var(--red-text); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset .5s var(--out); }
.xcard.pr .spark .new { stroke-dashoffset: 0; }
.spark .nd { fill: var(--red-text); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s var(--spring) .35s; }
.xcard.pr .spark .nd { transform: scale(1); }
.setrow .plus5 { position: absolute; right: 60px; top: 2px; font: 800 14px var(--sys); color: var(--red-text); opacity: 0; pointer-events: none; }
.setrow.on .plus5 { animation: rise 1.3s var(--out) .25s forwards; }
@keyframes rise { 0% { opacity: 0; transform: translateY(8px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.floaty { position: absolute; left: 10px; top: 8px; font-size: 24px; line-height: 1; pointer-events: none; opacity: 0; animation: floaty 1.4s linear forwards; animation-delay: var(--d); }
@keyframes floaty { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; transform: translate(calc(var(--dx) * .2px), -18px) scale(1); } 70% { opacity: 1; transform: translate(calc(var(--dx) * .75px), -72px) scale(1.1); } 100% { opacity: 0; transform: translate(calc(var(--dx) * 1px), -96px) scale(1.15); } }

/* Real screenshots beside the cards */
.side { justify-self: center; width: min(78vw, 320px); }
.js .side { opacity: 0; transform: translateY(60px) rotate(3deg); transition: opacity .8s, transform 1s var(--out); }
.js .side.in { opacity: 1; transform: none; }
.shot { display: block; border-radius: 13% / 6%; overflow: hidden; background: var(--card); box-shadow: 0 0 0 6px #050506, 0 0 0 7.5px #2A2A2E, 0 40px 80px -30px rgba(0, 0, 0, .45); }
.shot img { width: 100%; height: auto; }

/* The plus and minus stepper drives set 3 on the card beside it */
.stepper { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 14px; padding: 26px 10px; background: var(--card); border-radius: 28px; width: min(100%, 420px); justify-self: center; }
.js .stepper { opacity: 0; transform: translateY(60px); transition: opacity .8s, transform 1s var(--out); }
.js .stepper.in { opacity: 1; transform: none; }
.stepper .cap { width: 100%; text-align: center; font-size: 13px; font-weight: 750; letter-spacing: .06em; color: var(--secondary); text-transform: uppercase; }
.stepper .val { font-size: 64px; line-height: 1; min-width: 3.2ch; text-align: center; transition: transform .25s var(--spring); }
.stepper .val small { font-size: 18px; color: var(--secondary); margin-left: 4px; font-weight: 650; }
.stepper .val.bump { animation: bump .3s var(--spring); }
@keyframes bump { 40% { transform: scale(1.08); } }
.stepper .pm { width: 56px; height: 56px; padding: 0; border: 0; border-radius: 16px; background: var(--card2); color: var(--label); display: grid; place-items: center; font-size: 28px; font-weight: 700; cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .2s var(--spring), background-color .2s; }
.stepper .pm:active, .stepper .pm.tap { transform: scale(.86); background: var(--tint-wash); }

/* Privacy: a phone that keeps every set inside it */
.vault { display: grid; justify-items: center; gap: 18px; padding-block: 6vh 0; text-align: center; }
.phone { position: relative; display: block; width: min(66vw, 260px); aspect-ratio: 9 / 18.5; padding: 0; border-radius: 46px; border: 9px solid #050506; background: var(--card); box-shadow: 0 0 0 1.5px #2A2A2E, 0 0 0 0 var(--tint-wash), 0 40px 80px -30px rgba(0, 0, 0, .45); overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: box-shadow .3s; }
.js .phone { opacity: 0; transform: translateY(60px) scale(.96); transition: opacity .8s, transform 1s var(--out), box-shadow .3s; }
.js .vault.in .phone { opacity: 1; transform: none; }
.phone.bump { box-shadow: 0 0 0 1.5px #2A2A2E, 0 0 0 7px var(--tint-wash), 0 40px 80px -30px rgba(0, 0, 0, .45); }
.phone .island { position: absolute; top: 9px; left: 50%; width: 32%; height: 24px; border-radius: 20px; background: #050506; transform: translateX(-50%); }
.phone .lockic { position: absolute; top: 50px; left: 50%; width: 38px; height: 38px; margin-left: -19px; overflow: visible; }
.phone .lockic rect { fill: var(--tint); }
.phone .lockic .shackle { fill: none; stroke: var(--tint-text); stroke-width: 2.4; stroke-linecap: round; }
.js .phone .lockic .shackle { transform: translateY(-4px); transition: transform .5s var(--spring) .6s; }
.js .vault.in .lockic .shackle { transform: none; }
.phone .lockic.pulse { animation: pop .45s var(--spring); }
.phone .ptitle { position: absolute; top: 96px; left: 0; right: 0; font-weight: 750; font-size: 15px; color: var(--secondary); }
.phone .chip { position: absolute; left: 0; top: 0; white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: var(--card2); color: var(--label); font-weight: 700; font-size: 13px; line-height: 1.2; will-change: transform; pointer-events: none; }
.phone .chip.pr { background: var(--red); color: #fff; }
.vstat { display: flex; align-items: center; gap: 12px; text-align: left; }
.vstat b { font-size: 64px; line-height: 1; }
.vstat > span { font-size: 13px; font-weight: 750; letter-spacing: .06em; color: var(--secondary); max-width: 12ch; }
.vtap { margin: -6px 0 0; font-size: 14px; color: var(--secondary); }

/* The app icon opens and checks off "Open it" */
.appicon { justify-self: center; width: min(70vw, 260px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 30%; background: var(--card); display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.js .appicon { opacity: 0; transform: scale(.85); transition: opacity .8s, transform 1s var(--spring); }
.js .appicon.in { opacity: 1; transform: none; }
.appicon img { width: 46%; border-radius: 22%; }
.appicon.opening img { animation: launch .7s var(--spring); }
@keyframes launch { 30% { transform: scale(.82); } 65% { transform: scale(1.18); } }

/* The bar at the bottom: the workout and Finish are two real buttons */
.run { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; width: min(calc(100vw - 32px), 460px); display: flex; align-items: center; height: 60px; padding: 0 9px 0 0; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); box-shadow: 0 10px 40px rgba(0, 0, 0, .2), 0 0 0 1px var(--rule); transform: translateX(-50%) translateY(140%); transition: transform .6s var(--spring); }
.run.show { transform: translateX(-50%); }
.run:not(.show) { visibility: hidden; transition: transform .6s var(--spring), visibility 0s .6s; }
.run .rmain { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 20px; border: 0; border-radius: 999px; background: none; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; }
.run .play { width: 14px; height: 16px; flex: none; fill: var(--tint-text); transition: transform .2s var(--spring); }
.run .rmain:active .play { transform: scale(.8); }
.run .rn { font-weight: 700; color: var(--tint-text); white-space: nowrap; }
.run .rc { color: var(--secondary); font-size: 15px; white-space: nowrap; }
.run .rc b { color: var(--label); }
.run .bar { flex: 1; height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; min-width: 30px; }
.run .bar i { display: block; height: 100%; background: var(--tint); transform-origin: left; transform: scaleX(var(--f, 0)); transition: transform .4s var(--out); }
.run .finish { flex: none; height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--card2); color: var(--label); font-weight: 700; font-size: 16px; cursor: pointer; transition: transform .2s var(--spring); }
.run .finish:active { transform: scale(.94); }
.run.idle .rc, .run.idle .bar, .run.idle .finish, .run.idle .run-only, .run:not(.idle) .idle-only { display: none; }

/* The workout summary at the end of the page */
.wrapup { padding-block: 10vh 14vh; text-align: center; position: relative; scroll-margin-top: 60px; overflow-x: clip; }
.wrapup h2 { font-size: clamp(64px, 17vw, 170px); margin: 0; text-wrap: balance; }
.wrapup .when { color: var(--secondary); margin: 8px 0 28px; }
.sumstats { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto 36px; background: var(--card); border-radius: 22px; text-align: left; }
.sumstats > div { padding: 16px 18px; border-left: 1px solid var(--rule); }
.sumstats > div:first-child { border: 0; }
.sumstats b { display: block; font-size: 44px; line-height: 1; }
.sumstats b.odo { display: flex; }
.sumstats b.r { color: var(--red-text); }
.sumstats b small { font-size: .5em; color: var(--secondary); }
.sumstats > div > span { font-size: 12px; font-weight: 750; letter-spacing: .06em; color: var(--secondary); }
.confetti { position: absolute; left: 50%; top: 18%; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 14px; border-radius: 2px; background: var(--tint); opacity: 0; }
.confetti i:nth-child(3n) { background: var(--red); }
.confetti i:nth-child(3n+1) { background: var(--label); width: 6px; height: 6px; border-radius: 50%; }
.wrapup.in.won .confetti i { animation: conf 1.8s var(--out) forwards; animation-delay: calc(var(--k) * 12ms); }
@keyframes conf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--x) * 1px), calc(var(--y) * 1px)) rotate(calc(var(--r) * 1deg)); } }

@media (min-width: 900px) {
  .hero { padding-top: 56px; }
  .ex { grid-template-columns: 1fr 1fr; gap: 64px; }
  .ex.flip .xcard { order: 2; }
  .vault { grid-template-columns: auto auto; justify-content: center; align-content: center; column-gap: 72px; row-gap: 8px; }
  .vault .phone { grid-row: span 2; }
  .vault .vstat { align-self: end; }
  .vault .vtap { align-self: start; justify-self: start; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .split .w > span, .js .exhead p { transform: none; opacity: 1; }
  .kicker .dot, .js [data-hint] .setrow.next .tick { animation: none; }
}
