/* The tokens of the app, light first, plus the colors of the page's
   chapters: the warm cream light, the soft sage band of the steps, and
   the gold band of Premium (the gold tokens). */
:root {
  color-scheme: light dark;
  --ground: #e7efe0;
  --surface: #fffefb;
  --tint: #eaf2e4;
  --ink: #33463a;
  --ink-dim: #5d6f5e;
  --fern: #4f7d5c;
  --fern-text: #f2f8ef;
  --leaf-a: #9cc48e;
  --leaf-b: #6da272;
  --bark: #6e6749;
  --earth: #b3a17a;
  --gold-top: #fff6dd;
  --gold-bottom: #f3dfa6;
  --gold-line: #d9b25a;
  --gold-ink: #6e5112;
  --gold-leaf: #d6a93e;
  --gold-stem: #b88c2e;
  --ground-shadow: rgb(51 70 58 / .22);
  --gold-tag: #f1e1b0;
  --gold-bar-a: #e9c35e;
  --gold-bar-b: #c99a2e;
  --ink-soft: #4b5e4c;
  --rose: #b05c78;
  --petal: #e8a7b8;
  --soil: #e8e4cf;
  --sky: #c7e0ed;
  --sky-horizon: #e2eee6;
  --paper: #f7f5e4;
  --band: #e7efe0;
  --ray: rgb(156 196 142 / .32);
  /* The greenhouse light on the band of the steps: sun rays and the soft shadows of glass panes. */
  --glow: rgb(255 253 240 / .7);
  --sunray: rgb(255 255 248 / .5);
  --mullion: rgb(51 70 58 / .045);
  --line: #d6dfcf;
  --bezel: #26302a;
  --shadow-soft: 0 2px 4px rgb(51 70 58 / .06), 0 12px 32px rgb(51 70 58 / .10);
  --shadow-lift: 0 4px 10px rgb(51 70 58 / .10), 0 22px 48px rgb(51 70 58 / .18);
  --shadow-deep: 0 6px 12px rgb(51 70 58 / .10), 0 40px 80px rgb(51 70 58 / .22);
  /* The soft shadow that a pot or a panda casts on the page, and the gold shimmer of Premium. */
  --rest-shadow: rgb(51 70 58 / .28);
  --shimmer: rgb(255 255 255 / .75);
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  --calm: cubic-bezier(.45, 0, .2, 1);
  --gutter: 24px;
  --bar: 68px;
  --moon-icon: block;
  --sun-icon: none;
}

/* Dark: when the system is dark and the visitor chose nothing else, or when
   the visitor chose dark with the button in the top bar (theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #1a211b;
    --surface: #242c25;
    --tint: #2c362d;
    --ink: #e8ece6;
    --ink-dim: #9aa79b;
    --fern: #7fae8f;
    --fern-text: #152018;
    --leaf-a: #6b8f60;
    --leaf-b: #89b07c;
    --bark: #aba37e;
    --earth: #4a4231;
    --gold-top: #332e1e;
    --gold-bottom: #28251a;
    --gold-line: #7e6c34;
    --gold-ink: #e6cc86;
    --gold-leaf: #cda449;
    --gold-stem: #a88634;
    --ground-shadow: rgb(0 0 0 / .45);
    --gold-tag: #4a3f1f;
    --gold-bar-a: #d9b552;
    --gold-bar-b: #a9852f;
    --ink-soft: #b0bab1;
    --rose: #d78fa5;
    --petal: #d78fa5;
    --soil: #302e20;
    --sky: #22313c;
    --sky-horizon: #1c242a;
    --paper: #1a211b;
    --band: #141a15;
    --ray: rgb(127 174 143 / .16);
    --glow: rgb(230 204 134 / .06);
    --sunray: rgb(230 204 134 / .045);
    --mullion: rgb(0 0 0 / .2);
    --line: #2f3a30;
    --bezel: #0d110e;
    --shadow-soft: 0 2px 4px rgb(0 0 0 / .25), 0 12px 32px rgb(0 0 0 / .30);
    --shadow-lift: 0 4px 10px rgb(0 0 0 / .30), 0 22px 48px rgb(0 0 0 / .45);
    --shadow-deep: 0 6px 12px rgb(0 0 0 / .30), 0 40px 80px rgb(0 0 0 / .50);
    --rest-shadow: rgb(0 0 0 / .45);
    --shimmer: rgb(230 204 134 / .22);
    --moon-icon: none;
    --sun-icon: block;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #1a211b;
  --surface: #242c25;
  --tint: #2c362d;
  --ink: #e8ece6;
  --ink-dim: #9aa79b;
  --fern: #7fae8f;
  --fern-text: #152018;
  --leaf-a: #6b8f60;
  --leaf-b: #89b07c;
  --bark: #aba37e;
  --earth: #4a4231;
  --gold-top: #332e1e;
  --gold-bottom: #28251a;
  --gold-line: #7e6c34;
  --gold-ink: #e6cc86;
  --gold-leaf: #cda449;
  --gold-stem: #a88634;
  --ground-shadow: rgb(0 0 0 / .45);
  --gold-tag: #4a3f1f;
  --gold-bar-a: #d9b552;
  --gold-bar-b: #a9852f;
  --ink-soft: #b0bab1;
  --rose: #d78fa5;
  --petal: #d78fa5;
  --soil: #302e20;
  --sky: #22313c;
  --sky-horizon: #1c242a;
  --paper: #1a211b;
  --band: #141a15;
  --ray: rgb(127 174 143 / .16);
  --glow: rgb(230 204 134 / .06);
  --sunray: rgb(230 204 134 / .045);
  --mullion: rgb(0 0 0 / .2);
  --line: #2f3a30;
  --bezel: #0d110e;
  --shadow-soft: 0 2px 4px rgb(0 0 0 / .25), 0 12px 32px rgb(0 0 0 / .30);
  --shadow-lift: 0 4px 10px rgb(0 0 0 / .30), 0 22px 48px rgb(0 0 0 / .45);
  --shadow-deep: 0 6px 12px rgb(0 0 0 / .30), 0 40px 80px rgb(0 0 0 / .50);
  --rest-shadow: rgb(0 0 0 / .45);
  --shimmer: rgb(230 204 134 / .22);
  --moon-icon: none;
  --sun-icon: block;
}

:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.55 system-ui, -apple-system, sans-serif;
}
/* The full-width layers (the shelf, the greenhouse light) never make the page scroll sideways. */
main { overflow-x: clip; }

