/* ==========================================================================
   Starter journey — 2026-09-30, animated 2026-10-01 (sample: starter-lesson-1 and -2)
   A section page walked as one path, from the top of the page to the bottom:
     .jr-hero    the section title, and Mr. Wang introducing it, over a quiet
                 landscape (assets/starter-journey-scene.svg) with drifting
                 clouds (assets/starter-journey-clouds.svg)
     .jr-path    the steps on a vertical path; the way ahead is a quiet outline
                 (titles with a lock, the flag at the end), a step's activity
                 comes into the page when it is reached; a done step's dot turns
                 into a tick, a drop of ink runs down, a Continue button leads on
     .jr-finish  the end of the path: the section's result and the way on
   Behaviour and timing: assets/starter-journey.js (window.MWJourney), which puts
   html.jr-js and html.jr-anim (things play in) on the page, html.jr-seen when the
   learner has been here before (the hero is simply there), and html.jr-calm when
   the system asks for reduced motion (things only fade in). Loaded after
   assets/starter-v2.css; the pages carry body.jr-page.
   ========================================================================== */

body.lesson-page.jr-page {
  --jr-col: 920px;          /* the path's column */
  --jr-node: 48px;          /* a step's dot */
  --jr-indent: 78px;        /* where the step's content starts, right of the path */
  --jr-rail: #E4CCDA;       /* the path still to walk (dashes) */
  --jr-ink-soft: #8C7182;   /* quiet text */
  --jr-ease: cubic-bezier(.2, .8, .25, 1);
  --jr-pop: cubic-bezier(.2, .9, .3, 1.35);
}

/* the column: the hero is full width, the path sits in the middle */
body.dna-page.site-ui.pr-page.lesson-page.jr-page .lesson-main { max-width: none; margin: 0; padding: 0 0 96px; }
body.lesson-page.jr-page .jr-wrap { width: min(var(--jr-col), 100% - 40px); margin-inline: auto; }

