/* ThinkWagon motion: the animated wagon mark.
   Pair with tw-wagon.js, which writes the markup (one rider for each AI, 1 to 9).
   The shapes are the logo's own (Brand/logo/mark-color-on-dark.svg). Motion is CSS only.
   Themes: the default is for dark backgrounds. Add tw-light on light ones, tw-onlantern for the wheel on a Lantern button.
   Each rider wrapper carries --i (its seat, 0 from the left). The root carries data-n (team size), --gap (pause between riders
   at the start) and --after (when the star turns). State classes on a rider: is-active, is-waiting, is-done, is-out; the root then has tw-live. */

.tw { --tw-body:#FFC233; --tw-handle:#FFC233; --tw-wheel:#FFF8E8; --tw-seg:#FFC233; --tw-star:#FFF8E8; --tw-spark:#FFC233; --tw-road:rgba(255,248,232,.3);
      --i:0; --gap:.288s; --after:1.1s; display:inline-block; line-height:0; vertical-align:middle }
.tw.tw-light { --tw-handle:#12102A; --tw-wheel:#12102A; --tw-star:#5B4BFF; --tw-spark:#5B4BFF; --tw-road:rgba(18,16,42,.22) }
.tw.tw-onlantern { --tw-wheel:#12102A; --tw-seg:#FFF8E8 }
.tw .tw-svg { width:100%; height:auto; display:block; overflow:visible }
.tw .tw-body { fill:var(--tw-body) } .tw .tw-hs { stroke:var(--tw-handle) } .tw .tw-hk { fill:var(--tw-handle) }
.tw .tw-ring { stroke:var(--tw-wheel) } .tw .tw-seg { stroke:var(--tw-seg) }
.tw .tw-star, .tw .tw-tw, .tw .tw-note { fill:var(--tw-star) }
.tw .tw-spark, .tw .tw-halo circle { fill:var(--tw-spark) } .tw .tw-rays { stroke:var(--tw-spark) }
.tw .tw-dashes, .tw .tw-speed, .tw .tw-ground, .tw .tw-hiss { stroke:var(--tw-road) } .tw .tw-ping { stroke:var(--tw-handle) }
.tw .tw-wheel, .tw .tw-r, .tw .tw-rw, .tw .tw-star, .tw .tw-sparkshape, .tw .tw-tw, .tw .tw-halo, .tw .tw-ping, .tw .tw-note { transform-box:fill-box; transform-origin:center }
.tw .tw-r { transform-origin:50% 100% }
.tw .tw-handle { transform-origin:420px 292px }
.tw .tw-rays { transform-origin:256px 100px }
.tw .tw-hiss { transform-origin:176px 404px }
.tw .tw-rays, .tw .tw-speed line, .tw .tw-dash, .tw .tw-ping, .tw .tw-hiss, .tw .tw-note, .tw .tw-tw, .tw .tw-halo, .tw .tw-sparkshape { opacity:0 }
/* Parts of the newer animations, and the props a recipe can swap the spark for. */
.tw { --tw-prop-ink:#12102A } .tw.tw-light { --tw-prop-ink:#FFF8E8 }
.tw .tw-prop-line { stroke:var(--tw-spark) } .tw .tw-prop-fill, .tw .tw-glint { fill:var(--tw-spark) } .tw .tw-prop-ink { stroke:var(--tw-prop-ink) }
.tw .tw-beam-stop { stop-color:var(--tw-spark) } .tw .tw-puffs { fill:var(--tw-road) }
.tw .tw-glint, .tw .tw-puff, .tw .tw-mote-dot { transform-box:fill-box; transform-origin:center }
.tw .tw-beam { transform-origin:256px 100px } .tw .tw-wrench { transform-origin:176px 392px }
.tw .tw-beam, .tw .tw-glint, .tw .tw-puff, .tw .tw-mote-dot { opacity:0 }

@keyframes tw-spin { to { transform:rotate(360deg) } }
@keyframes tw-bob { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-7px) } }
@keyframes tw-bob-small { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-6px) } }
@keyframes tw-streak { 0% { transform:translateX(26px); opacity:0 } 25% { opacity:1 } 100% { transform:translateX(-22px); opacity:0 } }
@keyframes tw-dash { 0% { transform:translateX(0); opacity:0 } 14%,82% { opacity:1 } 100% { transform:translateX(-430px); opacity:0 } }
@keyframes tw-tug { 0%,100% { transform:rotate(0) } 50% { transform:rotate(4deg) } }
@keyframes tw-glow { 0%,100% { transform:scale(1) } 50% { transform:scale(1.1) } }