h1, h2, h3, button, .wordmark, .session, .start, .button, .premium, .label, .track span, .field, .stats, .badge-name, .plans b { font-family: var(--rounded); }
h1, h2 { font-weight: 800; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; margin: 0 0 18px; }
p { margin: 0 0 14px; }
a { color: var(--fern); }
img, video, picture, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
:focus-visible { outline: 3px solid var(--fern); outline-offset: 4px; }

/* The top bar stays on top, and the page shows blurred through it. */
.top {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar);
  padding: 0 max(32px, calc(50% - 608px));
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
}
.wordmark { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: var(--ink); text-decoration: none; }
.wordmark img { width: 36px; border-radius: 9px; }
.actions { display: flex; align-items: center; gap: 28px; }
.top nav { display: flex; gap: 28px; }
.top nav a { color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: 16px; }
.top nav a:hover { color: var(--ink); }

.theme {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  cursor: pointer;
}
.theme svg { width: 20px; height: 20px; }
.theme .moon { display: var(--moon-icon); }
.theme .sun { display: var(--sun-icon); }

/* The session: a tiny bonsai that grows with the steps, the timer, and the
   steps grown. It shows once the timer runs. */
.session {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.in-session .session { opacity: 1; transform: translate(-50%, 0); }
.timer { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fern); }
.session-stopped .dot { animation: none; opacity: .4; }
.count { padding: 4px 12px; border-radius: 999px; background: var(--tint); }
.count b { display: inline-block; color: var(--fern); }
.count.bump b { animation: bump .5s var(--pop); }
/* A thin line under the bar fills with the steps grown. */
.session-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--fern);
  opacity: 0;
  transform: scaleX(var(--grown, 0));
  transform-origin: left;
  transition: transform .8s var(--ease), opacity .4s;
}
.in-session .session-line { opacity: 1; }

/* The line that says the session has started. It shows at 1.4 times its
   size just under the session bar, then shrinks into its place, stays a
   few seconds and fades. With reduced motion, it only shows in its place. */
.session-note {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  margin: 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: var(--shadow-soft);
  color: var(--paper);
  font-family: var(--rounded);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  translate: -50%;
  transform-origin: 50% 0;
  pointer-events: none;
}
.session-note.show { animation: note 5s var(--ease); }
@keyframes note { 8%, 88% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .session-note.show { animation: note-arrive 5.4s linear; }
}
@keyframes note-arrive {
  /* At 1.4 times its size: in .3 s, held 1 s. */
  from { opacity: 0; transform: translateY(4px) scale(1.4); animation-timing-function: var(--ease); }
  6% { opacity: 1; }
  /* Shrinks into its place in .6 s, stays and fades. */
  24% { transform: translateY(4px) scale(1.4); animation-timing-function: var(--calm); }
  35% { transform: none; }
  91% { opacity: 1; }
}

/* The link to the app: Apple's badge, unchanged. Apple asks for clear space
   of a quarter of its height around it. */
.store { display: inline-block; margin: 12px 0 0; }
.store img { width: auto; height: 62px; }

/* The gold of the app: a diagonal gold with a gold rim, and the leaf. The
   Premium chip has its leaf after the word, as in the app; Start growing,
   a gold button, has it before. */
.premium, .start {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--gold-line);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-top), var(--gold-bottom));
  color: var(--gold-ink);
  font-weight: 700;
  white-space: nowrap;
}
.premium::after, .start::before { content: ""; aspect-ratio: 1; background: currentColor; mask: url(leaf.svg) center / contain no-repeat; }
.premium { gap: 5px; margin: 0 0 8px; padding: 3px 10px 3px 12px; font-size: 14px; }
.premium::after { width: 1em; }
p .premium { margin: 0 2px; padding-block: 0; vertical-align: 1px; }
.start {
  gap: 10px;
  padding: 16px 30px 16px 26px;
  /* The corners of the App Store badge beside it: 21% of its height. */
  border-radius: 13px;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .4s var(--ease);
}
.start::before { width: 1em; }
.start:hover { transform: translateY(-2px); }

.button {
  display: inline-block;
  margin-top: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--fern);
  color: var(--fern-text);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .4s var(--ease);
}
.button:hover { transform: translateY(-2px); }

main > section:not(.grow) { padding: 120px var(--gutter); }

/* The first screen, in the warm light of the greenhouse. It fills the
   window under the top bar, with the pandas' shelf at the bottom: the sizes
   follow the window's height as well as its width. The phone takes the
   height that the pandas and the margins leave. */
main > section.welcome {
  --panda: clamp(64px, 12vh, 132px);
  --phone-height: clamp(220px, 100svh - var(--bar) - var(--panda) - 150px, 600px);
  --phone: calc((var(--phone-height) - 22px) / 2.173 + 22px);
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--bar));
  padding-top: 2vh;
  padding-bottom: 1vh;
}
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
  width: 100%;
  max-width: 1216px;
  margin: 0 auto;
}
/* The headline, and beside it the bonsai of its hobby, the pot on the line
   of the headline's last row. */
/* The tree's square has room around the tree, so it needs no gap of its own. */
.headline { display: flex; align-items: flex-end; margin: 0 0 2.4vh; }
.welcome h1 { flex: none; font-size: clamp(44px, min(5.8vw, 10vh), 92px); line-height: 1.02; margin: 0; }

/* The hobby in the headline: the words share one place, as wide as the
   widest, so the line keeps its width. The old word slides up and fades,
   and the new one rises in. */
/* The words share one place, as wide as the longest, so the tree beside the
   headline stands still. */
.hobbies { display: grid; justify-items: start; color: var(--fern); }
.hobby { grid-area: 1 / 1; white-space: nowrap; opacity: 0; transform: translateY(.5em); }
/* The old word leaves fast, then the new one rises in, so the two never
   show at once. */
.hobby[data-state="shown"] { opacity: 1; transform: none; transition: opacity .35s var(--ease) .18s, transform .5s var(--ease) .18s; }
.hobby[data-state="left"] { transform: translateY(-.4em); transition: opacity .15s ease-in, transform .2s ease-in; }
.welcome .lead { margin: 0; color: var(--ink-dim); font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; }
.calls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 4vh; }
.calls .store { margin: 0; }

/* The app beside the text: the garden on a phone, and left of it the bonsai
   of the hobby in the headline, on a soft round shadow on the page. Two
   canvases take turns, so the old tree fades while the new one grows. */