/* ── The hero ──────────────────────────────────────────────────────────── */
body.lesson-page.jr-page .jr-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 36px 0 0;
  background: linear-gradient(180deg, #FFFCFE 0%, #FDF5F9 58%, var(--pr-bg) 100%);
}
body.lesson-page.jr-page .jr-hero::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 260px;
  background: url("starter-journey-scene.svg") center bottom / max(1600px, 100%) 260px no-repeat;
  pointer-events: none;
}
/* clouds drifting over the far hills (put in by the script) */
body.lesson-page.jr-page .jr-sky { position: absolute; z-index: -1; left: 0; right: 0; bottom: 138px; height: 150px; overflow: hidden; pointer-events: none; }
body.lesson-page.jr-page .jr-sky i {
  position: absolute; left: 0; top: 0; width: 3200px; height: 100%;
  background: url("starter-journey-clouds.svg") 0 0 / 1600px 150px repeat-x;
}
/* the title across the top; the Start button under it; Mr. Wang standing in the landscape on the right */
body.lesson-page.jr-page .jr-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text text" "actions guide";
  align-items: start; column-gap: 24px;
}
body.lesson-page.jr-page .jr-hero-text { grid-area: text; }
body.lesson-page.jr-page .jr-back {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 14px/1 var(--hz-ui); color: var(--pr-deep); text-decoration: none; opacity: .82;
  transition: opacity .15s ease, transform .15s ease;
}
body.lesson-page.jr-page .jr-back::before { content: "←"; }
body.lesson-page.jr-page .jr-back:hover { opacity: 1; transform: translateX(-3px); }
body.lesson-page.jr-page .jr-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 30px 0 14px; font: 600 12.5px/1.3 var(--hz-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--pr-deep);
}
body.lesson-page.jr-page .jr-kicker span { display: inline-flex; align-items: center; gap: 12px; color: #A7819A; letter-spacing: .12em; }
body.lesson-page.jr-page .jr-kicker span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-hero h1 {
  max-width: 13em; margin: 0; font: 700 clamp(34px, 4.6vw, 52px)/1.08 var(--hz-display); letter-spacing: -.028em; color: var(--hc-ink);
  text-wrap: balance;
}
body.lesson-page.jr-page .jr-hero-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
body.lesson-page.jr-page .jr-start {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: linear-gradient(170deg, var(--pr-accent), var(--pr-deep)); color: #fff;
  font: 600 16px/1 var(--hz-ui); text-decoration: none;
  box-shadow: 0 16px 28px -16px rgba(var(--pr-deep-rgb), .8);
  transition: transform .16s ease, box-shadow .16s ease;
}
body.lesson-page.jr-page .jr-start::after { content: "↓"; display: inline-block; font-size: 17px; }
body.lesson-page.jr-page .jr-start:hover { transform: translateY(-2px); box-shadow: 0 20px 32px -16px rgba(var(--pr-deep-rgb), .85); }
body.lesson-page.jr-page .jr-meta { font: 500 14px/1.3 var(--hz-ui); color: var(--jr-ink-soft); }

/* Mr. Wang, saying what this section is about (the bubble from the quiz feedback) */
body.lesson-page.jr-page .jr-guide {
  grid-area: guide; position: relative; display: flex; align-items: flex-start; margin: -24px 0 0;
}
body.lesson-page.jr-page .jr-say {
  --qs-fill: #FFFFFF; --qs-line: rgba(var(--pr-accent-rgb), .42);
  position: relative; flex: none; width: 336px; aspect-ratio: 320 / 170; margin-top: 26px; margin-right: -6px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 72px 0 46px; transform-origin: right 62%;
}
body.lesson-page.jr-page .jr-say svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 12px 16px rgba(var(--pr-deep-rgb), .10)); }
body.lesson-page.jr-page .jr-say svg path { fill: var(--qs-fill); stroke: var(--qs-line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
body.lesson-page.jr-page .jr-say p {
  position: relative; margin: 0; text-align: center; text-wrap: balance;
  font: 500 15px/1.5 var(--hz-ui); color: #4A2E40;
}
body.lesson-page.jr-page .jr-say p b { color: var(--pr-deep); font-weight: 700; }
body.lesson-page.jr-page .jr-guide-talk { position: relative; flex: none; display: block; padding: 0; border: 0; background: none; cursor: pointer; }
/* he stands in the mist: the picture fades out at his waist, where the hero ends */
body.lesson-page.jr-page .jr-guide-talk img {
  display: block; width: auto; height: 232px;
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%); mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
}
body.lesson-page.jr-page .jr-listen {
  position: absolute; right: 4px; top: 136px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--pr-deep); box-shadow: 0 0 0 1px var(--pr-line), 0 8px 16px -8px rgba(var(--pr-deep-rgb), .6);
  transition: transform .15s ease;
}
body.lesson-page.jr-page .jr-listen svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.lesson-page.jr-page .jr-guide-talk:hover .jr-listen { transform: scale(1.08); }
body.lesson-page.jr-page .jr-guide-talk:focus-visible { outline: 2px solid var(--pr-deep); outline-offset: 4px; border-radius: 12px; }

/* ── The path ──────────────────────────────────────────────────────────── */
body.lesson-page.jr-page .jr-path { position: relative; list-style: none; margin: -34px auto 0; padding: 0; }
body.lesson-page.jr-page .jr-step,
body.lesson-page.jr-page .jr-finish { position: relative; padding: 0 0 0 var(--jr-indent); }
body.lesson-page.jr-page .jr-step { padding-bottom: 64px; }

/* the stretch of path under a step: dashes, then ink once the step is done */
body.lesson-page.jr-page .jr-step::before,
body.lesson-page.jr-page .jr-step::after {
  content: ""; position: absolute; top: calc(var(--jr-node) + 10px); bottom: 10px; pointer-events: none;
}
body.lesson-page.jr-page .jr-step::before {
  left: calc(var(--jr-node) / 2 - 1px); width: 2px;
  background: linear-gradient(var(--jr-rail) 55%, transparent 0) 0 0 / 2px 12px repeat-y;
  transform-origin: 50% 0;
}
body.lesson-page.jr-page .jr-step::after {
  left: calc(var(--jr-node) / 2 - 2px); width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--pr-accent), var(--pr-deep));
  transform: scaleY(0); transform-origin: 50% 0; transition: transform 1s cubic-bezier(.45,.05,.25,1);
}
body.lesson-page.jr-page .jr-step.is-done::after { transform: scaleY(1); }
/* the drop of ink that runs down a stretch once its step is done */
body.lesson-page.jr-page .jr-drop {
  position: absolute; z-index: 2; left: calc(var(--jr-node) / 2 - 6px); top: calc(var(--jr-node) + 2px);
  width: 12px; height: 12px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 35% 32%, #fff 0 16%, var(--pr-accent) 42%, var(--pr-deep) 100%);
  box-shadow: 0 0 12px 4px rgba(var(--pr-accent-rgb), .45);
}

