/* ==========================================================================
   Mr. Grummel — shared site styles
   Chalk, cream paper and a teacher who is mildly disappointed in you.
   ========================================================================== */

:root {
  /* palette */
  --ink:        #1a1410;
  --dark:       #2a1f15;
  --cream:      #f4f1e4;
  --paper:      #fbf6e3;
  --board:      #2f5240;
  --wood:       #6b4a2a;
  --tray:       #8a5a32;
  --yellow:     #f2c54a;
  --tan:        #cfc0a4;
  --muted:      #a8956f;
  --dim:        #8a7458;
  --rule-blue:  #6fa6c9;
  --rule-red:   #d96a6a;
  --green:      #2f9e4f;
  --red:        #d63a2f;
  --brown:      #b07843;
  --chalk-dim:  #cfc8a8;
  --chalk-body: #e6e2cf;

  /* type */
  --font-body:    "Nunito", system-ui, -apple-system, sans-serif;
  --font-display: "Gochi Hand", "Comic Sans MS", cursive;
  --font-hand:    "Patrick Hand", "Comic Sans MS", cursive;
  --font-marker:  "Caveat", "Comic Sans MS", cursive;

  /* the margin rule on notebook paper */
  --margin-x: 32px;
}

html, body { margin: 0; padding: 0; background: var(--dark); }

/* iOS inflates text in landscape unless it is told not to */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* the top bar is sticky, so an in-page anchor has to stop clear of it */
html { scroll-padding-top: 88px; }

body {
  font-family: var(--font-body);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

* { box-sizing: border-box; }

a { color: var(--tan); text-decoration: none; }
a:hover { color: var(--yellow); }

img, svg { max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hidden until tabbed to, then a real visible control. Kept separate from
   .visually-hidden, which is also on labels that never take focus. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  padding: 10px 18px;
  font-family: var(--font-hand);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 5px;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.45);
}
.skip-link:focus { color: var(--ink); }

/* Honeypot. Pushed off-screen rather than display:none — bots that skip
   hidden inputs would sail straight past a display:none trap. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Form feedback
   -------------------------------------------------------------------------- */

.form-msg {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 10px;
  min-height: 1.2em;
}
.form-msg:empty { margin-top: 0; }
.form-msg--error { color: #c0301a; }
.form-msg--ok { color: #2f6b41; }

/* on the dark sections the same message needs to survive a dark background */
.form-msg--on-dark.form-msg--error { color: #ff9b86; }
.form-msg--on-dark.form-msg--ok { color: #8fc7a3; }

.btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

/* Pinned: the "Early access" CTA is the one control that must never scroll
   away. z-index clears the hero diorama (max 9) and the cameos (50). */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 6%;
  background: var(--dark);
  border-bottom: 3px solid var(--ink);
}

/* the CTA is a sibling of the nav, not a nav item — this keeps the two
   of them together on the right the way they read as one block */
.topbar > .btn { flex: 0 0 auto; }
.topbar .nav { margin-left: auto; }

.brand {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--cream);
}
.brand:hover { color: var(--yellow); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  font-family: var(--font-hand);
  font-size: 16px;
}
.nav a { color: var(--tan); }
.nav a:hover { color: var(--yellow); }
.nav [aria-current="page"] { color: var(--yellow); }

/* --------------------------------------------------------------------------
   Buttons — chunky, hand-drawn, they press down when you poke them
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 16px;
  letter-spacing: 1px;
  padding: 12px 22px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.45);
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.btn:hover, .btn:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45);
}

.btn--yellow { background: var(--yellow); color: var(--ink); }
.btn--yellow:hover { color: var(--ink); }

.btn--green { background: var(--green); color: var(--paper); }
.btn--green:hover { color: var(--paper); }

.btn--paper { background: var(--paper); color: var(--ink); }
.btn--paper:hover { color: var(--ink); }

.btn--sm {
  padding: 7px 16px;
  border-width: 2.5px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}
.btn--sm:hover, .btn--sm:focus-visible {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.btn--dashed {
  background: transparent;
  color: var(--cream);
  border: 3px dashed rgba(244, 241, 228, 0.75);
  box-shadow: none;
}
.btn--dashed:hover, .btn--dashed:focus-visible {
  color: var(--cream);
  border-color: var(--cream);
  background: rgba(244, 241, 228, 0.08);
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Chalkboard
   -------------------------------------------------------------------------- */

.board {
  position: relative;
  overflow: hidden;
  border: 10px solid var(--wood);
  border-radius: 4px;
  background:
    radial-gradient(ellipse 60% 40% at 30% 40%, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(ellipse 50% 30% at 75% 70%, rgba(255, 255, 255, 0.05), transparent 70%),
    var(--board);
  box-shadow:
    inset 0 0 0 3px var(--ink),
    inset 0 0 90px rgba(0, 0, 0, 0.25),
    0 10px 0 #4a3318;
}

/* faint smears of yesterday's lesson */
.board__ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 30% 8% at 20% 90%, rgba(255, 255, 255, 0.08), transparent 70%),
    radial-gradient(ellipse 25% 10% at 80% 15%, rgba(255, 255, 255, 0.06), transparent 70%),
    radial-gradient(ellipse 15% 6% at 50% 50%, rgba(255, 255, 255, 0.05), transparent 70%);
}

.board__eyebrow {
  font-family: var(--font-hand);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--chalk-dim);
}