.showcase { display: flex; align-items: flex-end; }
.potted { position: relative; z-index: 1; flex: none; width: clamp(140px, min(18vw, 32vh), 300px); margin-bottom: .2em; }
/* The pot's feet stand 1.8% above the bottom of its canvas. */
.hobby-tree { position: relative; width: 90%; aspect-ratio: 1; margin: 0 auto -1.6%; }
.hobby-tree canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .5s var(--ease); }
.hobby-tree canvas.shown { opacity: 1; }
.potted::before {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -2%;
  height: 4.5%;
  border-radius: 50%;
  background: var(--rest-shadow);
  filter: blur(6px);
}
/* Under the pot. */
.potted::before { left: 33%; width: 34%; }
.showcase .device { position: relative; flex: none; }

/* The category pandas stand on a shelf that runs from edge to edge, and
   drift to the right. Two clones of the list make the loop. With reduced
   motion, they stand still in one row. */
.marquee { position: relative; margin: 2vh calc(-1 * var(--gutter)) 0; overflow-x: clip; }
.track { position: relative; z-index: 1; list-style: none; display: flex; justify-content: center; margin: 0; padding: 0; }
.track li { flex: none; display: flex; flex-direction: column; align-items: center; width: calc(var(--panda) + 36px); }
.track img { width: var(--panda); }
.track span {
  margin-top: 12px;
  padding: 2px 12px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 700;
  transition: background-color .3s, color .3s;
}
/* When the tree changes, the panda of its hobby jumps on the shelf, and its
   name lights up. */
.track li.hop img { animation: hop .9s var(--ease); transform-origin: 50% 100%; }
.track li.hop span { background: var(--fern); color: var(--fern-text); }
.marquee.moving .track { justify-content: flex-start; width: max-content; animation: drift 70s linear infinite reverse; }
.shelf {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--panda) - 6px);
  height: 18px;
  background: linear-gradient(var(--earth), color-mix(in srgb, var(--earth) 70%, var(--bark)));
  box-shadow: 0 14px 24px -10px rgb(51 70 58 / .35);
}
@keyframes drift { to { transform: translateX(calc(-100% / 3)); } }
@keyframes hop {
  12% { transform: scale(1.06, .9); }
  45% { transform: translateY(-38%) rotate(-6deg) scale(.96, 1.06); }
  78% { transform: scale(1.06, .92); }
}

/* The tree screen, on a soft sage band that fades in from the cream
   chapters. The section is as tall as the frame plus a stretch of scroll
   for each of the seven steps and one for the grown tree; the frame stays
   in view meanwhile, with the stage beside the list of steps. The cards
   change size while the page scrolls, so the browser must not move the
   page to keep them in place. */
.grow {
  --step-scroll: 70svh;
  position: relative;
  isolation: isolate;
  overflow-anchor: none;
  height: calc(100svh - var(--bar) + 8 * var(--step-scroll));
  background: linear-gradient(var(--paper), var(--band) 160px, var(--band) calc(100% - 160px), var(--paper));
}
.frame {
  position: sticky;
  top: var(--bar);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(40px, 5vw, 72px);
  height: calc(100svh - var(--bar));
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 32px;
}

/* A greenhouse light on the band, on a wide screen:
   faint glass-pane shadows and soft sun rays that drift slowly. Its light
   stays in view while the section scrolls past. */
