/* Instrument Sans (SIL OFL 1.1, fonts/OFL.txt): the default book type (dusk look). */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 400 700; font-display: swap; src: url(fonts/instrument-sans-latin-wght-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --page: #2c2539; --board: #1b1530; --panel: #2a1f47; --edge: #4a4068; --plum: #2a1846;
  --line: rgba(255, 255, 255, .1);   /* hairline border for raised surfaces */
  --chalk: #f1eef7; --dim: #a9a2bf; --faint: #5f577a;
  --task: #f0b45a; --quiz: #c4b0f5; --good: #8fd6b0; --bad: #f08c7a;
  --ui: "Instrument Sans", "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
  --dusk: radial-gradient(70% 75% at 100% 100%, rgba(230, 164, 156, .9), rgba(230, 164, 156, 0) 62%),
    radial-gradient(60% 75% at 92% 48%, rgba(160, 132, 220, .85), rgba(160, 132, 220, 0) 66%),
    linear-gradient(162deg, #2c2539 0%, #3e3454 34%, #6c5c99 68%, #a084dc 100%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--page); }
/* Around the lesson: the cover's dusk gradient and grain (the frame sits on it like the cover's feature panel). */
body { color: var(--chalk); font: 26px/1.4 var(--ui); background: var(--dusk); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; background: var(--grain); pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--task); outline-offset: 3px; }
button[hidden] { display: none; }

/* One fixed 1600×960 frame (900 stage + 60 controls), scaled to fit the window. */
#frame { position: absolute; left: 50%; top: calc(50% + 30px); width: 1600px; height: 960px; transform: translate(-50%, -50%) scale(var(--k, .5));
  border-radius: 26px; overflow: hidden; background: var(--board); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 40px 110px rgba(14, 8, 30, .55); }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: block; }
#ui { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; pointer-events: none; }
#ui > * { pointer-events: auto; }

