/* The home page (redesign, 2026-10-23), on the site's shared base (site.css: the tokens, the bar, the buttons,
   the questions, the footer). One rule for the page: every big line is something a trainer actually says or a
   locked line, and the real app answers it. Red means one thing: SyncSet acting (the light that comes on with
   the phone, the one button). */
.chapter { position: relative; height: calc(100vh / var(--z)); min-height: 620px; overflow: hidden; --gap: calc(48vh / var(--z)); }
.chapter .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 3; }
.chapter .still { position: absolute; left: 50%; top: 50%; height: 88%; width: auto; transform: translate(-50%, -50%); z-index: 3; display: none; }
/* the hero's light falls behind the line: its canvas (and its still) sits under the words, which let taps
   through to the phone */
#hero .gl, #hero .still { z-index: 0; }
#hero .say, #hero .ask { pointer-events: none; }

/* play it again: a small mark, there once a film has played */
.replay { position: absolute; right: var(--gutter); bottom: 24px; z-index: 5; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--edge); color: var(--ink-dim); visibility: hidden; opacity: 0; transition: opacity 300ms linear, color 160ms linear, border-color 160ms linear, visibility 0s linear 300ms; }
.replay svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.replay:hover, .replay:focus-visible { color: var(--ink); border-color: var(--edge-hi); outline: none; }
.js .chapter.is-done .replay { visibility: visible; opacity: 1; transition: opacity 300ms linear, color 160ms linear, border-color 160ms linear, visibility 0s; }

/* the hero: the trainer's question, typed on their phone, at full size */
.ask {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%);
  width: max-content; max-width: calc(90vw / var(--z));
  margin: 0; font-family: var(--text); font-weight: 600;
  font-size: clamp(56px, calc(10.2vw / var(--z)), 196px);
  line-height: 0.96; letter-spacing: -0.045em; color: var(--ink); z-index: 2;
}
.ask-text { white-space: pre-wrap; }
.caret { display: inline-block; width: 0.05em; height: 0.82em; margin-left: 0.035em; vertical-align: -0.06em; background: var(--ink); }
/* the cursor blinks from the first frame, the way a phone's does while it waits (the film loads behind it);
   it holds solid once the delete key is down */
@media (prefers-reduced-motion: no-preference) {
  .caret { animation: caretBlink 1.06s steps(1, end) infinite; }
  .is-deleting .caret { animation: none; }
  @keyframes caretBlink { 50% { opacity: 0; } }
}
.js .chapter.is-live:not(.is-asking) .ask { opacity: 0; transition: opacity 120ms linear; }
.say {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: 1fr var(--gap) 1fr; align-items: center;
  margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase;
  /* the film measures the line to fit (--say-size); without it, the longest half ("Stop texting", 5.06 em) fits beside the phone */
  font-size: var(--say-size, clamp(48px, calc((100vw / var(--z) - var(--gap)) / 10.2 - 7px), 150px)); line-height: 0.84; letter-spacing: -0.005em;
  white-space: nowrap; z-index: 1;
}
.say-a { grid-column: 1; justify-self: end; }
.say-b { grid-column: 3; justify-self: start; }
.say span { transition: opacity 140ms linear; }
.is-changing .say span { opacity: 0; }
.js .chapter:not(.is-answer) .say { opacity: 0; transform: translateY(-50%) scale(1.05); }
.js .chapter.is-answer .say { opacity: 1; transform: translateY(-50%) scale(1); transition: opacity 160ms linear, transform 560ms cubic-bezier(0.2, 0, 0, 1); }
/* while the phone turns, the line goes, and the next one lands the way the first did */
.js .chapter.is-answer.is-turning .say { opacity: 0; transform: translateY(-50%) scale(1.05); transition: opacity 140ms linear, transform 0s linear 140ms; }

/* the end of the film: the two ways in either side of the phone, under the line, and a small mark down the page.
   Shown when the film reaches its end (or the visitor takes the phone), and always without the film */