.sunroom { display: none; }
@media (min-width: 900px) {
  .sunroom {
    display: block;
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
  }
  .glass {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 75%, var(--glow), transparent 70%);
  }
}
.panes {
  position: absolute;
  inset: -10% -30% 20%;
  background-image:
    linear-gradient(90deg, var(--mullion) 0 16px, transparent 16px),
    linear-gradient(0deg, var(--mullion) 0 16px, transparent 16px);
  background-size: 240px 300px;
  transform: skewX(-20deg);
  mask-image: linear-gradient(transparent, #000 20%, #000 50%, transparent);
}
.sunray {
  position: absolute;
  top: -30%;
  left: 12%;
  width: 14vw;
  height: 150%;
  background: linear-gradient(var(--sunray), transparent 75%);
  transform: rotate(24deg);
  transform-origin: top center;
  filter: blur(14px);
}
.sunray:nth-child(3) { left: 40%; width: 8vw; opacity: .7; }
.sunray:nth-child(4) { left: 70%; width: 18vw; opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .panes { animation: panes-drift 50s ease-in-out infinite alternate; }
  .sunray { animation: ray-sway 13s ease-in-out infinite alternate; }
  .sunray:nth-child(3) { animation-duration: 17s; animation-delay: -6s; }
  .sunray:nth-child(4) { animation-duration: 21s; animation-delay: -11s; }
}
@keyframes panes-drift { to { transform: skewX(-20deg) translateX(160px); } }
@keyframes ray-sway {
  from { transform: rotate(22deg); opacity: .45; }
  to { transform: rotate(27deg) translateX(2vw); }
}

/* The stage: the bonsai on a card of the app's sky, the card of the steps
   grown under it, and a phone right of them. The two cards are centered
   against the phone, which is as tall as the stage allows. */
.stage {
  --phone: min(340px, (100cqh - 22px) / 2.2 + 22px, 48cqw);
  position: relative;
  container-type: size;
}
.grove {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  gap: 12px;
  width: calc(100cqw - var(--phone) - 32px);
  translate: 0 -50%;
}
/* The tree, as a card of the garden in the app: the steps grown at the top
   left, a tag at the top right, the tree, its title, a status line and a
   bar. When every step is grown it turns gold, with a medal. */
.plot {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 30px 18px 18px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: center;
  transition: background .6s var(--ease), box-shadow .6s var(--ease);
}
.tally { position: absolute; top: 12px; left: 14px; display: flex; align-items: center; gap: 4px; color: var(--ink-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.grown-medal { display: none; width: 24px; }
.plot .tag { position: absolute; top: 12px; right: 12px; padding: 2px 9px; border-radius: 999px; background: var(--soil); color: var(--bark); font-family: var(--rounded); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.tree { position: relative; width: 96%; aspect-ratio: 1; }
.tree canvas { position: relative; width: 100%; height: 100%; transform-origin: 50% 96%; }
/* The app's gold wreath around a fully grown tree: laurel branches, a bow,
   and three sparkles that twinkle. */
.tree .wreath { position: absolute; left: -4.4%; top: 1.9%; width: 108.9%; height: 108.9%; opacity: 0; transform: scale(.85); transition: opacity .6s var(--ease), transform .8s var(--pop); }
.grove.grown .wreath { opacity: 1; transform: none; }
/* Room under the pot for the wreath's bow. */
.tree { transition: margin .6s var(--ease); }
/* A fixed length: a grid sizes its rows before it resolves a margin in %. */
.grove.grown .tree { margin-bottom: 26px; }
.sparkle { position: absolute; z-index: 1; width: 9%; aspect-ratio: 1; background: var(--gold-bar-a); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); opacity: 0; }
.sparkle:nth-of-type(1) { left: 9.5%; top: 13%; }
.sparkle:nth-of-type(2) { left: 82%; top: 17%; scale: .8; }
.sparkle:nth-of-type(3) { left: 85%; top: 65%; scale: .7; }
.grove.grown .sparkle { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .grove.grown .sparkle { animation: twinkle 2.4s ease-in-out infinite; }
  .grove.grown .sparkle:nth-of-type(2) { animation-duration: 3.1s; }
  .grove.grown .sparkle:nth-of-type(3) { animation-duration: 3.8s; }
}
@keyframes twinkle { 0%, 60%, 100% { opacity: .35; transform: scale(.7); } 15% { opacity: 1; transform: scale(1.15); } }
.tree.nod canvas { animation: nod .6s var(--pop); }
.plot h3 { margin: 6px 0 4px; font-size: 20px; line-height: 1.2; text-wrap: balance; }
.status { margin: 0 0 14px; color: var(--ink-dim); font-size: 14px; }
.grove.grown .plot {
  background: linear-gradient(135deg, var(--gold-top), var(--gold-bottom));
  box-shadow: inset 0 0 0 1.5px var(--gold-line), 0 8px 22px rgb(201 154 46 / .25);
}
.grove.grown .grown-medal { display: block; }
.grove.grown .tag { display: none; }
.grove.grown .status { padding: 2px 10px; border-radius: 999px; background: var(--gold-tag); color: var(--gold-ink); font-family: var(--rounded); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.grove.grown .grown-track span { background: linear-gradient(90deg, var(--gold-bar-a), var(--gold-bar-b)); }

/* The bloom moment: the tree grows to full bloom on a sky, with rays that
   turn behind it, then its title and what it took. */
html:has(.bloom[open]) { overflow: hidden; }
.bloom {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: var(--ground);
  color: var(--ink);
  box-shadow: var(--shadow-deep);
  overflow: hidden;
  text-align: center;
}
.bloom::backdrop { background: rgb(0 0 0 / .55); }
.bloom-sky { position: relative; display: grid; place-items: end center; height: 300px; background: var(--sky); overflow: hidden; }
.bloom-rays {
  position: absolute;
  left: calc(50% - 210px);
  bottom: -110px;
  width: 420px;
  aspect-ratio: 1;
  background: repeating-conic-gradient(rgb(255 255 255 / .35) 0 9deg, transparent 9deg 22.5deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 62%);
}
.bloom-sky canvas { position: relative; width: 240px; height: 240px; margin-bottom: 8px; }
.bloom-copy { padding: 22px 24px 0; }
.bloom-eyebrow { margin: 0 0 6px; color: var(--rose); font-family: var(--rounded); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.bloom h2 { margin: 0 0 6px; font-size: 28px; }
.bloom-copy p:last-child { margin: 0; color: var(--ink-soft); }
.bloom-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 24px 0; padding: 12px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-soft); }
.bloom-stats p { margin: 0; color: var(--ink-dim); font-size: 14px; }
.bloom-stats b { display: block; color: var(--ink); font-family: var(--rounded); font-size: 22px; font-variant-numeric: tabular-nums; }
.bloom form { margin: 20px 24px 24px; }
.bloom-close { width: 100%; padding: 15px; border: 0; border-radius: 14px; background: var(--fern); color: var(--fern-text); font-size: 18px; font-weight: 800; line-height: 1.3; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .bloom[open] { animation: bloom-in .35s var(--ease); }
  .bloom-rays { animation: turn 60s linear infinite; }
}
@keyframes bloom-in { from { opacity: 0; transform: scale(.88); } }

.grown-track { width: 100%; height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.grown-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--leaf-a), var(--fern));
  transform: scaleX(var(--grown, 0));
  transform-origin: left;
  transition: transform .8s var(--ease);
}

/* A phone drawn in CSS around the clips. In the stage, the clip of the
   step now fades in on top, and the old one fades out after it, so the
   screen never flickers. */
.device {
  width: var(--phone);
  height: calc((var(--phone) - 22px) * 2.173 + 22px);
  padding: 11px;
  border-radius: calc(var(--phone) * .16);
  background: var(--bezel);
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .14), var(--shadow-deep);
}
.stage .device { position: absolute; z-index: 4; top: 50%; right: 0; transform: translateY(-50%); }
.screen { position: absolute; inset: 11px; opacity: 0; transition: opacity .6s var(--ease) .6s; }
.screen.active { z-index: 1; opacity: 1; transition-delay: 0s; }
.screen video { width: 100%; height: 100%; border-radius: calc(var(--phone) * .16 - 11px); background: var(--surface); object-fit: cover; cursor: pointer; }

/* A play mark on a clip that the visitor paused: a dark disc with a white
   triangle. */
.screen::before, .screen::after, .clip::before, .clip::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  width: 60px;
  height: 60px;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.screen::before, .clip::before { border-radius: 50%; background: rgb(0 0 0 / .5); }
