/* Carryover launch site. Palette, type and layout follow docs/site/BRIEF.md. */

:root {
  color-scheme: light dark;
  --paper: #f4f1ea;
  --paper-deep: #ebe6db;
  --sheet: #ffffff;
  --ink: #1b2422;
  --ink-soft: #55605c;
  --ink-faint: #858d89;
  --rule: #dcd6c9;
  --teal: #0b7268;
  --teal-deep: #08564f;
  --teal-soft: #dcefeb;
  --on-teal: #ffffff;
  --amber: #8a5300;
  --amber-soft: #fbefd8;
  --struck: #a14b3f;
  --focus: #2f6fde;
  --shadow-sheet: 0 1px 2px rgb(27 36 34 / 0.06), 0 12px 32px -8px rgb(27 36 34 / 0.18), 0 40px 80px -24px rgb(11 114 104 / 0.18);
  --dot: rgb(27 36 34 / 0.06);

  --serif: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: max(16px, 4vw);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1413;
    --paper-deep: #151b1a;
    --sheet: #fbfaf7;
    --ink: #e8ecea;
    --ink-soft: #a6b0ac;
    --ink-faint: #7c8783;
    --rule: #26302e;
    --teal: #4fc4b4;
    --teal-deep: #6ed3c5;
    --teal-soft: #163a35;
    --on-teal: #06201c;
    --amber: #f2b766;
    --amber-soft: #36280f;
    --struck: #f0796d;
    --focus: #7aa7ff;
    --shadow-sheet: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px -8px rgb(0 0 0 / 0.55), 0 40px 90px -30px rgb(79 196 180 / 0.18);
    --dot: rgb(232 236 234 / 0.06);
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: calc(1240px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--teal);
  color: var(--on-teal);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.display {
  font-family: var(--serif);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  color: var(--teal);
}

.h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
}

.h1-size,
.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.soft {
  color: var(--ink-soft);
}

.small {
  font-size: 0.875rem;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--teal);
  color: var(--on-teal);
}

.btn--primary:hover {
  background: var(--teal-deep);
}

.btn--ghost {
  border-color: var(--rule);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--paper-deep);
}

.btn--sm {
  padding: 0 16px;
  font-size: 0.9375rem;
}

.btn--lg {
  height: 52px;
}

.btn--xl {
  height: 56px;
  padding: 0 26px;
}

