/* Character family (Fold, Tally, Stamp, Peep, and each category's mascot): idle + reaction motion.
   Art is 2.5D since 2026-11-18, generated by _build/art/family/depth/build-depth.mjs (one camera, one light).
   Transform + opacity only. Every transform-origin lives on its <g> in the SVG, in viewBox units.
   Idle loops run only while the SVG has .is-live (an IntersectionObserver adds it on screen).
   Reactions: hover on the .char-host (fine pointers only), or .is-react / .is-cheer / .is-nod set by script.
   Reduced motion: no loops, no jumps; the cheer pose still shows as a still. */

.ai-char { display: block; overflow: visible;
  --loop: cubic-bezier(.45, 0, .55, 1); --up: cubic-bezier(.23, 1, .32, 1); --down: cubic-bezier(.55, 0, .9, .45); }
.ai-char * { transform-box: view-box; }
.ai-char .c-twinkle { transform-box: fill-box; transform-origin: center; }
.ai-char .c-eyes-happy, .ai-char .c-grin, .ai-char .c-pop { opacity: 0; }
.ai-char .c-eyes-open, .ai-char .c-smile, .ai-char .c-eyes-happy, .ai-char .c-grin { transition: opacity 140ms ease; }

/* per-character clocks, so nobody moves in unison */
.ai-fold  { --sway: 5.6s; --breathe: 3.8s; --blink: 4.4s; --blink-delay: -1.2s; --look-delay: -3s; }
.ai-tally { --sway: 4.9s; --breathe: 3.4s; --blink: 5.6s; --blink-delay: -2.6s; --look-delay: -6s; --blink-name: c-blink2; --react: c-stretch; }
.ai-stamp { --sway: 4.4s; --breathe: 3.1s; --blink: 3.9s; --blink-delay: -0.4s; --look-delay: -1s; }
.ai-peep  { --sway: 5.2s; --breathe: 3.6s; --blink: 4.8s; --blink-delay: -3.3s; --look-delay: -4.5s; --look-x: 10px; --cheer-arm: 136deg; }

/* ---------- idle ---------- */
.ai-char.is-live .c-sway    { animation: c-sway var(--sway) var(--loop) infinite alternate; }
.ai-char.is-live .c-body    { animation: c-breathe var(--breathe) var(--loop) infinite alternate; }
.ai-char.is-live .c-eyes    { animation: var(--blink-name, c-blink) var(--blink) linear var(--blink-delay) infinite; }
.ai-char.is-live .c-look    { animation: c-look 9s var(--loop) var(--look-delay) infinite; }
.ai-char.is-live .c-leg-l   { animation: c-shuffle var(--shuffle, 2.4s) var(--loop) infinite alternate; }
.ai-char.is-live .c-leg-r   { animation: c-shuffle var(--shuffle, 2.4s) var(--loop) calc(var(--shuffle, 2.4s) / -2) infinite alternate; }
.ai-char.is-live .c-wave    { animation: c-wave 2.8s var(--loop) infinite alternate; }
.ai-fold.is-live .c-wave    { animation: c-wave-big 1.5s var(--loop) infinite alternate; } /* Fold waves hello */
.ai-char.is-live .c-sprout  { animation: c-sprout var(--sprout, 2.2s) var(--loop) infinite alternate; }
.ai-char.is-live .c-twinkle { animation: c-twinkle var(--twinkle, 2.6s) var(--loop) infinite alternate; }
.ai-char.is-live .c-twinkle + .c-twinkle { animation-delay: -1.3s; }
.ai-peep-peek.is-live .c-bob { animation: c-bob 3.4s var(--loop) infinite alternate; } /* sinks and rises behind the card edge */