.tray {
  height: 16px;
  margin: 0 -10px;
  background: var(--tray);
  border: 3px solid var(--ink);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Notebook paper
   -------------------------------------------------------------------------- */

.paper {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 6px 0 rgba(0, 0, 0, 0.4);
  background-image: linear-gradient(180deg, rgba(180, 150, 90, 0.10), rgba(180, 150, 90, 0.02));
}

/* the red margin rule */
.paper::before {
  content: "";
  position: absolute;
  left: var(--margin-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rule-red);
  opacity: 0.7;
}

.paper__label {
  font-family: var(--font-hand);
  font-size: 12px;
  letter-spacing: 2px;
  color: #8a6a3a;
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Section furniture
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-hand);
  font-size: 15px;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.wrap { max-width: 1180px; margin: 0 auto; }
.wrap--narrow { max-width: 1000px; margin: 0 auto; }

/* --------------------------------------------------------------------------
   Note card — a link to a post, used by the landing teaser and the
   "more from the staff room" list at the foot of a post
   -------------------------------------------------------------------------- */

.note-card {
  display: block;
  padding: 20px 20px 22px;
  background: rgba(47, 82, 64, 0.32);
  border: 2px solid rgba(244, 241, 228, 0.22);
  border-radius: 6px;
  color: var(--cream);
  transition: border-color 150ms ease, background 150ms ease;
}
.note-card:hover {
  color: var(--cream);
  border-color: rgba(242, 197, 74, 0.7);
  background: rgba(47, 82, 64, 0.5);
}
.note-card__cat {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--brown);
  margin-bottom: 8px;
}
.note-card__title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.note-card__desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 40px 6% 52px;
  background: var(--dark);
  border-top: 3px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
}

.site-footer .brand { font-size: 26px; }