.screen::after, .clip::after { background: #fff; clip-path: polygon(40% 30%, 40% 70%, 72% 50%); }
.held::before, .held::after { opacity: 1; }

/* The steps move inside a window that fades at its edges. The grown steps
   gather in a tight group at the top, the step now has room above and
   below it, and the next steps follow, faint. When the step now would
   reach past the bottom, the list slides up by as much; script.js gives
   the card's height (--card). When all are grown, the whole list shows in
   the middle. */
.list-window {
  --row: 46px;
  --gap: 6px;
  --room: 48px;
  --top: 28px;
  margin: 0 -16px;
  padding: 0 16px;
  overflow: hidden;
  container-type: size;
  mask-image: linear-gradient(transparent, #000 24px, #000 calc(100% - 40px), transparent);
}
.list {
  --now-top: calc(var(--now, 0) * (var(--row) + var(--gap)) + var(--room));
  transform: translateY(min(var(--top), 100cqh - var(--room) - var(--now-top) - var(--card, 0px)));
  transition: transform .6s var(--calm);
}
.grow[data-now="7"] .list { transform: translateY(calc((100cqh - 7 * var(--row) - 6 * var(--gap)) / 2)); }
.steps { display: grid; gap: var(--gap); margin: 0; padding: 0 0 40px; list-style: none; }

/* A step, as in the app: a compact row with its number and a lock when it
   is next, or a check when it is grown. The step now opens into the full
   card with its buttons, and the row fades out. */
.step {
  position: relative;
  display: grid;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-radius .6s var(--calm), margin .6s var(--calm), opacity .6s var(--calm);
}
.step[data-state="next"] { opacity: .45; }
.row, .card { grid-area: 1 / 1; }
.row { display: flex; align-items: center; gap: 12px; height: var(--row); padding: 0 16px 0 10px; transition: opacity .3s var(--calm) .3s; }
.number {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--ink-dim);
  font-family: var(--rounded);
  font-size: 15px;
  font-weight: 800;
}
.title { flex: 1; overflow: hidden; color: var(--ink-dim); font-family: var(--rounded); font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.step[data-state="grown"] .title { color: var(--ink); }
.card { display: grid; grid-template-rows: 0fr; text-align: center; transition: grid-template-rows .6s var(--calm); }
.card > div { min-height: 0; overflow: hidden; padding: 0 24px; opacity: 0; transition: opacity .3s var(--calm); }
/* The ring and lift of the card now, on a layer that fades. */
.step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--leaf-a) 70%, transparent), var(--shadow-lift);
  opacity: 0;
  transition: opacity .6s var(--calm);
  pointer-events: none;
}
.step[data-state="now"] { margin-block: var(--room); border-radius: 20px; }
.step[data-state="now"]::after { opacity: 1; }
.step[data-state="now"] .row { opacity: 0; transition-delay: 0s; }
.step[data-state="now"] .card { grid-template-rows: 1fr; }
.step[data-state="now"] .card > div { opacity: 1; transition: opacity .4s var(--calm) .2s; }

.label { margin: 22px 0 6px; color: var(--fern); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.card h2 { font-size: 27px; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 10px; }
.card p:not(.label) { color: var(--ink-dim); font-size: 17px; }

/* The lock opens when a step is now; the check pops in when it is grown. */
.mark { position: relative; flex: none; width: 22px; height: 22px; }
.mark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lock { fill: none; stroke: var(--ink-dim); stroke-width: 2.2; stroke-linecap: round; transition: opacity .4s var(--ease) .15s; }
.lock rect { fill: var(--ink-dim); stroke: none; }
.shackle { transition: transform .4s var(--pop); }
.check { opacity: 0; transform: scale(0); transition: opacity .2s, transform .5s var(--pop); }
.check circle { fill: var(--fern); }
.check path { fill: none; stroke: var(--fern-text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.step:not([data-state="next"]) .shackle { transform: translateY(-3px); }
.step:not([data-state="next"]) .lock { opacity: 0; }
.step[data-state="grown"] .check { opacity: 1; transform: none; }
/* A grown step seen again, on the way back: its card shows, without Mark grown. */
.step.done .buttons { display: none; }

/* The practice bar fills as the page scrolls through the step now. */
.bar { display: block; height: 6px; margin: 18px 0; border-radius: 3px; background: var(--tint); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf-a), var(--fern)); transform: scaleX(0); transform-origin: left; }

.buttons { display: grid; margin-bottom: 24px; }
.buttons button {
  padding: 15px 10px;
  border: 0;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .3s var(--pop);
}
.buttons button:active { transform: scale(.96); }
/* Mark grown, the card's one action. */
.grow-button { background: var(--fern); color: var(--fern-text); }

/* A card's own clip shows on a phone only; on a wide screen the stage's
   phone plays it. */
.clip { display: none; position: relative; width: fit-content; margin: 18px auto 4px; }
.clip video { width: auto; height: clamp(170px, 100svh - 470px, 400px); border-radius: 24px; background: var(--tint); box-shadow: var(--shadow-lift); cursor: pointer; }

/* The end of the session: the reflect card and the badge, side by side. */
.reflect { text-align: center; }
.reflect .intro { color: var(--ink-dim); font-size: 20px; max-width: 30em; margin: 0 auto; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; align-items: stretch; gap: 32px; margin-top: 56px; text-align: left; }
.save-card, .earned { padding: 28px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-soft); }
/* Both cards are as tall as the taller one, with their buttons at the
   bottom. A happy panda gives a thumbs up left of the card; on a phone, it
   stands on top of the card. */
