/* ==========================================================================
   Trayne — scroll story
   Brand tokens are taken from trayne.io and the Trayne iOS app
   (Inter + Space Mono, focus colours from utils/focus.ts, app palette from
   tamagui.config.ts).
   ========================================================================== */

@font-face {
  font-family: "Space Mono";
  src: url("../fonts/SpaceMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("../fonts/SpaceMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Site (trayne.io) */
  --paper: #fbfaf6;
  --paper-2: #f1eee6;
  --ink: #1e232a;
  --ink-2: #3e4c59;
  --muted: #6b7280;
  --stroke: #e6e1d7;
  --blue: #1b6fe5;
  --blue-2: #0f4fb8;

  /* Stage */
  --night: #0b0d10;
  --fog: #f5f3ee;
  --fog-2: rgba(245, 243, 238, 0.62);
  --fog-3: rgba(245, 243, 238, 0.36);
  --fog-4: rgba(245, 243, 238, 0.14);
  --accent: #5b9bf8;

  /* Logo blocks */
  --logo-1: #60a5fa;
  --logo-2: #3b82f6;
  --logo-3: #1e40af;

  /* App (focus themes + palette) */
  --bulk: #0967d2;
  --cut: #e12d39;
  --maintain: #f0b429;
  --wk: #d64545;
  --weeks: #f9703e;
  --ok: #18981d;
  --ok-bg: #e3f9e5;
  --app-blue: #47a3f3;
  --app-title: #3e4c59;
  --app-grey-9: #27241d;
  --app-grey-7: #504a40;
  --app-grey-5: #857f72;
  --app-grey-4: #a39e93;
  --app-grey-1: #e8e6e1;
  --app-grey-0: #faf9f7;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-optical-sizing: auto;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg use,
.i {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s;
}
.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Word masks (added by script) */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.1em 0.02em 0.14em;
  margin: -0.1em -0.02em -0.14em;
}
.wi {
  display: inline-block;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  padding: 12px 18px;
  font-weight: 650;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s, box-shadow 0.25s, color 0.25s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 14px 34px -12px rgba(27, 111, 229, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn--primary:hover {
  box-shadow: 0 18px 40px -12px rgba(27, 111, 229, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn--quiet {
  color: var(--ink);
  background: rgba(30, 35, 42, 0.05);
  box-shadow: inset 0 0 0 1px rgba(30, 35, 42, 0.08);
}
.btn--quiet:hover {
  background: rgba(30, 35, 42, 0.08);
}
.btn--sm {
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 13.5px;
}
.btn--lg {
  padding: 17px 26px;
  font-size: 16.5px;
  border-radius: 18px;
}

/* ── Navigation ──────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: var(--ink);
  transition: color 0.45s var(--ease);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(251, 250, 246, 0.72);
  -webkit-backdrop-filter: saturate(1.5) blur(18px);
  backdrop-filter: saturate(1.5) blur(18px);
  box-shadow: 0 1px 0 rgba(30, 35, 42, 0.06);
  opacity: 0;
  transition: opacity 0.45s var(--ease), background-color 0.45s var(--ease), box-shadow 0.45s;
}
.nav.is-compact::before {
  opacity: 1;
}
.nav[data-theme="dark"] {
  color: var(--fog);
}
.nav[data-theme="dark"]::before {
  background: rgba(11, 13, 16, 0.58);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 1240px;
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-left));
  transition: height 0.45s var(--ease);
}
.nav.is-compact .nav__inner {
  height: 52px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.03em;
}
.nav__mark {
  width: 19px;
  height: 23px;
}
.nav__bar rect {
  fill: #4b5563;
  transition: fill 0.45s var(--ease);
}
.nav[data-theme="dark"] .nav__bar rect {
  fill: #c9cdd3;
}
.nav__links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.nav__links a {
  opacity: 0.72;
  transition: opacity 0.2s;
}
.nav__links a:hover {
  opacity: 1;
}
.nav__cta {
  margin-left: 4px;
}

/* ── Shared: phone hardware ──────────────────────────────────────────── */
.phone {
  --w: 380px;
  --bz: calc(var(--w) * 0.034);
  position: relative;
  width: calc(var(--w) + 2 * var(--bz));
  padding: var(--bz);
  border-radius: calc(var(--w) * 0.168);
  background: #0b0b0c;
  box-shadow: 0 0 0 1.5px #4b4f57, 0 0 0 3px #1d1f23, 0 70px 110px -50px rgba(20, 24, 31, 0.55),
    0 30px 60px -30px rgba(20, 24, 31, 0.35);
}
.phone__screen {
  position: relative;
  aspect-ratio: 920 / 1993;
  border-radius: calc(var(--w) * 0.136);
  overflow: hidden;
  background: #fff;
}
.phone__screen img {
  width: 100%;
  height: 100%;
}
.phone::before,
.phone::after,
.device__frame::before,
.device__frame::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #3b3e45;
}
.phone::before,
.device__frame::before {
  left: -4px;
  top: 21%;
  height: 12%;
}
.phone::after,
.device__frame::after {
  right: -4px;
  top: 27%;
  height: 16%;
}

.shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}

/* ==========================================================================
   01 · HERO
   ========================================================================== */
.hero {
  position: relative;
  background: var(--paper);
}
.hero__stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 60%), var(--paper);
}
/* Scroll lengths (kept in sync with CHAPTERS in home.js, which re-applies them) */
.js .hero {
  height: 350vh;
}
.js .story {
  height: 2020vh;
}
.js .hero__stage {
  position: sticky;
  top: 0;
}
.hero__inner {
  position: absolute;
  inset: 0;
  transform-origin: 50% 40%;
}
.hero__copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  padding: 0 24px;
  text-align: center;
  transform-origin: 50% 0;
}
.js .hero__copy {
  top: 0;
  /* close to the script's first frame, so nothing jumps before it runs */
  transform: translateY(calc(46vh - 50%));
  transform: translateY(calc(46svh - 50%));
}
.js [data-split]:not(.is-split) {
  visibility: hidden;
}
.hero__title {
  max-width: 10.4ch;
  margin: 0 auto;
  font-size: clamp(48px, min(9vw, 15.5vh), 150px);
  font-weight: 750;
  line-height: 0.92;
  letter-spacing: -0.058em;
  color: var(--ink);
}
.hero__sub {
  margin-top: 0.62em;
  font-size: clamp(20px, min(2.3vw, 4.2vh), 36px);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--muted);
}
.hero__sub .accent {
  color: var(--blue);
}
.hero__details {
  display: grid;
  justify-items: center;
}
.hero__desc {
  max-width: 34em;
  margin-top: clamp(14px, 2.6vh, 26px);
  font-size: clamp(15.5px, min(1.3vw, 2.3vh), 19px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* App Store listing link (uses the real app icon) */
.store {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(18px, 3.2vh, 32px);
  padding: 10px 10px 10px 10px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(30, 35, 42, 0.07), 0 18px 40px -22px rgba(30, 35, 42, 0.35);
  text-align: left;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.store:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(30, 35, 42, 0.09), 0 22px 46px -22px rgba(30, 35, 42, 0.42);
}
.store__icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(30, 35, 42, 0.1);
}
.store__text {
  display: grid;
  gap: 2px;
  padding-right: 6px;
}
.store__text b {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.store__text span {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
}
.store__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1;
}
.store__btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__device {
  position: absolute;
  left: 50%;
  top: 100%;
  transform-origin: 50% 0;
}
.js .hero__device {
  left: 0;
  top: 0;
  opacity: 0;
}
.hero__device .phone {
  --w: min(420px, 74vw);
}

/* Load-in for the opening frame */
.js .hero__title .wi {
  transform: translateY(104%);
  opacity: 0;
  transition: transform 1.25s var(--ease), opacity 1.25s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + 120ms);
}
.js .is-ready .hero__title .wi {
  transform: none;
  opacity: 1;
}
.js .hero__in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease), box-shadow 0.3s var(--ease);
  transition-delay: var(--d, 0.5s);
}
.js .is-ready .hero__in {
  opacity: 1;
  transform: none;
}
.js .is-ready .store.hero__in:hover {
  transform: translateY(-1px);
  transition-delay: 0s;
}
.js .hero__device .phone {
  opacity: 0;
  transform: translateY(70px);
  transition: opacity 1.2s var(--ease), transform 1.5s var(--ease);
  transition-delay: 0.6s;
}
.js .is-ready .hero__device .phone {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   02–09 · THE STORY STAGE
   ========================================================================== */
.story {
  position: relative;
  background: var(--night);
  color: var(--fog);
}
.anchor {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.stage {
  position: relative;
  overflow: hidden;
  background: var(--night);
  color: var(--fog);
}
.js .story {
  margin-top: -100vh;
  z-index: 1;
}
.js .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
}
.stage__glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(52% 42% at 50% 46%, rgba(27, 111, 229, 0.16), rgba(27, 111, 229, 0) 72%);
  opacity: 0;
  pointer-events: none;
}