/* ---- roll: on its way ---- */
.tw-roll .tw-wheel { animation:tw-spin 1.1s linear infinite }
.tw-roll .tw-wagon { animation:tw-bob .55s ease-in-out infinite }
.tw-roll .tw-rw { animation:tw-bob-small .55s ease-in-out infinite; animation-delay:calc(-.12s - var(--i) * .08s) }
.tw-roll .tw-handle { animation:tw-tug 1.1s ease-in-out infinite }
.tw-roll .tw-dash { animation:tw-dash 1.8s linear infinite }
.tw-roll .tw-d2 { animation-delay:-.45s } .tw-roll .tw-d3 { animation-delay:-.9s } .tw-roll .tw-d4 { animation-delay:-1.35s }
.tw-roll .tw-speed line { animation:tw-streak .9s ease-out infinite }
.tw-roll .tw-s2 { animation-delay:-.3s } .tw-roll .tw-s3 { animation-delay:-.6s }
.tw-roll .tw-star { animation:tw-glow 2.2s ease-in-out infinite }

/* ---- turns: the rider that hops is the AI that is writing ---- */
@keyframes tw-hop {
  0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in }
  5% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) }
  17% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) }
  28% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out }
  34%,100% { transform:translateY(0) scale(1,1) }
}
@keyframes tw-hop-solo {
  0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in }
  8% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) }
  34% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) }
  58% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out }
  70%,100% { transform:translateY(0) scale(1,1) }
}
@keyframes tw-dip { 0%,72%,100% { transform:translateY(0) } 86% { transform:translateY(4px) } }
@keyframes tw-dip-slow { 0%,36%,52%,100% { transform:translateY(0) } 43% { transform:translateY(4px) } }
/* With nothing told about who is writing, everyone takes turns: one hop every 0.6 s. */
.tw-turns .tw-r { animation:tw-hop 1.8s infinite; animation-delay:calc(var(--i) * .6s - 1.8s) }
@keyframes tw-hop-n1 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 7.5% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 25.5% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 42.0% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 51.0%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="1"] .tw-r { animation-name:tw-hop-n1; animation-duration:1.2s; animation-delay:calc(var(--i) * .6s - 1.2s) }
@keyframes tw-hop-n2 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 7.5% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 25.5% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 42.0% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 51.0%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="2"] .tw-r { animation-name:tw-hop-n2; animation-duration:1.2s; animation-delay:calc(var(--i) * .6s - 1.2s) }
@keyframes tw-hop-n4 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 3.75% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 12.75% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 21.0% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 25.5%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="4"] .tw-r { animation-name:tw-hop-n4; animation-duration:2.4s; animation-delay:calc(var(--i) * .6s - 2.4s) }
@keyframes tw-hop-n5 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 3.0% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 10.2% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 16.8% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 20.4%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="5"] .tw-r { animation-name:tw-hop-n5; animation-duration:3s; animation-delay:calc(var(--i) * .6s - 3s) }
@keyframes tw-hop-n6 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 2.5% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 8.5% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 14.0% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 17.0%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="6"] .tw-r { animation-name:tw-hop-n6; animation-duration:3.6s; animation-delay:calc(var(--i) * .6s - 3.6s) }
@keyframes tw-hop-n7 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 2.14% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 7.29% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 12.0% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 14.57%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="7"] .tw-r { animation-name:tw-hop-n7; animation-duration:4.2s; animation-delay:calc(var(--i) * .6s - 4.2s) }
@keyframes tw-hop-n8 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 1.88% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 6.38% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 10.5% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 12.75%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="8"] .tw-r { animation-name:tw-hop-n8; animation-duration:4.8s; animation-delay:calc(var(--i) * .6s - 4.8s) }
@keyframes tw-hop-n9 { 0% { transform:translateY(0) scale(1,1); animation-timing-function:ease-in } 1.67% { transform:translateY(0) scale(1.08,.9); animation-timing-function:cubic-bezier(.2,.6,.35,1) } 5.67% { transform:translateY(-46px) scale(.96,1.05); animation-timing-function:cubic-bezier(.6,0,.9,.5) } 9.33% { transform:translateY(0) scale(1.09,.9); animation-timing-function:ease-out } 11.33%,100% { transform:translateY(0) scale(1,1) } }
.tw-turns[data-n="9"] .tw-r { animation-name:tw-hop-n9; animation-duration:5.4s; animation-delay:calc(var(--i) * .6s - 5.4s) }
.tw-turns .tw-cart { animation:tw-dip .6s ease-in-out infinite }
.tw-turns[data-n="1"] .tw-cart { animation:tw-dip-slow 1.2s ease-in-out infinite }
.tw-turns .tw-star { animation:tw-glow 1.8s ease-in-out infinite }
/* Told by the app (tw-live): is-active hops, is-waiting is dimmed, the rest sit still. */
.tw-turns.tw-live .tw-r { animation:none }
.tw-live .tw-r.is-waiting { opacity:.38 }
.tw-turns.tw-live .tw-r.is-active { animation:tw-hop-solo .9s infinite }
.tw-turns.tw-live .tw-cart { animation:tw-dip .9s ease-in-out -.21s infinite }

