/* ============================================================
   Your term: a tap-through story (Luke, 10 October 2026).
   Full-screen cards, one at a time, each with its own colours and a short
   animation: numbers count up, shoots grow, bars rise, a contour map draws.
   RULES: movement is transform and opacity (and a stroke draw) only; nothing
   flashes; no sound; every animation plays once. Under reduced motion or
   Reduce motion, the story is a plain stack of the same cards, all showing
   their final numbers, with no animation at all.
   Colours: every text and background pair here is white or near-white on a
   dark colour, checked above 4.5 to 1.
   ============================================================ */
.term-body { margin: 0; background: #0e1a15; color: #fff; }
#term { min-height: 100dvh; }
#story { position: fixed; inset: 0; display: grid; grid-template-rows: auto auto 1fr auto; color: #fff; }
.progress { display: flex; gap: 6px; padding: 12px 14px 0; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.progress i b { display: block; height: 100%; width: 0; background: #fff; }
.progress i.done b { width: 100%; }
.topline { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; gap: 10px; }
.exit { color: #fff; background: rgba(0,0,0,.28); border: 1.5px solid rgba(255,255,255,.7); border-radius: 999px; padding: 9px 16px; min-height: 44px; font-weight: 600; font-size: 15px; line-height: 1.2; font-family: inherit; text-decoration: none; cursor: pointer; }
.exit:focus-visible, .nav button:focus-visible, .share button:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.slides { position: relative; overflow: hidden; }
.slide { position: absolute; inset: 0; display: none; grid-auto-rows: max-content; padding: 8px 22px 12px; align-content: center; align-content: safe center; justify-items: center; text-align: center; overflow-y: auto; }
.slide.show { display: grid; }
.slide h2 { margin: 0 0 6px; font: 700 clamp(26px, 6vw, 40px)/1.15 system-ui, -apple-system, "Segoe UI", sans-serif; color: #fff; }
.slide p { margin: 0 0 12px; font-size: clamp(17px, 3.6vw, 22px); line-height: 1.4; max-width: 34ch; color: #fff; }
.slide .big { display: block; font: 800 clamp(64px, 20vw, 140px)/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.slide small { color: rgba(255,255,255,.88); font-size: 15px; }
.nav { display: flex; gap: 12px; justify-content: center; padding: 10px 16px 18px; }
.nav button { min-height: 48px; padding: 0 26px; border-radius: 999px; border: 2px solid #fff; background: rgba(0,0,0,.25); color: #fff; font: 700 17px/1 system-ui, sans-serif; cursor: pointer; }
.nav button.go { background: #fff; color: #10201f; }
.nav button[disabled] { opacity: .45; cursor: default; }

/* the slides' own colours */
.s-intro  { background: linear-gradient(160deg, #0f3d2c, #1f6f4a); }
.s-days   { background: linear-gradient(160deg, #3b2a6b, #5b3f99); }
.s-week   { background: linear-gradient(160deg, #8a3a10, #a2461a); }
.s-steps  { background: linear-gradient(160deg, #0f4c5c, #1b6a72); }
.s-worlds { background: linear-gradient(160deg, #5b2a4e, #7a3866); }
.s-first  { background: linear-gradient(160deg, #1b2a49, #2c4a7a); }
.s-card   { background: linear-gradient(160deg, #10201f, #1f3a33); }

/* pieces: the plot of shoots, bars, the contour map, the timeline dot */
.plot { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: center; max-width: 340px; margin: 10px auto; }
.shoot { width: 12px; height: 34px; position: relative; }
.shoot::before { content: ""; position: absolute; left: 5px; bottom: 0; width: 3px; height: 100%; background: #9be37a; border-radius: 2px; }
.shoot::after { content: ""; position: absolute; left: 0; bottom: 14px; width: 12px; height: 9px; background: #9be37a; border-radius: 12px 0 12px 0; }
.grain { width: 12px; height: 12px; border-radius: 50%; background: #ffd54a; display: inline-block; margin: 3px; }
.bars { display: grid; gap: 8px; width: min(420px, 90vw); margin: 10px auto; }
.bars .row { display: grid; grid-template-columns: 6em 1fr 3.2em; gap: 8px; align-items: center; text-align: left; font-size: 15px; }
.bars .track { height: 18px; background: rgba(255,255,255,.22); border-radius: 9px; overflow: hidden; }
.bars .track i { display: block; height: 100%; width: 100%; background: #fff; border-radius: 9px; transform-origin: left; transform: scaleX(var(--w, 0)); }
.weeks { display: flex; align-items: flex-end; gap: 6px; height: 150px; margin: 12px auto; width: min(420px, 90vw); }
.weeks div { flex: 1; background: rgba(255,255,255,.45); border-radius: 6px 6px 0 0; transform-origin: bottom; transform: scaleY(var(--h, .05)); min-height: 4px; }
.weeks div.best { background: #fff; }
.weekslab { width: min(420px, 90vw); display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,.85); }
.map { width: min(420px, 88vw); height: auto; max-height: 36vh; flex: none; margin: 6px auto; display: block; }
.map path { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.4; }
.map path.last { stroke: #fff; stroke-width: 2; }
.map circle { fill: #ffd54a; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; margin: 10px auto; }

/* the one that is saved: a card the student can keep */
.share { display: grid; gap: 10px; justify-items: center; margin-top: 8px; }
.share label { font-size: 15px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.share input[type=checkbox] { width: 22px; height: 22px; min-height: 0; min-width: 0; margin: 0; padding: 0; flex: none; accent-color: #ffd54a; }
.share button { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid #fff; background: #fff; color: #10201f; font: 700 16px/1 system-ui, sans-serif; cursor: pointer; }
.share .quiet { background: transparent; color: #fff; }
.share small { max-width: 38ch; }

/* ---- the animations: they play once, when a card appears ---- */
@media (prefers-reduced-motion: no-preference) {
  html:not(.rm):not(.hg-s-calm-on) .slide.show .pop { animation: t-pop .55s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i, 0) * 130ms); }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .shoot { animation: t-grow .5s ease-out both; animation-delay: calc(var(--i, 0) * 60ms + 300ms); transform-origin: bottom; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .grain { animation: t-pop .4s ease-out both; animation-delay: calc(var(--i, 0) * 40ms + 300ms); }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .bars .track i { animation: t-wide .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 120ms + 250ms); }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .weeks div { animation: t-rise .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 200ms); }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .map path { stroke-dasharray: 1; animation: t-draw 1.4s ease-out both; animation-delay: calc(var(--i, 0) * 70ms + 200ms); }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .map circle { animation: t-pop .4s ease-out both; animation-delay: 1.6s; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .dot { animation: t-pop .6s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: .3s; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .confetti i { animation: t-fall 1.8s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }
}
@keyframes t-pop   { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes t-grow  { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes t-wide  { from { transform: scaleX(0); } to { transform: scaleX(var(--w, 0)); } }
@keyframes t-rise  { from { transform: scaleY(.02); } to { transform: scaleY(var(--h, .05)); } }
@keyframes t-draw  { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes t-fall  { 0% { opacity: 0; transform: translateY(-30px) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(120px) rotate(200deg); } }
.confetti { position: relative; height: 0; width: min(380px, 90vw); }
.confetti i { position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; opacity: 0; }

/* ---- reduced motion: a plain stack of the same cards, all showing, no animation ---- */
html.rm #story, html.hg-s-calm-on #story { position: static; display: block; }
html.rm .progress, html.hg-s-calm-on .progress, html.rm .nav, html.hg-s-calm-on .nav { display: none; }
html.rm .slides, html.hg-s-calm-on .slides { overflow: visible; }
html.rm .slide, html.hg-s-calm-on .slide { position: static; display: grid; padding: 36px 22px; }
@media (prefers-reduced-motion: reduce) {
  #story { position: static; display: block; }
  .progress, .nav { display: none; }
  .slides { overflow: visible; }
  .slide { position: static; display: grid; padding: 36px 22px; }
}

/* ---- more life: scenes behind each card, words that swap, the self-check ---- */
.slide > *:not(.scene):not(.sun):not(.wave):not(.rings) { position: relative; z-index: 1; }
.scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.scene i { position: absolute; display: block; border-radius: 50%; background: rgba(255,255,255,.5); opacity: 0; }
.sc-leaves i { border-radius: 12px 0 12px 0; background: rgba(155,227,122,.55); }
.sc-sparks i { background: #ffd54a; }
.sc-bubbles i { background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.4); }
.sun { position: absolute; left: 50%; bottom: -120px; width: 320px; height: 320px; margin-left: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,213,74,.55), rgba(255,213,74,0) 68%); pointer-events: none; }
.wave { position: absolute; left: -10%; right: -10%; bottom: 0; height: 90px; background: rgba(255,255,255,.12); border-radius: 50% 50% 0 0; pointer-events: none; }
.wave.w2 { height: 60px; background: rgba(255,255,255,.1); }
.rings { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.rings i { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); opacity: 0; }
.swap { display: inline-grid; font-weight: 800; }
.swap span { grid-area: 1 / 1; }
.swap span + span { opacity: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 440px; margin: 6px auto 12px; }
.chip { min-height: 46px; padding: 8px 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,.75); background: rgba(0,0,0,.22); color: #fff; font: 600 16px/1.2 system-ui, sans-serif; cursor: pointer; transition: transform .15s; }
.chip.on { background: #fff; color: #10201f; transform: scale(1.04); }
.chip:focus-visible, .said textarea:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.said { display: block; width: min(420px, 88vw); }
.said textarea { width: 100%; box-sizing: border-box; border-radius: 14px; border: 2px solid rgba(255,255,255,.75); background: rgba(0,0,0,.25); color: #fff; font: 500 17px/1.4 system-ui, sans-serif; padding: 12px; resize: none; }
.said textarea::placeholder { color: rgba(255,255,255,.8); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.s-me { background: linear-gradient(160deg, #123a4a, #2b4f7e); }
.s-me2 { background: linear-gradient(160deg, #3a1f55, #5a3a86); }
.s-me3 { background: linear-gradient(160deg, #5a2a1a, #8a4a22); }
.s-me4 { background: linear-gradient(160deg, #1d3b2f, #2f6a4a); }
.mine { font-size: 17px; max-width: 34ch; }
.mine:empty { display: none; }

@media (prefers-reduced-motion: no-preference) {
  html:not(.rm):not(.hg-s-calm-on) .scene i { animation: t-float var(--d, 9s) ease-in-out infinite; animation-delay: var(--w, 0s); }
  html:not(.rm):not(.hg-s-calm-on) .sc-stars i { animation-name: t-twinkle; }
  html:not(.rm):not(.hg-s-calm-on) .sc-leaves i { animation-name: t-leaf; }
  html:not(.rm):not(.hg-s-calm-on) .sc-sparks i { animation-name: t-spark; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .sun { animation: t-sun 5s ease-out both; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .wave { animation: t-wave 6s ease-in-out infinite alternate; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .wave.w2 { animation-duration: 4.5s; animation-direction: alternate-reverse; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .rings i { animation: t-ring 3.6s ease-out infinite; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .rings i:nth-child(2) { animation-delay: 1.2s; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .rings i:nth-child(3) { animation-delay: 2.4s; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .swap span { animation: t-swap 9s infinite; animation-delay: calc(var(--k, 0) * 3s); opacity: 0; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .shoot { animation: t-grow .5s ease-out both, t-sway 4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 60ms + 300ms), 1.5s; }
  html:not(.rm):not(.hg-s-calm-on) .slide.show .big { animation: t-pop .55s cubic-bezier(.2, .9, .3, 1.15) both, t-breathe 3.2s ease-in-out 1.4s infinite; }
}
@keyframes t-float   { 0%, 100% { opacity: 0; transform: translateY(0); } 30%, 70% { opacity: .9; } 50% { transform: translateY(-40px); } }
@keyframes t-twinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes t-leaf    { 0% { opacity: 0; transform: translate(0, -30px) rotate(0); } 20%, 80% { opacity: .9; } 100% { opacity: 0; transform: translate(40px, 200px) rotate(260deg); } }
@keyframes t-spark   { 0% { opacity: 0; transform: translateY(40px) scale(.6); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-160px) scale(1); } }
@keyframes t-sun     { from { opacity: 0; transform: translateY(160px); } to { opacity: 1; transform: none; } }
@keyframes t-wave    { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
@keyframes t-ring    { 0% { opacity: .8; transform: scale(.2); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes t-swap    { 0% { opacity: 0; transform: translateY(10px); } 5%, 30% { opacity: 1; transform: none; } 35%, 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes t-sway    { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes t-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
