/* =============================================================================
   The LingoBlox page: a dark stage, like playlingoblox.com, where every app screen is
   live HTML you can play with. No screenshots.
   It stays light: only transform and opacity ever animate, and anything that loops
   runs only while it's on screen (lingoblox.js switches .is-live on and off).
   ============================================================================= */

/* ---------- The morph from the homepage's box ---------- */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.3, .8, .25, 1); }
::view-transition-old(lb-stage) { animation-duration: .3s; }
::view-transition-new(lb-stage) { animation-duration: .45s; animation-delay: .1s; }
.hero { view-transition-name: lb-stage; }
.try [data-w="w1"] { view-transition-name: lb-w1; }
.try [data-w="w2"] { view-transition-name: lb-w2; }
.try [data-w="w3"] { view-transition-name: lb-w3; }
/* Scrolled far down when leaving? Then just fade, don't fly from off screen. */
.leaving-far .hero, .leaving-far .try [data-w] { view-transition-name: none; }

/* ---------- Base ---------- */
:root {
  --bg: #0d1220;
  --text: #f1f4fa;
  --soft: #b8c3d8;
  --muted: #8693ab;
  --line: rgb(255 255 255 / .1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
  --tone: var(--lb-blue);
  --tone-d: var(--lb-blue-d);
}
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font: 700 18px/1.55 var(--lb-font);
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
main { overflow-x: clip; }
body { margin: 0; overflow-x: clip; background: linear-gradient(180deg, #111829 0%, #0d1220 18%, #0f1526 55%, #0b0f1b 100%); }
a { color: #8fc4ff; }
button { font-family: var(--lb-font); }
:focus-visible { outline: 3px solid #8fc4ff; outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
html:not(.js) .js-only { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: #fff; color: var(--lb-ink); font-weight: 900; text-decoration: none; }
.skip-link:focus { top: 12px; }

.c-blue { color: #5cb0ff; }
.c-red { color: #ff7482; }
.c-green { color: #3ddc84; }
.c-orange { color: #ffb53d; }
.c-purple { color: #c99be0; }

.tone-blue { --tone: var(--lb-blue); --tone-d: var(--lb-blue-d); }
.tone-red { --tone: var(--lb-red); --tone-d: var(--lb-red-d); }
.tone-green { --tone: var(--lb-green); --tone-d: var(--lb-green-d); }
.tone-orange { --tone: var(--lb-orange); --tone-d: var(--lb-orange-d); }
.tone-purple { --tone: var(--lb-purple); --tone-d: var(--lb-purple-d); }
.tone-teal { --tone: #469497; --tone-d: #2f6568; }

/* ---------- The top bar ---------- */
.bar { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; gap: 18px; height: 68px; padding: 0 22px; transition: background-color .3s, box-shadow .3s; }
.is-scrolled .bar { background: rgb(12 17 30 / .94); box-shadow: 0 1px 0 var(--line), 0 10px 30px rgb(0 0 0 / .25); }
.bar-back { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 11px; border-radius: 12px; background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .08); color: var(--soft); font: 800 15px/1 var(--lb-font); text-decoration: none; transition: background-color .2s, color .2s; }
.bar-back svg { width: 18px; height: 18px; }
.bar-back:hover { background: rgb(255 255 255 / .12); color: #fff; }
.bar-logo { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-size: 13.5px; }
.bar-kubi { width: 27px; height: 30px; }
.bar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bar-sound { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: rgb(255 255 255 / .06); color: var(--soft); cursor: pointer; transition: background-color .2s, color .2s; }
.bar-sound:hover { background: rgb(255 255 255 / .12); color: #fff; }
.bar-sound svg { grid-area: 1 / 1; width: 20px; height: 20px; }
.bar-sound[aria-pressed="true"] .off, .bar-sound[aria-pressed="false"] .on { display: none; }
.xp-pill { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 13px 0 10px; border-radius: 12px; background: rgb(34 191 102 / .14); box-shadow: inset 0 0 0 2px rgb(46 213 115 / .28); color: #45e08f; font: 900 16px/1 var(--lb-font); font-variant-numeric: tabular-nums; }
.xp-pill svg { width: 17px; height: 17px; }
.xp-pill.bump { animation: bump .55s var(--spring); }
@keyframes bump { 30% { scale: 1.22; } }
.bar-play { margin: 0 0 4px; font-size: 15px; }

/* ---------- The stage ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 112px 28px 140px;
  overflow: hidden;
  background:
    radial-gradient(55% 55% at 74% 46%, rgb(60 100 170 / .42), transparent 70%),
    radial-gradient(50% 45% at 18% 26%, rgb(40 70 130 / .3), transparent 70%),
    linear-gradient(180deg, #141c31 0%, #0e1424 72%, #0d1220 100%);
}
.sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(circle at 7% 14%, rgb(255 255 255 / .8) 0 1.2px, transparent 2px),
    radial-gradient(circle at 18% 62%, rgb(255 255 255 / .55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 26% 9%, rgb(255 255 255 / .6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 33% 82%, rgb(255 255 255 / .5) 0 1.2px, transparent 2px),
    radial-gradient(circle at 41% 30%, rgb(255 255 255 / .45) 0 1px, transparent 1.6px),
    radial-gradient(circle at 49% 6%, rgb(255 255 255 / .7) 0 1.3px, transparent 2px),
    radial-gradient(circle at 57% 72%, rgb(255 255 255 / .4) 0 1px, transparent 1.6px),
    radial-gradient(circle at 63% 21%, rgb(255 255 255 / .6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 90%, rgb(255 255 255 / .5) 0 1.2px, transparent 2px),
    radial-gradient(circle at 78% 38%, rgb(255 255 255 / .55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 85% 12%, rgb(255 255 255 / .75) 0 1.3px, transparent 2px),
    radial-gradient(circle at 91% 66%, rgb(255 255 255 / .45) 0 1px, transparent 1.6px),
    radial-gradient(circle at 96% 32%, rgb(255 255 255 / .6) 0 1px, transparent 1.6px),
    radial-gradient(circle at 3% 44%, rgb(255 255 255 / .5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 12% 92%, rgb(255 255 255 / .6) 0 1.2px, transparent 2px),
    radial-gradient(circle at 52% 52%, rgb(255 255 255 / .3) 0 1px, transparent 1.6px);
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 35%, rgb(255 255 255 / .9) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 45% 16%, rgb(255 255 255 / .9) 0 1.2px, transparent 2px),
    radial-gradient(circle at 67% 48%, rgb(255 255 255 / .9) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 88% 84%, rgb(255 255 255 / .9) 0 1.2px, transparent 2px),
    radial-gradient(circle at 30% 74%, rgb(255 255 255 / .9) 0 1.2px, transparent 2px);
  opacity: .3;
}
.hero.is-live .sky::after { animation: twinkle 3.6s ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: 1; } }

/* Two spotlights, swinging slowly. Soft edges come from the gradient, not from a blur. */
.beam {
  position: absolute;
  top: -6%;
  z-index: -1;
  width: 1300px;
  height: 125%;
  transform-origin: 50% 0;
  pointer-events: none;
  background: conic-gradient(from 165deg at 50% 0%, transparent 0deg, rgb(184 214 255 / .13) 8deg, rgb(184 214 255 / .24) 15deg, rgb(184 214 255 / .13) 22deg, transparent 30deg);
  -webkit-mask: linear-gradient(#000 5%, rgb(0 0 0 / .55) 50%, transparent 92%);
  mask: linear-gradient(#000 5%, rgb(0 0 0 / .55) 50%, transparent 92%);
}
.beam.left { left: calc(8% - 650px); rotate: -24deg; }
.beam.right { left: calc(92% - 650px); rotate: 22deg; }
.hero.is-live .beam.left { animation: sway-l 12s ease-in-out infinite alternate; }
.hero.is-live .beam.right { animation: sway-r 15s ease-in-out infinite alternate; }
@keyframes sway-l { from { rotate: -29deg; } to { rotate: -16deg; } }
@keyframes sway-r { from { rotate: 27deg; } to { rotate: 15deg; } }

/* Faded blocks drifting about. The layers shift a little with the pointer. */
.ghosts { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ghost-layer { position: absolute; inset: 0; transition: transform .8s var(--ease-out); }
.ghost-layer i { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border-radius: 13px; background: var(--c); opacity: var(--o); box-shadow: inset 0 -5px 0 rgb(0 0 0 / .22); }
.ghost-layer i.soft { filter: blur(6px); }
.hero.is-live .ghost-layer i { animation: float 9s ease-in-out infinite alternate; }
.ghost-layer i:nth-child(2) { animation-delay: -3s; }
.ghost-layer i:nth-child(3) { animation-delay: -6s; }
.ghost-layer.mid i { animation-duration: 11s; }
.ghost-layer.near i { animation-duration: 13s; }
@keyframes float { from { translate: 0 -10px; rotate: -4deg; } to { translate: 0 12px; rotate: 4deg; } }

.hero-in { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .92fr); gap: 56px; align-items: center; width: min(1240px, 100%); margin: 0 auto; }
.presents { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; color: #a9bbdb; font: 900 12.5px/1 var(--lb-font); letter-spacing: .34em; text-transform: uppercase; }
.presents::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; }

/* Words as big glowing blocks */
.title { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .2em .2em; margin: 0; font: 900 clamp(40px, 4.4vw, 68px)/1 var(--lb-font); letter-spacing: -.01em; }
.word {
  --c: var(--lb-blue);
  --cd: var(--lb-blue-d);
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: .2em .34em .24em;
  border-radius: .26em;
  background: var(--c);
  color: #fff;
  text-shadow: 0 .04em 0 rgb(0 0 0 / .12);
  box-shadow: 0 .13em 0 var(--cd), 0 .5em 1.1em -.3em color-mix(in srgb, var(--c) 75%, transparent);
  cursor: default;
  user-select: none;
}
.word.blue { --c: var(--lb-blue); --cd: var(--lb-blue-d); }
.word.red { --c: var(--lb-red); --cd: var(--lb-red-d); }
.word.green { --c: var(--lb-green); --cd: var(--lb-green-d); }
.word.orange { --c: var(--lb-orange); --cd: var(--lb-orange-d); }
.word.purple { --c: var(--lb-purple); --cd: var(--lb-purple-d); }
/* A glint of light runs across now and then. */
.word::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 36%, rgb(255 255 255 / .5) 50%, transparent 64%); translate: -110% 0; pointer-events: none; }
.hero.is-live .word::after, .finale.is-live .word::after { animation: glint 8s ease-in-out infinite; animation-delay: calc(var(--i) * 90ms + 2.4s); }
@keyframes glint { 0% { translate: -110% 0; } 12%, 100% { translate: 110% 0; } }
.hero .word { cursor: pointer; }
.word.poke { animation: poke .55s var(--spring); }
@keyframes poke { 30% { translate: 0 -.2em; rotate: -5deg; } 65% { translate: 0 .03em; rotate: 2deg; } }

/* They drop in one by one. Not when arriving through the morph: then they're already there. */
.js:not(.vt) .hero .word { animation: drop .8s cubic-bezier(.3, 1.15, .4, 1) both; animation-delay: calc(var(--i) * 110ms + 200ms); }
.js:not(.vt) .hero .word.poke { animation: poke .55s var(--spring); }
@keyframes drop { from { translate: 0 -140px; rotate: calc((var(--i) - 2) * 7deg); opacity: 0; } 55% { opacity: 1; } to { translate: 0 0; rotate: 0deg; opacity: 1; } }

.title .last { display: inline-flex; align-items: flex-end; gap: .14em; }
.hero-kubi { display: inline-block; width: 1.3em; margin: 0 0 -.1em 0; line-height: 0; cursor: pointer; }
.hero-kubi .kubi { width: 100%; height: auto; }
.kubi.cheer .arm { transform-box: view-box; }
.kubi.cheer .arm.l { transform-origin: 13px 70px; }
.kubi.cheer .arm.r { transform-origin: 107px 70px; }
.hero-kubi.cheering .arm.l { animation: arm-l .9s ease-in-out 2; }
.hero-kubi.cheering .arm.r { animation: arm-r .9s ease-in-out 2; }
.hero-kubi.cheering .kubi, .fin-kubi.cheering svg { animation: kubi-jump .9s var(--spring) 2; }
@keyframes arm-l { 25%, 75% { rotate: 150deg; } 50% { rotate: 120deg; } }
@keyframes arm-r { 25%, 75% { rotate: -150deg; } 50% { rotate: -120deg; } }
@keyframes kubi-jump { 30% { translate: 0 -14%; } 60% { translate: 0 2%; } }
.js:not(.vt) .hero-kubi { animation: kubi-in 1s cubic-bezier(.3, 1.2, .4, 1) .95s both; }
@keyframes kubi-in { from { translate: 0 -60%; scale: .4; opacity: 0; } to { translate: 0 0; scale: 1; opacity: 1; } }

.lead { max-width: 31em; margin: 32px 0 0; color: #c9d3e6; font: 700 clamp(18px, 1.45vw, 21px)/1.55 var(--lb-font); }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 0; }
.js:not(.vt) .hero-copy > :is(.presents, .lead, .ctas) { animation: rise .9s var(--ease-out) both; }
.js:not(.vt) .hero-copy > .presents { animation-delay: .05s; }
.js:not(.vt) .hero-copy > .lead { animation-delay: .8s; }
.js:not(.vt) .hero-copy > .ctas { animation-delay: .95s; }
.js:not(.vt) .try { animation: rise 1s var(--ease-out) .55s both; }
@keyframes rise { from { translate: 0 26px; opacity: 0; } }

/* ---------- The "try it" card in the hero ---------- */
.try { position: relative; justify-self: end; width: 100%; max-width: 480px; padding: 18px 18px 14px; border-radius: 26px; background: #fff; color: var(--lb-ink); box-shadow: 0 0 0 2px rgb(255 255 255 / .55), 0 40px 80px -30px rgb(0 0 0 / .75); font: 700 16px/1.45 var(--lb-font); }
.try::before { content: ""; position: absolute; inset: -32% -26% -44%; z-index: -1; background: radial-gradient(closest-side, rgb(110 168 255 / .36), transparent 75%); pointer-events: none; }
.try-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: #57606f; font: 900 13px/1 var(--lb-font); }
.try .prompt { margin-bottom: 14px; }
.try .blk { font-size: 21px; }
.try .tray { min-height: 78px; gap: 16px 16px; padding-top: 22px; }
.try .zone { min-height: 80px; }
.try .lb-btn.wide { margin-top: 8px; min-height: 50px; }
.try-msg { min-height: 1.45em; margin: 6px 0 0; color: var(--lb-muted); font: 800 14px/1.45 var(--lb-font); text-align: center; }
.try-msg.ok { color: var(--lb-green-d); }
.try-msg.err { color: var(--lb-red-d); }
.try.is-solved .tray { min-height: 0; padding: 0; }
.try.is-solved [data-check] { --c: var(--lb-green); --cd: var(--lb-green-d); --t: #fff; cursor: default; }

/* The little tick on a solved sentence */
.zone.is-right { position: relative; }
.zone.is-right::after { content: ""; position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 50%; background: var(--lb-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-8.5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; box-shadow: 0 3px 0 var(--lb-green-d); animation: pop-in .45s var(--spring) both; }
@keyframes pop-in { from { scale: 0; } }

.cue { position: absolute; left: 50%; bottom: 64px; display: grid; justify-items: center; gap: 10px; translate: -50% 0; color: var(--muted); font: 900 11px/1 var(--lb-font); letter-spacing: .34em; text-decoration: none; text-transform: uppercase; }
.cue i { width: 2px; height: 34px; border-radius: 2px; background: linear-gradient(currentColor, transparent); }
.hero.is-live .cue i { animation: cue 1.9s ease-in-out infinite; }
@keyframes cue { from { translate: 0 -10px; opacity: 0; } 45% { opacity: 1; } to { translate: 0 12px; opacity: 0; } }

/* ---------- The reel: a strip of film with sentences on it ---------- */
.reel { position: relative; z-index: 2; margin: -70px -6vw 0; overflow: hidden; rotate: -2.2deg; background: #05070c; border-block: 1px solid rgb(255 255 255 / .1); box-shadow: 0 24px 60px rgb(0 0 0 / .55); }
.reel-track {
  display: flex;
  width: max-content;
  padding: 20px 0;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .2) 0 12px, transparent 12px 26px) 0 5px / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, rgb(255 255 255 / .2) 0 12px, transparent 12px 26px) 0 calc(100% - 5px) / 100% 7px no-repeat;
}
.reel.is-live .reel-track { animation: reel 64s linear infinite; }
@keyframes reel { to { translate: -50% 0; } }
.frame { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 12px 28px; border-right: 2px solid rgb(255 255 255 / .12); }
.frame b { padding: .3em .62em .36em; border-radius: 10px; color: #fff; font: 900 19px/1.1 var(--lb-font); white-space: nowrap; }
.frame .s { background: var(--lb-blue); box-shadow: 0 3px 0 var(--lb-blue-d); }
.frame .v { background: var(--lb-red); box-shadow: 0 3px 0 var(--lb-red-d); }
.frame .o { background: var(--lb-green); box-shadow: 0 3px 0 var(--lb-green-d); }
.frame .x { background: var(--lb-orange); box-shadow: 0 3px 0 var(--lb-orange-d); }
.frame .p { background: var(--lb-purple); box-shadow: 0 3px 0 var(--lb-purple-d); }

/* ---------- The tour ---------- */
.tour { position: relative; padding: 150px 28px 30px; }
.eyebrow { margin: 0 0 18px; color: #a9bbdb; font: 900 12.5px/1 var(--lb-font); letter-spacing: .34em; text-transform: uppercase; }
.tour-head { max-width: 760px; margin: 0 auto; text-align: center; }
.tour-head h2 { margin: 0; color: #fff; font: 900 clamp(38px, 5vw, 66px)/1.04 var(--lb-font); letter-spacing: -.015em; text-wrap: balance; }
.tour-head h2 + p { max-width: 33em; margin: 22px auto 0; color: var(--soft); font-size: 19px; }

/* The path: a dashed rail with a numbered stop per scene. It lights up behind Kubi as you scroll. */
.path { --rail: 40px; --gap: 52px; position: relative; max-width: 1200px; margin: 50px auto 0; padding: 0 0 20px calc(var(--rail) + var(--gap)); }
.rail { position: absolute; top: 120px; bottom: 200px; left: calc(var(--rail) - 2px); width: 4px; border-radius: 4px; background: repeating-linear-gradient(rgb(255 255 255 / .17) 0 10px, transparent 10px 20px); }
/* One lit stretch per scene, in its colour. They only ever stretch (scaleY), which costs nothing. */
.rail i { position: absolute; left: 0; width: 4px; border-radius: 4px; background: var(--seg); box-shadow: 0 0 14px color-mix(in srgb, var(--seg) 70%, transparent); transform-origin: 50% 0; transform: scaleY(0); }
.rail-kubi { position: absolute; top: 120px; left: calc(var(--rail) - 23px); z-index: 3; width: 46px; height: 51px; margin-top: -74px; pointer-events: none; }
.rail-kubi svg { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }
.rail-kubi.walk svg { animation: walk .32s ease-in-out infinite alternate; }
@keyframes walk { from { rotate: -7deg; } to { rotate: 7deg; } }
html:not(.js) .rail-kubi { display: none; }

.node { position: absolute; top: -2px; left: calc(-1 * var(--gap) - 22px); z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid rgb(255 255 255 / .2); border-radius: 15px; background: #1a2135; color: var(--muted); font: 900 17px/1 var(--lb-font); transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s; }
.scene.is-reached .node, html:not(.js) .node { border-color: rgb(255 255 255 / .85); background: var(--tone); color: #fff; box-shadow: 0 4px 0 var(--tone-d), 0 0 26px var(--tone); }
.scene.is-reached .node { animation: node-pop .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes node-pop { 40% { scale: 1.25; } }

.scene { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); gap: 64px; align-items: center; padding: 110px 0; }
.copy { position: relative; }
.num { position: absolute; top: -78px; right: 0; z-index: -1; color: transparent; font: 900 190px/1 var(--lb-font); letter-spacing: -.04em; -webkit-text-stroke: 2px var(--tone); opacity: .2; pointer-events: none; user-select: none; }
.tag { display: flex; align-items: center; gap: 12px; margin: 6px 0 20px; color: var(--tone); font: 900 12.5px/1 var(--lb-font); letter-spacing: .3em; text-transform: uppercase; }
.tag span { padding: 6px 9px 6px 12px; border: 2px solid var(--tone); border-radius: 999px; color: color-mix(in srgb, var(--tone) 55%, #fff); }
.copy h3 { margin: 0; color: #fff; font: 900 clamp(36px, 4.2vw, 58px)/1.04 var(--lb-font); letter-spacing: -.015em; text-wrap: balance; }
.copy > p:not(.tag) { max-width: 30em; margin: 22px 0 0; color: var(--soft); font-size: 19px; }
.rule { margin: 28px 0 0; padding: 16px 18px 18px; border-radius: 18px; background: rgb(255 255 255 / .05); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .08); }
.rule figcaption { color: #a9bbdb; font: 900 11.5px/1 var(--lb-font); letter-spacing: .24em; text-transform: uppercase; }
.rule blockquote { margin: 10px 0 0; color: #e5ebf5; font: 800 17px/1.5 var(--lb-font); }

.stage-card { position: relative; }
.spot { position: absolute; inset: -30% -24% -42%; z-index: -1; background: radial-gradient(50% 44% at 50% 46%, color-mix(in srgb, var(--tone) 46%, transparent), transparent 74%), radial-gradient(42% 10% at 50% 86%, color-mix(in srgb, var(--tone) 55%, transparent), transparent 100%); pointer-events: none; }
.chip { position: absolute; top: -13px; right: 22px; z-index: 4; padding: 7px 12px; border-radius: 999px; background: var(--tone); color: #fff; font: 900 12px/1 var(--lb-font); letter-spacing: .05em; box-shadow: 0 3px 0 var(--tone-d); }
.card { position: relative; padding: 20px; border-radius: 26px; background: #fff; color: var(--lb-ink); box-shadow: 0 0 0 2px rgb(255 255 255 / .5), 0 40px 80px -36px rgb(0 0 0 / .85); font: 700 16px/1.45 var(--lb-font); }
.card.app { background: var(--lb-bg); }

/* ---------- Bits the app screens share ---------- */
.hearts { display: inline-flex; gap: 2px; font-size: 19px; line-height: 1; }
.hearts i { font-style: normal; transition: opacity .3s, filter .3s, scale .3s; }
.hearts i.lost { opacity: .3; filter: grayscale(1); scale: .8; }
.hearts.ouch { animation: shake .4s; }
.prompt { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 900 19px/1.25 var(--lb-font); }
.prompt-kubi { flex: none; width: 40px; height: 44px; }
.tr { flex: none; padding: 4px 6px; border-radius: 6px; background: #e9edf3; color: #7b8494; font: 900 10.5px/1 var(--lb-font); letter-spacing: .08em; }
.zone { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 12px 8px; min-height: 70px; padding: 12px; border: 2px dashed #cfd6e2; border-radius: 16px; background: #fff; transition: border-color .25s, background-color .25s; }
.zone:empty { align-content: center; justify-content: center; }
.zone:empty::before { content: attr(data-empty); color: #a4adbb; font: 800 15px/1.2 var(--lb-font); }
.zone.is-right { border: 2px solid var(--lb-green); background: #eafbf1; }
.zone.is-wrong { border-color: var(--lb-red); background: #fff1f2; animation: shake .38s; }
@keyframes shake { 20% { translate: -8px 0; } 40% { translate: 7px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; } }
.zone .plus { scale: 0; }
.tray { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 14px 10px; min-height: 62px; padding: 16px 6px 8px; }
.tray.boxed { min-height: 112px; padding: 20px 12px 12px; border: 2px solid #e6eaf0; border-radius: 18px; background: #fff; }
.label { display: flex; align-items: center; gap: 7px; margin: 16px 0 8px; color: #7b8494; font: 900 12px/1 var(--lb-font); letter-spacing: .08em; text-transform: uppercase; }
.label > svg { width: 16px; height: 16px; }
.label .label-kubi { width: 38px; height: 42px; margin: -22px 4px -12px auto; }
.meter { position: relative; display: block; height: 10px; overflow: hidden; border-radius: 99px; background: #e4e9f0; }
.meter > i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, #ff7f50, #ffc94a); transform-origin: left; scale: var(--p, .5) 1; transition: scale .6s var(--ease-out); }
.meter.green > i { background: var(--lb-green); }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions .lb-btn { min-height: 50px; padding-inline: 1em; font-size: 15.5px; }
.actions [data-check], .actions [data-say] { flex: 1; }
.app-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.app-back { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #fff; color: var(--lb-ink); box-shadow: 0 2px 8px rgb(0 0 0 / .08); }
.app-back svg { width: 20px; height: 20px; }
.app-level { flex: 1; display: grid; gap: 7px; min-width: 0; }
.app-level b { overflow: hidden; font: 900 14.5px/1.1 var(--lb-font); text-overflow: ellipsis; white-space: nowrap; }
.fine { margin: 12px 0 0; color: #98a1b0; font: 700 12.5px/1.4 var(--lb-font); text-align: center; }

/* ---------- 1 · Build ---------- */
.card.build { overflow: clip; padding-bottom: 22px; }
.build .blk { font-size: 17px; }
.build .prompt { font-size: 16.5px; }
.sheet { position: absolute; inset: auto 0 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 18px 20px 20px; translate: 0 104%; transition: translate .35s var(--ease-out); font: 900 16px/1.3 var(--lb-font); }
.sheet.ok, .sheet.err { translate: 0 0; }
.sheet.ok { background: #d9fbe6; color: #0b7a3b; }
.sheet.err { background: #ffe3e6; color: #b81220; }
.sheet .s-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.sheet.ok .s-icon { background: var(--lb-green); }
.sheet.err .s-icon { background: var(--lb-red); }
.sheet .s-icon svg { width: 22px; height: 22px; }
.sheet p { margin: 0; }
.sheet small { display: block; margin-top: 2px; font-weight: 800; opacity: .85; }
.sheet .lb-btn { flex: none; margin: 0 0 4px auto; }
.build .tip { display: flex; gap: 10px; align-items: center; margin: 14px 0 0; padding: 12px 14px; border-radius: 16px; background: #f3ecfa; color: #5b2a73; font: 800 14px/1.45 var(--lb-font); }
.build .tip svg { flex: none; width: 34px; height: 38px; }
.build .tip[hidden] { display: none; }

/* ---------- 2 · Speak ---------- */
.speak-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font: 900 18px/1.2 var(--lb-font); }
.speak-head svg { width: 38px; height: 42px; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { display: grid; justify-items: start; gap: 6px; min-width: 100px; padding: 12px 16px 13px; border: 0; border-radius: 16px; background: #eef1f5; color: var(--lb-ink); font: 900 22px/1.1 var(--lb-font); box-shadow: 0 4px 0 #d9dfe8; cursor: pointer; text-align: left; transition: background-color .3s, color .3s, box-shadow .3s, translate .15s; }
.tile em { min-height: 1em; color: transparent; font: 900 13px/1 var(--lb-font); font-style: normal; }
.tile em:not(:empty)::after { content: " / 100"; }
.tile.on { translate: 0 -4px; background: #dcecff; box-shadow: 0 4px 0 #b3d5ff; }
.tile.good { background: var(--lb-green); color: #fff; box-shadow: 0 4px 0 var(--lb-green-d); }
.tile.meh { background: var(--lb-orange); color: #fff; box-shadow: 0 4px 0 var(--lb-orange-d); }
.tile.good em, .tile.meh em { color: rgb(255 255 255 / .95); }
.tile.scored { animation: pop .45s var(--spring); }
@keyframes pop { 40% { scale: 1.1; } }
.wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 76px; margin: 18px 0 4px; }
.wave i { width: 6px; height: 56px; border-radius: 6px; background: #d3dae5; scale: 1 .12; transition: background-color .3s; }
.wave.on i { background: var(--lb-blue); animation: bar .46s ease-in-out infinite alternate; }
.wave i:nth-child(3n) { --h: .55; animation-duration: .38s; }
.wave i:nth-child(3n + 1) { --h: .95; animation-delay: -.15s; }
.wave i:nth-child(4n + 2) { --h: .7; animation-duration: .55s; animation-delay: -.3s; }
.wave i:nth-child(5n) { --h: .4; animation-delay: -.08s; }
@keyframes bar { from { scale: 1 .14; } to { scale: 1 var(--h, .8); } }
.speak-status { min-height: 1.45em; margin: 0; color: var(--lb-muted); font-weight: 800; text-align: center; }

/* ---------- 3 · Talk with Kubi (new in the app: a spoken conversation, then a recap) ---------- */
.new-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border: 2px solid #4c8889; border-radius: 999px; background: #1e2e36; color: #8fd3d3; font: 900 11px/1 var(--lb-font); letter-spacing: .2em; }
.new-tag svg { width: 13px; height: 13px; }
.say-block { display: inline-block; margin-top: .06em; padding: 0 .26em .05em; border-radius: .2em; background: var(--tone); color: #fff; box-shadow: 0 .09em 0 var(--tone-d); }
.feats { display: grid; gap: 16px; margin: 26px 0 0; padding: 0; list-style: none; }
.feats li { display: flex; align-items: flex-start; gap: 14px; }
.f-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #1f343c; color: #6cc1c4; box-shadow: inset 0 0 0 1px rgb(108 193 196 / .2); }
.f-ic svg { width: 21px; height: 21px; }
.feats li > span:last-child { color: var(--soft); font: 700 16px/1.5 var(--lb-font); }
.feats b { display: block; color: #fff; font: 900 17px/1.3 var(--lb-font); }

.card.talk { display: flex; flex-direction: column; gap: 12px; height: 580px; padding: 14px; background: #f2f4f6; }
.t-top { padding: 12px 16px 14px; border-radius: 18px; background: #fff; box-shadow: 0 1px 0 #e3e8ee; }
.t-topic { margin: 0 0 9px; color: var(--lb-ink); font: 900 17px/1.2 var(--lb-font); }
.t-topic span { margin-right: 4px; color: #7b8494; font-size: 13.5px; }
.t-time { display: flex; align-items: center; gap: 12px; }
.t-time .meter { flex: 1; }
.meter.teal > i { background: var(--tone); }
.t-time [data-t-clock] { color: #4a5363; font: 900 14px/1 var(--lb-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The talk scrolls inside the card as it grows, so the card never changes size. */
.t-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; margin: 0 -8px; padding: 2px 8px 6px; overflow-y: auto; scrollbar-width: thin; }
.t-log { display: grid; gap: 10px; }
.talk .msg p { font-size: 15px; }
.talk .msg.kubi p { background: #fff; box-shadow: 0 1px 0 #e3e8ee; }
.talk .msg.me p { background: var(--tone); }
.talk mark { padding: 0 .22em; border-radius: 6px; background: #fbe69c; color: inherit; box-shadow: inset 0 -2px 0 #f2cf55; }
.t-tip { display: flex; align-items: center; gap: 7px; margin: -2px 0 0 40px; color: #397a7e; font: 900 13px/1.3 var(--lb-font); }
.t-tip svg { flex: none; width: 15px; height: 15px; color: #e3b341; }
.t-tip.new { animation: msg-in .35s var(--ease-out); }
.msg.listening p { display: inline-flex; align-items: center; gap: 9px; }
.t-wave { display: inline-flex; align-items: center; gap: 3px; height: 16px; }
.t-wave i { width: 3px; height: 16px; border-radius: 2px; background: #fff; scale: 1 .3; animation: bar .42s ease-in-out infinite alternate; }
.t-wave i:nth-child(2) { --h: .95; animation-delay: -.12s; }
.t-wave i:nth-child(3) { --h: .6; animation-delay: -.3s; }
.t-wave i:nth-child(4) { --h: .85; animation-delay: -.2s; }
.t-wave i:nth-child(5) { --h: .5; animation-delay: -.05s; }
.t-say { display: grid; gap: 8px; }
.t-say[hidden], .t-recap[hidden], .t-again[hidden] { display: none; }
.t-say-h { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 2px 0 0; color: #7b8494; font: 900 11.5px/1 var(--lb-font); letter-spacing: .1em; text-transform: uppercase; }
.t-say-h svg { width: 15px; height: 15px; color: var(--tone); }
.t-opt { justify-self: end; max-width: 92%; padding: 11px 15px; border: 0; border-radius: 18px 18px 6px 18px; background: #fff; color: var(--tone-d); font: 800 15px/1.35 var(--lb-font); text-align: left; cursor: pointer; box-shadow: inset 0 0 0 2px #9fd0d1, 0 3px 0 #9fd0d1; transition: background-color .2s, translate .1s; animation: msg-in .35s var(--ease-out) both; }
.t-opt + .t-opt { animation-delay: .08s; }
.t-opt:hover { background: #ecf7f7; }
.t-opt:active { translate: 0 2px; }
.t-opt:focus-visible { outline: 3px solid var(--tone); outline-offset: 2px; }
.t-recap { padding: 16px 18px 18px; border-radius: 20px; background: #fff; box-shadow: 0 1px 0 #e3e8ee, 0 14px 30px -18px rgb(20 40 50 / .35); }
.t-recap.new { animation: msg-in .45s var(--ease-out); }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.r-head b { font: 900 21px/1.1 var(--lb-font); }
.r-xp { padding: 6px 11px; border-radius: 999px; background: #fdf4da; color: #a86500; font: 900 14px/1 var(--lb-font); }
.r-xp.pop { animation: pop .45s var(--spring); }
.r-label { margin: 14px 0 7px; color: #6b7686; font: 900 11.5px/1 var(--lb-font); letter-spacing: .14em; text-transform: uppercase; }
.r-good { display: flex; align-items: center; gap: 9px; margin: 7px 0 0; font: 800 15px/1.35 var(--lb-font); }
.r-tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #c8e8cf; color: #12844a; }
.r-tick svg { width: 13px; height: 13px; }
.r-swap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font: 900 15px/1.35 var(--lb-font); }
.r-swap s { color: #e1686f; text-decoration-thickness: 2px; }
.r-swap svg { flex: none; width: 15px; height: 15px; color: var(--tone); }
.r-swap b { color: #2f7f82; }
.r-why { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: #f2f6fa; }
.r-why span { color: #7b8494; font: 900 11px/1 var(--lb-font); letter-spacing: .12em; text-transform: uppercase; }
.r-why p { margin: 5px 0 0; color: var(--lb-ink); font: 800 14.5px/1.45 var(--lb-font); }
.r-fix + .r-fix { margin-top: 14px; }
.r-none { margin: 0; color: #4a5363; font: 800 15px/1.4 var(--lb-font); }
.r-teacher { margin: 14px 0 0; padding-top: 12px; border-top: 2px solid #eef1f5; color: #6b7686; font: 800 13px/1.35 var(--lb-font); }
.t-again { min-height: 50px; margin-top: 16px; font-size: 16px; }
.t-fine { color: var(--muted); }

/* ---------- 4 · Write ---------- */
.w-task { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.w-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #ffe6ee; color: #ff6b81; }
.w-ico svg { width: 20px; height: 20px; }
.w-task > span:last-child { display: grid; gap: 3px; color: #8a93a3; font: 900 11.5px/1.2 var(--lb-font); letter-spacing: .1em; text-transform: uppercase; }
.w-task b { color: var(--lb-ink); font-size: 17px; letter-spacing: 0; text-transform: none; }
.w-text { margin: 0; padding: 14px 18px; border-radius: 16px; background: #f6f8fb; font: 800 20px/2.05 var(--lb-font); }
.w-text.typing::after { content: ""; display: inline-block; width: 3px; height: 1.1em; margin-left: 2px; vertical-align: -.15em; border-radius: 2px; background: var(--lb-blue); animation: caret .7s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.mark { display: inline; margin: 0; padding: .06em .36em .12em; border: 0; border-radius: 10px; font: inherit; line-height: 1.3; cursor: pointer; transition: background-color .3s, color .3s, box-shadow .3s; }
.mark.hard { background: #d42a3a; color: #fff; box-shadow: 0 3px 0 #9b1422; }
.mark.soft { background: #ffe0e4; color: #c41c2e; box-shadow: inset 0 -3px 0 #ff9aa5; }
.mark[aria-expanded="true"] { outline: 3px solid var(--lb-blue); outline-offset: 2px; }
.mark.fixed { background: #d9f7e5; color: #0b7a3b; box-shadow: inset 0 -3px 0 #7fe0a6; cursor: default; }
.mark.fixed.pop { animation: pop .45s var(--spring); }
.w-explain { display: grid; align-content: center; min-height: 112px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: #f1f4f8; }
.w-hint { margin: 0; color: #8a93a3; font-weight: 800; text-align: center; }
.w-fix { margin: 0; font: 900 16.5px/1.4 var(--lb-font); }
.w-fix b { margin-right: 4px; color: #0b7a3b; }
.w-tr { display: flex; gap: 8px; align-items: baseline; margin: 6px 0 0; color: #5f6878; font: 800 14.5px/1.4 var(--lb-font); }
.w-tr .tr { position: relative; top: -1px; }
.w-explain .lb-btn { justify-self: start; margin-top: 12px; }
.w-own { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; color: #5b6576; font: 800 13.5px/1.4 var(--lb-font); }
.w-own svg { flex: none; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--lb-green); color: #fff; }
.w-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 2px solid #eef1f5; }
.w-mark { display: flex; align-items: center; gap: 8px; margin: 0; font: 900 15px/1 var(--lb-font); }
.w-mark b { font-size: 22px; }
.w-mark span { padding: 5px 9px; border-radius: 999px; background: #fff1d6; color: #a86500; font-size: 12.5px; }
.w-mark.final span { background: #d9f7e5; color: #0b7a3b; }
.w-foot .lb-btn { margin: 0 0 4px; }

/* ---------- 5 · Ask Kubi ---------- */
.c-context { display: grid; gap: 8px; padding: 13px 15px; border-radius: 16px; background: #f6f8fb; font: 900 17px/1.3 var(--lb-font); }
.c-context p { display: flex; align-items: center; gap: 10px; margin: 0; }
.c-badge { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; }
.c-badge svg { width: 14px; height: 14px; }
.c-wrong .c-badge { background: var(--lb-red); }
.c-right .c-badge { background: var(--lb-green); }
.c-wrong s { color: var(--lb-red-d); text-decoration-thickness: 3px; }
.c-right b { color: var(--lb-green-d); }
.c-log { display: grid; gap: 10px; margin: 16px 0; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 90%; }
.msg p { margin: 0; padding: 11px 14px; border-radius: 18px; font: 800 15.5px/1.45 var(--lb-font); }
.msg.kubi p { border-bottom-left-radius: 6px; background: #eef1f5; }
.msg.me { justify-self: end; }
.msg.me p { border-bottom-right-radius: 6px; background: var(--lb-blue); color: #fff; }
.msg.new { animation: msg-in .35s var(--ease-out); }
@keyframes msg-in { from { translate: 0 10px; opacity: 0; } }
.msg-kubi { flex: none; width: 32px; height: 36px; }
.msg.typing p { display: flex; gap: 5px; padding: 15px 16px; }
.msg.typing p i { width: 8px; height: 8px; border-radius: 50%; background: #9aa4b4; animation: dot 1s ease-in-out infinite; }
.msg.typing p i:nth-child(2) { animation-delay: .15s; }
.msg.typing p i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 30% { translate: 0 -5px; opacity: .6; } }
.c-asks { display: flex; flex-wrap: wrap; gap: 8px; }
.c-q { padding: 10px 14px; border: 0; border-radius: 999px; background: #fff; color: var(--lb-blue-d); font: 800 14.5px/1.2 var(--lb-font); box-shadow: inset 0 0 0 2px #cfe3ff, 0 3px 0 #cfe3ff; cursor: pointer; transition: background-color .2s, opacity .3s, translate .1s; }
.c-q:hover { background: #f0f7ff; }
.c-q:active { translate: 0 2px; }
.c-q:disabled { opacity: .4; cursor: default; translate: none; }

/* ---------- 6 · Words ---------- */
.v-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.v-title { flex: 1; font: 900 18px/1.2 var(--lb-font); }
.v-count { margin: 10px 0 12px; color: #7b8494; font: 900 14px/1 var(--lb-font); }
.v-stage { position: relative; perspective: 1400px; }
.v-card { display: block; width: 100%; height: 236px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.v-card:focus-visible { outline: none; }
.v-card:focus-visible .v-face { box-shadow: inset 0 0 0 3px var(--lb-blue), 0 6px 0 #dfe5ee; }
.v-in { position: relative; display: block; height: 100%; transform-style: preserve-3d; transition: rotate .6s cubic-bezier(.3, 1.25, .5, 1); }
.v-card[aria-pressed="true"] .v-in { rotate: y 180deg; }
.v-face { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 20px 30px; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 2px #e6eaf0, 0 6px 0 #dfe5ee; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.v-face b { font: 900 36px/1.15 var(--lb-font); text-wrap: balance; }
.v-face.back { rotate: y 180deg; }
.v-face.back b { font-size: 21px; line-height: 1.35; }
.v-face small { color: #8a93a3; font: 800 14px/1.2 var(--lb-font); }
.v-face.done b { color: var(--lb-green-d); }
.v-say { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 14px; background: #e8f2ff; color: var(--lb-blue); box-shadow: inset 0 0 0 2px #cfe3ff, 0 3px 0 #cfe3ff; cursor: pointer; }
.v-say[hidden] { display: none; }
.v-say svg { width: 26px; height: 26px; }
.v-say:active { translate: 0 2px; box-shadow: inset 0 0 0 2px #cfe3ff; }
.vocab [data-v-next] { margin-top: 16px; min-height: 52px; }

/* ---------- 7 · Home screen ---------- */
.card.home { overflow: hidden; padding: 0; }
.h-hero { position: relative; padding: 20px 20px 22px; border-radius: 0 0 28px 28px; background: radial-gradient(120% 90% at 92% 0%, #3d588c, transparent 60%), linear-gradient(160deg, #2c3653, #1b2236); color: #fff; }
.h-row { display: flex; align-items: flex-start; justify-content: space-between; }
.h-hi { margin: 0; font: 900 27px/1.1 var(--lb-font); }
.h-icons { display: flex; gap: 8px; }
.h-icons i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgb(255 255 255 / .12); }
.h-icons svg { width: 18px; height: 18px; }
.h-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.h-streak { display: inline-flex; align-items: center; gap: 6px; font: 900 19px/1 var(--lb-font); }
.dots { display: inline-flex; gap: 4px; margin-left: 4px; }
.dots i { width: 11px; height: 11px; border-radius: 4px; background: rgb(255 255 255 / .18); transition: background-color .3s; }
.dots i.on { background: #ffb020; }
.dots i.lit { animation: pop .5s var(--spring); }
.h-xp { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 12px; background: rgb(0 0 0 / .25); color: #ffcf4a; font: 900 16px/1 var(--lb-font); font-variant-numeric: tabular-nums; }
.h-xp svg { width: 16px; height: 16px; }
.h-next { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; }
.h-next > span { color: #62b4ff; font: 900 12px/1 var(--lb-font); letter-spacing: .14em; text-transform: uppercase; }
.h-next em { padding: 4px 8px; border-radius: 8px; background: rgb(255 159 10 / .2); color: #ffb53d; font: 900 12px/1 var(--lb-font); font-style: normal; }
.h-title { margin: 8px 0 0; padding-right: 76px; font: 900 23px/1.15 var(--lb-font); }
.h-sub { margin: 4px 0 0; color: #b7c2d6; font: 800 14px/1.3 var(--lb-font); }
.h-meter { display: block; height: 10px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: rgb(255 255 255 / .14); }
.h-meter i { display: block; height: 100%; border-radius: inherit; background: var(--lb-green); transform-origin: left; scale: var(--p, .88) 1; transition: scale .7s var(--spring); }
.h-actions { display: flex; gap: 10px; margin-top: 18px; }
.h-actions .lb-btn { min-height: 52px; margin: 0 0 5px; padding-inline: 1em; font-size: 17px; }
.h-actions [data-continue] { --t: #0f3a20; flex: 1.5; }
.lb-btn.outline { --c: transparent; --cd: transparent; --t: #fff; flex: 1; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .3); cursor: default; }
.lb-btn.outline:hover { background: transparent; }
.lb-btn.outline:active { translate: none; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .3); }
.h-kubi { position: absolute; top: 96px; right: 18px; width: 64px; }
.h-kubi svg { display: block; width: 64px; height: 71px; }
.h-kubi b { position: absolute; top: -12px; right: -10px; font-size: 26px; }
.h-kubi.hop { animation: kubi-jump .7s var(--spring); }
.h-label { margin: 18px 20px 10px; font: 900 18px/1 var(--lb-font); }
.h-tasks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 0 20px 22px; }
.t { position: relative; display: grid; align-content: start; gap: 4px; padding: 14px; border-radius: 20px; font: 800 13.5px/1.3 var(--lb-font); }
.t > b { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font: 900 15.5px/1.1 var(--lb-font); }
.t > b i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; font: 900 15px/1 var(--lb-font); font-style: normal; }
.t > b svg { width: 16px; height: 16px; }
.t strong { font: 900 40px/1 var(--lb-font); }
.t span strong { font-size: 24px; }
.t.homework { grid-row: span 2; background: linear-gradient(160deg, #a55bd0, #8a44b8); color: #fff; box-shadow: 0 5px 0 #6b2f93; }
.t.homework > b i { color: #8a44b8; }
.t.homework strong { margin-top: 10px; font-size: 48px; }
.t.homework em { justify-self: start; margin-top: 12px; padding: 5px 10px; border-radius: 999px; background: #fff; color: #c81e3c; font: 900 12.5px/1 var(--lb-font); font-style: normal; }
.t.writing { background: #fde8ef; color: #8a93a3; box-shadow: inset 0 0 0 2px #f8d3df; }
.t.writing > b { color: var(--lb-ink); }
.t.writing > b i { color: #ff6b81; }
.t.vocab { background: linear-gradient(160deg, #3fae6a, #2d8f55); color: #fff; box-shadow: 0 5px 0 #1f6b3e; }
.t.vocab > b i { color: #2d8f55; }
.t.extra { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; background: #effbf3; color: #5b6576; box-shadow: inset 0 0 0 2px #cdeed9, 0 4px 0 #cdeed9; }
.t.extra > b { grid-column: 1; color: var(--lb-ink); }
.t.extra > b i { background: #d9f7e5; color: var(--lb-green-d); }
.t.extra > span:not(.go) { grid-column: 1; padding-left: 38px; }
.t.extra .go { grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--lb-green); color: #0f3a20; box-shadow: 0 3px 0 var(--lb-green-d); }
.t.extra .go svg { width: 18px; height: 18px; }

/* ---------- 8 · Teacher ---------- */
.t-head { margin: 0 0 12px; color: #8a93a3; font: 900 12px/1 var(--lb-font); letter-spacing: .12em; text-transform: uppercase; }
.t-field { display: grid; gap: 7px; }
.t-field span { font: 900 13.5px/1 var(--lb-font); }
.t-field input { height: 50px; padding: 0 14px; border: 2px solid #dfe5ee; border-radius: 14px; background: #f8fafc; color: var(--lb-ink); font: 800 17px/1 var(--lb-font); transition: border-color .2s, box-shadow .2s; }
.t-field input:focus { border-color: var(--lb-blue); outline: none; box-shadow: 0 0 0 4px rgb(30 144 255 / .16); }
.t-levels { display: flex; gap: 8px; margin: 12px 0 14px; }
.t-levels button { flex: 1; height: 44px; border: 0; border-radius: 12px; background: #eef1f5; color: #5b6576; font: 900 15px/1 var(--lb-font); box-shadow: 0 3px 0 #d6dde7; cursor: pointer; transition: background-color .2s, color .2s; }
.t-levels button[aria-checked="true"] { background: var(--lb-blue); color: #fff; box-shadow: 0 3px 0 var(--lb-blue-d); }
.t-levels button:focus-visible { outline: 3px solid var(--lb-ink); outline-offset: 2px; }
.teacher [data-make] { min-height: 52px; }
.t-steps { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.t-steps li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; background: #f3f5f9; font: 900 14.5px/1.2 var(--lb-font); }
.t-steps li span { color: #0b7a3b; font: 800 13.5px/1.2 var(--lb-font); transition: opacity .3s; }
.t-steps li i { width: 22px; height: 22px; border-radius: 50%; background: #dfe5ee; }
.t-steps li.busy i { border: 3px solid #cfe3ff; border-top-color: var(--lb-blue); background: none; animation: spin .7s linear infinite; }
.t-steps li.done i, html:not(.js) .t-steps li i { background: var(--lb-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-8.5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; }
.t-steps li.done i { animation: pop-in .35s var(--spring); }
.js .t-steps li:not(.done) span { opacity: 0; }
@keyframes spin { to { rotate: 1turn; } }
.t-qr { display: grid; grid-template-columns: 116px 1fr; gap: 16px; align-items: center; margin-top: 14px; padding: 14px; border-radius: 16px; background: #f3f5f9; transition: opacity .5s; }
.t-qr .qr { display: block; width: 116px; height: 116px; border-radius: 10px; transition: filter .5s; }
.t-qr p { margin: 0; color: #5b6576; font: 800 14px/1.45 var(--lb-font); }
.t-qr b { display: block; margin-bottom: 4px; color: var(--lb-ink); font: 900 15.5px/1.3 var(--lb-font); }
.t-qr small { display: block; margin-top: 6px; color: var(--lb-blue-d); font: 900 13px/1.3 var(--lb-font); }
.js .t-qr:not(.show) { opacity: .4; }
.js .t-qr:not(.show) .qr { filter: blur(4px); }
.t-qr.show { animation: rise .6s var(--ease-out); }

/* ---------- 9 · The school ---------- */
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tile { display: grid; gap: 6px; margin: 0; padding: 14px 16px; border-radius: 16px; background: #f3f5f9; }
.m-tile span { color: #7b8494; font: 900 13px/1.2 var(--lb-font); }
.m-tile b { font: 900 36px/1 var(--lb-font); font-variant-numeric: tabular-nums; }
.m-label { margin: 16px 0 8px; font: 900 14px/1 var(--lb-font); }
.m-meter { display: block; height: 12px; overflow: hidden; border-radius: 99px; background: #e4e9f0; }
.m-meter i { display: block; height: 100%; border-radius: inherit; background: var(--lb-blue); transform-origin: left; scale: .38 1; transition: scale 1.4s var(--ease-out) .2s; }
.js .manager:not(.counted) .m-meter i { scale: 0 1; }
.m-rows { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.m-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #f3f5f9; font: 900 14.5px/1.3 var(--lb-font); }
.m-rows b { color: #d6336c; font-variant-numeric: tabular-nums; }

/* ---------- Credits ---------- */
.credits { padding: 140px 28px 60px; text-align: center; }
.title.small { justify-content: center; font-size: clamp(36px, 4.4vw, 60px); }
.roll { display: grid; gap: 24px; max-width: 640px; margin: 56px auto 0; }
.roll div { display: grid; gap: 6px; }
.roll dt { color: var(--muted); font: 900 12px/1.3 var(--lb-font); letter-spacing: .22em; text-transform: uppercase; }
.roll dd { margin: 0; color: #fff; font: 900 24px/1.25 var(--lb-font); }

/* ---------- The final scene ---------- */
.finale { position: relative; isolation: isolate; padding: 90px 28px 150px; overflow: hidden; text-align: center; }
.spot.gold { inset: -40px 0 auto; height: 820px; background: radial-gradient(42% 52% at 50% 42%, rgb(255 205 110 / .2), transparent 72%); opacity: 0; transition: opacity 1.6s .2s; }
.finale.in .spot.gold, html:not(.js) .spot.gold { opacity: 1; }
.fin { max-width: 680px; margin: 0 auto; }
.fin-kubi { position: relative; display: inline-block; margin-bottom: 24px; }
.fin-kubi svg { display: block; width: 104px; height: 116px; }
.fin-kubi b { position: absolute; top: -10px; right: -30px; font-size: 42px; }
.stars { display: flex; justify-content: center; gap: 12px; margin: 30px 0 0; }
.stars svg { width: 48px; height: 48px; color: #2c3550; transition: color .4s; }
.stars svg.on { color: #ffc531; }
.stars svg.on.pop { animation: star .6s var(--spring) both; }
@keyframes star { from { scale: 0; rotate: -60deg; } }
.fin-stats { display: flex; justify-content: center; gap: 14px; margin: 28px 0 0; }
.fin-stats p { min-width: 160px; margin: 0; padding: 16px 20px; border-radius: 20px; background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .1); }
.fin-stats b { display: block; color: #fff; font: 900 36px/1.1 var(--lb-font); font-variant-numeric: tabular-nums; }
.fin-stats span { color: #a9bbdb; font: 900 13px/1.3 var(--lb-font); }
.fin-msg { max-width: 30em; margin: 26px auto 0; color: var(--soft); font-size: 19px; }
.fin .ctas { justify-content: center; margin-top: 30px; }
.lb-btn .out { width: .9em; height: .9em; opacity: .8; }

.foot { padding: 30px 28px 46px; border-top: 1px solid var(--line); color: #6f7b93; font: 800 14px/1.5 var(--lb-font); text-align: center; }
.foot p { margin: 0; }

/* ---------- XP flying up to the bar, and confetti ---------- */
.xp-fly { position: fixed; left: 0; top: 0; z-index: 90; padding: 8px 12px; border-radius: 12px; background: var(--lb-green); color: #fff; font: 900 16px/1 var(--lb-font); white-space: nowrap; box-shadow: 0 4px 0 var(--lb-green-d), 0 10px 30px rgb(34 191 102 / .45); pointer-events: none; }
.confetti { position: fixed; z-index: 80; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 3px; pointer-events: none; }

/* ---------- Things slide in as they scroll into view ---------- */
.js [data-reveal], .js .scene .copy > :not(.num, .node), .js .scene .stage-card {
  opacity: 0;
  translate: 0 30px;
  transition: opacity .8s var(--ease-out), translate .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js .scene .copy > h3 { --d: 70ms; }
.js .scene .copy > p:not(.tag) { --d: 140ms; }
.js .scene .copy > .rule { --d: 210ms; }
.js .scene .stage-card { --d: 160ms; translate: 0 50px; }
.js [data-reveal].in, .js .scene.in .copy > :not(.num, .node), .js .scene.in .stage-card { opacity: 1; translate: 0 0; }
.js .scene .num { opacity: 0; transition: opacity 1.2s; }
.js .scene.in .num { opacity: .2; }
.js .scene .spot { opacity: 0; transition: opacity 1.2s .2s; }
.js .scene.in .spot { opacity: 1; }
/* The big outlined numbers drift a little slower than the page, where the browser can do it for free. */
@supports (animation-timeline: view()) {
  .scene .num { animation: drift linear both; animation-timeline: view(); animation-range: cover; }
  @keyframes drift { from { translate: 0 70px; } to { translate: 0 -70px; } }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1080px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .try { justify-self: start; }
  .hero { padding-bottom: 150px; }
}
@media (max-width: 920px) {
  .scene { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 80px 0; }
  .num { top: -60px; font-size: 150px; }
  .stage-card { max-width: 560px; }
}
@media (max-width: 640px) {
  html { font-size: 17px; }
  .bar { gap: 10px; height: 60px; padding: 0 12px; }
  .bar-back { justify-content: center; width: 40px; padding: 0; }
  .bar-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bar-logo { font-size: 11.5px; }
  .bar-kubi { width: 23px; height: 26px; }
  .bar-end { gap: 6px; }
  .bar-sound { width: 36px; height: 36px; }
  .xp-pill { height: 34px; padding: 0 10px 0 8px; font-size: 15px; }
  .bar-play { display: none; }
  .hero { padding: 92px 16px 130px; }
  .presents { margin-bottom: 18px; }
  .title { font-size: clamp(34px, 10.4vw, 46px); }
  .lead { margin-top: 24px; font-size: 18px; }
  .ctas { gap: 10px; }
  .ctas .lb-btn.big { flex: 1; padding-inline: 1em; }
  .try { padding: 16px 14px 12px; border-radius: 22px; }
  .try .blk { font-size: 17px; }
  .cue { display: none; }
  .reel { margin-top: -60px; }
  .frame { padding: 10px 20px; }
  .frame b { font-size: 16px; }
  .tour { padding: 110px 16px 20px; }
  .tour-head h2 + p { font-size: 17.5px; }
  .path { --rail: 15px; --gap: 30px; }
  .node { left: calc(-1 * var(--gap) - 16px); width: 32px; height: 32px; border-radius: 11px; font-size: 14px; }
  .rail-kubi { left: calc(var(--rail) - 17px); width: 34px; height: 38px; margin-top: -54px; }
  .scene { gap: 34px; padding: 64px 0; }
  .num { top: -40px; font-size: 110px; }
  .tag { gap: 8px; margin-bottom: 16px; font-size: 11px; letter-spacing: .22em; }
  .copy > p:not(.tag) { font-size: 17.5px; }
  .rule blockquote { font-size: 16px; }
  .chip { right: 14px; }
  .card { padding: 16px 14px; border-radius: 22px; }
  .build .blk { font-size: 15.5px; }
  .tray.boxed { gap: 14px 8px; padding: 18px 8px 10px; }
  .actions { gap: 8px; }
  .actions .lb-btn { padding-inline: .8em; font-size: 15px; }
  .build .actions [data-reset], .build .actions [data-skip] { width: 50px; padding: 0; }
  .build .actions .btn-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet { flex-wrap: wrap; padding: 14px 16px 16px; }
  .sheet .lb-btn { width: 100%; margin: 4px 0; }
  .tile { flex: 1; min-width: 0; padding: 11px 12px 12px; font-size: 19px; }
  .w-text { padding: 12px 14px; font-size: 17.5px; }
  .w-foot { flex-wrap: wrap; }
  .msg { max-width: 96%; }
  .card.talk { height: 540px; padding: 12px; }
  .feats b { font-size: 16px; }
  .feats li > span:last-child { font-size: 15px; }
  .t-tip { margin-left: 0; }
  .v-card { height: 210px; }
  .v-face { padding: 20px; }
  .v-face b { font-size: 30px; }
  .v-face.back b { font-size: 19px; }
  .h-hero { padding: 18px 16px 20px; }
  .h-title { font-size: 20px; }
  .h-kubi { top: 104px; right: 12px; width: 52px; }
  .h-kubi svg { width: 52px; height: 58px; }
  .h-tasks { gap: 8px; padding: 0 14px 18px; }
  .h-actions { gap: 8px; }
  .h-actions .lb-btn { min-width: 0; padding-inline: .6em; font-size: 15px; }
  .h-actions .outline svg { display: none; }
  .t > b { gap: 6px; font-size: 14px; }
  .t > b i { width: 26px; height: 26px; border-radius: 8px; }
  .h-label { margin-inline: 14px; }
  .t { padding: 12px; }
  .t.homework strong { font-size: 40px; }
  .t-qr { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .t-qr .qr { width: 120px; height: 120px; }
  .m-tile b { font-size: 30px; }
  .credits { padding: 110px 16px 40px; }
  .roll dd { font-size: 20px; }
  .finale { padding: 70px 16px 110px; }
  .fin-stats { gap: 10px; }
  .fin-stats p { flex: 1; min-width: 0; padding: 14px 10px; }
  .fin-stats b { font-size: 30px; }
  .fin .ctas .lb-btn { flex: 1 1 100%; }
}

/* ---------- Less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js .scene .copy > :not(.num, .node), .js .scene .stage-card { opacity: 1; translate: none; }
  .scene .num { animation: none !important; }
  .word::after { display: none; }
}