/* ---- spark: a spark passes along the riders and lights the star. tw-wagon.js writes the path for each team size. ---- */

/* ---- star: calm, for long waits ---- */
@keyframes tw-starturn { 0% { transform:rotate(0) scale(1) } 50% { transform:rotate(90deg) scale(1.2) } 100% { transform:rotate(180deg) scale(1) } }
@keyframes tw-halo { 0%,100% { transform:scale(.55); opacity:0 } 50% { transform:scale(1.08); opacity:1 } }
@keyframes tw-twinkle { 0%,100% { transform:scale(.2) rotate(0); opacity:0 } 50% { transform:scale(1) rotate(45deg); opacity:.9 } }
@keyframes tw-breathe { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-6px) } }
.tw-star .tw-star { animation:tw-starturn 2.4s cubic-bezier(.45,0,.55,1) infinite }
.tw-star .tw-halo { animation:tw-halo 2.4s ease-in-out infinite }
.tw-star .tw-tw { animation:tw-twinkle 2.4s ease-in-out infinite }
.tw-star .tw-tw2 { animation-delay:-.8s } .tw-star .tw-tw3 { animation-delay:-1.6s }
.tw-star .tw-rw { animation:tw-breathe 2.4s ease-in-out infinite; animation-delay:calc(var(--i) * -.2s) }
/* In the calm set a recipe's prop floats beside the star instead of hopping between riders. */
.tw-star .tw-propfloat { animation:tw-breathe 2.4s ease-in-out -.6s infinite }

/* ---- aboard: the preview loop of the start. The riders pop up one by one, the star turns, the wagon sets off. ---- */
@keyframes tw-pop { 0%,4% { transform:translateY(94px) scale(.85); opacity:0; animation-timing-function:cubic-bezier(.2,.8,.3,1) } 5% { opacity:1 }
  12% { transform:translateY(-18px) scale(1); opacity:1; animation-timing-function:ease-in-out } 16% { transform:translateY(4px) scale(1) }
  19%,90% { transform:translateY(0) scale(1); opacity:1; animation-timing-function:ease-in } 95% { transform:translateY(94px) scale(.85); opacity:1 } 96%,100% { transform:translateY(94px) scale(.85); opacity:0 } }
