/* Built Diff cast motion. Personality: Playful. Base unit 0.3s; work loops 2.4s (8 units) in
   ease-in-out sine; reactions 0.3s with a soft overshoot. Travel 3px or less at rest. Text never moves. */
.bdc { --loop: 2.4s; --sine: cubic-bezier(.45, 0, .55, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  position: relative; display: block; aspect-ratio: 260 / 240; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.bdc__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bdc__svg * { transform-box: fill-box; }
.bdc :is(.c-body, .c-pupils, .c-lid, .c-brow, .c-prop *, .c-hat) { animation-delay: var(--delay, 0s); }

/* at work: a breathing bob, eyes on the job */
.bdc .c-body { transform-origin: 50% 100%; animation: bdc-bob var(--loop) var(--sine) infinite; }
@keyframes bdc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(var(--bob, 3) * -1px)); } }
/* each role keeps its own tempo, so the crew reads as six people, not one machine */
.bdc[data-role="social"] { --loop: 1.8s; --bob: 2; }
.bdc[data-role="editor"] { --loop: 2.1s; --bob: 2; }
.bdc[data-role="camera"] { --loop: 2.7s; --bob: 2; }
.bdc[data-role="strategist"] { --loop: 3s; --bob: 3; }
.bdc[data-role="voice"] { --loop: 2.1s; --bob: 3; }
.bdc[data-role="host"] { --loop: 3s; --bob: 3; }
.bdc .c-pupils { transition: transform .3s var(--spring); }
.bdc .look-down .c-pupils { transform: translate(0, 5px); }
.bdc .look-right .c-pupils { transform: translate(5px, 1px); }
.bdc .look-left .c-pupils { transform: translate(-5px, 2px); }
.bdc .c-lid { transform-origin: 50% 0; transform: scaleY(0); transition: transform .3s var(--spring); }
.bdc.is-blink .c-lid { transform: scaleY(1); transition-duration: .06s; }
.bdc .c-brow { transform-origin: 50% 100%; transition: transform .3s var(--spring); }

/* writer: pencil scribbles, lines write themselves */
.p-pencil { transform-origin: 50% 100%; animation: bdc-scribble .6s var(--sine) infinite alternate; }
@keyframes bdc-scribble { from { transform: translate(-14px, 0) rotate(-6deg); } to { transform: translate(6px, -2px) rotate(4deg); } }
.p-writer .p-line { stroke-dasharray: 90; stroke-dashoffset: 90; animation: bdc-write var(--loop) var(--sine) infinite; }
.p-writer .l2 { animation-delay: .4s; } .p-writer .l3 { animation-delay: .8s; }
@keyframes bdc-write { 0% { stroke-dashoffset: 90; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 90; } }

/* editor: the playhead runs the timeline, clips light as it passes */
.p-playhead { animation: bdc-play var(--loop) linear infinite; }
@keyframes bdc-play { from { transform: translateX(0); } to { transform: translateX(110px); } }
.p-editor .clip { animation: bdc-clip var(--loop) steps(1) infinite; }
.p-editor .c2 { animation-delay: .8s; } .p-editor .c3 { animation-delay: 1.6s; }
@keyframes bdc-clip { 0%, 30% { opacity: 1; } 31%, 100% { opacity: .55; } }

/* camera: recording light blinks, the camera pans a little */
.p-rec { animation: bdc-rec 1.2s steps(1) infinite; }
@keyframes bdc-rec { 0%, 50% { opacity: 1; } 51%, 100% { opacity: .15; } }
.p-cam { transform-origin: 60% 100%; animation: bdc-pan var(--loop) var(--sine) infinite; }
@keyframes bdc-pan { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

/* strategist: the chart line draws itself */
.p-chart { stroke-dasharray: 60; stroke-dashoffset: 60; animation: bdc-write var(--loop) var(--sine) infinite; }

/* social: hearts float up off the phone */
.p-heart { transform-origin: 50% 50%; opacity: 0; animation: bdc-heart var(--loop) var(--sine) infinite; }
.p-heart.h2 { animation-delay: 1.2s; }
@keyframes bdc-heart { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -70px) scale(1.04); } }