.arrow {
  display: inline-block;
  transition: transform 180ms ease;
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.nav[data-scrolled] {
  border-bottom-color: var(--rule);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.mark {
  flex: none;
  display: block;
}

.logo__word {
  font: 600 1.375rem/1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.nav__link:hover {
  color: var(--ink);
}

@media (max-width: 40rem) {
  .nav__link {
    display: none;
  }
}

/* ---------- The printed sheet ---------- */

.sheet {
  /* Anything on the sheet uses the light values, whatever the theme. */
  --ink: #1b2422;
  --ink-soft: #55605c;
  --rule: #dcd6c9;
  --teal: #0b7268;
  --teal-soft: #dcefeb;
  --amber: #8a5300;
  --amber-soft: #fbefd8;
  --struck: #a14b3f;
  --fs: clamp(9px, 2.6cqi, 13px);
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  padding: 6% 7%;
  border-radius: 3px;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: var(--shadow-sheet);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}

.sheet--tiny {
  --fs: 2.6cqi;
}

.sheet > * {
  font-size: calc(var(--fs) * var(--k, 1));
}

.sheet__clinic {
  --k: 0.72;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  color: var(--ink-soft);
}

.sheet__clinic b {
  color: var(--ink);
  font-weight: 600;
}

.sheet__eyebrow {
  --k: 0.72;
  margin-top: 1.2em;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sheet__who {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  margin: 0.25em 0 0.5em;
}

.sheet__name {
  font: 600 2.1em/1.1 var(--serif);
  letter-spacing: -0.02em;
}

.sheet__date {
  display: grid;
  justify-items: end;
  color: var(--ink-soft);
  font-size: 0.9em;
}

.sheet__date > span {
  grid-area: 1 / 1;
}

.sheet__list {
  display: grid;
  gap: 0.45em;
  padding: 0.8em 0 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.ex {
  display: grid;
  grid-template-columns: 1.5em minmax(0, 1fr);
  gap: 0.6em;
}

.ex__num {
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 1em;
  font-weight: 600;
  line-height: 1;
}

.ex__name {
  position: relative;
  font-weight: 600;
  line-height: 1.2;
}

.ex__steps {
  margin-top: 0.2em;
  padding-left: 1.2em;
  color: var(--ink-soft);
  font-size: 0.74em;
  line-height: 1.28;
}

.ex__steps li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex__dose {
  margin-top: 0.25em;
  font-weight: 600;
  line-height: 1.3;
}

.ex__freq {
  color: var(--ink-soft);
  font-size: 0.85em;
  line-height: 1.25;
}

.tag {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.12em 0.6em;
  border-radius: 99px;
  font-size: 0.68em;
  font-weight: 600;
  line-height: 1.3;
  vertical-align: 0.12em;
}

.tag--new {
  background: var(--teal-soft);
  color: var(--teal);
}

.tag--updated {
  background: var(--amber-soft);
  color: var(--amber);
}

.sheet__stopped {
  --k: 0.9;
  margin-top: 0.7em;
  color: var(--struck);
  font-style: italic;
}

.sheet__foot {
  --k: 0.72;
  margin-top: auto;
  padding-top: 0.8em;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  line-height: 1.35;
}

/* The Changes panel mirrors the app's, always on white. */
.changes {
  --ink: #1b2422;
  --ink-soft: #55605c;
  --teal: #0b7268;
  --amber: #8a5300;
  --struck: #a14b3f;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 0.9375rem;
  box-shadow: 0 1px 2px rgb(27 36 34 / 0.05), 0 8px 20px -6px rgb(27 36 34 / 0.14);
}

.changes__title {
  margin-bottom: 8px;
  font-weight: 600;
}

.changes ul {
  display: grid;
  gap: 4px;
  padding: 0;
  list-style: none;
}

.changes__row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot--updated {
  background: var(--amber);
}

.dot--new {
  background: var(--teal);
}

.dot--stopped {
  background: var(--struck);
}

.magnet {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #22a395, #0b7268 60%, #075048);
  box-shadow: 0 6px 10px -2px rgb(0 0 0 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.35);
}

/* ---------- Act 1: Hero ---------- */

.hero {
  display: grid;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 72px;
}

.lead {
  max-width: 34rem;
  margin: 24px 0 32px;
  color: var(--ink-soft);
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 30rem) {
  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.meta svg {
  flex: none;
}

.hero__stage {
  width: 92vw;
  height: calc(92vw * 1.2 * 0.7);
  margin-inline: calc(50% - 46vw);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}

.stack {
  --sy: 0;
  --mx: 0;
  --my: 0;
  --rot: 1.5;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.2;
  transform: perspective(1400px) rotateX(calc(var(--my) * -3deg)) rotateY(calc(var(--mx) * 3deg));
}

.plane {
  position: absolute;
}

.plane--desk {
  inset: 6% 0 0 2%;
}

.desk {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: radial-gradient(var(--dot) 1px, transparent 1.5px) 0 0 / 18px 18px, var(--paper-deep);
}

.plane--back {
  left: 11%;
  top: 4%;
  width: 74%;
}

.plane--front {
  left: 18%;
  top: 8%;
  width: 74%;
}

.plane--magnet {
  left: 55%;
  top: 8%;
  width: 44px;
  height: 44px;
  margin: -24px 0 0 -22px;
}

.plane--back .layer {
  transform: translate(calc(var(--mx) * 2px), calc(var(--sy) * 0.04px + var(--my) * 2px)) rotate(-4deg);
}

.plane--front .layer {
  transform: translate(calc(var(--mx) * 5px), calc(var(--sy) * -0.08px + var(--my) * 5px)) rotate(calc(var(--rot) * 1deg));
}

.plane--magnet .layer {
  transform: translate(calc(var(--mx) * 9px), calc(var(--sy) * -0.14px + var(--my) * 9px));
}

.sheet--back {
  filter: brightness(0.96);
}

@media (prefers-color-scheme: dark) {
  .sheet--back {
    filter: none;
  }
}

@media (min-width: 64rem) {
  .hero {
    grid-template-columns: 5fr 6fr;
    align-items: center;
    gap: 56px;
    min-height: min(100svh, 860px);
    padding-top: 96px;
  }

  .hero__stage {
    width: 100%;
    max-width: 640px;
    height: auto;
    margin: 0;
    justify-self: end;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- Act 2: How it works ---------- */

.how {
  padding: 80px 0;
}

.how__intro .soft {
  max-width: 30rem;
  margin-top: 20px;
}

.steps {
  margin-top: 48px;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  gap: 24px;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}

.step__num {
  display: block;
  color: var(--teal);
  font: 500 44px/1 var(--serif);
}

.step h3 {
  margin: 14px 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.step p {
  color: var(--ink-soft);
}

.vig {
  align-self: center;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper-deep);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 11px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}

.chip--on {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--on-teal);
}

.lib {
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.lib li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  font-weight: 500;
}

.lib__added {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
}

.lib__add,
.fake-btn {
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--teal);
  color: var(--on-teal);
  font-size: 0.8125rem;
  font-weight: 600;
}

.fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field__label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field__box {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.field__box--live {
  border-color: var(--teal);
}

.printed {
  margin-top: 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.printed__arrow {
  color: var(--teal);
}

.vig--print {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.thumb {
  width: 140px;
}

.thumb .sheet {
  box-shadow: 0 1px 2px rgb(27 36 34 / 0.08), 0 8px 18px -6px rgb(27 36 34 / 0.2);
}

@media (min-width: 48rem) {
  .step {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
  }
}

@media (min-width: 64rem) {
  .how {
    padding: 128px 0;
  }

  .how__grid {
    display: grid;
    grid-template-columns: 4fr 7fr;
    gap: 64px;
    align-items: start;
  }

  .how__intro {
    position: sticky;
    top: 120px;
  }

  .steps {
    margin-top: 0;
  }

  .step:first-child {
    padding-top: 8px;
    border-top: 0;
  }
}

/* ---------- Act 3: Next visit ---------- */

.next {
  padding: 80px 0;
  background: var(--paper-deep);
}

.next__stage {
  display: grid;
  gap: 40px;
}

.next__copy > .soft {
  max-width: 34rem;
  margin-top: 20px;
}

.next__copy .h2 {
  margin-top: 14px;
}

.progress {
  position: relative;
  display: grid;
  gap: 8px;
  max-width: 30rem;
  margin-top: 28px;
  padding: 2px 0 2px 20px;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.progress::before,
.progress::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--rule);
}

.progress::after {
  background: var(--teal);
  transform: scaleY(var(--p, 1));
  transform-origin: top;
}

.next__visual--scrub {
  display: none;
}

.pair {
  display: grid;
  gap: 32px;
}

.pair figcaption {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.cap-rm {
  display: none;
}

.next__visual--static .changes {
  max-width: 26rem;
  margin-top: 28px;
}

@media (prefers-reduced-motion: reduce) {
  .cap-rm {
    display: inline;
  }

  .cap-date {
    display: none;
  }
}

/* Phone sheets keep names, tags and doses readable; steps are too small. */
@media (max-width: 40rem) {
  .pair .sheet {
    --fs: 12px;
  }

  .pair .ex__steps,
  .hero .sheet .ex__steps {
    display: none;
  }
}

@media (min-width: 64rem) {
  .next {
    padding: 128px 0;
  }

  .pair {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 960px;
  }
}

/* Pinned and scrubbed by scroll on desktop (main.js adds .scrub-on). */
.next.scrub-on {
  --p: 0;
  height: 300vh;
  padding: 0;
}

.scrub-on .next__stage {
  --c: clamp(0, calc(var(--p) / 0.18), 1);
  --roll: clamp(0, calc((var(--p) - 0.18) / 0.12), 1);
  --room: clamp(0, calc((var(--p) - 0.42) / 0.08), 1);
  --a1: clamp(0, calc((var(--p) - 0.5) / 0.1), 1);
  --a2: clamp(0, calc((var(--p) - 0.6) / 0.1), 1);
  --s1: clamp(0, calc((var(--p) - 0.7) / 0.07), 1);
  --s2: clamp(0, calc((var(--p) - 0.77) / 0.07), 1);
  --s3: clamp(0, calc((var(--p) - 0.84) / 0.08), 1);
  --h: clamp(0, calc((var(--p) - 0.92) / 0.08), 1);
  position: sticky;
  top: 0;
  height: 100svh;
  grid-template-columns: 5fr 6fr;
  align-items: center;
  gap: 56px;
  padding-top: 64px;
}

.scrub-on .next__visual--static {
  display: none;
}

.scrub-on .next__visual--scrub {
  display: block;
  justify-self: end;
}

.scrub-on .progress li {
  color: var(--ink-soft);
}

.scrub-on .progress li.is-current {
  color: var(--ink);
  font-weight: 500;
}

.scrub-sheet {
  position: relative;
  width: min(520px, 42vw, calc((100svh - 120px) / 1.414));
}

.scrub-sheet .sheet {
  z-index: 1;
}

.ghost {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid #b9b2a3;
  border-radius: 3px;
  background: #fff;
  opacity: calc(0.2 * (1 - var(--c)));
  transform: translate(calc(3px - var(--c) * 44px), calc(3px - var(--c) * 32px)) rotate(calc(var(--c) * -3deg));
  pointer-events: none;
}

.sheet-shadow {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 3px;
  box-shadow: var(--shadow-sheet);
  opacity: calc(var(--h) * 0.6);
}

.date-old {
  opacity: calc(1 - var(--c));
  transform: translateY(calc(var(--c) * -6px));
}

.date-new {
  opacity: var(--c);
  transform: translateY(calc((1 - var(--c)) * 6px));
}

.slots {
  position: relative;
  height: calc(0.8em + 5 * 6.95em + 1.6em);
  border-top: 1px solid var(--rule);
}

.sheet__list--slots {
  display: block;
  padding: 0;
  border: 0;
}

.sheet__list--slots .ex {
  position: absolute;
  top: 0.8em;
  left: 0;
  right: 0;
  transform: translateY(calc(var(--slot) * 6.95em));
}

.ex--clam {
  --slot: calc(3 + 2 * var(--room));
  opacity: calc(1 - var(--s2));
  transform-origin: top;
}

.sheet__list--slots .ex--clam {
  transform: translateY(calc(var(--slot) * 6.95em)) scaleY(calc(1 - var(--s2) * 0.5));
}

.ex--clam .ex__name {
  display: inline-block;
}

.ex--clam .ex__name::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 55%;
  height: 1.5px;
  background: var(--struck);
  transform: scaleX(var(--s1));
  transform-origin: left;
}

.sheet__list--slots .ex--add1 {
  opacity: var(--a1);
  transform: translate(calc((1 - var(--a1)) * 24px), calc(var(--slot) * 6.95em));
}

.sheet__list--slots .ex--add2 {
  opacity: var(--a2);
  transform: translate(calc((1 - var(--a2)) * 24px), calc(var(--slot) * 6.95em));
}

.sheet__stopped--type {
  position: absolute;
  left: 0;
  top: calc((0.8 + 5 * 6.95) * 1em / 0.9);
  margin: 0;
  font-size: 0.9em;
  clip-path: inset(0 calc((1 - var(--s3)) * 100%) 0 0);
}

.odo {
  display: inline-flex;
  vertical-align: bottom;
}

.odo__d {
  display: inline-block;
  height: 1.3em;
  overflow: hidden;
}

.odo__col {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--roll) * -2.6em));
}

.odo__col span {
  height: 1.3em;
}

.stamp {
  opacity: 0;
  transform: scale(1.15) rotate(1deg);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.is-updated .stamp {
  opacity: 1;
  transform: none;
}

.changes--live {
  position: absolute;
  z-index: 3;
  left: -220px;
  bottom: 40px;
  width: 260px;
  opacity: var(--roll);
  transform: translateY(calc((1 - var(--roll)) * 8px));
}

.changes--live ul {
  gap: 0;
}

/* Hidden rows collapse so the card grows as changes land; max-height
   switches instantly, only opacity and transform animate. */
.changes--live .changes__row {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.is-updated .changes__row[data-flag="updated"],
.is-added .changes__row[data-flag="added"],
.is-stopped .changes__row[data-flag="stopped"] {
  /* Room for two lines: "Straight leg raise · Reps 10 → 12" wraps at 260px. */
  max-height: 3em;
  opacity: 1;
  transform: none;
}

/* ---------- Act 4: The real app ---------- */

.real {
  padding-block: 80px;
  text-align: center;
}

.real__lead {
  max-width: 38rem;
  margin: 18px auto 36px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--paper-deep);
}

.tab {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-soft);
  font: 500 0.9375rem/1 var(--sans);
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
}

.frame {
  max-width: 1100px;
  margin: 28px auto 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper-deep);
  box-shadow: var(--shadow-sheet);
}

.frame__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-bottom: 1px solid var(--rule);
}

.dots {
  position: absolute;
  left: 16px;
  display: flex;
  gap: 7px;
}

.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rule);
}

.frame__url {
  padding: 3px 14px;
  border-radius: 99px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.frame__view {
  display: grid;
}

.panel {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 0s 240ms;
}

.panel.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.panel img {
  display: block;
  width: 100%;
  height: auto;
}

.real__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 40px;
}

@media (max-width: 40rem) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(3, auto);
    width: 100%;
    overflow: visible;
  }

  .tab {
    padding: 0 10px;
    font-size: 0.875rem;
  }

  @media (max-width: 22rem) {
    .tab {
      padding: 0 6px;
      font-size: 0.8125rem;
    }
  }

  .frame {
    max-width: 320px;
    border: 10px solid #1b2422;
    border-radius: 36px;
  }

  .frame__bar {
    display: none;
  }

  .frame__view {
    aspect-ratio: 390 / 844;
  }

  .panel img {
    height: 100%;
    object-fit: cover;
    object-position: top;
  }
}