@keyframes tw-squash { 0%,7% { transform:scale(1) } 12% { transform:scale(.95,1.06) } 16% { transform:scale(1.06,.94) } 20%,100% { transform:scale(1) } }
@keyframes tw-load { 0%,10% { transform:translateY(0) } 13% { transform:translateY(-4px) } 17%,18% { transform:translateY(0) } 21% { transform:translateY(-4px) } 25%,26% { transform:translateY(0) } 29% { transform:translateY(-4px) } 33%,100% { transform:translateY(0) } }
@keyframes tw-setoff { 0%,44% { transform:translateY(0) } 50% { transform:translateY(-6px) } 56% { transform:translateY(0) } 62% { transform:translateY(-6px) } 68% { transform:translateY(0) } 74% { transform:translateY(-6px) } 80% { transform:translateY(0) } 85% { transform:translateY(-4px) } 89%,100% { transform:translateY(0) } }
@keyframes tw-wheelgo { 0%,42% { transform:rotate(0) } 89%,100% { transform:rotate(720deg) } }
@keyframes tw-ready { 0%,36% { transform:scale(1) rotate(0) } 41% { transform:scale(1.4) rotate(45deg) } 47%,100% { transform:scale(1) rotate(90deg) } }
@keyframes tw-wind { 0%,46% { transform:translateX(26px); opacity:0 } 52% { opacity:1 } 60% { transform:translateX(-22px); opacity:0 } 61% { transform:translateX(26px); opacity:0 } 66% { opacity:1 } 74% { transform:translateX(-22px); opacity:0 } 75% { transform:translateX(26px); opacity:0 } 79% { opacity:.8 } 86%,100% { transform:translateX(-22px); opacity:0 } }
.tw-aboard .tw-rw { animation:tw-pop 3.6s both infinite; animation-delay:calc(var(--i) * var(--gap)) }
.tw-aboard .tw-r { animation:tw-squash 3.6s ease-out both infinite; animation-delay:calc(var(--i) * var(--gap)) }
.tw-aboard .tw-cart { animation:tw-load 3.6s ease-out infinite } .tw-aboard .tw-wagon { animation:tw-setoff 3.6s ease-in-out infinite }
.tw-aboard .tw-wheel { animation:tw-wheelgo 3.6s cubic-bezier(.45,0,.55,1) infinite }
.tw-aboard .tw-star { animation:tw-ready 3.6s ease-out infinite }
.tw-aboard .tw-speed line { animation:tw-wind 3.6s ease-out infinite }
.tw-aboard .tw-s2 { animation-delay:.08s } .tw-aboard .tw-s3 { animation-delay:.16s }

/* ---- intro: the start as the app plays it, once. Riders pop up and stay, then the star turns. ---- */
@keyframes tw-popin { 0% { transform:translateY(94px) scale(.85); opacity:0 } 8% { opacity:1 } 55% { transform:translateY(-18px) scale(1); opacity:1 } 80% { transform:translateY(4px) scale(1) } 100% { transform:translateY(0) scale(1); opacity:1 } }
@keyframes tw-ready-once { 0% { transform:scale(1) rotate(0) } 45% { transform:scale(1.4) rotate(45deg) } 100% { transform:scale(1) rotate(90deg) } }
.tw-intro .tw-rw { animation:tw-popin .54s cubic-bezier(.2,.8,.3,1) both; animation-delay:calc(var(--i) * var(--gap)) }
.tw-intro .tw-star { animation:tw-ready-once .4s ease-out both; animation-delay:var(--after) }

/* ---- arrive: the answer lands. Loops as a preview; add tw-once to play it once. ---- */
@keyframes tw-pullin { 0% { transform:translateX(-64px) } 20% { transform:translateX(9px) } 27%,100% { transform:translateX(0) } }
@keyframes tw-brake { 0% { transform:rotate(-360deg) } 22%,100% { transform:rotate(0) } }
@keyframes tw-cheer { 0%,22% { transform:translateY(0) scale(1) } 30% { transform:translateY(-30px) scale(.97,1.04) } 38% { transform:translateY(0) scale(1.07,.93) } 43%,100% { transform:translateY(0) scale(1) } }
@keyframes tw-starpop { 0%,24% { transform:scale(1) rotate(0) } 31% { transform:scale(1.5) rotate(45deg) } 40%,100% { transform:scale(1) rotate(90deg) } }
@keyframes tw-burst { 0%,25% { transform:scale(.5); opacity:0 } 30% { opacity:1 } 42%,100% { transform:scale(1.36); opacity:0 } }
@keyframes tw-trail { 0% { transform:translateX(-40px); opacity:.9 } 16% { transform:translateX(-64px); opacity:0 } 100% { transform:translateX(-64px); opacity:0 } }
.tw-arrive .tw-cart { animation:tw-pullin 3.2s cubic-bezier(.2,.8,.3,1) infinite }
.tw-arrive .tw-wheel { animation:tw-brake 3.2s cubic-bezier(.1,.7,.3,1) infinite }
.tw-arrive .tw-r { animation:tw-cheer 3.2s ease-out infinite; animation-delay:calc(var(--i) * .05s) }
.tw-arrive .tw-star { animation:tw-starpop 3.2s ease-out infinite }
.tw-arrive .tw-rays { animation:tw-burst 3.2s ease-out infinite }
.tw-arrive .tw-speed line { animation:tw-trail 3.2s ease-out infinite }
.tw.tw-once, .tw.tw-once * { animation-iteration-count:1 !important; animation-fill-mode:both !important }
/* The calm finish (still + tw-once): no pull-in and no cheer, the star just turns once. */
.tw-still.tw-once .tw-star { animation:tw-ready-once .5s ease-out }