/* ads: bars grow, a coin drops in */
.p-bar { transform-origin: 50% 100%; animation: bdc-bar var(--loop) var(--spring) infinite; }
.p-bar.b2 { animation-delay: .3s; } .p-bar.b3 { animation-delay: .6s; }
@keyframes bdc-bar { 0%, 15% { transform: scaleY(.4); } 45%, 100% { transform: scaleY(1); } }
.p-coin { animation: bdc-coin var(--loop) var(--sine) infinite; }
@keyframes bdc-coin { 0% { transform: translateY(-20px); opacity: 0; } 30% { opacity: 1; } 60% { transform: translateY(18px); opacity: 1; } 70%, 100% { transform: translateY(22px); opacity: 0; } }

/* voice: sound waves pulse out from the mic */
.p-wave { opacity: .2; animation: bdc-wave 1.2s var(--sine) infinite; }
.p-wave.w2 { animation-delay: .3s; }
@keyframes bdc-wave { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

/* host: question marks bob */
.p-q { animation: bdc-bob var(--loop) var(--sine) infinite; }
.p-q.q2 { animation-delay: -1.2s; }

/* annoyed: work stops, the brick-eyebrow drops, eyes squint at you, a shake, a grumble */
.bdc.is-annoyed .c-body { animation: bdc-flinch .1s var(--sine) 1, bdc-shake .3s var(--sine) .1s 2; }
@keyframes bdc-flinch { 0% { transform: scale(1); } 100% { transform: scale(1.03, .96); } }
@keyframes bdc-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.bdc.is-annoyed .c-prop *, .bdc.is-annoyed .c-prop { animation-play-state: paused; }
.bdc.is-annoyed .c-pupils { transform: translate(0, -1px) !important; }
.bdc.is-annoyed .c-lid { transform: scaleY(.45); }
.bdc.is-annoyed .c-brow { transform: translate(-6px, 30px) rotate(-38deg); }
.bdc__say { position: absolute; left: 50%; top: -4%; z-index: 3; translate: -50% 0; padding: 6px 12px; border-radius: 999px;
  background: var(--p-ink); color: var(--p-bg); font: 500 14px/1.3 var(--font-text, system-ui); white-space: nowrap;
  opacity: 0; scale: .8; pointer-events: none; transition: opacity .18s, scale .3s var(--spring); }
.bdc.is-annoyed .bdc__say { opacity: 1; scale: 1; }

/* off screen: everything rests */
.bdc.is-off *, .bdc.is-off .c-body { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .bdc *, .bdc .c-body { animation: none !important; }
  .p-writer .p-line, .p-chart { stroke-dashoffset: 0; }
  .p-heart.h1, .p-coin { opacity: 1; }
  .p-wave { opacity: 1; }
}

/* the brothers: a firm handshake that pumps on a loop */
.bdc[data-role="duo"] { aspect-ratio: 296 / 190; --loop: 2.4s; --bob: 2; }
.duo-shake { transform-origin: 50% 50%; animation: bdc-handshake 1.2s var(--sine) infinite; }
@keyframes bdc-handshake { 0%, 60%, 100% { transform: translateY(0); } 15% { transform: translateY(-7px); } 30% { transform: translateY(5px); } 45% { transform: translateY(-3px); } }
.duo-b { animation: bdc-lean-b 1.2s var(--sine) infinite; transform-origin: 30% 100%; }
.duo-d { animation: bdc-lean-d 1.2s var(--sine) infinite; transform-origin: 70% 100%; }
@keyframes bdc-lean-b { 0%, 60%, 100% { transform: rotate(0); } 20% { transform: rotate(1.5deg); } }
@keyframes bdc-lean-d { 0%, 60%, 100% { transform: rotate(0); } 20% { transform: rotate(-1.5deg); } }
.bdc[data-role="duo"].is-annoyed .duo-shake, .bdc[data-role="duo"].is-annoyed .duo-b, .bdc[data-role="duo"].is-annoyed .duo-d { animation-play-state: paused; }

/* one pause state for every character: html.bd-paused, set by the control in the hero (WCAG 2.2.2).
   A tap or hover reaction still plays, because the visitor asked for it. */
html.bd-paused .bdc:not(.is-annoyed), html.bd-paused .bdc:not(.is-annoyed) * { animation-play-state: paused !important; }