.hero-end { position: absolute; left: 0; right: 0; top: calc(50% + var(--say-size, 120px) * 0.42 + 34px); z-index: 4; display: grid; grid-template-columns: 1fr var(--gap) 1fr; align-items: center; pointer-events: none; }
.hero-end a { pointer-events: auto; } /* the row runs across the phone: only the two buttons take a tap */
.hero-go { grid-column: 1; justify-self: end; font: 600 17px/1 var(--text); color: #fff; background: var(--sync-red); border-radius: 10px; padding: 16px 22px; text-decoration: none; }
.hero-store { grid-column: 3; justify-self: start; }
.hero-store img { height: 49px; width: auto; display: block; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; z-index: 5; width: 40px; height: 40px; margin-left: -20px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--edge); color: var(--ink-dim); }
.scroll-cue svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue:hover, .scroll-cue:focus-visible { color: var(--ink); border-color: var(--edge-hi); outline: none; }
.js .chapter:not(.is-final) .hero-end, .js .chapter:not(.is-final) .scroll-cue { opacity: 0; visibility: hidden; }
.js .chapter.is-final .hero-end, .js .chapter.is-final .scroll-cue { opacity: 1; visibility: visible; transition: opacity 420ms linear, visibility 0s; }
.js .chapter.is-final .scroll-cue { transition-delay: 300ms; }
.no-scene .chapter .hero-end, .no-scene .chapter .scroll-cue { opacity: 1 !important; visibility: visible !important; }
.no-scene #hero .still { height: 80%; top: 47%; }

/* chapter 2: the import. The words on the left, the text and the phone on the right */
.write .words { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-52%); width: calc(40vw / var(--z)); z-index: 4; }
.write h2 { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(54px, calc(6.4vw / var(--z)), 124px); line-height: 0.86; letter-spacing: -0.005em; }
.js .write .w2 { display: none; }
.js .write[data-say="2"] .w1 { display: none; }
.js .write[data-say="2"] .w2 { display: block; }
.write .sub { margin: 22px 0 0; font-size: clamp(17px, calc(1.45vw / var(--z)), 25px); line-height: 1.4; color: var(--ink-dim); max-width: 26ch; }