/* the dots */
body.lesson-page.jr-page .jr-node {
  position: absolute; left: 0; top: 0; z-index: 1; display: grid; place-items: center;
  width: var(--jr-node); height: var(--jr-node); border-radius: 50%;
  background: #fff; border: 2px solid #EAD6E2; color: #B596A9;
  font: 600 18px/1 var(--hz-ui);
  transition: background-color .35s ease, border-color .35s ease, color .35s ease, box-shadow .35s ease;
}
body.lesson-page.jr-page .jr-node > * { grid-area: 1 / 1; }
body.lesson-page.jr-page .jr-node::before {           /* a ring that spreads out when the dot arrives */
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--pr-accent); opacity: 0; pointer-events: none;
}
body.lesson-page.jr-page .jr-tick { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
body.lesson-page.jr-page .jr-lock { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
body.lesson-page.jr-page :is(.jr-num, .jr-tick, .jr-lock) { transition: opacity .3s ease; }
body.lesson-page.jr-page .jr-step.is-current .jr-node {
  background: linear-gradient(160deg, var(--pr-accent), var(--pr-deep)); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 7px rgba(var(--pr-accent-rgb), .15), 0 12px 22px -10px rgba(var(--pr-deep-rgb), .7);
}
body.lesson-page.jr-page .jr-step.is-done .jr-node {
  background: var(--pr-deep); border-color: transparent; box-shadow: 0 10px 20px -12px rgba(var(--pr-deep-rgb), .8);
}
body.lesson-page.jr-page .jr-step.is-done .jr-num { opacity: 0; }
body.lesson-page.jr-page .jr-step.is-done .jr-tick { opacity: 1; }
body.lesson-page.jr-page .jr-spark {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--pr-accent); pointer-events: none; opacity: 0;
  animation: jr-spark .75s cubic-bezier(.2,.8,.3,1) forwards;
}
body.lesson-page.jr-page .jr-spark:nth-child(even) { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #F2B8D4; }

/* a step's heading and Mr. Wang's line */
body.lesson-page.jr-page .jr-head { min-height: var(--jr-node); display: flex; flex-direction: column; justify-content: center; }
body.lesson-page.jr-page .jr-no { margin: 0 0 7px; font: 600 12px/1 var(--hz-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--pr-deep); transition: color .4s ease; }
body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-title {
  margin: 0; font: 700 clamp(23px, 2.5vw, 28px)/1.2 var(--hz-display); letter-spacing: -.018em; color: var(--hc-ink); outline: none;
  transition: color .4s ease;
}
body.lesson-page.jr-page .jr-line { display: flex; align-items: flex-start; gap: 12px; margin: 16px 0 0; }
body.lesson-page.jr-page .jr-line-who {
  position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  background: #F8E7F0; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--pr-line);
}
body.lesson-page.jr-page .jr-line-who img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; transform: scale(1.18); transform-origin: 50% 30%; }
body.lesson-page.jr-page .jr-line-who:focus-visible { outline: 2px solid var(--pr-deep); outline-offset: 3px; }
body.lesson-page.jr-page .jr-line p {
  margin: 0; padding: 10px 16px; border: 1px solid var(--pr-line); border-radius: 4px 18px 18px 18px; background: #fff;
  font: 500 15.5px/1.5 var(--hz-ui); color: #4A2E40; box-shadow: 0 10px 20px -16px rgba(var(--pr-deep-rgb), .45);
  transform-origin: 0 0;
}
body.lesson-page.jr-page .jr-line p b { color: var(--pr-deep); }
body.lesson-page.jr-page .jr-body { margin-top: 20px; }
body.lesson-page.jr-page :is(.jr-line, .jr-body, .jr-finish-card) { position: relative; z-index: 1; }
body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-body > :is(.lesson-card, .quiz, section, div):first-child { margin-top: 0; }

body.lesson-page.jr-page .jr-skip { margin: 14px 0 0; text-align: right; }
body.lesson-page.jr-page .jr-skip button {
  padding: 4px 2px; border: 0; background: none; cursor: pointer;
  font: 500 14px/1.3 var(--hz-ui); color: var(--jr-ink-soft); text-decoration: underline; text-underline-offset: 3px;
}
body.lesson-page.jr-page .jr-skip button:hover { color: var(--pr-deep); }
/* only with the Starter dev switch on (assets/starter-progress.js): students never see it */
body.lesson-page.jr-page .jr-skip.is-dev button em {
  display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 999px;
  background: #1E3A8A; color: #FFFFFF; font: 700 10px/1.5 system-ui, 'Segoe UI', sans-serif;
  letter-spacing: .04em; vertical-align: 1px;
}
body.lesson-page.jr-page :is(.jr-step.is-done, .jr-step.is-skipped) .jr-skip { display: none; }
/* the shared Place-the-strokes activity (assets/place-strokes.js): Mr. Wang's line says what to do */
body.lesson-page.jr-page .jr-body .mp-instr { display: none; }
body.lesson-page.jr-page .jr-body .mp-topbar { justify-content: flex-end; }
/* sections 4 and 7: how many strokes have been written (writing them all completes the step) */
body.lesson-page.jr-page .write-count { margin: 12px 0 0; text-align: center; font: 500 13.5px/1.4 var(--hz-ui); color: var(--jr-ink-soft); }
body.lesson-page.jr-page .write-count b { color: var(--pr-deep); font-weight: 700; }

/* under a finished step: go on when ready (the next step comes in then) */
body.lesson-page.jr-page .jr-continue { margin: 22px 0 0; transition: opacity .3s ease; }
body.lesson-page.jr-page .jr-continue[hidden] { display: none; }
body.lesson-page.jr-page .jr-continue.is-gone { opacity: 0; pointer-events: none; }
body.lesson-page.jr-page .jr-continue-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(170deg, var(--pr-accent), var(--pr-deep)); color: #FFFFFF; font: 600 16px/1 var(--hz-ui);
  box-shadow: 0 16px 28px -16px rgba(var(--pr-deep-rgb), .8);
  transition: transform .16s ease, box-shadow .16s ease;
}
body.lesson-page.jr-page .jr-continue-btn::after { content: "↓"; display: inline-block; font-size: 17px; }
body.lesson-page.jr-page .jr-continue-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 32px -16px rgba(var(--pr-deep-rgb), .85); }
body.lesson-page.jr-page .jr-continue-btn:focus-visible { outline: 2px solid var(--pr-deep); outline-offset: 3px; }