.stage__scrim {
  display: none;
}
.js .scene {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.js .bigcard {
  z-index: 2;
}
.js .device {
  z-index: 3;
}
.js .timeline {
  z-index: 4;
}
.will {
  will-change: transform, opacity;
}

.accent {
  color: var(--accent);
}

.display {
  font-size: clamp(40px, 6.3vw, 104px);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.052em;
  text-wrap: balance;
}
.display--md {
  font-size: clamp(30px, 4.3vw, 70px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fog-2);
}
.eyebrow__n {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(91, 155, 248, 0.14);
  color: var(--accent);
  letter-spacing: 0.06em;
}

.copy__title {
  font-size: clamp(34px, 4.3vw, 66px);
  font-weight: 720;
  line-height: 1.02;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.copy__body {
  max-width: 33ch;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.5;
  color: var(--fog-2);
  letter-spacing: -0.01em;
}
.copy > * + * {
  margin-top: 20px;
}
.copy .copy__title + .copy__body {
  margin-top: 22px;
}

/* ── 02 · Problem ─────────────────────────────────────────────────── */
.js .problem__a,
.js .problem__b,
.js .problem__c {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0 auto;
  width: min(92vw, 17ch);
  text-align: center;
  transform-origin: 50% 50%;
}
.js .problem__c {
  width: min(90vw, 19ch);
}
.goals {
  display: grid;
  gap: 4px;
}
.js .goals {
  position: absolute;
  inset: 0;
  display: block;
}
.goal {
  display: flex;
  align-items: baseline;
  gap: 16px;
  white-space: nowrap;
}
.js .goal {
  position: absolute;
  left: 0;
  top: 0;
}
.goal__name {
  font-size: clamp(30px, 4.5vw, 70px);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1;
}
.goal__note {
  font-family: var(--mono);
  font-size: clamp(11px, 0.9vw, 14px);
  letter-spacing: 0.04em;
  color: var(--fog-3);
}

/* ── 03 · Focus ───────────────────────────────────────────────────── */
.focus__lines {
  font-size: clamp(60px, 12vw, 204px);
  font-weight: 750;
  line-height: 0.95;
  letter-spacing: -0.06em;
}
.focus__line {
  display: block;
  white-space: nowrap;
}
.js .focus__line {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  transform-origin: 0 50%;
}

/* ── 04 · Timeline ────────────────────────────────────────────────── */
.copy--top {
  position: absolute;
  left: max(6vw, 28px);
  top: calc(var(--nav-h) + 5vh);
  width: min(58vw, 820px);
}
.copy__swap {
  position: relative;
}
.copy__title--alt {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--fog);
}

.timeline {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.timeline__world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
}
.timeline__cards {
  position: absolute;
  inset: 0;
}
.rail {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 243, 238, 0), rgba(245, 243, 238, 0.2) 6%, rgba(245, 243, 238, 0.2) 88%, rgba(245, 243, 238, 0));
  transform-origin: 0 50%;
}
.rail--v {
  width: 1px;
  background: linear-gradient(180deg, rgba(245, 243, 238, 0), rgba(245, 243, 238, 0.2) 6%, rgba(245, 243, 238, 0.2) 88%, rgba(245, 243, 238, 0));
  transform-origin: 50% 0;
}
.rseg {
  position: absolute;
  height: 3px;
  border-radius: 3px;
  background: var(--c);
  transform-origin: 0 50%;
}
.rseg--v {
  width: 3px;
  transform-origin: 50% 0;
}
.rseg--plan {
  height: 0;
  background: none;
  border-top: 2px dashed rgba(245, 243, 238, 0.22);
}
.rseg--plan.rseg--v {
  width: 0;
  height: auto;
  border-top: 0;
  border-left: 2px dashed rgba(245, 243, 238, 0.22);
}
.rnode {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent), 0 0 22px color-mix(in srgb, var(--c) 55%, transparent);
}
.rnode--plan {
  background: var(--night);
  box-shadow: inset 0 0 0 2px rgba(245, 243, 238, 0.3);
}
.rmonth {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fog-3);
  white-space: nowrap;
}
.rmonth::before {
  content: "";
  position: absolute;
  left: 0;
  top: -12px;
  width: 1px;
  height: 7px;
  background: rgba(245, 243, 238, 0.24);
}

