/* Groundup buddy (js/buddy.js). Ink outlines, flat grey shading, lime cap. Transform-only animation, running only
   on instances marked .is-on (on screen). Reduced motion: static poses. */
.bd-host{position:relative}
.buddy{position:absolute;z-index:4;width:116px;pointer-events:none;line-height:0}
.bd-move,.bd-flip{transform-origin:50% 100%}
.bd-svg{display:block;width:100%;height:auto;overflow:visible}
.bd-svg *{stroke:#0E0E0D;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.bd-svg text{stroke:none;fill:#0E0E0D;font-family:var(--display);font-weight:800;text-anchor:middle}
.bd-pants{fill:#8C877C}.bd-shoe{fill:#0E0E0D}.bd-tee{fill:#EFECE5}.bd-shade{fill:#D9D5CB;stroke:none!important}
.bd-line,.bd-limb,.bd-hair,.bd-smile,.bd-closed,.bd-pole{fill:none}
.bd-sleeve{fill:#EFECE5}.bd-hand,.bd-face{fill:#FBFAF7}.bd-cheek{fill:#D9D5CB;stroke:none!important}
.bd-eyes circle{fill:#0E0E0D;stroke:none}
.bd-cap{fill:#CBF442}.bd-brim{fill:#0E0E0D}
.bd-badge *{fill:#0E0E0D;stroke:none!important}
.bd-board{fill:#FBFAF7}.bd-sign text{font-size:11px;letter-spacing:.5px}
.bd-lid{fill:#0E0E0D}.bd-base{fill:#B3AEA2}.bd-glow{fill:#CBF442;stroke:none!important}
.bd-zzz text{font-size:13px}
.bd-sign,.bd-sitlegs,.bd-laptop,.bd-zzz,.bd-closed{display:none}
.bd-armF,.bd-armB,.bd-head,.bd-legL,.bd-legR{transform-box:view-box;transition:transform .5s var(--ease)}
.bd-armF{transform-origin:74px 72px}.bd-armB{transform-origin:46px 72px}
.bd-head{transform-origin:60px 62px}.bd-legL{transform-origin:57px 104px}.bd-legR{transform-origin:67px 104px}
/* sleep */
.buddy.zz .bd-eyes{display:none}.buddy.zz .bd-closed{display:inline}.buddy.zz .bd-zzz{display:inline}
.buddy.zz .bd-head{transform:rotate(9deg)}
.buddy.zz .bd-armF{transform:none!important;animation:none!important}
@keyframes bd-z{0%{transform:translate(0,6px);opacity:0}30%{opacity:1}100%{transform:translate(6px,-10px);opacity:0}}
.buddy.zz.is-on .bd-zzz text{animation:bd-z 2.6s ease-in-out infinite;transform-box:fill-box}
.buddy.zz.is-on .bd-zzz text:nth-child(2){animation-delay:.5s}.buddy.zz.is-on .bd-zzz text:nth-child(3){animation-delay:1s}
/* wave (hero), then wander off */
.bm-wave{left:58%;bottom:0;width:112px}
.bm-wave .bd-armF{transform:rotate(-150deg)}
@keyframes bd-wave{0%,100%{transform:rotate(-140deg)}50%{transform:rotate(-172deg)}}
.bm-wave.is-on:not(.leave) .bd-armF{animation:bd-wave .7s ease-in-out 4}
.bm-wave .bd-move{transition:transform 7s linear,opacity .6s 6.4s}
.bm-wave.leave .bd-move{transform:translateX(70vw);opacity:0}
.bm-wave.leave .bd-armF{transform:none}
/* walk cycle (used by leave and the footer walk) */
@keyframes bd-legA{0%,100%{transform:rotate(16deg)}50%{transform:rotate(-16deg)}}
@keyframes bd-legB{0%,100%{transform:rotate(-16deg)}50%{transform:rotate(16deg)}}
@keyframes bd-armS{0%,100%{transform:rotate(-14deg)}50%{transform:rotate(14deg)}}
@keyframes bd-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
.bm-wave.leave.is-on .bd-legL,.bm-walk.is-on .bd-legL{animation:bd-legA .7s ease-in-out infinite}
.bm-wave.leave.is-on .bd-legR,.bm-walk.is-on .bd-legR{animation:bd-legB .7s ease-in-out infinite}
.bm-wave.leave.is-on .bd-armF,.bm-walk.is-on .bd-armF{animation:bd-armS .7s ease-in-out infinite}
.bm-walk.is-on .bd-armB{animation:bd-armS .7s ease-in-out infinite reverse}
.bm-walk.is-on .bd-flip{animation:bd-flipx 64s steps(1) infinite}
/* footer skyline walk: left to right and back, flipping at each end */
/* bottom: his soles sit on the skyline's ground line (viewBox y 200 of 214: about 13px up at desktop sizes) */
.bm-walk{left:0;right:0;bottom:9px;width:auto;container-type:inline-size}
.bm-walk .bd-move{width:58px}
@keyframes bd-walkx{from{transform:translateX(2cqw)}to{transform:translateX(calc(100cqw - 64px))}}
@keyframes bd-flipx{0%{transform:none}50%{transform:scaleX(-1)}}
.bm-walk.is-on .bd-move{animation:bd-walkx 32s linear infinite alternate}
.bm-walk .bd-move{transform:translateX(30cqw)}
.bm-walk.zz .bd-move,.bm-walk.zz .bd-legL,.bm-walk.zz .bd-legR,.bm-walk.zz .bd-armB,.bm-walk.zz .bd-flip{animation-play-state:paused}
/* Phones (fix 2026-12-01): the skyline strip pans under him (css/style.css sky-pan), so he walks on the spot like a
   side-scroller and turns with the ground. The turn runs off the sky's own .is-on and uses the same 110s and the same
   33.5% / 83.5% stops, so both start on the same frame and stay in step. js/buddy.js keeps him awake on phones. */
@media (max-width:600px){
  .bm-walk{bottom:7px}
  .foot-sky .bm-walk .bd-move,.foot-sky .bm-walk.is-on .bd-move{width:46px;transform:translateX(calc(30cqw - 23px));animation:none}
  .bm-walk.is-on .bd-flip{animation:none}
  .foot-sky.is-on .bm-walk .bd-flip{animation:bd-flip-m 110s linear infinite}
}
@keyframes bd-flip-m{0%,33.49%{transform:none}33.5%,83.49%{transform:scaleX(-1)}83.5%,100%{transform:none}}
/* sit on a section edge, typing */
.bm-sit{top:-118px;right:var(--gutter);width:116px}
.bm-sit .bd-legs{display:none}.bm-sit .bd-sitlegs,.bm-sit .bd-laptop{display:inline}
.bm-sit .bd-armF{transform:rotate(-62deg)}.bm-sit .bd-armB{transform:rotate(-48deg)}
@keyframes bd-typeA{0%,100%{transform:rotate(-62deg)}50%{transform:rotate(-55deg)}}
@keyframes bd-typeB{0%,100%{transform:rotate(-48deg)}50%{transform:rotate(-55deg)}}
.bm-sit.is-on:not(.zz) .bd-armF{animation:bd-typeA .32s ease-in-out infinite}
.bm-sit.is-on:not(.zz) .bd-armB{animation:bd-typeB .32s ease-in-out infinite}
.bm-sit.zz .bd-armB{transform:rotate(-30deg)}
/* holding a sign by a CTA */
.bm-sign{right:7%;bottom:0;width:150px}
.bm-sign .bd-sign{display:inline}
.bm-sign .bd-armF{transform:rotate(-168deg)}.bm-sign .bd-armB{transform:rotate(166deg)}
@keyframes bd-lift{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.bm-sign.is-on:not(.zz) .bd-move{animation:bd-lift 1.6s ease-in-out infinite}
/* peeking beside the chat button */
.bm-peek{position:fixed;right:30px;bottom:64px;width:72px;z-index:9980;transform:translateY(24px);opacity:0;pointer-events:none;transition:transform .6s var(--ease),opacity .4s}
.bm-peek.up{transform:none;opacity:1;pointer-events:auto}
.bm-peek.gone{transform:translateY(24px);opacity:0;pointer-events:none}
.bm-peek .bd-armF{transform:rotate(-150deg)}
.bm-peek.is-on.up .bd-armF{animation:bd-wave .7s ease-in-out 3 .8s}
.bd-x{position:absolute;right:-6px;top:4px;width:24px;height:24px;border-radius:50%;background:#0E0E0D;color:#EFECE5;border:1px solid rgba(239,236,229,.5);font-size:15px;line-height:1;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:.85}
.bd-x:hover,.bd-x:focus-visible{opacity:1;outline:2px solid #CBF442;outline-offset:1px}
.buddy-tog{display:none;margin-left:14px;font:inherit;color:inherit;text-decoration:underline;text-underline-offset:3px}
.js .buddy-tog{display:inline}
.buddy-tog:hover{color:var(--accent)}
@media (max-width:899.98px){.bm-peek{display:none}}
@media (prefers-reduced-motion:reduce){
  .buddy *,.buddy{animation:none!important;transition:none!important}
  .bm-wave.leave .bd-move{transform:none;opacity:1}
}
/* On ink, the outline turns paper so the character stays readable */
.hero .buddy .bd-svg *,.site-footer .buddy .bd-svg *{stroke:#EFECE5}
.hero .buddy .bd-shoe,.site-footer .buddy .bd-shoe,.hero .buddy .bd-brim,.site-footer .buddy .bd-brim{fill:#EFECE5}
.bm-wave{width:132px}.bm-sit{width:150px;top:-148px}.bm-walk .bd-move{width:66px}
@media (min-width:900px){.bm-peek{width:74px;bottom:66px}}
.ab-hero .buddy .bd-svg *{stroke:#EFECE5}.ab-hero .buddy .bd-shoe,.ab-hero .buddy .bd-brim{fill:#EFECE5}
.ab-hero .bm-wave{left:auto;right:9%;bottom:10px;width:230px}
/* Rail buddy (task Y): a tiny buddy under the tip of the reading-progress line, front hand on the line as if pulling
   it along. Fixed; y follows the header bottom (transition matches the header), x is set per scroll frame by
   js/buddy.js. Walk cycle only while scrolling (.walking, removed 150 ms after the last scroll event).
   Sits below the header (z-index 49 < 50), so it can never cover the nav, the CTA or the menu button. */
.bm-rail{position:fixed;top:0;left:0;width:0;height:0;z-index:49;--bw:32px;transition:transform .35s var(--ease),opacity .3s}
.bm-rail .bd-move{position:absolute;left:0;top:0;width:var(--bw);margin-left:calc(var(--bw) * -.626);margin-top:calc(var(--bw) * -.44)}
.bm-rail .bd-flip{transform-origin:62.6% 0;transition:transform .2s var(--ease)}
.bm-rail .bd-flip.bd-back{transform:scaleX(-1)}
.bm-rail .bd-svg *{stroke-width:3.6}
.bm-rail .bd-armF{transform:rotate(-165deg)}
.bm-rail.bd-away{opacity:0}
html:has(.nav.open) .bm-rail{opacity:0}
.bm-rail.walking .bd-legL{animation:bd-legA .5s ease-in-out infinite}
.bm-rail.walking .bd-legR{animation:bd-legB .5s ease-in-out infinite}
.bm-rail.walking .bd-armB{animation:bd-armS .5s ease-in-out infinite}
.bm-rail.cheer .bd-armF{animation:bd-wave .6s ease-in-out 3}
.bm-rail .bd-star{position:absolute;left:calc(var(--bw) * .95);top:calc(var(--bw) * .55);font:700 13px/1 var(--display);font-style:normal;color:#CBF442;-webkit-text-stroke:.7px #0E0E0D;opacity:0;pointer-events:none}
.bm-rail.cheer .bd-star{animation:bd-star 1.8s var(--ease) 1}
@keyframes bd-star{0%{opacity:0;transform:scale(.4) rotate(-40deg)}25%{opacity:1;transform:scale(1.15) rotate(0)}70%{opacity:1;transform:scale(1)}100%{opacity:0;transform:translateY(-4px) scale(.9)}}
@media (max-width:767.98px){.bm-rail{--bw:23px}.bm-rail .bd-star{font-size:11px}}
@media (prefers-reduced-motion:reduce){.bm-rail .bd-star{display:none}}
/* About hero v2: the waving buddy stands on the skyline ground line in front of the 2021 art */
.ab-hero .bm-wave{right:5%;bottom:12px;width:150px}
.ab-hero .bm-wave{right:11%}
/* Phones: the rail Buddy sat over the content under the header; hide it below 768px (the footer skyline walk stays). */
@media (max-width:767.98px){.bm-rail{display:none!important}}