.site-footer__links {
  font-family: var(--font-hand);
  font-size: 16px;
  color: #a8906a;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Mood faces — any Grummel figure carrying .grummel-moods holds all five
   face variants; the is-mood-* class on the figure picks exactly one.
   Face skin tints with the mood, like the app.
   -------------------------------------------------------------------------- */

.grummel-moods .mood { display: none; }
.grummel-moods.is-mood-stern .mood--stern,
.grummel-moods.is-mood-annoyed .mood--annoyed,
.grummel-moods.is-mood-furious .mood--furious,
.grummel-moods.is-mood-surprised .mood--surprised,
.grummel-moods.is-mood-pleased .mood--pleased { display: block; }

.grummel-moods { --face: #eecaa6; }
.grummel-moods.is-mood-annoyed { --face: #eab098; }
.grummel-moods.is-mood-furious { --face: #e07050; }
.grummel-moods.is-mood-surprised { --face: #f0ceaa; }
.grummel-moods .grummel-face { fill: var(--face); transition: fill 400ms ease; }

.grummel-steam { opacity: 0; }
.grummel-fog { opacity: 0; transition: opacity 320ms ease; }
.grummel-steam__puff { transform-box: fill-box; transform-origin: 50% 100%; }
.is-steaming .grummel-steam,
.is-steaming .grummel-fog { opacity: 1; }
.is-steaming .grummel-steam__puff { animation: lb-steam-rise 1.2s ease-out infinite; }
.is-steaming .grummel-steam__puff--2 { animation-delay: 0.35s; }
.is-steaming .grummel-steam__puff--3 { animation-delay: 0.7s; }
.grummel-figure { transform-box: fill-box; transform-origin: 50% 80%; }
.is-steaming .grummel-figure { animation: lb-shake-body 0.25s linear infinite; }
/* Cursor actually on the button he has been pointing at: he stops pretending
   to be stern and hops. The face stays pleased — this is only the body. */
.is-celebrating .grummel-figure { animation: lb-cheer 0.85s ease-in-out infinite; }

/* --------------------------------------------------------------------------
   Cameo — Mr. Grummel peeks over the bottom of the viewport, injected by
   grummel.js on pages that carry data-grummel. Fixed to the viewport so no
   overflow:hidden section can clip him.
   -------------------------------------------------------------------------- */

.grummel-cameo {
  position: fixed;
  bottom: -3px;
  z-index: 50;
  width: 120px;
  pointer-events: none;
  animation: lb-cameo-peek 6s ease-in-out both;
}

.grummel-cameo svg { display: block; width: 100%; height: auto; }

.grummel-cameo__eyes {
  transform-box: view-box;
  transform-origin: 158px 132px;
  animation: lb-blink 2s ease-in-out 0.7s 2;
}

.grummel-cameo__pupils {
  animation: lb-glance 4s ease-in-out 1.2s 1;
}

/* side variant — he leans in from an edge, head sideways */
.grummel-cameo--side { width: 110px; bottom: auto; }
.grummel-cameo--side.is-left { left: -6px; animation: lb-cameo-side-l 6s ease-in-out both; }
.grummel-cameo--side.is-right { right: -6px; left: auto; animation: lb-cameo-side-r 6s ease-in-out both; }

/* small speech bubble for cameos and the reading buddy — the hero bubble's
   look, on its own clock */
.grummel-bubble {
  position: absolute;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.3);
  font-family: var(--font-hand);
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
  transform-origin: 30% 100%;
  animation: lb-mutter-pop 4.4s ease-in-out both;
}
.grummel-cameo .grummel-bubble { bottom: calc(100% + 8px); left: 4px; }

/* tab-return — arms crossed, bottom centre, a slow disappointed shake */
.grummel-cameo--return {
  left: 50%;
  width: 150px;
  margin-left: -75px;
  animation: lb-cameo-return 8s ease-in-out both;
}
.grummel-cameo--return .grummel-cameo__scold {
  transform-origin: 50% 90%;
  animation: lb-scold 1.4s ease-in-out 2.2s 2;
}

/* walk variant — across the bottom, pauses mid-way to look at you */
.grummel-cameo--walk {
  left: 0;
  bottom: -4px;
  width: 130px;
  animation: lb-cameo-walk-x 9.5s linear both;
  will-change: transform;
}
.grummel-cameo--walk.is-reverse { animation-direction: reverse; }
.grummel-cameo--walk .grummel-cameo__bob { animation: lb-cameo-walk-bob 0.5s linear infinite; }
.grummel-cameo--walk .grummel-cameo__look {
  animation: lb-cameo-walk-look 9.5s linear both;
}

/* --------------------------------------------------------------------------
   Small screens — shared furniture
   The top bar folds to two rows: brand and CTA stay on the first, the nav
   drops to its own. No drawer, no toggle — the links must survive no-JS.
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  /* two rows of top bar to clear instead of one */
  html { scroll-padding-top: 128px; }
  .topbar {
    padding: 12px 5%;
    gap: 8px 16px;
  }
  .topbar > .btn { order: 2; }
  .topbar .nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    gap: 4px 18px;
  }
  /* thumb-sized targets without changing how the row reads */
  .topbar .nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
  .brand { font-size: 22px; }
  .btn--sm { padding: 9px 16px; }
}

@media (max-width: 620px) {
  .note-card { padding: 18px 16px 20px; }
  .note-card__title { font-size: 20px; }

  .site-footer {
    padding: 32px 5% 40px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .site-footer .brand { font-size: 24px; }
  .site-footer__links { gap: 4px 18px; }
  .site-footer__links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}

/* --------------------------------------------------------------------------
   Keyframes — the whole classroom is on a timer
   -------------------------------------------------------------------------- */

@keyframes lb-idle-tap {
  0%, 70%, 100% { transform: rotate(0deg); }
  76% { transform: rotate(-108deg); }
  80% { transform: rotate(-100deg); }
  83% { transform: rotate(-108deg); }
  87% { transform: rotate(-100deg); }
  90% { transform: rotate(-108deg); }
  95% { transform: rotate(0deg); }
}
/* CTA tap. He raises the pointer until it lines up with the "Early access"
   button, jabs it twice, and lowers the arm; lb-cta-struck runs on the button
   over the same 2.8s so the two jolts land on the two jabs without a timer.
   The angles are aimed, not decorative, and are tuned for the MIRRORED hero
   svg (rotations read flipped) — see the -stacked variant below. */
@keyframes lb-cta-point {
  0%, 100% { transform: rotate(0deg); }
  16%      { transform: rotate(-118deg); }
  22%, 78% { transform: rotate(-110deg); }
}
/* stacked layout: the CTA is straight above him, not up in the corner */
@keyframes lb-cta-point-stacked {
  0%, 100% { transform: rotate(0deg); }
  16%      { transform: rotate(-108deg); }
  22%, 78% { transform: rotate(-100deg); }
}
/* the two jabs, along the stick's own axis */
@keyframes lb-cta-jab {
  0%, 30%   { transform: translateX(0); }
  35%       { transform: translateX(15px); }
  41%       { transform: translateX(0); }
  49%       { transform: translateX(15px); }
  55%, 100% { transform: translateX(0); }
}
/* drop-shadow rather than box-shadow: the two CTAs carry different offsets */
@keyframes lb-cta-struck {
  0%, 33%, 60%, 100% { transform: translate(0, 0) rotate(0deg); filter: none; }
  36% { transform: translate(0, 3px) rotate(-1.6deg); filter: drop-shadow(0 0 12px rgba(242, 197, 74, 0.95)); }
  43% { transform: translate(0, -1px) rotate(0.9deg); filter: drop-shadow(0 0 6px rgba(242, 197, 74, 0.5)); }
  50% { transform: translate(0, 3px) rotate(-1.2deg); filter: drop-shadow(0 0 12px rgba(242, 197, 74, 0.95)); }
}
@keyframes lb-flicker {
  0%, 96%, 100% { opacity: 0; }
  97% { opacity: 0.22; }
  98% { opacity: 0.04; }
  99% { opacity: 0.16; }
}
@keyframes lb-drift {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 0.5; }
  100% { transform: translate(10px, -46px); opacity: 0; }
}
@keyframes lb-draw { to { stroke-dashoffset: 0; } }
@keyframes lb-seam-fade { to { opacity: 0; } }
@keyframes lb-door-swing {
  0% { transform: rotateY(-90deg); }
  100% { transform: rotateY(0deg); }
}
@keyframes lb-door-fade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes lb-walk {
  0%   { transform: translate3d(-78vw, 0, 0); }
  10%  { transform: translate3d(-70vw, -4px, 0); }
  20%  { transform: translate3d(-62vw, 0, 0); }
  30%  { transform: translate3d(-54vw, -4px, 0); }
  40%  { transform: translate3d(-45vw, 0, 0); }
  50%  { transform: translate3d(-36vw, -4px, 0); }
  60%  { transform: translate3d(-27vw, 0, 0); }
  70%  { transform: translate3d(-18vw, -4px, 0); }
  80%  { transform: translate3d(-10vw, 0, 0); }
  90%  { transform: translate3d(-4vw, -3px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
/* A flat figure turns by scaling through zero: 1 faces the way he is walking,
   -1 faces back the way he came. Pair it with lb-walk so he never moonwalks. */
@keyframes lb-turn-around {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(-1); }
}
@keyframes lb-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-pop-up {
  0% { transform: translateY(120%); opacity: 0; }
  70% { transform: translateY(-6px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes lb-pop-down {
  0% { transform: translateY(-120%); opacity: 0; }
  70% { transform: translateY(4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes lb-rise-in {
  0% { transform: translateY(36px); opacity: 0; }
  70% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes lb-pop-board {
  0% { transform: scale(0.2) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.06) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes lb-pop-sign {
  0% { transform: rotate(-30deg) scale(0.3); opacity: 0; }
  70% { transform: rotate(-1deg) scale(1.1); opacity: 1; }
  100% { transform: rotate(-4deg) scale(1); opacity: 1; }
}
@keyframes lb-pop-clock {
  0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes lb-bubble {
  0% { transform: scale(0.3) rotate(-6deg); opacity: 0; }
  55% { transform: scale(1.06) rotate(1deg); opacity: 1; }
  70% { transform: scale(1) rotate(0); opacity: 1; }
  92% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1) rotate(0) translateY(-14px); opacity: 0; }
}
@keyframes lb-confetti {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(420px) rotate(680deg); opacity: 0; }
}
@keyframes lb-win-pop {
  0% { transform: rotate(-2deg) scale(0.4); opacity: 0; }
  60% { transform: rotate(-2deg) scale(1.08); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); opacity: 1; }
}
@keyframes lb-win-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-rattle {
  0%, 100% { transform: rotate(-1.2deg) translateX(0); }
  25% { transform: rotate(-1.6deg) translateX(-2px); }
  50% { transform: rotate(-0.8deg) translateX(2px); }
  75% { transform: rotate(-1.5deg) translateX(-1px); }
}
/* the 404 page's big chalk digits sway like they haven't quite dried */
@keyframes lb-chalk-sway {
  0%, 100% { transform: rotate(-1.4deg) translateY(0); }
  50% { transform: rotate(0.6deg) translateY(-3px); }
}
@keyframes lb-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45) rotate(-8deg); }
  100% { transform: scale(1) rotate(0); }
}
/* Breathing timing ported from the app (4.2s). Blink/glance/nod are new but
   share its idle spirit; all end at identity so reduced-motion lands neutral. */
@keyframes lb-breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.005, 1.012); }
}
@keyframes lb-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.08); }
}
@keyframes lb-glance {
  0%, 55%, 100% { transform: translate(0, 0); }
  62%, 88% { transform: translate(-3px, 1px); }
}
/* mirror-image glance for figures drawn flipped (the hero) */
@keyframes lb-glance-r {
  0%, 55%, 100% { transform: translate(0, 0); }
  62%, 88% { transform: translate(3px, 1px); }
}
@keyframes lb-nod {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(4.5deg); }
  70% { transform: rotate(-1deg); }
}
/* Each idle cycle: the double board-tap, then a windup flourish and the
   stick jabs at the waiting-list button. Tuned for the MIRRORED hero svg
   (he faces the board), where applied rotations read flipped: -108deg
   taps toward the board, and at -2deg the stick's line runs straight
   through the primary CTA — the ±jabs circle its aim around the button. */