/* Block card (the object that travels through the story) */
.bcard {
  --c: var(--bulk);
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw, 300px);
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: #fff;
  color: #1f2933;
  transform-origin: 50% 50%;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.bcard[data-focus="cut"] {
  --c: var(--cut);
}
.bcard[data-focus="maintain"] {
  --c: var(--maintain);
}
.bcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-grey-5);
}
.bcard__status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.08em;
}
.bcard__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent);
}
.bcard__status .done {
  display: none;
  align-items: center;
  gap: 5px;
  color: var(--ok);
}
.bcard__status .done svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}
.bcard.is-done .bcard__status .run {
  display: none;
}
.bcard.is-done .bcard__status .done {
  display: inline-flex;
}
.bcard__status .run {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bcard__name {
  margin-top: 14px;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #1f2933;
}
.bcard__goal {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--app-grey-5);
}
.bcard__pills {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
}
.pill svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}
.pill--focus,
.pill--bulk {
  font-weight: 700;
  background: var(--c, var(--bulk));
}
.pill--weeks {
  background: var(--weeks);
}
.bcard__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.bar {
  display: flex;
  flex: 1;
  gap: 4px;
}
.bar > span {
  position: relative;
  flex: 1;
  height: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: #ece9e2;
}
.bar > span > i {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.bcard__wk {
  font-family: var(--mono);
  font-size: 12px;
  color: #3e4c59;
  white-space: nowrap;
  min-width: 8.4ch;
  text-align: right;
}
.bcard__metrics {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #efece6;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--app-grey-5);
}
.bcard__metrics span {
  display: grid;
  gap: 2px;
}
.bcard__metrics b {
  font-size: 14px;
  color: #1f2933;
}
.bcard__metrics b.up {
  color: var(--ok);
}

.bcard--plan {
  background: transparent;
  color: var(--fog-2);
  box-shadow: inset 0 0 0 1.5px rgba(245, 243, 238, 0.16);
}
.bcard--plan .bcard__top,
.bcard--plan .bcard__goal {
  color: var(--fog-3);
}
.bcard--plan .bcard__name {
  color: var(--fog-2);
}
.bcard--plan .bar > span {
  background: rgba(245, 243, 238, 0.08);
}

.curve {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
}
.curve__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.curve__next {
  fill: none;
  stroke: rgba(245, 243, 238, 0.35);
  stroke-width: 3;
  stroke-dasharray: 2 14;
  stroke-linecap: round;
}
.curve__area {
  fill: url(#curve-fill);
}
.curve__text {
  fill: var(--fog-2);
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.08em;
}

/* ── 05–07 · Copy beside the device ───────────────────────────────── */
.copy--side {
  position: absolute;
  left: max(7vw, 32px);
  top: 0;
  bottom: 0;
  width: min(38vw, 520px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.js .scene.copy--side {
  left: max(7vw, 32px);
  right: auto;
  width: min(38vw, 520px);
}

.ledger {
  display: grid;
  gap: 2px;
  margin-top: 12px !important;
  font-family: var(--mono);
}
.ledger__name {
  margin-top: 34px !important;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-2);
}
.ledger__row {
  display: grid;
  grid-template-columns: 5.2ch 1fr auto 6ch 22px;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(245, 243, 238, 0.08);
}
.ledger__set {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-3);
}
.ledger__load {
  font-size: clamp(20px, 1.9vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fog);
}
.ledger__load small {
  font-size: 0.55em;
  font-weight: 400;
  color: var(--fog-3);
}
.ledger__rpe {
  font-size: 12px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(71, 163, 243, 0.16);
  color: #7cc4fa;
}
.ledger__delta {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: #7ed787;
  text-align: right;
}
.ledger__check {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #51ca58;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}
.ledger__done {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px !important;
  font-family: var(--mono);
  font-size: 13px;
  color: #7ed787;
}
.ledger__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #51ca58;
  box-shadow: 0 0 0 4px rgba(81, 202, 88, 0.18);
}

.metric {
  margin-top: 36px !important;
}
.metric__label,
.metric-row dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-3);
}
.metric__value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(44px, 5vw, 80px);
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--fog);
  font-variant-numeric: tabular-nums;
}
.metric__value small {
  font-size: 0.3em;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--fog-3);
}
.metric__weeks {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fog-3);
}
.metric__weeks li {
  display: grid;
  gap: 3px;
}
.metric__weeks b {
  font-size: 15px;
  color: var(--fog-2);
  font-weight: 400;
}
.metric__weeks li.is-on b {
  color: #7ed787;
}
.metric-row {
  display: flex;
  gap: 36px;
  margin-top: 28px !important;
  padding-top: 20px;
  border-top: 1px solid rgba(245, 243, 238, 0.08);
}
.metric-row dd {
  margin-top: 6px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 22px;
  color: var(--fog);
}
.metric-row dd small {
  font-size: 12px;
  font-weight: 400;
  color: var(--fog-3);
}