@keyframes c-sway    { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
@keyframes c-breathe { from { transform: none; } to { transform: scale(.99, 1.03); } }
@keyframes c-blink   { 0%, 92%, 96%, 100% { transform: none; } 94% { transform: scaleY(.1); } }
@keyframes c-blink2  { 0%, 86%, 90%, 92%, 96%, 100% { transform: none; } 88%, 94% { transform: scaleY(.1); } }
@keyframes c-look    { 0%, 40%, 74%, 100% { transform: none; } 46%, 68% { transform: translateX(var(--look-x, 8px)); } }
@keyframes c-shuffle { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes c-wave    { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes c-wave-big { from { transform: rotate(-8deg); } to { transform: rotate(6deg); } }
@keyframes c-sprout  { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes c-twinkle { from { transform: none; opacity: 1; } to { transform: scale(.82); opacity: .55; } }
@keyframes c-bob     { from { transform: translateY(26px); } to { transform: none; } }

/* ---------- one-shot reactions ---------- */
/* hop: anticipation squash, stretch up, land squash, settle (same grammar as the home mascot) */
@keyframes c-hop {
  0%   { transform: none; animation-timing-function: var(--up); }
  16%  { transform: scale(1.06, .9); animation-timing-function: var(--up); }
  44%  { transform: translateY(-46px) scale(.96, 1.06); animation-timing-function: var(--down); }
  68%  { transform: scale(1.05, .93); animation-timing-function: var(--loop); }
  84%  { transform: scale(.99, 1.02); animation-timing-function: var(--loop); }
  100% { transform: none; }
}
/* Tally measures: stretches tall from the feet, then settles */
@keyframes c-stretch {
  0%   { transform: none; animation-timing-function: var(--up); }
  14%  { transform: scale(1.04, .94); animation-timing-function: var(--up); }
  46%  { transform: scale(.95, 1.1); animation-timing-function: var(--loop); }
  72%  { transform: scale(1.02, .98); animation-timing-function: var(--loop); }
  100% { transform: none; }
}
@keyframes c-nod   { 0% { transform: none; animation-timing-function: var(--up); } 40% { transform: translateY(-16px) scale(.98, 1.03); animation-timing-function: var(--down); } 75% { transform: scale(1.03, .97); } 100% { transform: none; } }
@keyframes c-rise  { 0% { transform: none; animation-timing-function: var(--up); } 40%, 70% { transform: translateY(-70px); animation-timing-function: var(--loop); } 100% { transform: none; } }
@keyframes c-jab   { 0%, 100% { transform: none; } 40% { transform: rotate(-12deg) translateX(-10px); } 70% { transform: rotate(3deg); } }
@keyframes c-pulse { 0%, 100% { transform: none; } 35% { transform: scale(1.4); } 65% { transform: scale(.92); } }
@keyframes c-happy-on  { 0%, 100% { opacity: 0; } 18%, 82% { opacity: 1; } }
@keyframes c-happy-off { 0%, 100% { opacity: 1; } 18%, 82% { opacity: 0; } }
@keyframes c-pop   { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; transform: scale(1.12); } 100% { opacity: 0; transform: translateY(-40px) scale(.9); } }

/* hover on the host card (fine pointers only) — and the same thing by class for taps */
@media (hover: hover) and (pointer: fine) {
  .char-host:hover .ai-char .c-hop { animation: var(--react, c-hop) 680ms 1; }
  .char-host:hover .ai-char .c-eyes-open, .char-host:hover .ai-char .c-smile { animation: c-happy-off 680ms 1; }
  .char-host:hover .ai-char .c-eyes-happy, .char-host:hover .ai-char .c-grin { animation: c-happy-on 680ms 1; }
  .char-host:hover .ai-fold .c-dot { animation: c-pulse 680ms var(--loop) 1; }
  .char-host:hover .ai-tally .c-arm-l { animation: c-jab 680ms var(--loop) 1; }
  .char-host:hover .ai-peep-peek .c-hop { animation: c-rise 1100ms 1; }
  .char-host:hover .ai-peep-peek .c-eyes-open, .char-host:hover .ai-peep-peek .c-smile { animation: c-happy-off 1100ms 1; }
  .char-host:hover .ai-peep-peek .c-eyes-happy, .char-host:hover .ai-peep-peek .c-grin { animation: c-happy-on 1100ms 1; }
}
.ai-char.is-react .c-hop { animation: var(--react, c-hop) 680ms 1; }
.ai-char.is-react .c-eyes-open, .ai-char.is-react .c-smile { animation: c-happy-off 680ms 1; }
.ai-char.is-react .c-eyes-happy, .ai-char.is-react .c-grin { animation: c-happy-on 680ms 1; }
.ai-fold.is-react .c-dot { animation: c-pulse 680ms var(--loop) 1; }
.ai-tally.is-react .c-arm-l { animation: c-jab 680ms var(--loop) 1; }
.ai-peep-peek.is-react .c-hop { animation: c-rise 1100ms 1; }
.ai-char.is-nod .c-hop { animation: c-nod 420ms 1; }

/* ---------- cheer state (Stamp: all 5 ticked; Peep: "Yes") — held while true, transitions so it can be undone ---------- */
.ai-char .c-arm-l, .ai-char .c-arm-r { transition: transform 420ms var(--up); }
.ai-char.is-cheer .c-arm-l { transform: rotate(var(--cheer-arm, 118deg)); }
.ai-char.is-cheer .c-arm-r { transform: rotate(calc(-1 * var(--cheer-arm, 118deg))); }
.ai-char.is-cheer .c-eyes-open, .ai-char.is-cheer .c-smile { opacity: 0; }
.ai-char.is-cheer .c-eyes-happy, .ai-char.is-cheer .c-grin { opacity: 1; }
.ai-char.is-cheer .c-hop { animation: c-hop 820ms 1; }
.ai-char.is-cheer .c-pop { animation: c-pop 900ms var(--up) calc(120ms + var(--i, 0) * 70ms) 1 both; }
.ai-char.is-cheer .c-eyes-open, .ai-char.is-cheer .c-smile, .ai-char.is-cheer .c-eyes-happy, .ai-char.is-cheer .c-grin { animation: none; }


/* ==== GENERATED by _build/art/family/depth/build-depth.mjs: plumber scene (edit there) ==== */
/* Plays twice when it comes on screen (.is-live), then rests FIXED (fill forwards), only blinking; it never keeps
   pulling the eye off the listings. Reduced motion = mid-job still (wrench on the joint, one drip hanging). */
.ai-d .d-drip2, .ai-d .d-spark, .ai-d .d-happy { opacity: 0; }
.ai-d-plumber { --scene: 6.4s; --blink: 4.6s; --blink-delay: -2s; --look-delay: -7s; }
.ai-d-plumber.is-live .d-wrench { animation: d-wrench var(--scene) linear 2 both; }
.ai-d-plumber.is-live .d-upper  { animation: d-upper var(--scene) linear 2 both; }
.ai-d-plumber.is-live .d-fore   { animation: d-fore var(--scene) linear 2 both; }
.ai-d-plumber.is-live .d-drip1  { animation: d-drip1 var(--scene) var(--up) 2 both; }
.ai-d-plumber.is-live .d-drip2  { animation: d-drip2 var(--scene) var(--up) 2 both; }
.ai-d-plumber.is-live .d-puddle { animation: d-puddle var(--scene) var(--loop) 2 both; }
.ai-d-plumber.is-live .d-spark  { animation: d-spark var(--scene) var(--up) 2 both; }
.ai-d-plumber.is-live .d-happy  { animation: d-happy-on var(--scene) linear 2 both; }
.ai-d-plumber.is-live .d-open   { animation: d-happy-off var(--scene) linear 2 both; }
.ai-d-plumber.is-live .d-look   { animation: d-look var(--scene) var(--loop) 2 both; }
.ai-d-plumber.is-live .d-farm   { animation: d-farm var(--scene) var(--loop) 2 both; }
@keyframes d-puddle { 0%, 20%, 26%, 54%, 60%, 100% { transform: none; } 22%, 56% { transform: scale(1.12, 1.08); } }
@keyframes d-spark  { 0%, 66% { opacity: 0; transform: scale(.3); } 72% { opacity: 1; transform: scale(1.1); } 84%, 100% { opacity: 0; transform: scale(.8) rotate(20deg); } }
@keyframes d-happy-on  { 0%, 69% { opacity: 0; } 71%, 90% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes d-happy-off { 0%, 69% { opacity: 1; } 71%, 90% { opacity: 0; } 92%, 100% { opacity: 1; } }
@keyframes d-look   { 0%, 10% { transform: none; } 16%, 64% { transform: translate(-7px, 5px); } 72%, 100% { transform: none; } }
@keyframes d-farm   { 0%, 18%, 69%, 100% { transform: none; } 30%, 56% { transform: rotate(-6deg); } }
@keyframes d-wrench{0%{transform:rotate(0deg)}2%{transform:rotate(0deg)}4%{transform:rotate(0deg)}6%{transform:rotate(0deg)}8%{transform:rotate(0deg)}10%{transform:rotate(0deg)}12%{transform:rotate(0deg)}14%{transform:rotate(0deg)}16%{transform:rotate(0deg)}18%{transform:rotate(0deg)}20%{transform:rotate(0.9deg)}22%{transform:rotate(3.8deg)}24%{transform:rotate(8.4deg)}26%{transform:rotate(15deg)}28%{transform:rotate(21.6deg)}30%{transform:rotate(26.2deg)}32%{transform:rotate(29.1deg)}34%{transform:rotate(30deg)}36%{transform:rotate(27deg)}38%{transform:rotate(18.1deg)}40%{transform:rotate(6.7deg)}42%{transform:rotate(0.7deg)}44%{transform:rotate(0deg)}46%{transform:rotate(0.3deg)}48%{transform:rotate(2.4deg)}50%{transform:rotate(6.7deg)}52%{transform:rotate(13.1deg)}54%{transform:rotate(20.4deg)}56%{transform:rotate(25.7deg)}58%{transform:rotate(28.9deg)}60%{transform:rotate(30deg)}62%{transform:rotate(27deg)}64%{transform:rotate(18.1deg)}66%{transform:rotate(6.7deg)}68%{transform:rotate(0.7deg)}70%{transform:rotate(0deg)}72%{transform:rotate(0deg)}74%{transform:rotate(0deg)}76%{transform:rotate(0deg)}78%{transform:rotate(0deg)}80%{transform:rotate(0deg)}82%{transform:rotate(0deg)}84%{transform:rotate(0deg)}86%{transform:rotate(0deg)}88%{transform:rotate(0deg)}90%{transform:rotate(0deg)}92%{transform:rotate(0deg)}94%{transform:rotate(0deg)}96%{transform:rotate(0deg)}98%{transform:rotate(0deg)}100%{transform:rotate(0deg)}}
@keyframes d-upper{0%{transform:rotate(0deg)}2%{transform:rotate(0deg)}4%{transform:rotate(0deg)}6%{transform:rotate(0deg)}8%{transform:rotate(0deg)}10%{transform:rotate(0deg)}12%{transform:rotate(0deg)}14%{transform:rotate(0deg)}16%{transform:rotate(0deg)}18%{transform:rotate(0deg)}20%{transform:rotate(-1.9deg)}22%{transform:rotate(-7.5deg)}24%{transform:rotate(-17.6deg)}26%{transform:rotate(-40.9deg)}28%{transform:rotate(-45.8deg)}30%{transform:rotate(-45.7deg)}32%{transform:rotate(-45.5deg)}34%{transform:rotate(-45.4deg)}36%{transform:rotate(-45.7deg)}38%{transform:rotate(-45.7deg)}40%{transform:rotate(-13.6deg)}42%{transform:rotate(-1.5deg)}44%{transform:rotate(0deg)}46%{transform:rotate(-0.5deg)}48%{transform:rotate(-4.8deg)}50%{transform:rotate(-13.6deg)}52%{transform:rotate(-30.5deg)}54%{transform:rotate(-45.8deg)}56%{transform:rotate(-45.7deg)}58%{transform:rotate(-45.5deg)}60%{transform:rotate(-45.4deg)}62%{transform:rotate(-45.7deg)}64%{transform:rotate(-45.7deg)}66%{transform:rotate(-13.6deg)}68%{transform:rotate(-1.5deg)}70%{transform:rotate(0deg)}72%{transform:rotate(0deg)}74%{transform:rotate(0deg)}76%{transform:rotate(0deg)}78%{transform:rotate(0deg)}80%{transform:rotate(0deg)}82%{transform:rotate(0deg)}84%{transform:rotate(0deg)}86%{transform:rotate(0deg)}88%{transform:rotate(0deg)}90%{transform:rotate(0deg)}92%{transform:rotate(0deg)}94%{transform:rotate(0deg)}96%{transform:rotate(0deg)}98%{transform:rotate(0deg)}100%{transform:rotate(0deg)}}
@keyframes d-fore{0%{transform:rotate(0deg)}2%{transform:rotate(0deg)}4%{transform:rotate(0deg)}6%{transform:rotate(0deg)}8%{transform:rotate(0deg)}10%{transform:rotate(0deg)}12%{transform:rotate(0deg)}14%{transform:rotate(0deg)}16%{transform:rotate(0deg)}18%{transform:rotate(0deg)}20%{transform:rotate(2.5deg)}22%{transform:rotate(10.7deg)}24%{transform:rotate(27deg)}26%{transform:rotate(70.8deg)}28%{transform:rotate(79.8deg)}30%{transform:rotate(79.8deg)}32%{transform:rotate(79.9deg)}34%{transform:rotate(79.9deg)}36%{transform:rotate(79.8deg)}38%{transform:rotate(79.7deg)}40%{transform:rotate(20.3deg)}42%{transform:rotate(2deg)}44%{transform:rotate(0deg)}46%{transform:rotate(0.7deg)}48%{transform:rotate(6.6deg)}50%{transform:rotate(20.3deg)}52%{transform:rotate(50.6deg)}54%{transform:rotate(79.8deg)}56%{transform:rotate(79.8deg)}58%{transform:rotate(79.9deg)}60%{transform:rotate(79.9deg)}62%{transform:rotate(79.8deg)}64%{transform:rotate(79.7deg)}66%{transform:rotate(20.3deg)}68%{transform:rotate(2deg)}70%{transform:rotate(0deg)}72%{transform:rotate(0deg)}74%{transform:rotate(0deg)}76%{transform:rotate(0deg)}78%{transform:rotate(0deg)}80%{transform:rotate(0deg)}82%{transform:rotate(0deg)}84%{transform:rotate(0deg)}86%{transform:rotate(0deg)}88%{transform:rotate(0deg)}90%{transform:rotate(0deg)}92%{transform:rotate(0deg)}94%{transform:rotate(0deg)}96%{transform:rotate(0deg)}98%{transform:rotate(0deg)}100%{transform:rotate(0deg)}}
@keyframes d-drip1{0%{transform:scale(.2);opacity:1}10%{transform:none;opacity:1;animation-timing-function:cubic-bezier(.5,0,.9,.5)}20%{transform:translateY(113.1px) scale(.9,1.1);opacity:1}22%,100%{transform:translateY(119.1px) scale(1.4,.3);opacity:0}}
@keyframes d-drip2{0%,36%{transform:scale(.2);opacity:0}38%{opacity:1}46%{transform:none;opacity:1;animation-timing-function:cubic-bezier(.5,0,.9,.5)}55%{transform:translateY(113.1px) scale(.9,1.1);opacity:1}57%,100%{transform:translateY(119.1px) scale(1.4,.3);opacity:0}}
/* ==== END GENERATED ==== */

/* ---------- Cursor-follow (owner 2026-11-23, replaces the 11-18 face slide that let Peep's eyes leave its face) ----------
   public/mascots.js moves .c-face (55%) and .c-track (45%) through an overdamped spring, never further than the SVG's
   data-track="L R U D" (measured by _build/art/family/depth/track.mjs so eyes and smile stay on the body). With no mouse
   in the section the face rests on --rest-x / --rest-y (-1..1), pointed at the content beside it. Touch and reduced
   motion: no follow. While it follows, the idle sideways glance (.c-look) is off so the two never add up. */
.ai-char.is-tracking .c-look { animation: none; }
.steps-mascot { --rest-x: -.6; --rest-y: .8; }  /* peeks over the steps card: looks down-left at it */
.ask-stamp    { --rest-x: .6; }                 /* left of the five questions: looks right at them */
.helpful-peep { --rest-x: .6; }                 /* left of Yes / No */
.fold-perch   { --rest-x: -.5; --rest-y: .5; }  /* top right of the address card: looks down-left */
.rank-mascot  { --rest-x: -.6; }                /* right of "2 of 8 plumbers" */
.cat-mascot   { --rest-x: .5; --rest-y: .3; }   /* category head: looks back at the H1 and list */
.hero-mascot  { --rest-x: -.7; --rest-y: -.4; } /* home: looks up-left along the magnifier at the search box */
.hero-mascot-m { --rest-x: -.6; --rest-y: .6; }
.closing-art  { --rest-x: -.5; }                /* holding the door: looks at the "Own a business" copy */

/* Hidden tab: every loop pauses (mascots.js toggles .is-tab-hidden on <html>) */
.is-tab-hidden .ai-char, .is-tab-hidden .ai-char *, .is-tab-hidden .art-float { animation-play-state: paused !important; }

/* Home hero illustrations (traced art, no separate face): a slow float, each on its own clock (mascots.js sets --float) */
.art-float.is-live { animation: art-float var(--float, 7s) var(--loop, ease-in-out) var(--float-delay, 0s) infinite alternate; }
@keyframes art-float { from { transform: translateY(0); } to { transform: translateY(-6px); } }

/* ---------- reduced motion: a still picture, state still readable ---------- */
@media (prefers-reduced-motion: reduce) {
  .ai-char, .ai-char *, .art-float { animation: none !important; transition: none !important; }
  .ai-char.is-cheer .c-pop { opacity: 1; }
}
/* the cast sheet's "still" column */
.ai-char.is-still, .ai-char.is-still * { animation: none !important; }