.save-card { position: relative; display: flex; flex-direction: column; }
.happy { position: absolute; right: calc(100% + 4px); bottom: 28px; width: 128px; }
.stats { display: flex; justify-content: space-around; margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); text-align: center; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--ink-dim); font-size: 14px; font-weight: 600; }
.field { margin-bottom: 12px; color: var(--ink-dim); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.prompt { margin: 0 0 14px; font-size: 22px; line-height: 1.25; letter-spacing: -.01em; }
.feelings { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.feelings button {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(51 70 58 / .12), 0 3px 10px rgb(51 70 58 / .10), inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .25s, color .25s;
}
.feelings button[aria-pressed="true"] { background: var(--fern); color: var(--fern-text); box-shadow: none; }
.feelings button.picked { animation: bump .5s var(--pop); }
.reply { min-height: 1.55em; margin: 16px 0 20px; color: var(--ink-dim); }
/* Save session and Keep growing: one size. */
.save, .earned .button {
  margin: auto 0 0;
  padding: 15px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}
.save {
  border: 0;
  background: var(--fern);
  color: var(--fern-text);
  cursor: pointer;
}
.save.saved { background: var(--tint); color: var(--fern); }
/* Leaves burst from a feeling when it is picked. */
.leaf {
  position: fixed;
  z-index: 9;
  width: 10px;
  height: 10px;
  border-radius: 60% 0;
  background: var(--leaf-b);
  pointer-events: none;
  animation: burst .9s var(--ease) forwards;
}

/* Badge earned, as in the app: rays that turn slowly behind the badge. */
.earned { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.rays {
  position: absolute;
  top: calc(50% - 300px - 60px);
  left: calc(50% - 300px);
  width: 600px;
  height: 600px;
  background: repeating-conic-gradient(var(--ray) 0 9deg, transparent 9deg 22.5deg);
  mask-image: radial-gradient(circle, #000 18%, transparent 52%);
  pointer-events: none;
}
.medal { position: relative; width: 170px; margin: auto 0 20px; filter: drop-shadow(0 10px 18px rgb(51 70 58 / .25)); }
.earned .field { position: relative; margin-bottom: 4px; color: var(--fern); }
.badge-name { position: relative; margin-bottom: 22px; font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.earned .button { position: relative; align-self: stretch; box-shadow: none; }

/* The badge wall. */
.badges { text-align: center; }
.badges > p { color: var(--ink-dim); max-width: 32em; margin: 0 auto; font-size: 20px; }
.badges ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; max-width: 1000px; margin: 56px auto 0; padding: 0; }
.badges li { width: 112px; }
.badges img { filter: drop-shadow(0 8px 14px rgb(51 70 58 / .18)); }

/* The team of helpers, as a group picture on a soft shadow. */
.helpers { --team: clamp(160px, 34vh, 380px); text-align: center; }
.helpers h2 { margin-bottom: 28px; text-wrap: balance; }
.group { margin: 0 auto; text-align: left; }
/* The bubbles sit around the group: three on top at their own heights, and
   one at each side, beside its panda. The script draws each tail from the
   bubble's nearest edge to its panda's head. */
.group {
  position: relative;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 11em) repeat(3, minmax(0, calc(var(--team) * .8))) minmax(0, 11em);
  grid-template-areas: ". coaches sage cheering ." "books team team team maker";
  align-items: end;
  gap: clamp(18px, 4vh, 44px) 14px;
  width: min(100%, var(--team) * 2.4 + 22em + 28px);
}
/* The top of the group's box is empty sky: it tucks under the bubbles, so the tails stay short. */
.team { grid-area: team; position: relative; z-index: 0; aspect-ratio: 2.4; margin-top: calc(var(--team) * -.22); }
.tails { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tails path { fill: var(--surface); filter: drop-shadow(0 3px 4px rgb(51 70 58 / .12)); }
.team::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: -2%; height: 22%; border-radius: 50%; background: radial-gradient(closest-side, var(--ground-shadow), transparent); }
.helper, .extra { position: absolute; z-index: 1; rotate: var(--tilt); transform-origin: 50% 100%; }
.helper img { width: 100%; transform-origin: 50% 100%; }
.books { left: 2%; bottom: 5%; width: 19%; z-index: 4; --tilt: -4deg; --order: 3; --breath: 4.4s; }
.coaches { left: 15%; bottom: 16%; width: 34%; --tilt: -2deg; --order: 1; --breath: 3.4s; }
.seedling { left: 35%; bottom: 0; width: 15%; z-index: 5; --tilt: 6deg; --order: 4; --breath: 3.6s; }
.sage { left: 42%; bottom: 12%; width: 26%; z-index: 2; --tilt: -3deg; --order: 0; --breath: 3.9s; }
.cheering { left: 62%; bottom: 13%; width: 22%; z-index: 3; --tilt: 4deg; --order: 2; --breath: 3.1s; }
.maker { left: 82%; bottom: 5%; width: 16%; z-index: 4; --tilt: 3deg; --order: 6; --breath: 3.3s; }

.bubble {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 8px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-family: var(--rounded);
  font-size: clamp(13px, 1.9vh, 17px);
  font-weight: 700;
  line-height: 1.25;
  justify-self: center;
  max-width: 13em;
  text-wrap: balance;
  rotate: var(--lean);
}
.bubble.for-books { grid-area: books; align-self: center; justify-self: end; margin-top: 18%; --lean: -1.5deg; --order: 3; }
.bubble.for-coaches { grid-area: coaches; justify-self: start; margin-top: 30px; --lean: 1deg; --order: 1; }
.bubble.for-sage { grid-area: sage; margin-bottom: 22px; --lean: -1deg; --order: 0; }
.bubble.for-cheering { grid-area: cheering; justify-self: end; margin-top: 48px; --lean: 1.5deg; --order: 2; }
.bubble.for-maker { grid-area: maker; align-self: center; justify-self: start; margin-top: 30%; --lean: -1deg; --order: 6; }
.bubble b { font-weight: 800; }
.bubble .premium { margin: 0 0 0 4px; padding-block: 0; font-size: 12px; vertical-align: 1px; }
@media (prefers-reduced-motion: no-preference) {
  /* The pandas pop in one after another when the section shows, then each
     breathes at its own pace; the bubbles follow. */
  .alive .helpers:not(.shown) :is(.helper, .extra, .bubble, .tails) { opacity: 0; }
  .helpers.shown :is(.helper, .extra) { animation: helper-pop .7s var(--pop) calc(.1s + var(--order) * .16s) both; }
  .helpers.shown .bubble { animation: helper-pop .5s var(--pop) calc(.35s + var(--order) * .16s) both; }
  .helpers.shown .tails { animation: tails-in .4s var(--ease) 1.3s both; }
  .helpers.shown .helper img { animation: breathe var(--breath) ease-in-out calc(var(--order) * -.7s) infinite alternate; }
  .helpers.shown .extra { animation: helper-pop .7s var(--pop) calc(.1s + var(--order) * .16s) both, breathe var(--breath) ease-in-out 1.5s infinite alternate; }
}
@keyframes helper-pop { from { opacity: 0; transform: translateY(25%) scale(.4); } }
@keyframes tails-in { from { opacity: 0; } }
@keyframes breathe { to { transform: translateY(-2%) scale(1.02, 1.03); } }

/* Premium, on a gold band: the heading centered over the band, then the
   panda beside what is free and what Premium adds. */
main > section.upgrade {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 800px);
  grid-template-areas: "title title" "panda plans";
  justify-content: center;
  align-items: center;
  gap: 48px;
  padding: 96px var(--gutter);
  border-block: 1px solid var(--gold-line);
  background: linear-gradient(var(--gold-top), var(--gold-bottom));
}
.offer { display: contents; }
.upgrade h2 { grid-area: title; margin: 0; color: var(--gold-ink); text-align: center; }
.celebration { grid-area: panda; }
.plans { grid-area: plans; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); align-items: center; gap: 28px; }
.plans > div { border-radius: 20px; }
.plans h3 { display: flex; height: 30px; align-items: center; margin: 0 0 14px; font-size: 22px; }
.plans ul { list-style: none; margin: 0; padding: 0; }
.plans li { display: flex; gap: 12px; margin-bottom: 12px; font-size: 17px; line-height: 1.4; }
.plans li::before { content: ""; flex: none; width: 11px; height: 11px; margin-top: 6px; border-radius: 0 70%; background: var(--leaf-b); }

/* The Free card stays plain: a thin gold line on the band. */
.plain { padding: 22px 24px 12px; box-shadow: inset 0 0 0 1px var(--gold-line); color: var(--ink-dim); }

/* The Premium card is the hero, as the app's gold orchard card: a gold
   frame and glow, a vine with leaves and small flowers along its top and
   around its corners, a vine on its chip, and a shimmer that
   sweeps across it now and then. */
.gilded {
  position: relative;
  padding: 58px 32px 34px;
  border: 2px solid var(--gold-line);
  background: linear-gradient(170deg, var(--surface) 35%, var(--gold-top) 75%, var(--gold-bottom));
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--gold-leaf) 16%, transparent), var(--shadow-lift);
}
.gilded h3 { justify-content: center; gap: 8px; height: 40px; margin-bottom: 24px; }
/* The big chip wears the app's vine along its top and bottom. */
.gilded h3 .premium { position: relative; justify-content: center; width: 150px; height: 42px; margin: 0; padding: 0; font-size: 20px; }
.chip-vine { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); overflow: visible; pointer-events: none; }
/* Each Premium item: a bold title, and its short line under it. */
.gilded li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin-bottom: 18px; }
.gilded li::before { grid-row: span 2; width: 13px; height: 13px; background: var(--gold-leaf); }
.gilded b { font-size: 18px; font-weight: 800; }
.gilded li span { color: var(--ink-dim); font-size: 16px; }
.vine { position: absolute; top: -14px; left: -14px; width: calc(100% + 28px); height: auto; overflow: visible; pointer-events: none; }
.vine-stem { fill: none; stroke: var(--bark); stroke-width: 2.8; stroke-linecap: round; }
.vine-stem.thin { stroke-width: 1.6; }
.vine-leaf { fill: var(--leaf-b); }
.vine-gold { fill: var(--gold-leaf); }
.vine-flower { fill: var(--petal); color: var(--gold-leaf); }
.shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.shine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, var(--shimmer) 50%, transparent 70%);
  transform: translateX(-100%);
}