/* ── The story device ─────────────────────────────────────────────── */
.device {
  --w: 360px;
  --h: 783px;
  --bz: 12px;
  --R: 60px;
  --r: 49px;
  --s: 0.923;
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--w) + 2 * var(--bz));
  height: calc(var(--h) + 2 * var(--bz));
  transform-origin: 0 0;
  pointer-events: none;
}
.device__frame {
  position: absolute;
  inset: 0;
  border-radius: var(--R);
  background: #0a0a0b;
  box-shadow: 0 0 0 1.5px #5b5f68, 0 0 0 3px #1b1d21, 0 60px 120px -40px rgba(0, 0, 0, 0.8);
}
.device__screen {
  position: absolute;
  left: var(--bz);
  top: var(--bz);
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  border-radius: var(--r);
  background: #fff;
  isolation: isolate;
}

/* Real screenshots, positioned in % of the 920 × 1993 screen crop */
.shot {
  position: absolute;
  inset: 0;
}
.shot__img {
  position: absolute;
  inset: 0;
  background-color: #fff;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.shot__cover {
  position: absolute;
  background: #fff;
}
/* Active session: the two sets are added one at a time.
   Geometry is in % of the 920 × 1993 screenshot. */
.shot__cover--rows {
  left: 4.674%;
  width: 90.543%;
  top: 52.183%;
  height: 9.132%;
}
.shot__cover--below {
  left: 0;
  width: 100%;
  top: 61.315%;
  height: 30.205%;
}
.shot__lower {
  background-color: transparent;
  clip-path: inset(61.315% 0 8.48% 0);
}
.shot__hl {
  position: absolute;
  left: 4.674%;
  width: 90.543%;
  top: 64.024%;
  height: 5.018%;
  background: rgba(9, 103, 210, 0.1);
  opacity: 0;
}
.shot__tap {
  position: absolute;
  left: 46.739%;
  top: 64.526%;
  width: 8.696%;
  height: 4.014%;
  border-radius: 50%;
  background: rgba(30, 35, 42, 0.22);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
  opacity: 0;
}
.shot__row {
  background-color: transparent;
}
.shot__row--1 {
  clip-path: inset(52.584% 4.565% 42.9% 4.565%);
}
.shot__row--2 {
  clip-path: inset(57.3% 4.565% 38.685% 4.565%);
}
/* covers hide each value until it is "typed" */
.sc {
  position: absolute;
  top: 54.792%;
  height: 1.505%;
  background: #e7f4e7;
}
.shot__row--2 .sc {
  top: 58.856%;
}
.sc--wt {
  left: 25.87%;
  width: 6.739%;
}
.sc--rp {
  left: 54.348%;
  width: 2.609%;
}
.sc--pc {
  left: 75%;
  width: 14.783%;
  background: #e6fae9;
}
/* the RPE chip sits half above its row: white above, the row's two cell shades below */
.sc--bd,
.shot__row--2 .sc--bd {
  left: 64.457%;
  width: 6.739%;
  top: 52.584%;
  height: 2.609%;
  background: linear-gradient(180deg, #fff 0 50%, transparent 50%), linear-gradient(90deg, #e7f4e7 0 30.6%, #e6fae9 30.6%);
}
.shot__row--2 .sc--bd {
  top: 56.95%;
  height: 2.307%;
  background: linear-gradient(180deg, #fff 0 43.5%, transparent 43.5%), linear-gradient(90deg, #e7f4e7 0 30.6%, #e6fae9 30.6%);
}
.sc--notch {
  left: 64.239%;
  width: 7.174%;
  top: 56.548%;
  height: 0.75%;
  background: #e6fae9;
}
.shot__badge {
  background-color: transparent;
}
.shot__badge--1 {
  clip-path: inset(52.735% 29.13% 44.907% 64.674% round 1% / 0.46%);
  transform-origin: 67.772% 53.914%;
}
.shot__badge--2 {
  clip-path: inset(56.749% 29.13% 40.893% 64.674% round 1% / 0.46%);
  transform-origin: 67.772% 57.978%;
}
.shot__finish {
  background-color: transparent;
  clip-path: inset(93.527% 6.087% 1.355% 25% round 2.39% / 1.1%);
  transform-origin: 59.457% 96.086%;
}
.shot__dim {
  position: absolute;
  inset: 0;
  background: #141414;
  opacity: 0;
}
/* The exercise card's surface, which grows into the exercise sheet */
.shot__surface {
  position: absolute;
  inset: 0;
  background: #fff;
}
.shot__card {
  background-color: transparent;
  clip-path: inset(31.36% 4.565% 30.908% 4.457% round 1.304% / 0.602%);
}
.shot__wrap {
  position: absolute;
  inset: 0;
}
.shot__modal {
  background-color: transparent;
  clip-path: inset(12.393% 2.391% 12.393% 2.5% round 2.609% / 1.204%);
}
.device__wash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}
.shot__plot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.plot__cover {
  fill: #fff;
}
.plot__area {
  fill: #b0d0ff;
}
.plot__dots circle {
  fill: #88b1fc;
}
.plot__head {
  fill: #3b82f6;
  stroke: #fff;
  stroke-width: 3;
}
.plot__halo {
  fill: rgba(59, 130, 246, 0.2);
}

.toast {
  position: absolute;
  left: 50%;
  top: 40%;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 64%;
  padding: 22px 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-family: var(--mono);
  color: var(--app-grey-7);
  text-align: center;
  transform: translate(-50%, -50%);
}
.toast__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--ok-bg);
}
.toast__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ok);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}
.toast b {
  font-size: 14px;
  color: #1f2933;
}
.toast span:last-child {
  font-size: 11px;
  color: var(--app-grey-5);
}