/* try it */
.try { padding: calc(14vh / var(--z)) var(--gutter); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 calc(5vw / var(--z)); align-items: start; border-top: 1px solid var(--line); }
.try h2 { grid-column: 1 / -1; margin: 0 0 calc(5vh / var(--z)); font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(52px, calc(6.4vw / var(--z)), 120px); line-height: 0.86; }
.try h2 span { display: block; }
.try .pane { border-top: 1px solid var(--line-2); padding-top: 18px; }
.try .pane-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.try .pane-label { font-size: 14px; color: var(--ink-dim); }
.try textarea { width: 100%; height: 420px; resize: vertical; background: var(--field); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 18px; font: 400 15px/1.6 var(--mono); }
.try textarea:focus { outline: none; border-color: var(--edge-hi); }
.try .demo-btn { font: 600 16px/1 var(--text); color: #fff; background: var(--sync-red); border: 0; border-radius: 8px; padding: 13px 20px; cursor: pointer; }
.try .demo-btn:disabled { opacity: 0.6; cursor: default; }
.try .demo-char-count { font-size: 12px; color: var(--ink-dim); }
.read { min-height: 420px; max-height: 540px; overflow: auto; }
.read-day { margin: 0 0 26px; }
.read-day h3 { margin: 0 0 10px; font: 900 30px/1 var(--display); text-transform: uppercase; }
.read-day h3 span { color: var(--ink-dim); margin-left: 0.3em; }
.read-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; padding: 11px 0; border-top: 1px solid var(--row); }
.read-row b { font-weight: 600; font-size: 17px; }
.read-row .rx { font: 400 16px/1.4 var(--mono); white-space: nowrap; }
.read-row .note { grid-column: 1 / -1; font-size: 14px; color: var(--ink-dim); }
.read-row .check { font-size: 12px; color: var(--warn); margin-left: 8px; }
/* a pasted note with no spaces breaks inside the panel instead of pushing it wider than a phone */
.read-row b, .read-row .note, .read-day h3 { overflow-wrap: anywhere; }
.read .demo-loading-text, .read .demo-error { color: var(--ink-dim); font-size: 16px; }
.read .demo-loading-dots { display: none; }
.read .demo-error-retry { margin-left: 10px; font: 600 14px var(--text); color: var(--ink); background: none; border: 1px solid var(--edge); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.demo-result-fade.hidden { display: none; }
.demo-note { font-size: 14px; color: var(--ink-dim); margin-top: 12px; }
.demo-cta-line { grid-column: 1 / -1; margin-top: 28px; font-size: 17px; color: var(--ink-dim); }
.demo-cta-line a { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .read-row { animation: readIn 260ms linear both; animation-delay: calc(var(--i, 0) * 36ms); }
  @keyframes readIn { from { opacity: 0; } to { opacity: 1; } }
}

/* the close: the page's own headline, with the one button */
.final { padding: calc(20vh / var(--z)) var(--gutter) calc(16vh / var(--z)); border-top: 1px solid var(--line); }
.final h2 { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(72px, calc(13vw / var(--z)), 250px); line-height: 0.82; letter-spacing: -0.01em; }
.final h2 span { display: block; }
.final p { margin: 30px 0 34px; font-size: clamp(17px, calc(1.45vw / var(--z)), 25px); color: var(--ink-dim); }
.final .row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.final .go { font: 600 18px/1 var(--text); color: #fff; background: var(--sync-red); border-radius: 10px; padding: 19px 28px; text-decoration: none; }
.final .row a.small { font-size: 15px; color: var(--ink-dim); }

/* the download prompt: once, after a workout has been parsed in the demo (script.js) */
.get-app { margin: auto; width: min(520px, calc(100vw - 2 * var(--gutter))); padding: 36px 32px 28px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--ground); color: var(--ink); text-align: center; }
.get-app:focus { outline: none; }
.get-app::backdrop { background: rgb(0 0 0 / 0.74); }
.get-app-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-dim); cursor: pointer; }
.get-app-close:hover { color: var(--ink); background: var(--row); }
.get-app-title { font: 900 clamp(38px, 9vw, 50px)/0.88 var(--display); text-transform: uppercase; text-wrap: balance; }
.get-app-title .accent { color: var(--sync-red); }
.get-app-sub { margin: 14px auto 24px; max-width: 30ch; font-size: 16px; line-height: 1.5; color: var(--ink-dim); }
.get-app-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.get-app-actions .app-store-badge img { height: 48px; width: auto; display: block; }
.get-app-web { font: 600 16px/1 var(--text); color: #fff; background: var(--sync-red); border-radius: 10px; padding: 16px 20px; text-decoration: none; }
.get-app-note { margin-top: 16px; font-size: 13px; color: var(--ink-dim); }
@media (prefers-reduced-motion: no-preference) {
  .get-app[open] { animation: getAppIn 280ms cubic-bezier(0.2, 0, 0, 1) both; }
  @keyframes getAppIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* without the scenes: each chapter's last frame, composed */
.no-scene .chapter .still { display: block; }
.no-scene .chapter .ask, .no-scene .film-text { display: none; }
.no-scene .chapter .say { opacity: 1 !important; transform: translateY(-50%) !important; }
.no-scene .write .still { left: auto; right: 6%; transform: translateY(-50%); height: 80%; }
.no-scene .write .w2 { display: block; }

@media (max-width: 899px) {
  .replay { right: 10px; bottom: 14px; }
  .hero-end { top: calc(90px + var(--say-size, 64px) * 1.96 + 18px); display: flex; gap: 12px; padding: 0 var(--gutter); }
  .hero-go { font-size: 16px; padding: 14px 18px; }
  .hero-store img { height: 45px; }
  .scroll-cue { bottom: 10px; }
  .no-scene #hero .still { top: auto; height: 50%; bottom: 9%; }
  .ask { top: 30%; font-size: clamp(44px, 13vw, 88px); max-width: calc(100vw - 2 * var(--gutter)); }
  /* stacked, the lines get a little more air so a comma closing the first does not hang onto the second */
  .say { top: 90px; transform: none; display: block; padding: 0 var(--gutter); font-size: var(--say-size, clamp(40px, calc((100vw - 2 * var(--gutter)) / 5.15), 112px)); line-height: 0.98; }
  .say span, .say-a, .say-b { display: block; justify-self: start; }
  .js .chapter:not(.is-answer) .say { transform: scale(1.04); transform-origin: left top; }
  .js .chapter.is-answer .say { transform: none; }
  .js .chapter.is-answer.is-turning .say { transform: scale(1.04); transform-origin: left top; }
  .no-scene .chapter .say { transform: none !important; }
  .chapter .still { top: auto; bottom: 3%; height: 62%; transform: translateX(-50%); }
  .write .words { top: 88px; transform: none; width: auto; right: var(--gutter); }
  .write h2 { font-size: clamp(44px, 12.5vw, 80px); }
  .write .sub { margin-top: 12px; }
  .no-scene .write .still { right: 50%; transform: translateX(50%); height: 40%; }
  .try { grid-template-columns: 1fr; }
  .try textarea { height: 300px; }
  .read { min-height: 0; margin-top: 30px; }
  .final h2 { font-size: clamp(64px, 21vw, 140px); }
}