/* ---- yourturn: parked. The app is waiting for the person, not thinking. ---- */
@keyframes tw-wave { 0%,50%,100% { transform:rotate(0) } 58% { transform:rotate(-17deg) } 66% { transform:rotate(5deg) } 74% { transform:rotate(-13deg) } 84% { transform:rotate(2deg) } 92% { transform:rotate(0) } }
@keyframes tw-ping { 0%,54% { transform:scale(1); opacity:0 } 58% { opacity:.9 } 84%,100% { transform:scale(2.7); opacity:0 } }
@keyframes tw-look { 0%,46%,100% { transform:translateX(0) } 56%,86% { transform:translateX(8px) } }
@keyframes tw-blink { 0%,100% { opacity:1 } 50% { opacity:.4 } }
.tw-yourturn .tw-handle { animation:tw-wave 2.6s ease-in-out infinite }
.tw-yourturn .tw-ping { animation:tw-ping 2.6s ease-out infinite }
.tw-yourturn .tw-rw { animation:tw-look 2.6s ease-in-out infinite; animation-delay:calc(var(--i) * .05s) }
.tw-yourturn .tw-star { animation:tw-blink 2.6s ease-in-out infinite }

/* ---- debate: two riders trade hops, the wagon rocks, the star leans toward whoever is speaking ---- */
@keyframes tw-rock { 0%,100% { transform:rotate(1.8deg) } 50% { transform:rotate(-1.8deg) } }
@keyframes tw-lean { 0%,50%,100% { transform:translateX(0) rotate(0) } 25% { transform:translateX(-9px) rotate(-10deg) } 75% { transform:translateX(9px) rotate(10deg) } }
.tw-debate .tw-r { animation:tw-hop-n2 1.2s infinite; animation-delay:calc(var(--i) * -.6s) }
.tw-debate .tw-cart { transform-origin:256px 410px; animation:tw-rock 1.2s ease-in-out infinite }
.tw-debate .tw-star { animation:tw-lean 1.2s ease-in-out infinite }
/* Told who is speaking (tw-live, data-active on the root): that rider hops and the star leans toward them. */
.tw-debate.tw-live .tw-r { animation:none }
.tw-debate.tw-live .tw-r.is-active { animation:tw-hop-solo .9s infinite }
.tw-debate.tw-live .tw-cart { animation-duration:1.8s }
.tw-debate.tw-live .tw-star { animation:none; transition:transform .35s ease-out }
.tw-debate.tw-live[data-active="0"] .tw-star { transform:translateX(-9px) rotate(-10deg) }
.tw-debate.tw-live[data-active="1"] .tw-star { transform:translateX(9px) rotate(10deg) }

/* ---- panel: everyone works at once, each at their own pace (--d and --o are set per rider) ---- */
@keyframes tw-busy { 0%,100% { transform:translateY(0) scale(1,1) } 45% { transform:translateY(-15px) scale(.98,1.03) } 80% { transform:translateY(0) scale(1.05,.95) } }
@keyframes tw-note { 0%,100% { transform:scale(.2) rotate(0) translateY(0); opacity:0 } 40% { transform:scale(1) rotate(45deg) translateY(-6px); opacity:.95 } 70% { transform:scale(.6) rotate(90deg) translateY(-16px); opacity:0 } }
.tw-panel .tw-r { animation:tw-busy var(--d,.8s) ease-in-out var(--o,0s) infinite }
.tw-panel .tw-note { animation:tw-note 2.4s ease-out infinite; animation-delay:calc(var(--i) * -.85s) }
.tw-panel .tw-star { animation:tw-glow 1.8s ease-in-out infinite }
.tw-panel.tw-live .tw-r.is-done, .tw-panel.tw-live .tw-r.is-waiting { animation:none }
.tw-panel.tw-live .tw-note.is-done, .tw-panel.tw-live .tw-note.is-waiting { animation:none }