/* ── Live app screen: the current Trayne home screen at 393 × 852 pt ── */
.app {
  --card: #27241d;
  --card-2: #413f38;
  --card-line: #37342e;
  --card-k: #b8b2a7;
  position: absolute;
  left: 0;
  top: 0;
  width: 393px;
  height: 852px;
  overflow: hidden;
  background: #fff;
  color: var(--app-grey-9);
  font-family: var(--mono);
  line-height: 1.15;
  transform: scale(var(--s));
  transform-origin: 0 0;
}
.app svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app__status {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 54px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  color: #111;
}
.app__time {
  position: absolute;
  left: 54px;
  top: 21px;
  letter-spacing: -0.01em;
}
.app__island {
  position: absolute;
  left: 135.5px;
  top: 12px;
  width: 122px;
  height: 35px;
  border-radius: 18px;
  background: #000;
}
.app__sys {
  position: absolute;
  right: 35px;
  top: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.app__dots {
  width: 19px;
  height: 3px;
  background: radial-gradient(circle, #9a9a9a 1.4px, transparent 1.6px) 0 0 / 4.75px 3px repeat-x;
}
.app__sys svg {
  width: 17px;
  height: 12px;
  fill: #111;
  stroke: none;
}
.app__battery {
  position: relative;
  width: 26px;
  height: 12.5px;
  border-radius: 4px;
  border: 1.2px solid rgba(0, 0, 0, 0.45);
}
.app__battery::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  border-radius: 2px;
  background: #111;
}

/* Block header card */
.ablock {
  position: absolute;
  left: 20.5px;
  top: 74px;
  width: 352px;
  height: 277px;
  padding: 17.5px 15.5px 0;
  border-radius: 20px;
  background: var(--card);
  color: #faf9f7;
}
.ablock__top {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 24px;
}
.apill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 7px;
  border-radius: 4px;
  background: var(--bulk);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
}
.apill svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}
.ablock__wks {
  font-size: 13.5px;
  color: #d3cec4;
}
.ablock__more {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #d3cec4;
}
.ablock__name {
  margin-top: 15px;
  font-weight: 700;
  font-size: 21.5px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.ablock__sub {
  margin-top: 7.5px;
  font-size: 11px;
  color: #b8b2a7;
}
.ablock__prog {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 16.5px;
}
.ablock__k {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--card-k);
}
.ablock__wk {
  font-size: 14.5px;
  color: #b8b2a7;
}
.ablock__wk b {
  color: #fff;
}
.ablock__bar {
  position: relative;
  height: 5.5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--card-2);
}
.ablock__bar {
  margin-top: 9px;
}
.ablock__bar i {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: #2186eb;
  transform: scaleX(0.6667);
  transform-origin: 0 50%;
}
.ablock__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 13.5px;
  padding-top: 17.5px;
  border-top: 1px solid var(--card-line);
}
.ablock__stat {
  position: relative;
  padding-right: 13px;
}
.ablock__stat + .ablock__stat {
  padding: 0 0 0 13px;
  border-left: 1px solid #423f3a;
}
.ablock__plus {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin: -6px 0;
  border-radius: 50%;
  background: var(--card-2);
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}
.ablock__info {
  width: 17px;
  height: 17px;
  margin: -4px 0;
  color: #47a3f3;
  stroke-width: 1.8 !important;
}
.ablock__v {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 4px;
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.01em;
  color: #fff;
}
.ablock__v small {
  font-weight: 400;
  font-size: 11.5px;
  color: #b8b2a7;
}
.ablock__v em {
  margin-left: 4px;
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  color: #51ca58;
}
.ablock__d {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-weight: 700;
  font-size: 11px;
  color: #e8e6e1;
  white-space: nowrap;
}
.ablock__d svg {
  width: 13px;
  height: 13px;
  color: #51ca58;
}
.ablock__m {
  margin-top: 5.5px;
  font-size: 11px;
  color: #b8b2a7;
  white-space: nowrap;
}
.fbar {
  position: relative;
  height: 4px;
  margin: 10.5px 0 9px;
  border-radius: 2px;
  background: linear-gradient(90deg, #554826 0%, #554826 55%, #553524 100%);
}
.fbar__ok {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: 2px;
  background: #51ca58;
  transform-origin: 0 50%;
}
.fbar__knob {
  position: absolute;
  left: 38%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--card);
}
.fbar + .ablock__m {
  margin-top: 0;
}
.fbar__mark {
  position: absolute;
  left: 90%;
  top: -3.5px;
  width: 1.5px;
  height: 11px;
  background: #ccc1bf;
}