@media (min-width: 64rem) {
  .real {
    padding-block: 128px;
  }
}

/* ---------- Act 5: Close ---------- */

.close {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
}

.close__grid {
  display: grid;
  gap: 56px;
}

.close__copy {
  max-width: 46rem;
}

.close__copy .soft {
  max-width: 38rem;
  margin: 24px 0 32px;
}

.close__sheet {
  justify-self: center;
  width: 200px;
}

.close__tilt {
  position: relative;
  transform: rotate(3deg);
}

.magnet--small {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
}

@media (min-width: 64rem) {
  .close {
    padding: 160px 0;
  }

  .close__grid {
    grid-template-columns: 8fr 4fr;
    align-items: center;
  }
}

/* ---------- Footer ---------- */

.foot {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.foot__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

@media (min-width: 40rem) {
  .foot__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Motion (only when the visitor allows it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero .w {
    display: inline-block;
    animation: rise 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--line, 0) * 70ms);
    --rise: 16px;
  }

  .plane--desk {
    animation: rise 400ms ease-out both;
    --rise: 0px;
  }

  .plane--back {
    animation: rise 400ms ease-out both;
    --rise: 24px;
  }

  .plane--front {
    animation: rise 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both;
    --rise: 40px;
  }

  .plane--magnet {
    animation: rise 380ms cubic-bezier(0.34, 1.56, 0.64, 1) 520ms both;
    --rise: -12px;
  }

  .motion .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease, transform 500ms ease;
  }

  .motion .close .reveal {
    transform: translateY(16px);
  }

  .motion .step .vig.reveal {
    transition-delay: 80ms;
  }

  .motion .reveal.is-in {
    opacity: 1;
    transform: none;
  }

  .motion .settle {
    transform: rotate(6deg);
    transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .motion .settle.is-in {
    transform: rotate(3deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(var(--rise));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .arrow,
  .panel,
  .stamp,
  .changes__row {
    transition: none;
  }
}