.cover { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 64px;
  padding: 0 96px 0 110px; border: 0; text-align: left; color: #fff; background: var(--dusk); isolation: isolate; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grain); }
.cover[hidden] { display: none; }
.cover-text { display: flex; flex-direction: column; align-items: flex-start; }
.cover-k { margin: 0 0 22px; font-size: 22px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #fff; opacity: .85; }
.cover-t { margin: 0 0 48px; max-width: 820px; font: 400 80px/1.02 var(--ui); letter-spacing: -.035em; color: #fff; text-wrap: balance; }
.cover-art { width: 600px; aspect-ratio: 16 / 9; border-radius: 26px; overflow: hidden; box-shadow: 0 30px 80px rgba(14, 8, 30, .45); animation: rise .9s cubic-bezier(.2, .8, .2, 1) .2s backwards; }
/* "From the book": the start screen as a slide before the lesson (coverage.js). The title steps down to make room. */
.cover { cursor: pointer; }
.cover.with-cov { align-items: center; padding: 56px 84px 56px 100px; gap: 56px; }
.with-cov .cover-t { margin-bottom: 30px; font-size: 64px; }
.with-cov .cover-k { margin-bottom: 16px; }
.cover-side { display: flex; flex-direction: column; gap: 22px; width: 560px; }
.with-cov .cover-art { width: 560px; }
.cover-cov { width: 100%; max-width: 820px; margin: 0 0 34px; cursor: default; animation-delay: .14s; }
.cover-cov[hidden], .cover-read[hidden] { display: none; }
.cov-k, .read-k { margin: 0 0 14px; font-size: 18px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #fff; opacity: .78; }
.cov-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 330px; align-items: center; gap: 18px; margin-bottom: 12px; font-size: 19px; }
.cov-l { color: #fff; opacity: .78; }
.cov-r { color: #fff; white-space: nowrap; }
.cov-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.cov-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: rgba(255, 255, 255, .28); }
.cov-bar i.on { background: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, .55); }
.cov-bar.segs i { border: 1.5px solid rgba(20, 12, 36, .55); }
.cov-t { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 18px; margin: 14px 0 0; font-size: 21px; line-height: 1.38; color: #fff; }
.cov-t b { font-weight: 600; }
.cov-t span { text-wrap: pretty; }
.cover-read { padding: 26px 30px 24px; border-radius: 24px; background: rgba(20, 12, 36, .42); border: 1px solid rgba(255, 255, 255, .16); cursor: default;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: rise .9s cubic-bezier(.2, .8, .2, 1) .3s backwards; }
.read-t { margin: 0 0 18px; font-size: 21px; line-height: 1.38; color: #fff; }
.read-go { display: inline-flex; align-items: center; gap: 12px; padding: 12px 26px; border-radius: 999px; border: 1.5px solid #fff; color: #fff; font-size: 22px; font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s; }
.read-go:hover { background: #fff; color: var(--plum); }
.read-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.read-s { margin: 16px 0 0; font-size: 16px; line-height: 1.4; color: #fff; opacity: .72; }
.cover .go { border: 0; cursor: pointer; font-family: inherit; }
.cover-art:empty { display: none; }
.cover-art svg { display: block; width: 100%; height: 100%; }
.cover-text > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.cover-t { animation-delay: .08s; }
.cover .go { animation-delay: .18s; }
.cover small { animation-delay: .26s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.cover .go { display: inline-flex; align-items: center; gap: 16px; padding: 20px 40px; border-radius: 999px; background: #fff; color: var(--plum); font-weight: 500; font-size: 30px; transition: transform .25s; }
.cover:hover .go { transform: translateY(-2px); }
.cover small { display: block; margin-top: 24px; font-size: 21px; color: #fff; opacity: .78; }
.paused-mark { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: none; place-items: center; pointer-events: none; }
.paused .paused-mark { display: grid; }
.paused-mark div { padding: 14px 30px; border-radius: 999px; background: rgba(18, 12, 34, .88); color: var(--chalk); font-size: 22px; }

/* Question cards inside the picture. */
.card { position: absolute; padding: 20px 26px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(10, 6, 24, .35); }
.card.band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "pic head body acts" "pic fb body acts"; column-gap: 28px; align-items: center; align-content: center; min-height: 150px; }
.band .mascot { grid-area: pic; }
.band .head { grid-area: head; align-self: end; }
.band .fb { grid-area: fb; align-self: start; }
.band .body { grid-area: body; }
.band .acts { grid-area: acts; }
.side .mascot { float: right; margin: -2px -4px 6px 10px; }
.kicker { margin: 0 0 6px; font-size: 19px; font-weight: 500; letter-spacing: .02em; color: var(--quiz); }
.prompt { margin: 0; font-size: 28px; line-height: 1.35; }
.side .prompt { font-size: 24px; }
.body:empty { display: none; }
.side .body { margin-top: 14px; }
.opts { display: flex; gap: 12px; flex-wrap: wrap; }
.opt { padding: 8px 24px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .03); color: var(--chalk); font-size: 24px; min-height: 58px; display: inline-flex; align-items: center; text-align: left; transition: border-color .2s, background-color .2s; }
.opt:hover:not(:disabled) { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .07); }
.opt[aria-pressed="true"] { background: var(--c, var(--chalk)); border-color: var(--c, var(--chalk)); color: var(--board); font-weight: 600; }
.opt.good { border-color: var(--good); box-shadow: 0 0 0 3px rgba(143, 214, 176, .35); }
.opt.bad { border-color: var(--bad); color: var(--bad); }
.opt:disabled { cursor: default; }
.fb { margin-top: 8px; font-size: 22px; line-height: 1.4; color: var(--chalk); }
.fb:empty { display: none; }
.fb.ok::before { content: "✓ "; color: var(--good); font-weight: 700; }
.fb.no::before { content: "✗ "; color: var(--bad); font-weight: 700; }
.fb ul { margin: 6px 0 0; padding-left: 22px; }
.side .fb { max-height: 110px; overflow: auto; font-size: 20px; }
.acts { display: flex; gap: 12px; align-items: center; }
.side .acts { margin-top: 16px; }
.side .acts { flex-wrap: wrap; gap: 10px; }
.side .btn { padding: 8px 16px; font-size: 20px; }
.card.side { padding: 18px 22px; }
.btn { padding: 10px 28px; border-radius: 999px; border: 1.5px solid #fff; background: #fff; color: var(--plum); font-weight: 500; font-size: 22px; white-space: nowrap; transition: background-color .2s, color .2s; }
.btn:hover:not(:disabled) { background: transparent; color: #fff; }
.btn.quiet { background: transparent; color: var(--chalk); border-color: rgba(255, 255, 255, .45); }
.btn.quiet:hover { background: rgba(255, 255, 255, .08); }
.btn.go { background: var(--quiz); border-color: var(--quiz); color: var(--plum); }
.btn.go:hover { background: transparent; color: var(--quiz); }
.btn:disabled { background: var(--edge); border-color: var(--edge); color: var(--dim); cursor: default; }

.grid .row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 34px; gap: 16px; align-items: center; padding: 5px 0 5px 12px; border-bottom: 1px solid var(--line); }
.grid .num { display: flex; justify-content: flex-end; align-items: center; font-size: 26px; }
.grid.text .row { grid-template-columns: minmax(0, 1fr) auto 34px; }
.grid.text .num { justify-content: flex-start; }
.grid .opts { gap: 8px; }
.grid .opt { padding: 3px 16px; min-height: 42px; font-size: 20px; }
.grid .mark { font-weight: 700; text-align: center; }
.grid .mark.good { color: var(--good); }
.grid .mark.bad { color: var(--bad); }
.grid .why { grid-column: 1 / -1; font-size: 19px; color: var(--dim); padding-left: 186px; }
.grid.text .why { padding-left: 0; }
.grid .why:empty { display: none; }

.hit { cursor: pointer; }
.hit .ring { fill: transparent; stroke: var(--chalk); stroke-width: 2.5; stroke-opacity: 0; }
.hit:hover .ring, .hit:focus .ring { stroke-opacity: .7; }
.hit.bad .ring { stroke: var(--bad); stroke-opacity: 1; }
.hit.good .ring { stroke: var(--good); stroke-opacity: 1; stroke-width: 4; }
.tok { cursor: grab; }

/* Controls strip, part of the frame. */
#bar { position: absolute; left: 0; top: 900px; width: 1600px; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: #140f25; border-top: 1px solid rgba(255, 255, 255, .08); }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .2); background: transparent; display: grid; place-items: center; flex: none; padding: 0; transition: background-color .2s, border-color .2s; }
.icon:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .45); }
.icon svg { width: 18px; height: 18px; fill: var(--chalk); }
.icon .i-pause { display: none; }
.is-playing .icon .i-play { display: none; }
.is-playing .icon .i-pause { display: block; }
.segs { flex: 1; display: flex; gap: 4px; height: 30px; align-items: center; min-width: 0; margin: 0 8px; }
.seg { position: relative; display: block; min-width: 0; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .14); border: 0; padding: 0; overflow: hidden; }
.seg:hover { height: 10px; }
.seg i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--chalk); }
.seg.ask { background: rgba(196, 176, 245, .26); }
.seg.ask i { background: var(--quiz); }
.step { width: 300px; flex: none; color: var(--dim); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.volume { display: flex; align-items: center; flex: none; width: 44px; height: 44px; overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, .2); border-radius: 999px; background: transparent; color: var(--chalk); transition: width .18s ease; }
.volume .icon { width: 42px; height: 42px; border: 0; background: transparent; }
.volume:hover, .volume:focus-within { width: 166px; gap: 10px; padding-right: 12px; }
.volume:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .45); }
.volume:has(:focus-visible) { outline: 2px solid var(--task); outline-offset: 3px; }
.volume .icon:focus-visible { outline: none; }
.volume input { appearance: none; flex: none; width: 0; height: 42px; margin: 0; opacity: 0; background: transparent; cursor: pointer; }
.volume:hover input, .volume:focus-within input { width: 100px; opacity: 1; }
.volume input:focus-visible { outline: none; }
.volume input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--chalk) var(--volume, 100%), var(--faint) var(--volume, 100%)); }
.volume input::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--chalk); }
.volume input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--faint); }
.volume input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--chalk); }
.volume input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--chalk); }
/* Phones and tablets (a touch screen, or a window up to 700px wide): the controls strip keeps its full size outside
   the scaled picture, with finger-sized buttons and a finger-high timeline. fit() in engine.js reserves the strip's
   real size and places the frame (--fx, --fy). */