/* ── Showing only what has been reached ────────────────────────────────── */
/* before the script has set the path up, only step 1 is there (and, when things
   play in, not even that yet: it comes in after the introduction) */
html.jr-js body.lesson-page.jr-page .jr-path:not(.jr-ready) > :not(:first-child) { display: none; }
html.jr-anim body.lesson-page.jr-page .jr-path:not(.jr-ready) > :first-child { visibility: hidden; animation: jr-unhide 0s 6s forwards; }
body.lesson-page.jr-page :is(.jr-step, .jr-finish).is-pending { visibility: hidden; }
/* the way ahead: each step's heading with a lock, the flag at the end; its activity is not
   in the page until the step is reached (and, once reached, until the learner goes on) */
body.lesson-page.jr-page .jr-path:not(.jr-go) > .is-locked { visibility: hidden; }
/* (step 1 before it comes in keeps its layout, hidden: its activity measures itself as the page loads) */
body.lesson-page.jr-page .jr-step:is(.is-locked, .is-waiting):not(.is-pending) :is(.jr-line, .jr-body) { display: none; }
body.lesson-page.jr-page .jr-step:is(.is-locked, .is-waiting):not(.is-pending) { padding-bottom: 40px; }
body.lesson-page.jr-page .jr-step.is-locked .jr-node { border-style: dashed; color: #C4A9BA; }
body.lesson-page.jr-page .jr-step.is-locked .jr-num { opacity: 0; }
body.lesson-page.jr-page .jr-step.is-locked .jr-lock { opacity: 1; }
body.lesson-page.jr-page .jr-step.is-locked .jr-no { color: #C4A9BA; }
body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-step.is-locked .jr-title { color: #AD97A5; }
/* passed without doing it (Skip): the dot stays open */
body.lesson-page.jr-page .jr-step.is-skipped .jr-node { background: #FFFFFF; border: 2px dashed var(--pr-accent); color: var(--pr-deep); box-shadow: none; }
body.lesson-page.jr-page .jr-step.is-skipped .jr-no::after { content: " · Skipped"; color: var(--jr-ink-soft); letter-spacing: .12em; }

/* ── The end of the path ───────────────────────────────────────────────── */
body.lesson-page.jr-page .jr-flag { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
body.lesson-page.jr-page .jr-finish .jr-node {
  background: linear-gradient(160deg, var(--pr-accent), var(--pr-deep)); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 7px rgba(var(--pr-accent-rgb), .15), 0 12px 22px -10px rgba(var(--pr-deep-rgb), .7);
}
body.lesson-page.jr-page .jr-finish .jr-flag path:last-child { fill: rgba(255, 255, 255, .28); transform-origin: 6px 8px; }
body.lesson-page.jr-page .jr-finish.is-locked .jr-node { background: #FFFFFF; border: 2px dashed #EAD6E2; color: #C4A9BA; box-shadow: none; }
body.lesson-page.jr-page .jr-finish.is-locked .jr-flag path:last-child { fill: none; }
body.lesson-page.jr-page .jr-finish-ahead {
  display: none; align-items: center; min-height: var(--jr-node); margin: 0;
  font: 600 12px/1 var(--hz-ui); letter-spacing: .16em; text-transform: uppercase; color: #C4A9BA; transition: color .4s ease;
}
body.lesson-page.jr-page .jr-finish:not(.is-done) .jr-finish-ahead { display: flex; }
body.lesson-page.jr-page .jr-finish.is-open .jr-finish-ahead { color: var(--pr-deep); }
body.lesson-page.jr-page .jr-finish:not(.is-done) .jr-finish-card,
body.lesson-page.jr-page .jr-finish-card:empty { display: none; }
body.lesson-page.jr-page .jr-finish-card {
  padding: 28px 30px 26px; border: 1px solid var(--pr-line); border-radius: 22px; background: #fff; box-shadow: var(--pr-lift);
}
body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-finish-title {
  margin: 0; font: 700 28px/1.25 var(--hz-display); letter-spacing: -.015em; color: var(--hc-ink); outline: none;
}
body.lesson-page.jr-page .jr-finish-sub { margin: 6px 0 0; font: 400 15.5px/1.5 var(--hz-ui); color: var(--jr-ink-soft); }
body.lesson-page.jr-page .jr-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
body.lesson-page.jr-page .jr-stat {
  flex: 1 1 200px; padding: 14px 18px; border: 1px solid var(--pr-line-soft); border-radius: 16px; background: var(--pr-wash);
}
body.lesson-page.jr-page .jr-stat b { display: block; font: 700 26px/1.15 var(--hz-display); color: var(--pr-deep); font-variant-numeric: tabular-nums; }
body.lesson-page.jr-page .jr-stat span { display: block; margin-top: 4px; font: 500 13px/1.35 var(--hz-ui); color: var(--jr-ink-soft); }
body.lesson-page.jr-page .jr-next-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 24px; }
body.lesson-page.jr-page .jr-next {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 58px; padding: 8px 56px 8px 24px;
  position: relative; overflow: hidden;
  border-radius: 18px; background: linear-gradient(170deg, var(--pr-accent), var(--pr-deep)); color: #fff; text-decoration: none;
  box-shadow: 0 16px 28px -16px rgba(var(--pr-deep-rgb), .8); transition: transform .16s ease, box-shadow .16s ease;
}
body.lesson-page.jr-page .jr-next small { font: 500 12px/1 var(--hz-ui); letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
body.lesson-page.jr-page .jr-next span { font: 600 17px/1.25 var(--hz-ui); }
body.lesson-page.jr-page .jr-next::after { content: "→"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 20px; }
body.lesson-page.jr-page .jr-next::before {           /* a glint that crosses the button once */
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-18deg); opacity: 0;
}
body.lesson-page.jr-page .jr-next:hover { transform: translateY(-2px); box-shadow: 0 20px 32px -16px rgba(var(--pr-deep-rgb), .85); }
body.lesson-page.jr-page .jr-home { font: 500 15px/1.3 var(--hz-ui); color: var(--pr-deep); text-decoration: underline; text-underline-offset: 3px; }
body.lesson-page.jr-page .jr-again {
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  font: 500 15px/1.3 var(--hz-ui); color: var(--jr-ink-soft); text-decoration: underline; text-underline-offset: 3px;
}
body.lesson-page.jr-page .jr-again:hover { color: var(--pr-deep); }

/* ── Motion (html.jr-anim; with html.jr-calm nothing loops, drifts or flies) ── */
/* the hero plays in from the first paint: landscape, title, Start, Mr. Wang, his bubble */
html.jr-anim body.lesson-page.jr-page .jr-hero::before { animation: jr-scene 1.4s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-sky { animation: jr-fadein 2.4s .4s ease both; }
html.jr-anim:not(.jr-calm) body.lesson-page.jr-page .jr-sky i { animation: jr-drift 150s linear infinite; }
html.jr-anim body.lesson-page.jr-page .jr-back { animation: jr-rise .55s .05s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-kicker { animation: jr-rise .55s .14s var(--jr-ease) both; }
html.jr-anim body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-hero h1 { animation: jr-title .85s .24s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-hero-actions { animation: jr-rise .6s .62s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-guide-talk { animation: jr-who-in .95s .42s cubic-bezier(.2,.8,.3,1.08) both; }
html.jr-anim body.lesson-page.jr-page .jr-say { animation: jr-say-in .45s .95s cubic-bezier(.2,.8,.3,1.25) both; }
html.jr-anim body.lesson-page.jr-page .jr-listen { animation: jr-pop .45s 2.1s var(--jr-pop) both; }
html.jr-anim body.lesson-page.jr-page .jr-say p:not(.jr-words) { opacity: 0; animation: jr-fadein .3s 2.3s forwards; }   /* if the script is late */
html.jr-anim:not(.jr-started):not(.jr-calm) body.lesson-page.jr-page .jr-start::after { animation: jr-nudge 1.6s 2.4s ease-in-out infinite; }
/* his words, one after another (the script numbers them and sets --jr-t0) */
html.jr-anim body.lesson-page.jr-page .jr-words .jr-w {
  display: inline-block; opacity: 0;
  animation: jr-word .32s ease-out forwards; animation-delay: calc(var(--jr-t0, 0ms) + var(--i) * 42ms);
}

/* a step coming into the page: dot and ring, heading, Mr. Wang, his line, the activity, the path below */
html.jr-anim:not(.jr-calm) body.lesson-page.jr-page .jr-step.is-current .jr-node { animation: jr-breathe 2.8s ease-in-out infinite; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering .jr-node { animation: jr-pop .6s var(--jr-pop) both; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering .jr-node::before { animation: jr-ring 1s .18s ease-out; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering .jr-head { animation: jr-slide .55s .12s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering .jr-line-who { animation: jr-pop .45s .3s var(--jr-pop) both; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering .jr-line p { animation: jr-bubble .42s .4s cubic-bezier(.2,.8,.3,1.2) both; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering .jr-body { animation: jr-rise .75s .72s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-step.is-entering::before { animation: jr-grow 1.1s .6s ease-out both; }

html.jr-anim body.lesson-page.jr-page .jr-step.is-entering.from-outline .jr-head { animation: none; }
/* the way ahead comes into view once step 1 is there (the first time only) */
html.jr-anim:not(.jr-seen) body.lesson-page.jr-page .jr-path.jr-go > .is-locked { animation: jr-fadein .7s calc(1.3s + var(--jr-k, 1) * .15s) both; }
/* Continue under a finished step */
html.jr-anim body.lesson-page.jr-page .jr-continue:not(.is-gone) { animation: jr-rise .5s var(--jr-ease) both; }
html.jr-anim:not(.jr-calm) body.lesson-page.jr-page .jr-continue-btn::after { animation: jr-nudge 1.6s 1.2s ease-in-out infinite; }

/* a step done: the dot is stamped and ticked, sparks fly, a drop of ink runs down the path */
html.jr-anim body.lesson-page.jr-page .jr-step.just-done .jr-node { animation: jr-stamp .5s cubic-bezier(.2,.8,.3,1.4); }
html.jr-anim body.lesson-page.jr-page .jr-step.just-done .jr-node::before { animation: jr-ring .9s ease-out; }
html.jr-anim body.lesson-page.jr-page .jr-step.just-done .jr-tick path { stroke-dasharray: 24; animation: jr-draw .45s .1s ease-out both; }
html.jr-anim body.lesson-page.jr-page .jr-step.just-done .jr-drop { animation: jr-drop 1s .12s cubic-bezier(.45,.05,.25,1) both; }

/* the end: the flag lands and waves, the card rises, the Next button glints */
html.jr-anim body.lesson-page.jr-page .jr-finish.is-entering .jr-node { animation: jr-pop .6s var(--jr-pop) both; }
html.jr-anim body.lesson-page.jr-page .jr-finish.is-entering .jr-node::before { animation: jr-ring 1.1s .2s ease-out; }
html.jr-anim body.lesson-page.jr-page .jr-finish.is-entering .jr-flag path:last-child { animation: jr-wave .8s .45s ease-in-out 3; }
html.jr-anim body.lesson-page.jr-page .jr-finish.is-entering .jr-finish-card { animation: jr-rise .75s .2s var(--jr-ease) both; }
html.jr-anim body.lesson-page.jr-page .jr-finish.is-entering .jr-next::before { animation: jr-glint 1s 1.4s ease-in-out; }

/* petals thrown up from the flag (put in by the script, over the page) */
.jr-petals { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.jr-petal { position: absolute; width: 10px; height: 14px; border-radius: 80% 0 80% 0; box-shadow: 0 1px 2px rgba(116, 36, 90, .18); opacity: 0; }

@keyframes jr-scene { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes jr-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes jr-unhide { to { visibility: visible; } }
@keyframes jr-drift { to { transform: translateX(-1600px); } }
@keyframes jr-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes jr-title { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes jr-who-in { from { opacity: 0; transform: translateY(46px); } to { opacity: 1; transform: none; } }
@keyframes jr-say-in { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@keyframes jr-word { from { opacity: 0; transform: translateY(5px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes jr-nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(4px); } }
@keyframes jr-pop { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes jr-ring { from { opacity: .65; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
@keyframes jr-slide { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes jr-bubble { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes jr-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes jr-breathe { 50% { box-shadow: 0 0 0 11px rgba(var(--pr-accent-rgb), .08), 0 12px 22px -10px rgba(var(--pr-deep-rgb), .7); } }
@keyframes jr-stamp { 0% { transform: scale(.7); } 60% { transform: scale(1.14); } 100% { transform: none; } }
@keyframes jr-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes jr-spark {
  0% { opacity: 1; transform: rotate(calc(var(--k) * 45deg + 20deg)) translateY(-12px) scale(1); }
  100% { opacity: 0; transform: rotate(calc(var(--k) * 45deg + 20deg)) translateY(-44px) scale(.3); }
}
@keyframes jr-drop {
  0% { opacity: 0; transform: translateY(0) scale(.5); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--jr-rail-len, 240px)) scale(.6); }
}
@keyframes jr-wave { 0%, 100% { transform: none; } 50% { transform: skewY(-9deg) scaleX(.92); } }
@keyframes jr-glint { 0% { opacity: 1; left: -40%; } 100% { opacity: 1; left: 120%; } }

/* ── Reduced motion (html.jr-calm): things only fade in; nothing moves, grows, loops or flies ── */
html.jr-calm body.lesson-page.jr-page .jr-hero::before,
html.jr-calm body.lesson-page.jr-page :is(.jr-back, .jr-kicker, .jr-hero-actions, .jr-guide-talk, .jr-say, .jr-listen),
html.jr-calm body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-hero h1,
html.jr-calm body.lesson-page.jr-page .jr-words .jr-w,
html.jr-calm body.lesson-page.jr-page .jr-step.is-entering :is(.jr-node, .jr-head, .jr-line-who, .jr-line p, .jr-body),
html.jr-calm body.lesson-page.jr-page .jr-step.is-entering::before,
html.jr-calm body.lesson-page.jr-page .jr-finish.is-entering :is(.jr-node, .jr-finish-card),
html.jr-calm body.lesson-page.jr-page .jr-continue:not(.is-gone) { animation-name: jr-fadein; }
html.jr-calm body.lesson-page.jr-page :is(.jr-step, .jr-finish):is(.is-entering, .just-done) .jr-node::before,
html.jr-calm body.lesson-page.jr-page .jr-step.just-done :is(.jr-node, .jr-drop, .jr-tick path),
html.jr-calm body.lesson-page.jr-page .jr-finish.is-entering .jr-flag path:last-child,
html.jr-calm body.lesson-page.jr-page .jr-finish.is-entering .jr-next::before { animation: none; }
html.jr-calm body.lesson-page.jr-page .jr-spark { display: none; }
/* the ink along a done stretch fades in instead of running down */
html.jr-calm body.lesson-page.jr-page .jr-step::after { transform: none; opacity: 0; transition: opacity .6s ease; }
html.jr-calm body.lesson-page.jr-page .jr-step.is-done::after { opacity: 1; }
html.jr-calm body.lesson-page.jr-page :is(.jr-start, .jr-continue-btn, .jr-next, .jr-back):hover { transform: none; }

/* ── Back on the page (html.jr-seen): the hero is simply there ───────────── */
html.jr-seen body.lesson-page.jr-page .jr-hero::before,
html.jr-seen body.lesson-page.jr-page :is(.jr-sky, .jr-back, .jr-kicker, .jr-hero-actions, .jr-guide-talk, .jr-say, .jr-listen),
html.jr-seen body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-hero h1 { animation: none; }
html.jr-seen body.lesson-page.jr-page .jr-say p:not(.jr-words) { opacity: 1; animation: none; }

/* ── Narrower screens ──────────────────────────────────────────────────── */
@media (max-width: 919px) {
  body.lesson-page.jr-page .jr-hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "actions" "guide"; }
  body.lesson-page.jr-page .jr-guide { justify-content: flex-end; margin-top: 8px; }
}
@media (max-width: 719px) {
  body.lesson-page.jr-page { --jr-node: 38px; --jr-indent: 0px; }
  body.lesson-page.jr-page .jr-wrap { width: calc(100% - 32px); }
  body.lesson-page.jr-page .jr-hero { padding-top: 22px; }
  body.lesson-page.jr-page .jr-sky { bottom: 110px; height: 120px; }
  body.lesson-page.jr-page .jr-sky i { background-size: 1280px 120px; }
  body.lesson-page.jr-page .jr-kicker { margin: 20px 0 10px; font-size: 11.5px; letter-spacing: .12em; }
  body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-hero h1 { font-size: 32px; }
  body.lesson-page.jr-page .jr-hero-actions { margin-top: 18px; }
  /* on a phone the bubble is a plain rounded box beside him, so any sentence fits */
  body.lesson-page.jr-page .jr-guide { margin: 20px 0 0; justify-content: space-between; align-items: flex-end; }
  body.lesson-page.jr-page .jr-say {
    width: auto; flex: 1 1 auto; aspect-ratio: auto; margin: 0 10px 44px 0; padding: 14px 16px; justify-content: flex-start;
    border: 1px solid var(--qs-line); border-radius: 20px; background: #fff; box-shadow: 0 12px 20px -14px rgba(var(--pr-deep-rgb), .45);
    transform-origin: right bottom;
  }
  body.lesson-page.jr-page .jr-say svg { display: none; }
  body.lesson-page.jr-page .jr-say::after {
    content: ""; position: absolute; right: -8px; bottom: 22px; width: 14px; height: 14px; background: #fff;
    border-top: 1px solid var(--qs-line); border-right: 1px solid var(--qs-line); transform: rotate(45deg) skew(8deg, 8deg);
  }
  body.lesson-page.jr-page .jr-say p { text-align: left; font-size: 14.5px; }
  body.lesson-page.jr-page .jr-guide-talk img { height: 150px; }
  body.lesson-page.jr-page .jr-listen { top: 84px; right: -2px; width: 32px; height: 32px; }
  body.lesson-page.jr-page .jr-path { margin-top: -18px; }
  /* dots and headings keep the path; Mr. Wang's line and the activity use the full width */
  body.lesson-page.jr-page .jr-step { padding-bottom: 52px; }
  body.lesson-page.jr-page .jr-step:is(.is-locked, .is-waiting):not(.is-pending) { padding-bottom: 32px; }
  body.lesson-page.jr-page .jr-head { padding-left: 52px; }
  body.dna-page.site-ui.pr-page.lesson-page.jr-page .jr-title { font-size: 22px; }
  body.lesson-page.jr-page .jr-no { font-size: 11px; margin-bottom: 5px; }
  body.lesson-page.jr-page .jr-line p { font-size: 15px; }
  body.lesson-page.jr-page .jr-tick { width: 20px; height: 20px; }
  body.lesson-page.jr-page .jr-finish { padding-top: 52px; }   /* padding, not the card's margin: that would collapse through the li and pull the dot down */
  body.lesson-page.jr-page .jr-finish:not(.is-done) { padding-top: 0; }
  body.lesson-page.jr-page .jr-finish-ahead { padding-left: 52px; }
  body.lesson-page.jr-page .jr-continue-btn { width: 100%; justify-content: center; }
  body.lesson-page.jr-page .jr-finish-card { padding: 22px 20px; }
  body.lesson-page.jr-page .jr-next { width: 100%; }
}