/* Gold leaves drift down behind the celebrating panda (script.js adds them). */
.celebration { position: relative; }
.celebration .panda { position: relative; }
.drift { position: absolute; inset: -12% -8% -6%; overflow: hidden; pointer-events: none; mask-image: linear-gradient(transparent, #000 18%, #000 70%, transparent); }
.drift span {
  position: absolute;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 0 70%;
  background: var(--gold-leaf);
  opacity: 0;
  animation: leaf-fall 9s linear infinite;
}
@media (prefers-reduced-motion: no-preference) {
  .shine::before { animation: shimmer 7s var(--calm) 1.5s infinite; }
}
@keyframes shimmer { 20%, 100% { transform: translateX(100%); } }
@keyframes leaf-fall {
  12%, 85% { opacity: .9; }
  50% { transform: translate(22px, 210px) rotate(200deg); }
  to { opacity: 0; transform: translate(-8px, 420px) rotate(420deg); }
}

/* Orchards: for learners first, then a gold-framed card for the people who
   teach them, as orchard trees have a gold frame in the garden. */
.orchards { max-width: 1240px; margin: 0 auto; }
.learners { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; max-width: 1080px; margin: 0 auto 120px; }
.learners p { color: var(--ink-dim); font-size: 20px; }
.business {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 64px;
  align-items: center;
  padding: 64px;
  border: 2px solid var(--gold-line);
  border-radius: 36px;
  background: linear-gradient(160deg, var(--gold-top), var(--surface) 45%);
  box-shadow: var(--shadow-soft);
}
.business h2 { font-size: clamp(32px, 3.6vw, 48px); }
.business .lead { font-size: 20px; }
.business ul { padding-left: 22px; margin: 0 0 20px; }
.business li { margin-bottom: 8px; }
.business .note { color: var(--ink-dim); font-size: 16px; }
.dashboard { border-radius: 14px; box-shadow: var(--shadow-deep); }

/* The closing: the panda waves from the greenhouse door. */
.closing { text-align: center; }
main > .closing { padding-bottom: 72px; }
.entrance { position: relative; max-width: 520px; margin: 0 auto 32px; }
.entrance .waving { position: absolute; left: 50%; bottom: 2.3%; width: auto; height: 45%; transform: translateX(-50%); }
.closing h2 { font-size: clamp(56px, 8vw, 112px); line-height: .95; margin-bottom: 16px; }
.closing > p:not(.store) { color: var(--ink-dim); font-size: 22px; }

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 15px;
}
footer a { color: var(--ink-dim); }
footer span { margin-left: auto; }

/* Motion that is not the visitor's own: none of it with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .dot { animation: blink 2s ease-in-out infinite; }
  .rays { animation: turn 60s linear infinite; }
  .alive .earned:not(.shown) .medal { opacity: 0; }
  .earned.shown .medal { animation: pop .8s var(--pop) both; }
  .alive .badges .pop-in li { opacity: 0; transform: scale(.3) rotate(-12deg); transition: opacity .3s var(--ease), transform .7s var(--pop); transition-delay: calc(var(--order) * 70ms); }
  .alive .badges .pop-in.shown li { opacity: 1; transform: none; }
  /* The pandas pop up when their section comes into view. */
  .panda.pop-in { transform-origin: 50% 100%; transition: opacity .4s var(--ease), transform .8s var(--pop); }
  .alive .panda.pop-in:not(.shown) { opacity: 0; transform: translateY(30px) scale(.6); }
}
@media (prefers-reduced-motion: reduce) {
  .hobby-tree canvas { transition: none; }
  .track li.hop img { animation: none; }
  .step, .step::after, .row, .card, .card > div, .list, .check, .shackle { transition-duration: .01s; transition-delay: 0s; }
}