/* ---- flat: an AI could not be reached (is-out marks its rider). Never used for an ordinary wait. ---- */
@keyframes tw-shudder { 0%,58%,100% { transform:rotate(-3.2deg) translateX(0) } 64% { transform:rotate(-3.2deg) translateX(6px) } 70% { transform:rotate(-3.2deg) translateX(-3px) } 76% { transform:rotate(-3.2deg) translateX(4px) } 84% { transform:rotate(-3.2deg) translateX(0) } }
@keyframes tw-hiss { 0%,60% { transform:scale(.5); opacity:0 } 66% { opacity:.95 } 86%,100% { transform:scale(1.25); opacity:0 } }
@keyframes tw-flicker { 0%,44%,56%,100% { opacity:.38 } 50% { opacity:.8 } }
.tw-flat .tw-cart { transform-origin:336px 428px; transform:rotate(-3.2deg); animation:tw-shudder 2.8s ease-in-out infinite }
.tw-flat .tw-w1 { transform-origin:50% 100%; transform:scale(1.13,.76) }
.tw-flat .tw-w1 .tw-seg { opacity:0 }
.tw-flat .tw-hiss { animation:tw-hiss 2.8s ease-out infinite }
.tw-flat .tw-star { opacity:.38; animation:tw-flicker 2.8s ease-in-out infinite }
.tw-flat .tw-rw.is-out { transform:translateY(12px) } .tw-flat .tw-r.is-out { opacity:.3 }

/* ---- check: lantern check. The star's beam sweeps over the riders like a searchlight, and each rider swells as it passes.
        --h1 and --h2 on a rider are the moments the beam crosses it, on the way over and on the way back. ---- */
@keyframes tw-sweep { 0%,100% { transform:rotate(36deg) } 10%,90% { transform:rotate(29.1deg) } 20%,80% { transform:rotate(11.1deg) } 30%,70% { transform:rotate(-11.1deg) } 40%,60% { transform:rotate(-29.1deg) } 50% { transform:rotate(-36deg) } }
@keyframes tw-peer { 0%,100% { transform:rotate(16deg) } 50% { transform:rotate(-16deg) } }
@keyframes tw-seen { 0%,9%,100% { transform:scale(1) } 3% { transform:scale(1.1,1.08) } }
@keyframes tw-nod { 0%,100% { transform:translateY(0) } 50% { transform:translateY(6px) } }
.tw-check .tw-beam { opacity:1; animation:tw-sweep 3.2s linear infinite }
.tw-check .tw-star { animation:tw-peer 3.2s ease-in-out infinite }
.tw-check .tw-rw { animation:tw-seen 3.2s ease-out infinite; animation-delay:calc(var(--h1,0) * 1s) }
.tw-check .tw-r { animation:tw-seen 3.2s ease-out infinite; animation-delay:calc(var(--h2,0) * 1s) }
/* Told who is checking (tw-live): that rider nods along. Riders whose work is being checked still swell; waiting riders do nothing. */
.tw-check.tw-live .tw-rw.is-active, .tw-check.tw-live .tw-rw.is-waiting, .tw-check.tw-live .tw-r.is-waiting { animation:none }
.tw-check.tw-live .tw-r.is-active { animation:tw-nod 1.6s ease-in-out infinite }

/* ---- tune: tune-up. A spanner tightens the back wheel in three strokes, the wheel spins free, and a glint says it is fixed. ---- */
@keyframes tw-ratchet { 0% { transform:rotate(-20deg); opacity:1; animation-timing-function:cubic-bezier(.3,.7,.4,1) } 11.7% { transform:rotate(28deg); animation-timing-function:ease-in }
  16.7% { transform:rotate(-20deg); animation-timing-function:cubic-bezier(.3,.7,.4,1) } 28.3% { transform:rotate(28deg); animation-timing-function:ease-in }
  33.3% { transform:rotate(-20deg); animation-timing-function:cubic-bezier(.3,.7,.4,1) } 45% { transform:rotate(28deg); opacity:1 } 52% { transform:rotate(40deg); opacity:0 }
  90% { transform:rotate(-20deg); opacity:0 } 97%,100% { transform:rotate(-20deg); opacity:1 } }
