:root {
  --ground: #f1e5c8;
  --paper: #f7eee3;
  --ink: #392d25;
  --ink-soft: #6b5a4a;
  --saffron: #f2b233;
  --orange: #e0752e;
  --rose: #e38ba0;
  --violet: #6e4c8e;
  --blue: #3a5ba0;
  --moss: #7e8f3e;
  --wood: #c97c4b;
  --rule: #d8c6b6;
  --stamp: #b23a2e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 25% 30%, #fff9e6 0, transparent 65%), linear-gradient(115deg, #eee0bf, #f8eed7 60%, #e4d1ab);
  color: var(--ink);
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 18px;
  line-height: 1.45;
}

button, select, input, textarea { font: inherit; color: inherit; }
button {
  background: transparent;
  border: 1px solid var(--ink-soft);
  border-radius: 20px 18px 22px 16px;
  padding: 5px 13px;
  cursor: pointer;
}
button:hover { background: color-mix(in srgb, var(--saffron) 22%, transparent); }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
button.primary { background: var(--saffron); border-color: var(--saffron); color: #3b2a4a; }
button[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #f7eee3; }

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 6px 20px; flex-wrap: wrap; font-size: 14px; min-height: 44px;
}
.wordmark { margin: 0; font-family: "Fraunces", serif; font-size: 18px; }
.wordmark em { font-style: italic; color: var(--violet); }
.wordlink { color: inherit; text-decoration: none; }
.wordlink:hover em { text-decoration: underline; text-underline-offset: 4px; }
.lesson-tag { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-left: 10px; }
.masthead { justify-content: flex-start; }
.goto { margin-left: auto; }
.explore select { margin-left: 6px; max-width: 240px; border: 1px solid var(--ink-soft); border-radius: 6px; padding: 3px 6px; background: var(--paper); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; width: 48px; height: 40px; display: grid; place-items: center; border: 1px solid var(--ink-soft); border-radius: 20px 18px 22px 16px; background: var(--paper); color: var(--orange); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.case-icon { width: 28px; height: 23px; fill: currentColor; display: block; }
.menu[open] > summary { background: var(--violet); border-color: var(--violet); color: #f7eee3; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; display: flex; flex-direction: column; align-items: stretch; padding: 8px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 3px 4px 0 rgba(59, 42, 74, .2); z-index: 40; font-size: 15px; }
.menu-panel button, .menu-panel .file-control { text-align: left; padding: 10px 8px; border: 0; border-radius: 0; border-bottom: 1px solid var(--rule); background: none; font-size: 15px; }
.menu-panel button:hover, .menu-panel .file-control:hover { background: color-mix(in srgb, var(--saffron) 22%, transparent); }
.file-control { cursor: pointer; }
.file-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.local-label { color: var(--ink-soft); font-size: 12px; padding: 8px 8px 2px; }

/* ---------- the stage: the room is the page ---------- */

.stage-wrap { padding: 4px 12px 12px; }
.stage {
  position: relative;
  width: min(100%, 1240px, calc((100dvh - 96px) * 520 / 380));
  aspect-ratio: 520 / 380;
  margin: 0 auto;
  container-type: inline-size;
  border-radius: 6px 10px 8px 12px;
  overflow: visible;
}
.room, .room svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.room svg { overflow: visible; }
.room .hot { cursor: pointer; }
.room .hot:hover { filter: brightness(1.1); }

/* ---------- vessels: the words find you ---------- */

.vessel {
  position: absolute;
  padding: 2cqw 2.4cqw;
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: clamp(12px, 1.5cqw, 17px);
  line-height: 1.38;
  font-variation-settings: "opsz" 24;
  max-width: 44%;
  overflow-wrap: anywhere;
}
.vessel.long { font-size: clamp(11px, 1.3cqw, 15px); max-width: 46%; }
.vessel p { margin: 0 0 .7em; }
.vessel p:last-child { margin-bottom: 0; }
.place { font-size: clamp(10px, 1.05cqw, 12px); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .6em; font-weight: 500; }

/* shapes */
.vessel { --a: .9; }
.v-slip { background: rgb(247 238 227 / var(--a)); color: #3b2a4a; box-shadow: 2px 3px 0 rgba(59, 42, 74, .25); clip-path: polygon(0 3%, 4% 0, 97% 1%, 100% 5%, 99% 96%, 95% 100%, 3% 99%, 0 94%); }
.v-bubble { background: rgb(247 238 227 / var(--a)); color: #3b2a4a; border-radius: 2.6cqw 3.2cqw 2.4cqw 3cqw / 3cqw 2.4cqw 3.2cqw 2.6cqw; box-shadow: 0 3px 0 rgba(59, 42, 74, .2); padding: 2.4cqw 3cqw; }
.v-bubble::after { content: ""; position: absolute; width: 0; height: 0; border: 1.6cqw solid transparent; border-top-color: rgb(247 238 227 / var(--a)); border-left-color: rgb(247 238 227 / var(--a)); bottom: -2.2cqw; left: 18%; transform: rotate(-20deg); }
.v-bubble.tail-right::after { left: auto; right: 18%; transform: rotate(20deg) scaleX(-1); }
.v-circle { background: rgb(242 178 51 / var(--a)); color: #3b2a4a; border-radius: 50%; text-align: center; display: flex; flex-direction: column; justify-content: center; aspect-ratio: 1; width: 30%; max-width: 30%; padding: 4cqw; }
.v-circle .choices { justify-content: center; }
.v-cloud { background: rgb(110 76 142 / var(--a)); color: #f7eee3; border-radius: 4cqw 6cqw 5cqw 4.5cqw / 5cqw 4cqw 6cqw 4cqw; padding: 2.8cqw 3.4cqw; }
.v-cloud .place, .v-cloud .hint, .v-cloud label { color: #e9dcf2; }
.v-pane { --a: .8; background: rgb(247 238 227 / var(--a)); color: #3b2a4a; backdrop-filter: blur(8px); border: 1px solid rgba(247, 238, 227, .95); border-radius: 4px; }
.v-tag { background: rgb(251 239 168 / var(--a)); color: #3b2a4a; border-radius: 4px 40% 40% 4px / 4px 50% 50% 4px; box-shadow: 2px 3px 0 rgba(59, 42, 74, .2); padding-left: 3.4cqw; }
.v-tag::before { content: ""; position: absolute; left: 1.2cqw; top: 50%; width: 1.1cqw; height: 1.1cqw; border-radius: 50%; background: var(--ground); box-shadow: inset 0 0 0 2px #c9a84a; transform: translateY(-50%); }
.v-rose { background: rgb(227 139 160 / var(--a)); color: #3b2a4a; border-radius: 5cqw 4cqw 5.5cqw 4.5cqw / 4cqw 5.5cqw 4cqw 5cqw; padding: 2.8cqw 3.4cqw; }
.v-panel { background: rgb(247 238 227 / var(--a)); color: #3b2a4a; border-radius: 0 12px 12px 0; box-shadow: 4px 0 0 rgba(59, 42, 74, .2); max-width: 44%; }
.v-panel.from-right { border-radius: 12px 0 0 12px; box-shadow: -4px 0 0 rgba(59, 42, 74, .2); }
.v-panel.from-bottom { border-radius: 12px 12px 0 0; box-shadow: 0 -4px 0 rgba(59, 42, 74, .2); max-width: 70%; }

/* zones: a loose 2 × 2 with the desk in the middle; the dog keeps the bottom-right corner */
.z-tl { left: 3%; top: 4%; }
.z-tc { left: 27%; top: 3%; }
.z-tr { right: 3%; top: 4%; }
.z-ml { left: 3%; top: 30%; }
.z-mr { right: 4%; top: 28%; }
.z-bl { left: 3%; bottom: 8%; max-width: 42%; }
.z-bc { left: 12%; bottom: 6%; max-width: 42%; }
.z-br { right: 4%; bottom: 26%; max-width: 40%; }
.z-desk { left: 14%; top: 40%; max-width: 58%; }
.z-page { left: 6%; top: 14%; max-width: 44%; }
.z-card { left: 56%; top: 36%; max-width: 40%; }
.z-edge-left { left: 0; top: 8%; }
.z-edge-right { right: 0; top: 8%; }
.z-edge-bottom { left: 15%; bottom: 0; }
.p-tl { left: 2%; top: 3%; }
.p-tr { right: 2%; top: 3%; }
.p-bl { left: 2%; bottom: 3%; }
.p-br { right: 2%; top: 58%; }
.p-bc { right: 2%; bottom: 3%; }
.rot-a { transform: rotate(-2deg); }
.rot-b { transform: rotate(1.5deg); }
.rot-c { transform: rotate(-.8deg); }

/* words vs doing */
.words { z-index: 3; }
.doing { z-index: 4; font-family: "Crimson Pro", serif; font-weight: 400; font-size: clamp(11px, 1.35cqw, 15px); max-width: 46%; }
.doing .you { font-family: "Fraunces", serif; font-weight: 500; font-size: clamp(10px, 1.05cqw, 12px); letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin: 0 0 .4em; }
.v-cloud.doing .you { color: var(--saffron); }
.doing .hint { font-size: .88em; color: var(--ink-soft); }
.doing label { display: block; font-size: .88em; color: var(--ink-soft); margin-top: .6em; }
.doing textarea, .doing input[type="text"] {
  width: 100%; font-size: 1em; color: var(--ink); background: rgba(255, 255, 255, .55);
  border: 0; border-bottom: 1px solid var(--ink-soft); padding: .4em .4em; margin-top: .2em; resize: vertical;
}
.v-cloud.doing textarea, .v-cloud.doing input[type="text"] { color: #f7eee3; background: rgba(0, 0, 0, .18); border-bottom-color: #e9dcf2; }
.doing .card-lines input { font-family: "Fraunces", serif; font-style: italic; background: #fbefa8; color: #3b2a4a; border-bottom-color: var(--saffron); }
.choices { display: flex; gap: .4em; flex-wrap: wrap; margin-top: .5em; }
.choices button { font-size: .95em; padding: .25em .8em; }
.v-cloud .choices button { border-color: #e9dcf2; color: #f7eee3; }
.v-cloud .choices button[aria-pressed="true"] { background: var(--saffron); color: #3b2a4a; border-color: var(--saffron); }
button.para { display: block; text-align: left; width: 100%; border-radius: 6px; margin: 0 0 .5em; padding: .45em .7em; font-family: "Crimson Pro", serif; font-size: 1em; line-height: 1.4; }
.reading { font-family: "Crimson Pro", serif; font-weight: 400; padding-left: .8em; border-left: 2px solid var(--rule); }
.reading.here { border-left-color: var(--saffron); }
.reading.faded { opacity: .45; }
.find { font-size: .9em; color: var(--ink-soft); font-style: italic; }
.reveal { margin-top: .7em; padding-top: .6em; border-top: 1px dashed var(--rule); }

/* folded doing: a small circle that pops open */
.doing.folded { width: 9cqw; height: 9cqw; padding: 0; border-radius: 50%; background: rgba(242, 178, 51, .9); display: flex; align-items: center; justify-content: center; cursor: pointer; max-width: none; clip-path: none; }
.doing.folded > * { display: none; }
.doing.folded::after { content: "write here"; font-family: "Fraunces", serif; font-style: italic; font-size: clamp(11px, 1.3cqw, 15px); color: #3b2a4a; }
.doing.folded:hover { transform: scale(1.06); }
.vessel.popped { --a: 1; z-index: 7; }

/* stamp */
.stamp {
  display: inline-block; font-family: "Fraunces", serif; font-style: italic; font-size: clamp(11px, 1.2cqw, 14px);
  letter-spacing: .06em; color: var(--stamp); border: 2px solid var(--stamp); border-radius: 4px; padding: .15em .7em;
  transform: rotate(-4deg); margin: .3em 0 .5em; background: transparent;
}
.stamp.once { color: var(--violet); border-color: var(--violet); }
.stamp.notreal { color: var(--ink-soft); border-color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.v-cloud .stamp { color: var(--saffron); border-color: var(--saffron); }
.stamp-note { font-family: "Crimson Pro", serif; font-size: .8em; color: var(--ink-soft); margin: 0; }
.v-cloud .stamp-note { color: #e9dcf2; }
.stamp-note a { color: var(--blue); }
.v-cloud .stamp-note a { color: #ffd98a; }

/* nudge */
.nudge { z-index: 3; font-family: "Crimson Pro", serif; font-size: clamp(12px, 1.4cqw, 15px); max-width: 40%; }
.nudge summary { cursor: pointer; font-family: "Fraunces", serif; font-style: italic; }

/* dog captions */
.room-note { position: absolute; right: 2%; bottom: 2%; max-width: 40%; margin: 0; z-index: 3; font-family: "Fraunces", serif; font-style: italic; font-size: clamp(11px, 1.4cqw, 15px); color: #3b2a4a; background: rgba(247, 238, 227, .85); padding: .3em .8em; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.room-note:empty { display: none; }

/* the pocket: the plan, drifting */
.pocket {
  position: absolute; z-index: 5; width: 11cqw; height: 11cqw; border-radius: 50%; border: 0;
  background: rgba(227, 139, 160, .9); color: #3b2a4a; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: "Fraunces", serif; font-style: italic; font-size: clamp(11px, 1.3cqw, 15px); line-height: 1.1; box-shadow: 0 3px 0 rgba(59, 42, 74, .2);
}
.pocket .count { font-style: normal; font-size: .8em; color: #5a3a4a; }
.pocket:hover { transform: scale(1.06); }
.plan-open { --a: 1; z-index: 6; background: #f7eee3; color: #3b2a4a; border-radius: 6cqw 8cqw 7cqw 6cqw / 7cqw 6cqw 8cqw 6cqw; left: 18%; top: 6%; max-width: 64%; width: 64%; padding: 3cqw 5cqw; font-family: "Crimson Pro", serif; font-size: clamp(11px, 1.3cqw, 15px); box-shadow: 0 6px 0 rgba(59, 42, 74, .25), 0 0 0 .6cqw rgba(227, 139, 160, .6); }
.stage.plan-showing .words, .stage.plan-showing .doing, .stage.plan-showing .nudge, .stage.plan-showing .room-note { visibility: hidden; }
.plan-open ol { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 3cqw; }
.plan-open li { break-inside: avoid; border-bottom: 1px solid var(--rule); padding: .35em 0; color: var(--ink-soft); }
.plan-open li.on { color: var(--ink); }
.plan-open li .text { display: block; font-family: "Fraunces", serif; font-size: .95em; color: var(--ink); white-space: pre-wrap; }
.plan-open li .when { display: block; font-size: .75em; color: var(--ink-soft); }
.plan-open li.now { color: var(--orange); }
#plan-close { margin-top: .8em; font-size: .9em; }

/* page turning */
.arrow {
  position: absolute; z-index: 8; top: 50%; transform: translateY(-50%);
  width: 5cqw; height: 5cqw; min-width: 40px; min-height: 40px; border-radius: 50%; border: 0; padding: 0;
  background: rgb(247 238 227 / .82); color: #3b2a4a; font-family: "Fraunces", serif; font-size: clamp(18px, 2.4cqw, 28px); line-height: 1;
  box-shadow: 0 3px 0 rgba(59, 42, 74, .25);
}
.arrow-back { left: 1.2%; }
.arrow-next { right: 1.2%; background: rgb(242 178 51 / .92); }
.arrow:hover { transform: translateY(-50%) scale(1.08); background: rgb(242 178 51 / .95); }
.arrow:disabled { opacity: .3; cursor: default; }
.arrow:disabled:hover { transform: translateY(-50%); background: rgb(247 238 227 / .82); }

/* dialogs */
dialog { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; padding: 20px 24px; max-width: 60ch; }
dialog::backdrop { background: rgba(43, 33, 64, .55); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-heading h2 { margin: 0; font-family: "Fraunces", serif; font-weight: 400; }
.record-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.writing-body { font-size: 16px; max-height: 50vh; overflow: auto; }
.writing-body h3 { font-family: "Fraunces", serif; font-weight: 400; font-size: 17px; margin: 14px 0 4px; }
.writing-body blockquote { margin: 0 0 8px; padding-left: 12px; border-left: 2px solid var(--rule); white-space: pre-wrap; }
.writing-body .old { color: var(--ink-soft); font-size: 14px; }
.found { font-size: 14px; color: var(--ink-soft); }
.notice { padding: 12px; border: 1px solid var(--orange); }

/* small screens: the room on top, the papers fall below it */
@media (max-width: 900px) {
  body { padding-bottom: 24px; }
  .masthead { padding: 6px 12px; gap: 8px; }
  .masthead-actions { gap: 6px; }
  .masthead-actions button, .file-control { padding: 4px 10px; font-size: 13px; }
  .explore select { max-width: 42vw; }
  .stage-wrap { padding: 4px 8px 12px; }
  .stage { width: 100%; aspect-ratio: auto; }
  .room, .room svg { position: relative; aspect-ratio: 520 / 380; height: auto; }
  .vessel, .pocket, .plan-open, .room-note, .ending-again { position: static; transform: none !important; max-width: none; width: auto; margin: 10px 0; animation: none !important; opacity: 1 !important; }
  .vessel.long { font-size: 17px; }
  .vessel { font-size: 17px; padding: 14px 18px; clip-path: none; border-radius: 14px; }
  .v-bubble::after { display: none; }
  .v-tag { padding-left: 18px; }
  .v-tag::before { display: none; }
  .doing { font-size: 16px; }
  .doing.folded { width: auto; height: auto; border-radius: 30px; padding: 12px; }
  .v-circle { aspect-ratio: auto; border-radius: 14px; display: block; text-align: left; width: auto; max-width: none; padding: 14px 18px; }
  .pocket { width: auto; height: auto; border-radius: 30px; padding: 8px 16px; flex-direction: row; gap: 10px; justify-content: flex-start; }
  .plan-open { width: auto; max-width: none; border-radius: 14px; padding: 14px 18px; }
  .plan-open ol { columns: 1; }
  .stage.plan-showing .words, .stage.plan-showing .doing, .stage.plan-showing .nudge, .stage.plan-showing .room-note { display: none; }
  .stage { display: flex; flex-direction: column; }
  .arrow { position: static; transform: none; width: 56px; height: 56px; margin: 14px 0 0; }
  .arrow-back { align-self: flex-start; }
  .arrow-next { align-self: flex-end; margin-top: -56px; }
  .arrow:hover, .arrow:disabled:hover { transform: none; }
  .flyer { display: none; }
}

/* the ending: slips into the case, the case out the door, the dog after it */
.flyer { position: absolute; z-index: 6; background: #f7eee3; color: #3b2a4a; font-family: "Fraunces", serif; font-style: italic; font-size: clamp(10px, 1.1cqw, 13px); padding: .4em .8em; box-shadow: 1px 2px 0 rgba(59, 42, 74, .25); clip-path: polygon(0 4%, 3% 0, 97% 2%, 100% 6%, 99% 95%, 96% 100%, 4% 98%, 0 93%); max-width: 26%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.case .lid-closed { visibility: hidden; }
.case.closed .lid-open { visibility: hidden; }
.case.closed .lid-closed { visibility: visible; }
.case, #ending-dog { transform-box: fill-box; }
.ending-again { margin-top: .6em; font-family: "Crimson Pro", serif; font-size: .85em; }
.ending-links { margin-top: .9em; font-family: "Crimson Pro", serif; font-size: .85em; display: flex; flex-wrap: wrap; gap: .6em 1em; align-items: center; }
.ending-links a { color: var(--blue); text-underline-offset: 3px; }
.ending-links .ending-main { background: var(--saffron); color: #3b2a4a; text-decoration: none; padding: .35em 1em; border-radius: 20px 18px 22px 16px; font-family: "Fraunces", serif; }
.ending-links .ending-main:hover { background: var(--orange); color: #f7eee3; }
.ending-links .ending-soon { color: var(--ink-soft); font-style: italic; }

/* motion */
@media (prefers-reduced-motion: no-preference) {
  body:not(.still) .tail { animation: tail 1.6s ease-in-out infinite; transform-origin: 20px 0; }
  body:not(.still) .zz { animation: zz 2.4s ease-in-out infinite; }
  body:not(.still) .wag .tail { animation: wag .18s ease-in-out 8; }
  body:not(.still) .wag { animation: hop .5s ease-out 1; transform-box: fill-box; transform-origin: 50% 100%; }
  body:not(.still) .heart { animation: heart 1.4s ease-out forwards; transform-box: fill-box; }
  body:not(.still) .bird { animation: bird 2.6s linear forwards; }
  body:not(.still) .steam { animation: steam 1.6s ease-out forwards; transform-box: fill-box; }
  body:not(.still) .buzz { animation: buzz .5s linear 2; transform-box: fill-box; }
  body:not(.still) .scrap-in { animation: scrap 2.2s ease-in forwards; transform-box: fill-box; }
  body:not(.still) .card-in { animation: cardin .7s cubic-bezier(.2,.9,.3,1.2) both; transform-box: fill-box; }
  body:not(.still) .door-swing { animation: door .9s ease-out both; transform-box: fill-box; transform-origin: 0% 50%; }
  body:not(.still) .bloom { animation: bloom .6s cubic-bezier(.2,1.4,.4,1) both; transform-box: fill-box; transform-origin: 50% 100%; }
  body:not(.still) .stamp { animation: thump .45s cubic-bezier(.2,1.4,.4,1) both; }
  body:not(.still) .enter-pop { animation: pop .5s cubic-bezier(.2,1.4,.4,1) both; }
  body:not(.still) .enter-float { animation: floatin .8s ease-out both; }
  body:not(.still) .enter-drift { animation: driftin 1.1s ease-out both; }
  body:not(.still) .enter-slide-left { animation: slideleft .6s cubic-bezier(.2,.9,.3,1) both; }
  body:not(.still) .enter-slide-right { animation: slideright .6s cubic-bezier(.2,.9,.3,1) both; }
  body:not(.still) .enter-slide-up { animation: slideup .6s cubic-bezier(.2,.9,.3,1) both; }
  body:not(.still) .pocket { animation: bob 5s ease-in-out infinite; }
  body:not(.still) .doing.folded { animation: pulse 2.2s ease-in-out infinite; }
  body:not(.still) .curtain { animation: sway 7s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
  body:not(.still) .curtain.breeze { animation: breeze 2.8s ease-in-out infinite; }
  body:not(.still) .sash.open { animation: sashup 1.4s cubic-bezier(.3,.8,.3,1) forwards; transform-box: fill-box; }
  body:not(.still) .buzzing { animation: buzzcycle 5s linear infinite; transform-box: fill-box; }
  body:not(.still) .ping { animation: ping 5s ease-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
  body:not(.still) .mouse { animation: peek 11s ease-in-out infinite; transform-box: fill-box; }
  body:not(.still) .paper-a { animation: papera 23s ease-in-out infinite; transform-box: fill-box; }
  body:not(.still) .paper-b { animation: paperb 31s ease-in-out infinite; transform-box: fill-box; }
  @keyframes sway { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(1.5deg); } }
  @keyframes breeze { 0%, 100% { transform: skewX(-2deg) scaleX(1); } 50% { transform: skewX(4deg) scaleX(1.06); } }
  @keyframes sashup { 0% { transform: translateY(0); } 100% { transform: translateY(-58px); } }
  @keyframes buzzcycle { 0%, 84%, 100% { transform: translateX(0) rotate(0); } 86% { transform: translateX(-2px) rotate(-3deg); } 88% { transform: translateX(2px) rotate(3deg); } 90% { transform: translateX(-2px) rotate(-3deg); } 92% { transform: translateX(2px) rotate(3deg); } 94% { transform: translateX(0) rotate(0); } }
  @keyframes ping { 0%, 84% { opacity: 0; transform: scale(.4); } 86% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(2.2); } }
  @keyframes peek { 0%, 60%, 100% { transform: translateX(-30px); opacity: 0; } 66% { transform: translateX(0); opacity: 1; } 72% { transform: translateX(6px); opacity: 1; } 78% { transform: translateX(0); opacity: 1; } 84% { transform: translateX(-30px); opacity: 0; } }
  @keyframes papera { 0%, 40%, 100% { opacity: 0; transform: translateY(-40px) rotate(-30deg); } 46% { opacity: 1; transform: translateY(0) rotate(0); } 90% { opacity: 1; transform: translateY(0) rotate(0); } 96% { opacity: 0; transform: translateY(0) rotate(0); } }
  @keyframes paperb { 0%, 55%, 100% { opacity: 0; transform: translateY(-40px) rotate(30deg); } 61% { opacity: 1; transform: translateY(0) rotate(0); } 92% { opacity: 1; transform: translateY(0) rotate(0); } 97% { opacity: 0; } }
  .paper-a, .paper-b { opacity: 0; }
  body.still .paper-a, body.still .paper-b { opacity: 1; transform: none; }
  body.still .mouse { opacity: 0; }
  body:not(.still) .case.out { animation: caseout 1.8s cubic-bezier(.4, 0, .8, .4) forwards; }
  body:not(.still) #ending-dog.out { animation: dogout 2.6s ease-in-out forwards; }
  body:not(.still) #ending-dog.out .tail { animation: wag .22s ease-in-out infinite; }
  body:not(.still) #ending-dog.out use { animation: trot .28s ease-in-out infinite; }
  @keyframes caseout { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(0, -14px) rotate(-3deg); } 100% { transform: translate(-330px, -30px) rotate(-8deg); opacity: 0; } }
  @keyframes dogout { 0% { transform: translateX(0) scaleX(1); } 12% { transform: translateX(0) scaleX(-1); } 100% { transform: translateX(-330px) scaleX(-1); opacity: 0; } }
  @keyframes trot { 50% { transform: translateY(-2px); } }
  @keyframes tail { 50% { transform: rotate(6deg); } }
  @keyframes wag { 50% { transform: rotate(22deg); } }
  @keyframes hop { 30% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
  @keyframes zz { 50% { opacity: .3; transform: translateY(-3px); } }
  @keyframes heart { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px) scale(1.2); } }
  @keyframes bird { 0% { transform: translateX(0) translateY(0); } 50% { transform: translateX(70px) translateY(-14px); } 100% { transform: translateX(150px) translateY(-4px); } }
  @keyframes steam { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-26px) scale(1.4); } }
  @keyframes buzz { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-2px) rotate(-2deg); } 75% { transform: translateX(2px) rotate(2deg); } }
  @keyframes scrap { 0% { opacity: 0; transform: translate(60px, -220px) rotate(-40deg); } 20% { opacity: 1; } 60% { transform: translate(-20px, -80px) rotate(20deg); } 100% { transform: translate(0, 0) rotate(-6deg); } }
  @keyframes cardin { 0% { opacity: 0; transform: translate(80px, -60px) rotate(20deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(0); } }
  @keyframes door { 0% { transform: scaleX(1.4); } 100% { transform: scaleX(1); } }
  @keyframes thump { 0% { opacity: 0; transform: rotate(-4deg) scale(1.8); } 100% { opacity: 1; transform: rotate(-4deg) scale(1); } }
  @keyframes bloom { 0% { transform: scale(0); } 100% { transform: scale(1); } }
  @keyframes pop { 0% { opacity: 0; transform: scale(.4) rotate(-6deg); } 100% { opacity: 1; transform: scale(1) rotate(var(--rot, 0deg)); } }
  @keyframes floatin { 0% { opacity: 0; transform: translateY(24px) rotate(var(--rot, 0deg)); } 100% { opacity: 1; transform: translateY(0) rotate(var(--rot, 0deg)); } }
  @keyframes driftin { 0% { opacity: 0; transform: translate(-40px, -30px) rotate(-8deg); } 100% { opacity: 1; transform: translate(0, 0) rotate(var(--rot, 0deg)); } }
  @keyframes slideleft { 0% { transform: translateX(-110%); } 100% { transform: translateX(0); } }
  @keyframes slideright { 0% { transform: translateX(110%); } 100% { transform: translateX(0); } }
  @keyframes slideup { 0% { transform: translateY(110%); } 100% { transform: translateY(0); } }
  @keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
  @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 178, 51, .6); } 50% { box-shadow: 0 0 0 1.2cqw rgba(242, 178, 51, 0); } }
}

/* Shared correction register; opens separately to preserve the live lesson. */
.issues-link { color: inherit; font-size: .9rem; text-underline-offset: .18em; margin-inline-start: .8rem; }