.app__h {
  position: absolute;
  left: 23px;
  top: 384px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: #3e4c59;
}
.app__h svg {
  width: 16px;
  height: 16px;
}

/* Goal tracker */
.agoal {
  position: absolute;
  left: 20.5px;
  top: 428px;
  width: 352px;
  height: 310px;
  padding: 18px 13px 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1.3px #bfddf8;
}
.agoal__h {
  display: flex;
  align-items: center;
  gap: 10px;
}
.agoal__h b {
  display: block;
  font-family: var(--sans);
  font-weight: 650;
  font-size: 18.5px;
  line-height: 1.1;
  color: #423d33;
}
.agoal__h small {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: #2186eb;
  white-space: nowrap;
}
.agoal__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  background: #bae3ff;
  color: #0552b5;
}
.agoal__icon svg {
  width: 17px;
  height: 17px;
}
.agoal__info {
  width: 17px;
  height: 17px;
  margin: 0 0 0 auto;
  flex: none;
  color: #47a3f3;
  stroke-width: 1.8 !important;
}
.agoal__rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #857f72;
}
.achip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--ok-bg);
  color: #0e7817;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.achip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31b237;
}
.agoal__val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 0;
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ok);
}
.agoal__val small {
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: #8a8a8a;
}
.agoal__note {
  margin-top: 11px;
  font-size: 10.5px;
  color: #504a40;
}
.gauge {
  position: relative;
  height: 8.5px;
  margin: 32px 14px 0;
  border-radius: 9px;
  background: #e8e6e1;
}
.gauge__band {
  position: absolute;
  left: 58.33%;
  width: 8.33%;
  top: -0.5px;
  bottom: -0.5px;
  border-radius: 9px;
  background: #84c5f4;
  box-shadow: 0 0 0 1.3px #2186eb;
}
.gauge__zero {
  position: absolute;
  left: 50%;
  top: -7px;
  width: 1.5px;
  height: 17px;
  background: #857f72;
}
.gauge__mark {
  position: absolute;
  left: 62.67%;
  top: -3px;
  width: 14.5px;
  height: 14.5px;
  margin-left: -7.25px;
  border-radius: 50%;
  border: 2.5px solid #18981d;
  background: #fff;
}
.gauge__mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -11px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 6px solid #18981d;
}
.gauge__ticks {
  display: flex;
  justify-content: space-between;
  margin: 7px 0 0;
  font-family: var(--sans);
  font-size: 10px;
  color: #8a8a8a;
}
.agoal__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 18px;
}
.agoal__tiles > div {
  display: grid;
  gap: 4px;
  padding: 11px 10px;
  border-radius: 9px;
  background: #faf9f7;
  box-shadow: inset 0 0 0 1px #efece6;
}
.agoal__tiles span {
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #857f72;
}
.agoal__tiles b {
  font-size: 17px;
  color: #504a40;
}
.agoal__tiles b small {
  font-size: 10px;
  font-weight: 400;
  color: #a39e93;
}
.agoal__tiles b.up {
  font-size: 19px;
  color: #18981d;
}
.agoal__tiles em {
  margin-top: 4px;
  font-style: normal;
  font-size: 10px;
  color: #3f9142;
}