@keyframes tw-tighten { 0% { transform:rotate(0); animation-timing-function:cubic-bezier(.3,.7,.4,1) } 11.7%,16.7% { transform:rotate(48deg); animation-timing-function:cubic-bezier(.3,.7,.4,1) }
  28.3%,33.3% { transform:rotate(96deg); animation-timing-function:cubic-bezier(.3,.7,.4,1) } 45%,52% { transform:rotate(144deg); animation-timing-function:cubic-bezier(.2,.6,.3,1) } 84%,100% { transform:rotate(360deg) } }
@keyframes tw-press { 0%,4%,16.7%,21%,33.3%,38%,50%,78%,92%,100% { transform:translateY(0) } 11.7%,28.3%,45% { transform:translateY(3px) } 85% { transform:translateY(-6px) } }
@keyframes tw-watch { 0%,62%,100% { transform:translateX(0) } 8%,50% { transform:translateX(-7px) } }
@keyframes tw-work { 0%,4%,16.7%,21%,33.3%,38%,50%,100% { transform:translateY(0) } 11.7%,28.3%,45% { transform:translateY(6px) } }
@keyframes tw-glint { 0%,80% { transform:scale(0) rotate(0); opacity:0 } 87% { transform:scale(1.2) rotate(45deg); opacity:1 } 97%,100% { transform:scale(0) rotate(90deg); opacity:0 } }
@keyframes tw-proud { 0%,78%,96%,100% { transform:scale(1) } 87% { transform:scale(1.28) } }
.tw-tune .tw-wrench { animation:tw-ratchet 2.4s infinite }
.tw-tune .tw-w1 { animation:tw-tighten 2.4s infinite }
.tw-tune .tw-cart { animation:tw-press 2.4s ease-in-out infinite }
.tw-tune .tw-rw { animation:tw-watch 2.4s ease-in-out infinite; animation-delay:calc(var(--i) * .04s) }
.tw-tune .tw-r { animation:tw-work 2.4s ease-in-out infinite }
.tw-tune .tw-glint { animation:tw-glint 2.4s ease-out infinite } .tw-tune .tw-g2 { animation-delay:.1s }
.tw-tune .tw-star { animation:tw-proud 2.4s ease-in-out infinite }
/* Told who is fixing (tw-live): only that rider works the strokes; the others watch. */
.tw-tune.tw-live .tw-r { animation:none }
.tw-tune.tw-live .tw-r.is-active { animation:tw-work 2.4s ease-in-out infinite }

/* ---- huddle: combining answers. The riders squeeze together and a mote of each one's color swirls up into the star.
        Every mote runs the same 100 units; the group around it turns and scales that onto its rider's own path. ---- */
@keyframes tw-squeeze { 0%,78%,100% { transform:scale(1,1) } 12%,62% { transform:scale(.86,1.03) } }
@keyframes tw-rise { 0%,16% { transform:translateY(100px); animation-timing-function:cubic-bezier(.45,0,.75,.45) } 58%,100% { transform:translateY(0) } }
@keyframes tw-drift { 0%,16% { transform:translateX(0); animation-timing-function:ease-out } 37% { transform:translateX(24px); animation-timing-function:ease-in } 58%,100% { transform:translateX(0) } }
@keyframes tw-motefade { 0%,14% { transform:scale(.3); opacity:0 } 20% { transform:scale(1); opacity:1 } 50% { transform:scale(.9); opacity:1 } 58%,100% { transform:scale(.3); opacity:0 } }
@keyframes tw-gather { 0%,34% { transform:scale(1) rotate(0) } 62% { transform:scale(1.22) rotate(0) } 74% { transform:scale(1.5) rotate(90deg) } 86%,100% { transform:scale(1) rotate(180deg) } }
@keyframes tw-gatherglow { 0%,44% { transform:scale(.55); opacity:0 } 74% { transform:scale(1.1); opacity:1 } 90%,100% { transform:scale(.7); opacity:0 } }
.tw-huddle .tw-riders { transform-origin:256px 252px; animation:tw-squeeze 3.2s ease-in-out infinite }
.tw-huddle .tw-mote { animation:tw-rise 3.2s backwards infinite; animation-delay:calc(var(--i) * var(--mgap,.12s)) }
.tw-huddle .tw-mote-drift { animation:tw-drift 3.2s backwards infinite; animation-delay:calc(var(--i) * var(--mgap,.12s)) }
.tw-huddle .tw-mote-dot { animation:tw-motefade 3.2s linear backwards infinite; animation-delay:calc(var(--i) * var(--mgap,.12s)) }
.tw-huddle .tw-star { animation:tw-gather 3.2s ease-in-out infinite }
.tw-huddle .tw-halo { animation:tw-gatherglow 3.2s ease-in-out infinite }
.tw-huddle.tw-live .tw-r.is-active { animation:tw-nod 1.6s ease-in-out infinite }