@keyframes lb-idle-point {
  0%, 33%, 48% { transform: rotate(0deg); }
  36% { transform: rotate(-108deg); }
  38% { transform: rotate(-100deg); }
  40% { transform: rotate(-108deg); }
  42% { transform: rotate(-100deg); }
  44% { transform: rotate(-108deg); }
  54% { transform: rotate(-52deg); }
  58% { transform: rotate(7deg); }
  60%, 63% { transform: rotate(-2deg); }
  66% { transform: rotate(6deg); }
  69% { transform: rotate(-2deg); }
  72% { transform: rotate(6deg); }
  76% { transform: rotate(-2deg); }
  86%, 100% { transform: rotate(0deg); }
}
@keyframes lb-mutter-pop {
  0% { opacity: 0; transform: scale(0.4) rotate(-6deg); }
  6% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  10%, 88% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(0.95) translateY(-8px); }
}
/* Steam and shake timings ported from the app's furious combo. */
@keyframes lb-steam-rise {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  30% { opacity: 0.9; }
  100% { transform: translate(0, -36px) scale(1.2); opacity: 0; }
}
/* Celebration: a two-beat hop with a bit of sway. Units are viewBox units,
   so it scales with whichever figure wears it. Ends at identity, so reduced
   motion collapses it to a standing figure. */