.app__start {
  position: absolute;
  left: 149px;
  top: 700.5px;
  width: 170px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 23px;
  background: var(--bulk);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 10px 22px -8px rgba(9, 103, 210, 0.6);
}
.app__start svg,
.app__start svg use {
  width: 22px;
  height: 12px;
  fill: #fff;
  stroke: none;
}
.app__hist {
  position: absolute;
  left: 326.5px;
  top: 700.5px;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 6px 16px rgba(0, 0, 0, 0.12);
  color: #423d33;
}
.app__hist svg {
  width: 20px;
  height: 20px;
}
.app__tabs {
  position: absolute;
  left: 0;
  right: 0;
  top: 771.5px;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  padding-top: 7px;
  border-top: 1px solid #eee;
  background: #fff;
  font-family: var(--sans);
  font-size: 12.5px;
  color: #8a8a8a;
}
.app__tab {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
}
.app__tab svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.7;
}
.app__tab--pro {
  color: #c76108;
}
.app__tab--pro svg {
  color: #f0b429;
}
.app__tab--center i {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  margin-top: -20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #7cc4fa, 0 6px 18px rgba(71, 163, 243, 0.45);
}
.app__tab--center svg {
  width: 24px;
  height: 29px;
  stroke: none;
}
.app__tab--center svg use {
  stroke: none;
}
.app__dim {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
}

/* ── 08 · Progress ────────────────────────────────────────────────── */
.copy--center {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--nav-h) + 4.5vh);
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 0 24px;
}
.copy--center .copy__title {
  font-size: clamp(30px, 3.6vw, 56px);
}
.js .progress__done {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  font-size: clamp(44px, 7vw, 120px);
}

.bigcard {
  --c: var(--bulk);
  position: absolute;
  left: 0;
  top: 0;
  width: var(--bw, 720px);
  border-radius: 28px;
  background: #fff;
  color: #1f2933;
  transform-origin: 0 0;
}
.bigcard__in {
  padding: 30px 32px 28px;
}
.bigcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mono-k {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--app-grey-5);
}
.status {
  position: relative;
  display: inline-grid;
  font-family: var(--mono);
  font-size: 12px;
}
.status > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 99px;
  white-space: nowrap;
}
.status__run {
  background: #e6f6ff;
  color: #03449e;
}
.status__run i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bulk);
}
.status__done {
  background: var(--ok-bg);
  color: #0e7817;
  font-weight: 700;
  opacity: 0;
}
.status__done svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}
.bigcard__title {
  margin-top: 14px;
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 720;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.bigcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 14px;
}
.bigcard__target {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bulk);
  margin-left: 4px;
}
.weeks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #efece6;
}
.week {
  display: grid;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--app-grey-5);
}
.week__bar {
  position: relative;
  height: 54px;
  overflow: hidden;
  border-radius: 9px;
  background: #f1efea;
}
.week__bar i {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #2186eb, var(--bulk));
  transform: scaleY(0);
  transform-origin: 50% 100%;
}
.week.is-on {
  color: #1f2933;
}
.bigcard__tiles {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.btile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 108px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #ece9e2;
}
.btile b {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: -0.03em;
  color: #1f2933;
  font-variant-numeric: tabular-nums;
}
.btile b small {
  font-size: 12px;
  font-weight: 400;
  color: var(--app-grey-4);
}
.btile--chart b {
  color: var(--ok);
}
.btile__sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--app-grey-5);
}
.spark {
  width: 100%;
  height: 40px;
  overflow: visible;
}
.spark__line {
  fill: none;
  stroke: #1d4ed8;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.spark__area {
  fill: rgba(29, 78, 216, 0.1);
}

/* ── 09 · Compound ────────────────────────────────────────────────── */
.js .compound__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0 auto;
  width: min(92vw, 20ch);
  text-align: center;
  font-size: clamp(38px, 5.6vw, 96px);
}

/* ==========================================================================
   10 · CTA
   ========================================================================== */
.cta {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px 24px 80px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}
.js .cta {
  margin-top: -100vh;
  border-radius: 32px 32px 0 0;
}
.cta__inner {
  display: grid;
  justify-items: center;
}
.cta__mark {
  width: 46px;
  height: auto;
  overflow: visible;
}
.cta__lead {
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.cta__title {
  margin-top: 18px;
  font-size: clamp(52px, 9vw, 150px);
  font-weight: 750;
  letter-spacing: -0.058em;
  line-height: 0.95;
}
.cta__sub {
  margin-top: 12px;
  font-size: clamp(24px, 3.2vw, 48px);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--blue);
}
.loop {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.loop li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loop li + li::before {
  content: "→";
  color: rgba(30, 35, 42, 0.28);
}
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}
.cta__note {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.cta__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 15px;
}
.cta__url {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--blue);
}

.footer {
  position: relative;
  z-index: 2;
  background: var(--paper);
  border-top: 1px solid rgba(30, 35, 42, 0.07);
  font-size: 13px;
  color: var(--muted);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px calc(30px + env(safe-area-inset-bottom));
}
.footer nav {
  display: flex;
  gap: 20px;
}
.footer a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Mobile / portrait composition
   (kept in sync with the matchMedia query in home.js)
   ========================================================================== */