@media (max-width: 700px), (pointer: coarse) {
  #frame { left: var(--fx, 50%); top: var(--fy, 50%); overflow: visible; }
  #bar { width: calc(1600px * var(--k)); height: auto; flex-wrap: wrap; gap: 6px; padding: 8px;
    transform: scale(calc(1 / var(--k))); transform-origin: left top; border-radius: 0 0 12px 12px; }
  .step { display: none; }
  .segs { order: 1; min-width: 160px; margin: 0; }   /* too little room beside the buttons: the timeline takes its own row */
  #bar .seg, #bar .seg:hover, #bar .seg.ask { height: 28px; background: none; overflow: visible; }   /* a finger-high target round the thin bar */
  #bar .seg::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
  #bar .seg.ask::before { background: rgba(196, 176, 245, .26); }
  #bar .seg i { top: 11px; bottom: 11px; border-radius: 4px; }
}
@media (max-width: 700px) and (pointer: fine) {   /* a narrow window with a mouse keeps every button, a little smaller */
  #bar .icon { width: 36px; height: 40px; }
  .volume { width: 36px; height: 40px; }
  #bar .volume .icon { width: 34px; height: 38px; }
  .volume:hover, .volume:focus-within { width: 158px; }
  .volume input { height: 38px; }
}
/* Touch screens: no keyboard shortcuts to show, and the device's own buttons set the volume. */
@media (pointer: coarse) { #bHelp, .volume, .kbd-hint { display: none; } }
/* A phone held sideways: the picture takes the full height, the buttons stand in pairs to its right and the
   timeline runs under it. The site bar (shell/nav.js) and the back link hide, and TOP() in engine.js is 0. */
@media (pointer: coarse) and (max-height: 500px) {
  #frame { height: 900px; }
  #bar { left: 1600px; top: 0; width: auto; height: calc(900px * var(--k)); display: grid; grid-template-columns: repeat(2, 44px);
    grid-auto-rows: 44px; align-content: center; gap: 6px; padding: 0 8px; background: none; border: 0; border-radius: 0; }   /* buttons in pairs */
  .segs { position: absolute; left: calc(-1600px * var(--k)); top: calc(900px * var(--k) + 4px); width: calc(1600px * var(--k)); height: 28px; }
  .back-home { display: none; }
}
.sound-note { position: absolute; left: 24px; top: 20px; margin: 0; padding: 8px 18px; border-radius: 999px; background: rgba(18, 12, 34, .88); color: var(--dim); font-size: 19px; }
.sound-note[hidden] { display: none; }
.blanks .brow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.blanks .brow:last-child { border-bottom: 0; }
.blanks .bline { line-height: 64px; white-space: nowrap; }
.blanks .mark { display: inline-block; margin-left: 14px; font-weight: 700; }
.blanks .mark.good { color: var(--good); animation: pop .35s ease-out; }
.blanks .mark.bad { color: var(--bad); }
.blanks .why { font-size: 19px; color: var(--dim); line-height: 1.35; }
.blanks .why:empty { display: none; }
.box { height: 52px; margin: 0 6px; padding: 0 6px; border: 0; border-bottom: 3px solid var(--quiz); border-radius: 8px 8px 0 0; background: rgba(255, 255, 255, .07); color: var(--chalk); font: 32px "STIX Two Text", "Cambria Math", "Iowan Old Style", Palatino, Georgia, serif; text-align: center; vertical-align: -6px; }
.box:focus { outline: none; background: rgba(196, 176, 245, .16); }
.box.good { border-color: var(--good); }
.box.bad { border-color: var(--bad); }
.box:disabled { opacity: 1; }
kbd { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: .5em; border: 1.5px solid currentColor; border-radius: 6px; font: 600 .7em/1.5 var(--ui); text-align: center; vertical-align: .12em; opacity: .6; }
.opt kbd { margin: 0 .6em 0 0; }
.keys { margin: 6px 0 0; font-size: 18px; color: var(--dim); }
.keys kbd { margin: 0 .15em; }
.grid .row.cur { background: rgba(255, 255, 255, .06); border-radius: 12px; }
.help { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; display: grid; place-items: center; background: rgba(12, 8, 24, .72); }
.help[hidden] { display: none; }
.help-box { width: 1120px; padding: 44px 54px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); }
.help h2 { margin: 0 0 24px; font-size: 40px; font-weight: 400; letter-spacing: -.02em; }
.help h3 { margin: 0 0 12px; font-size: 20px; font-weight: 500; color: var(--quiz); }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.help dl { margin: 0; display: grid; grid-template-columns: 150px 1fr; row-gap: 10px; font-size: 22px; }
.help dt { text-align: right; padding-right: 18px; white-space: nowrap; }
.help dt kbd { margin: 0 0 0 .3em; opacity: .9; }
.help dd { margin: 0; color: var(--dim); }
.help-close { margin: 26px 0 0; font-size: 18px; color: var(--dim); }
.icon.txt { font-size: 20px; font-weight: 700; color: var(--dim); }
/* Optional captions of the narration, one sentence at a time. Off by default: teaching text lives in the picture. */
.caption { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); width: max-content; max-width: 1180px; padding: 10px 24px; border-radius: 14px; background: rgba(18, 12, 34, .86); color: var(--chalk); font-size: 28px; line-height: 1.35; text-align: center; pointer-events: none; }
.caption[hidden] { display: none; }
.icon.cc { font-size: 15px; font-weight: 700; color: var(--dim); }
.icon.cc[aria-pressed="true"] { background: var(--chalk); border-color: var(--chalk); color: var(--board); }
.card.side { overflow: auto; }
svg.m { display: inline-block; overflow: visible; }
.card { animation: card-in .45s cubic-bezier(.2, .9, .3, 1.15); }
.fb:not(:empty) { animation: fb-in .3s ease-out; }
.opt.bad, .grid .mark.bad { animation: shake .4s; }
.grid .mark.good { animation: pop .35s ease-out; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fb-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.3); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
/* Full-screen chapter practice. */
.card.screen { height: 900px; padding: 50px 70px; border: 0; border-radius: 0; background: transparent; box-shadow: none; animation: screen-in .5s ease-out; max-height: none; overflow: visible; }
.screen .kicker { font-size: 22px; }
.screen .prompt { font-size: 40px; font-weight: 500; letter-spacing: -.012em; }
.screen .body { margin-top: 30px; }
.screen .fb { position: absolute; left: 70px; bottom: 56px; max-width: 1080px; margin: 0; font-size: 24px; }
.screen .acts { position: absolute; right: 70px; bottom: 48px; }
.screen > .skip { position: absolute; top: 40px; right: 70px; padding: 8px 16px; font-size: 17px; }
.screen .head .kicker { width: fit-content; }   /* skip-kicker: keeps the kicker clear of Skip practice */
.screen .grid .row { grid-template-columns: 200px minmax(0, 1fr) 40px; padding: 9px 0 9px 12px; }
.screen .grid.text .row { grid-template-columns: minmax(0, 1fr) auto 40px; }
.screen .grid .opt { font-size: 22px; min-height: 50px; padding: 4px 20px; }
.screen .grid .why { padding-left: 216px; font-size: 20px; }
.screen .grid.text .why { padding-left: 0; }
#ui > .screen.sort { pointer-events: none; }
.screen.sort > * { pointer-events: auto; }
.screen.sort .head { position: absolute; right: 34px; top: 40px; width: 330px; }
.screen.sort .prompt { font-size: 28px; }
.screen.sort .fb { left: auto; right: 34px; bottom: 116px; width: 330px; max-height: 240px; overflow: auto; font-size: 20px; }
.screen.sort .acts { right: 34px; }
.fin .finwrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding-bottom: 60px; }
.fin .mascot { margin-bottom: 28px; }
.fin .fb, .fin .acts { position: static; }
.fin .acts { margin-top: 30px; }
@keyframes screen-in { from { opacity: 0; } }