@keyframes lb-cheer {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(-3deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes lb-cheer-arm {
  0%, 100% { transform: rotate(-88deg); }
  50% { transform: rotate(-112deg); }
}
@keyframes lb-shake-body {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-2px, -1px) rotate(-1deg); }
  40% { transform: translate(2px, 1px) rotate(1deg); }
  60% { transform: translate(-2px, 1px) rotate(-1deg); }
  80% { transform: translate(2px, -1px) rotate(1deg); }
}
/* Cameo entrance/exit. Reduced motion collapses this to its 100% frame,
   which is off-screen — so even a stray injection stays invisible. */
@keyframes lb-cameo-peek {
  0% { transform: translateY(103%); }
  10% { transform: translateY(4%); }
  16%, 82% { transform: translateY(12%); }
  88% { transform: translateY(8%); }
  100% { transform: translateY(103%); }
}
/* his eyes sit deep in the cropped art, so the lean has to come well past
   the edge before they clear it */
@keyframes lb-cameo-side-l {
  0% { transform: translateX(-108%) rotate(90deg); }
  10% { transform: translateX(-8%) rotate(90deg); }
  16%, 82% { transform: translateX(-18%) rotate(90deg); }
  88% { transform: translateX(-14%) rotate(90deg); }
  100% { transform: translateX(-108%) rotate(90deg); }
}
@keyframes lb-cameo-side-r {
  0% { transform: translateX(108%) rotate(-90deg); }
  10% { transform: translateX(8%) rotate(-90deg); }
  16%, 82% { transform: translateX(18%) rotate(-90deg); }
  88% { transform: translateX(14%) rotate(-90deg); }
  100% { transform: translateX(108%) rotate(-90deg); }
}
@keyframes lb-cameo-return {
  0% { transform: translateY(103%); }
  8% { transform: translateY(0%); }
  13%, 90% { transform: translateY(5%); }
  100% { transform: translateY(103%); }
}
@keyframes lb-scold {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-2.4deg); }
  75% { transform: rotate(2.4deg); }
}
@keyframes lb-zzz {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-26px); }
}
@keyframes lb-startle {
  0% { transform: rotate(-4deg) translateY(2px); }
  40% { transform: rotate(3deg); }
  100% { transform: rotate(0); }
}
/* the walker keeps a metronome bob while his x-position holds mid-screen */
@keyframes lb-cameo-walk-x {
  0% { transform: translateX(-150px); }
  42%, 58% { transform: translateX(44vw); }
  100% { transform: translateX(100vw); }
}
@keyframes lb-cameo-walk-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes lb-cameo-walk-look {
  0%, 40%, 60%, 100% { transform: translate(3px, 0); }
  44%, 56% { transform: translate(-1px, 1.5px); }
}

/* Respect people who would rather the classroom sat still. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