@media (max-width: 759px), (max-aspect-ratio: 4/5) {
  :root {
    --nav-h: 56px;
  }
  .nav__links {
    gap: 0;
  }
  .nav__links a {
    font-size: 13px;
  }
  .nav__inner {
    gap: 14px;
    padding: 0 18px;
  }
  .hero__title {
    font-size: clamp(44px, min(14.2vw, 7.4vh), 120px);
    max-width: 8.2ch;
  }
  .hero__sub {
    font-size: clamp(18px, 5.2vw, 30px);
  }
  .hero__desc {
    font-size: clamp(14.5px, 3.9vw, 18px);
    max-width: 30em;
  }
  .store {
    gap: 12px;
    padding: 8px;
    border-radius: 20px;
  }
  .store__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
  .store__text b {
    font-size: 15px;
  }
  .store__text span {
    font-size: 10.5px;
  }
  .store__btn {
    padding: 11px 13px;
    font-size: 13.5px;
  }

  .display {
    font-size: clamp(36px, 10.6vw, 80px);
  }
  .display--md {
    font-size: clamp(28px, 8vw, 56px);
  }
  .goal__name {
    font-size: clamp(28px, 9.4vw, 60px);
  }
  .goal__note {
    font-size: 11px;
  }
  .focus__lines {
    font-size: clamp(48px, 13.6vw, 120px);
  }
  .js .stage__scrim {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: var(--scrim, 40vh);
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(180deg, var(--night) 0%, var(--night) 72%, rgba(11, 13, 16, 0) 100%);
    opacity: 0;
  }

  .copy--top {
    left: 22px;
    right: 22px;
    width: auto;
    top: calc(var(--nav-h) + 3vh);
  }
  .copy__title {
    font-size: clamp(30px, 8.6vw, 52px);
  }
  .copy--side,
  .js .scene.copy--side {
    left: 22px;
    right: 22px;
    width: auto;
    top: calc(var(--nav-h) + 2.5vh);
    bottom: auto;
    justify-content: flex-start;
  }
  .copy--side .copy__body {
    font-size: 15px;
    margin-top: 12px !important;
  }
  .train .copy__body,
  .track .copy__body {
    display: none;
  }
  .copy > * + * {
    margin-top: 12px;
  }
  .ledger,
  .ledger__name,
  .metric-row {
    display: none;
  }
  .ledger__done {
    display: none;
  }
  .metric {
    margin-top: 16px !important;
  }
  .metric__value {
    font-size: 34px;
  }
  .metric__weeks {
    display: none;
  }
  .copy--center .copy__title {
    font-size: clamp(26px, 7.4vw, 44px);
  }
  .bigcard__in {
    padding: 20px 18px 18px;
  }
  .bigcard__target {
    display: none;
  }
  .weeks {
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
  }
  .week__bar {
    height: 40px;
  }
  .week span {
    font-size: 0;
  }
  .week span::after {
    content: attr(data-s);
    font-size: 10px;
  }
  .bigcard__tiles {
    grid-template-columns: 1fr 1fr;
  }
  .btile--chart {
    grid-column: 1 / -1;
  }
  .btile {
    min-height: 0;
  }
  .btile b {
    font-size: 20px;
  }
  .compound__line {
    font-size: clamp(32px, 9.4vw, 64px) !important;
  }
  .cta__actions {
    flex-direction: column;
    width: 100%;
    max-width: 340px;
  }
  .loop {
    max-width: 320px;
  }
}

@media (max-width: 380px) {
  .nav__cta {
    padding: 8px 11px;
    font-size: 12.5px;
  }
  .nav__inner {
    gap: 10px;
    padding: 0 14px;
  }
  .nav__links a {
    font-size: 12.5px;
  }
  .store__btn {
    padding: 11px 11px;
  }
}

/* ==========================================================================
   No-JS fallback: the story reads top-to-bottom as plain sections
   ========================================================================== */
.no-js .story {
  padding: 18vh 24px;
}
.no-js .stage {
  display: grid;
  gap: 16vh;
  max-width: 900px;
  margin: 0 auto;
}
.no-js .scene {
  display: grid;
  gap: 24px;
  text-align: center;
  justify-items: center;
}
.no-js .timeline,
.no-js .device,
.no-js .bigcard,
.no-js .shade,
.no-js .stage__glow,
.no-js .copy__title--alt {
  display: none;
}
.no-js .focus__line {
  white-space: normal;
  font-size: 0.72em;
}
.no-js .hero__stage {
  display: grid;
  place-items: center;
  height: auto;
  padding: 18vh 24px 10vh;
}
.no-js .hero__inner {
  position: static;
  display: grid;
  justify-items: center;
  gap: 8vh;
}
.no-js .hero__copy,
.no-js .hero__device {
  position: static;
}
.no-js .copy--top,
.no-js .copy--side,
.no-js .copy--center {
  position: static;
  width: auto;
  display: grid;
  justify-items: center;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .hero__title .wi {
    transform: none;
    transition: opacity 0.6s;
    transition-delay: 0s;
  }
  .js .hero__in,
  .js .hero__device .phone {
    transform: none;
  }
  .btn,
  .btn:hover,
  .btn:active {
    transform: none;
  }
}