/* The guide: an infinity sign whose loops are its eyes. */
.mascot { display: block; flex: none; overflow: visible; }
.mascot .mbody { transform-box: view-box; transform-origin: 60px 46px; animation: bob 3.4s ease-in-out infinite; }
.mascot .eyes { transition: transform .3s; }
.mascot .pupil { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
.mascot .joy, .mascot .flat { display: none; }
.mascot.happy .pupil { display: none; }
.mascot.happy .joy { display: inline; }
.mascot.happy .mbody { animation: hop .55s ease-out 2, bob 3.4s ease-in-out 1.1s infinite; }
.mascot.oops .eyes { transform: translate(-3px, 4px); }
.mascot.oops .smile { display: none; }
.mascot.oops .flat { display: inline; }
.mascot.oops .mbody { animation: wobble .5s ease-in-out, bob 3.4s ease-in-out .5s infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-2deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes hop { 40% { transform: translateY(-12px) rotate(4deg); } }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .volume { transition: none; } .card, .fb, .opt, .grid .mark, .mascot * { animation: none !important; } }

a.icon { text-decoration: none; }
a.btn { text-decoration: none; display: inline-block; }
/* Page-to-page motion: the contents card grows into this frame, and shrinks back on the way out. */
@view-transition { navigation: auto; }
#frame { view-transition-name: lesson; }
::view-transition-group(lesson) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(lesson), ::view-transition-new(lesson) { height: 100%; object-fit: cover; }
::view-transition-old(lesson) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { .cover-text > *, .cover-art { animation: none; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
/* The finish screen speaks the same type as the chapter cover and the contents page. */
.fin .kicker { font-size: 20px; letter-spacing: .08em; text-transform: uppercase; }
.fin .prompt { margin: 8px 0 16px; font: 400 64px/1.08 var(--ui); letter-spacing: -.03em; }

/* The way home, top left above the frame (hidden in full screen, where the frame takes the whole screen). */
.back-home { position: fixed; left: 16px; top: 10px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, .4); color: #fff; font: 500 15px/1 var(--ui, system-ui, sans-serif); text-decoration: none; background: rgba(20, 12, 36, .25); backdrop-filter: blur(6px); transition: background-color .2s, border-color .2s; }
.back-home:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .7); }
.back-home:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.back-home svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:fullscreen .back-home, :root:fullscreen .back-home { display: none; }
:fullscreen #frame { left: var(--fx, 50%); top: var(--fy, 50%); }