@keyframes nod {
  40% { transform: scale(1.06, .97); }
  70% { transform: scale(.98, 1.03); }
}
@keyframes bump { 40% { transform: scale(1.3); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes turn { to { transform: rotate(1turn); } }
@keyframes pop {
  from { opacity: 0; transform: scale(.2) rotate(-20deg); }
  60% { opacity: 1; transform: scale(1.12) rotate(4deg); }
}
@keyframes burst {
  from { opacity: 1; transform: translate(0, 0) rotate(0); }
  to { opacity: 0; transform: translate(var(--drift-x), var(--drift-y)) rotate(200deg); }
}

/* In a mid-size window, the session bar takes the place of the nav links. */
@media (min-width: 900px) and (max-width: 1099px) {
  .in-session .top nav { display: none; }
}


/* A phone: everything stacks. The session bar keeps the tiny tree, and the
   step now plays its own clip. */
@media (max-width: 899px) {
  /* The group stands closer: three bubbles over it, two under it. */
  .helpers { --team: clamp(150px, 30vh, 300px); }
  .group {
    width: min(100%, var(--team) * 1.4);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "coaches sage cheering" "team team team" "books . maker";
    gap: 12px 8px;
  }
  .team { aspect-ratio: 1.4; margin-top: -10%; }
  .bubble.for-books, .bubble.for-maker { align-self: start; justify-self: center; margin: 0; }
  .bubble.for-coaches, .bubble.for-sage, .bubble.for-cheering { justify-self: center; margin: 0; }
  .coaches { left: 0; bottom: 30%; width: 44%; }
  .sage { left: 32%; bottom: 28%; width: 36%; }
  .cheering { left: 66%; bottom: 18%; width: 32%; }
  .books { left: 0; bottom: 2%; width: 28%; }
  .seedling { left: 50%; bottom: 0; width: 20%; }
  .maker { left: 74%; bottom: 0; width: 26%; }
  .bubble { max-width: 100%; padding: 5px 9px; border-radius: 12px; font-size: 12px; }
  :root { --gutter: 20px; --bar: 64px; }
  body { font-size: 17px; }
  .top { padding: 0 16px; }
  .top nav { display: none; }
  .in-session .wordmark { visibility: hidden; }
  .session { left: 16px; gap: 10px; font-size: 14px; transform: translateY(-12px); }
  .in-session .session { transform: none; }
  /* On a phone, the line wraps, so that at 1.4 times its size it still fits the window. */
  .session-note {
    width: min(230px, 100% - 48px);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    white-space: normal;
  }
  main > section:not(.grow) { padding: 72px var(--gutter); }
  main > section.welcome {
    --panda: clamp(56px, 9vh, 84px);
    padding-top: 2vh;
  }
  /* The first step shows the same garden clip, at full size. */
  .showcase { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; gap: 3vh; text-align: center; }
  .hobbies { justify-items: center; }
  /* The hobby's tree stands over the headline, centered on it. */
  .headline { flex-direction: column; align-items: center; }
  .potted { order: -1; width: clamp(110px, min(40vw, 20svh), 170px); margin: 0 0 6px; }
  .calls { justify-content: center; margin-top: 2.6vh; }
  /* As wide as the App Store badge under it: its height times 119.664 / 40. */
  .calls .start { width: calc(62px * 119.664 / 40); justify-content: center; padding-inline: 0; }
  .shelf { height: 14px; }
  /* The steps are a plain list of full cards that scrolls as the page does.
     A card is grown when it passes the middle of the window; its bar fills,
     and the step after it gets the ring. */
  .grow { height: auto; padding: 56px 0 72px; }
  .frame { display: block; position: static; height: auto; padding: 0 16px; }
  .stage { display: none; }
  .list-window { margin: 0; padding: 0; overflow: visible; container-type: normal; mask-image: none; }
  .grow .list, .grow[data-now] .list { transform: none; }
  .steps { gap: 20px; padding: 0; }
  .step[data-state] { opacity: 1; margin: 0; border-radius: 20px; }
  .step .row, .buttons { display: none; }
  .step .card { grid-template-rows: 1fr; }
  .step .card > div { padding: 0 16px 6px; opacity: 1; }
  .bar span { transition: transform .6s var(--calm); }
  .card h2 { font-size: 24px; }
  .card p:not(.label) { font-size: 16px; line-height: 1.5; }
  .clip { display: block; }
  /* As wide as the window allows, while the whole clip fits in it. */
  .clip video { width: min(280px, 72vw, (100svh - 120px) * .46); height: auto; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 96px; }
  .happy { right: 16px; bottom: calc(100% - 12px); width: 100px; }
  .save-card, .earned { padding: 22px 18px; }
  .badges ul { gap: 12px; }
  .badges li { width: 76px; }
  .learners { grid-template-columns: 1fr; gap: 24px; margin-bottom: 64px; text-align: center; }
  .business { grid-template-columns: 1fr; gap: 40px; padding: 32px 24px; border-radius: 28px; }
  main > section.upgrade { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "panda" "plans"; gap: 8px; padding: 64px var(--gutter); text-align: center; }
  .upgrade .celebration { width: 190px; margin: 0 auto; }
  .plans { grid-template-columns: minmax(0, 1fr); gap: 32px; text-align: left; }
  footer span { margin-left: 0; width: 100%; }
}

/* On a short phone, smaller text and buttons keep the pandas on the first
   screen. */
@media (max-width: 899px) and (max-height: 740px) {
  main > section.welcome { --panda: 52px; }
  .welcome h1 { font-size: 38px; margin-bottom: 8px; }
  .welcome .lead { font-size: 17px; }
  .calls { margin-top: 14px; gap: 14px; }
  .calls .start { width: calc(51px * 119.664 / 40); padding-block: 12px; font-size: 16px; border-radius: 11px; }
  .calls .store img { height: 51px; }
}

/* The other pages: the privacy policy, the terms, support, and the 404 page. */
.page, .lost { max-width: 760px; margin: 0 auto; padding: 56px var(--gutter) 88px; }
.page h1, .lost h1 { margin: 0 0 12px; font-size: clamp(40px, 6vw, 64px); line-height: 1.04; }
.page h2 { margin: 48px 0 12px; font-size: 28px; line-height: 1.15; letter-spacing: -.015em; }
.page .note { margin-bottom: 32px; color: var(--ink-dim); font-size: 16px; }
.page li { margin-bottom: 8px; }
.page table { width: 100%; margin: 8px 0 20px; border-collapse: collapse; font-size: 16px; }
.page th, .page td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lost { text-align: center; }
.lost img { width: 220px; margin: 0 auto 16px; }
.lost p { color: var(--ink-dim); }