/* ---- uphill: a very long wait. Road and wagon tilt together, the wheels grind round in two pushes, and the star leads the way. ---- */
@keyframes tw-grind { 0% { transform:rotate(0); animation-timing-function:cubic-bezier(.2,.6,.4,1) } 30% { transform:rotate(160deg); animation-timing-function:linear }
  50% { transform:rotate(180deg); animation-timing-function:cubic-bezier(.2,.6,.4,1) } 80% { transform:rotate(340deg); animation-timing-function:linear } 100% { transform:rotate(360deg) } }
@keyframes tw-heave { 0%,100% { transform:translate(0,0) } 55% { transform:translate(7px,-2px) } }
@keyframes tw-push { 0%,100% { transform:translateX(0) } 55% { transform:translateX(6px) } }
@keyframes tw-puff { 0%,6% { transform:translate(0,0) scale(.3); opacity:0 } 22% { opacity:.9 } 62%,100% { transform:translate(-26px,-12px) scale(1.25); opacity:0 } }
.tw-uphill .tw-slope { transform-origin:256px 443px; transform:translateY(-10px) rotate(-7deg) }
.tw-uphill .tw-starwrap { transform:translate(14px,-4px) }
.tw-uphill .tw-wheel { animation:tw-grind 2.2s infinite }
.tw-uphill .tw-cart { animation:tw-heave 1.1s ease-in-out infinite }
.tw-uphill .tw-rw { animation:tw-push 1.1s ease-in-out infinite; animation-delay:calc(var(--i) * .05s) }
.tw-uphill .tw-handle { animation:tw-tug 1.1s ease-in-out infinite }
.tw-uphill .tw-dash { animation:tw-dash 3.6s linear infinite }
.tw-uphill .tw-d2 { animation-delay:-.9s } .tw-uphill .tw-d3 { animation-delay:-1.8s } .tw-uphill .tw-d4 { animation-delay:-2.7s }
.tw-uphill .tw-puff { animation:tw-puff 1.1s ease-out infinite }
.tw-uphill .tw-p2 { animation-delay:.12s } .tw-uphill .tw-p3 { animation-delay:.24s }
.tw-uphill .tw-star { animation:tw-glow 2.2s ease-in-out infinite }

/* ---- wheel: one wagon wheel, for buttons and other small spaces ---- */
.tw-wheel-only .tw-wheel { animation:tw-spin 1s linear infinite }

/* ---- People who ask their device for less motion get a still wagon. While something is being worked on its star breathes softly;
        parked, finished and broken-down wagons do not move at all. Dimmed riders still show who is waiting. ---- */
@keyframes tw-calm { 0%,100% { opacity:1 } 50% { opacity:.45 } }
@media (prefers-reduced-motion: reduce) {
  .tw, .tw * { animation:none !important; transition:none !important }
  .tw:is(.tw-turns,.tw-spark,.tw-roll,.tw-star,.tw-panel,.tw-debate,.tw-aboard,.tw-intro,.tw-check,.tw-tune,.tw-huddle,.tw-uphill) .tw-star, .tw-wheel-only .tw-seg { animation:tw-calm 2.4s ease-in-out infinite !important }
  .tw .tw-rw, .tw .tw-r { opacity:1 }
  .tw .tw-r.is-waiting { opacity:.38 } .tw .tw-r.is-out { opacity:.3 }
}
