/* Cat buddy: the hoodie cat walks to a heading in every section and shows its mood with little effects. */
.cat{position:fixed;left:0;top:0;width:132px;height:122px;z-index:60;pointer-events:none;will-change:transform;opacity:0;transition:opacity .5s}
.cat.on{opacity:1}
.cat .cat-inner{position:absolute;inset:0;transform-origin:50% 100%;pointer-events:auto;cursor:pointer}
.cat .cat-shadow{position:absolute;left:50%;bottom:-4px;width:78%;height:10px;margin-left:-39%;border-radius:50%;background:rgba(20,16,28,.24);filter:blur(3px)}
.cat .cat-img{position:absolute;left:50%;bottom:0;translate:-50% 0;width:132px;height:auto;user-select:none;-webkit-user-drag:none;transition:rotate .35s,filter .35s,translate .35s;transform-origin:50% 100%;
  filter:drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 8px 6px rgba(20,16,28,.3))}

/* movement */
.cat.walk .cat-inner{animation:catBob .36s ease-in-out infinite}
@keyframes catBob{0%,100%{translate:0 0;rotate:-3deg}50%{translate:0 -7px;rotate:3deg}}
.cat:not(.walk) .cat-inner{animation:catBreathe 3.4s ease-in-out infinite}
@keyframes catBreathe{0%,100%{scale:1 1}50%{scale:1.012 1.03}}
.cat.jump .cat-inner{animation:catJump .6s cubic-bezier(.3,1.6,.5,1)}
@keyframes catJump{0%{translate:0 0;scale:1 1}25%{scale:1.08 .86}55%{translate:0 -34px;scale:.94 1.1}100%{translate:0 0;scale:1 1}}

/* the cat types on its laptop whenever it is sitting (a quick little wiggle) */
.cat:not(.walk):not([data-emo="sleepy"]) .cat-img{animation:catType 1.1s ease-in-out infinite}
@keyframes catType{0%,100%{translate:-50% 0}30%{translate:-50% -1.5px}60%{translate:-50% 0}80%{translate:-50% -1px}}

/* moods */
.cat[data-emo="curious"] .cat-img{rotate:-7deg}
.cat[data-emo="surprised"] .cat-inner{animation:catStartle .5s cubic-bezier(.3,1.6,.5,1)}
@keyframes catStartle{0%{translate:0 0;scale:1}35%{translate:0 -16px;scale:1.07 .95}100%{translate:0 0;scale:1}}
.cat[data-emo="excited"]:not(.walk) .cat-inner{animation:catHop .9s ease-in-out infinite}
@keyframes catHop{0%,100%{translate:0 0}40%{translate:0 -11px}}
.cat[data-emo="wink"] .cat-img{rotate:4deg}
.cat[data-emo="sleepy"] .cat-img{rotate:6deg;translate:-50% 5px;filter:brightness(.88) saturate(.85) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 8px 6px rgba(20,16,28,.3))}

/* little effects above the cat for each mood */
.cat .fx{position:absolute;left:0;right:0;top:-6px;height:50px;pointer-events:none}
.cat .fx>*{position:absolute;display:none;opacity:0}
.cat .fx svg{width:100%;height:100%;overflow:visible}
.cat .fx-q,.cat .fx-x{right:8px;top:0;width:26px;height:30px}
.cat .fx-star{width:18px;height:18px}
.cat .fx-star.s1{left:14px;top:6px}.cat .fx-star.s2{right:10px;top:0}.cat .fx-star.s3{left:56px;top:-8px}
.cat .fx-heart{width:16px;height:16px;left:50%;margin-left:-8px;top:12px}
.cat .fx-z{right:14px;top:6px;font:800 18px 'Plus Jakarta Sans',sans-serif;color:#7a4fd0}
.cat[data-emo="curious"] .fx-q{display:block;animation:fxPop .5s cubic-bezier(.3,1.6,.5,1) forwards,fxBob 1.6s ease-in-out .5s infinite}
.cat[data-emo="surprised"] .fx-x{display:block;animation:fxPop .35s cubic-bezier(.3,1.8,.5,1) forwards,fxShake .5s ease-in-out .35s 2}
.cat[data-emo="excited"] .fx-star{display:block;animation:fxTwinkle 1s ease-in-out infinite}
.cat[data-emo="excited"] .fx-star.s2{animation-delay:.3s}.cat[data-emo="excited"] .fx-star.s3{animation-delay:.6s}
.cat[data-emo="wink"] .fx-star.s2{display:block;animation:fxTwinkle 1.2s ease-in-out infinite}
.cat[data-emo="happy"] .fx-star.s3{display:block;animation:fxTwinkle 1.8s ease-in-out infinite}
.cat[data-emo="love"] .fx-heart{display:block;animation:fxHeart 1.8s ease-out infinite}
.cat[data-emo="love"] .fx-heart.h2{animation-delay:.6s;margin-left:-22px}.cat[data-emo="love"] .fx-heart.h3{animation-delay:1.2s;margin-left:8px}
.cat[data-emo="sleepy"] .fx-z{display:block;animation:fxZ 2.6s ease-in-out infinite}
.cat[data-emo="sleepy"] .fx-z.z2{animation-delay:.9s;font-size:14px}.cat[data-emo="sleepy"] .fx-z.z3{animation-delay:1.8s;font-size:11px}
@keyframes fxPop{from{opacity:0;scale:.2}to{opacity:1;scale:1}}
@keyframes fxBob{0%,100%{translate:0 0}50%{translate:0 -5px}}
@keyframes fxShake{0%,100%{rotate:0deg}25%{rotate:-10deg}75%{rotate:10deg}}
@keyframes fxTwinkle{0%,100%{opacity:0;scale:.3;rotate:0deg}50%{opacity:1;scale:1;rotate:30deg}}
@keyframes fxHeart{0%{opacity:0;translate:0 14px;scale:.5}20%{opacity:1}100%{opacity:0;translate:0 -34px;scale:1.15}}
@keyframes fxZ{0%{opacity:0;translate:0 10px}35%{opacity:1}100%{opacity:0;translate:10px -22px}}

/* speech bubble */
.cat-bubble{position:absolute;left:50%;bottom:100%;margin-bottom:34px;translate:-50% 0;white-space:nowrap;background:#fff;color:#14101c;border:2px solid #14101c;border-radius:12px;padding:3px 11px 4px;font:600 1.1rem/1.1 'Caveat',cursive;box-shadow:3px 3px 0 #7a4fd0;opacity:0;scale:.6;transform-origin:50% 100%;transition:opacity .25s,scale .35s cubic-bezier(.3,1.6,.5,1);pointer-events:none}
.cat-bubble::after{content:"";position:absolute;left:50%;bottom:-7px;margin-left:-5px;width:9px;height:9px;background:#fff;border-right:2px solid #14101c;border-bottom:2px solid #14101c;rotate:45deg}
.cat-bubble.show{opacity:1;scale:1}

/* hearts when you click the cat */
.cat-heart{position:absolute;left:50%;top:14px;width:16px;height:16px;margin-left:-8px;pointer-events:none;animation:catHeart 1.2s ease-out forwards}
.cat-heart::before{content:"";display:block;width:100%;height:100%;background:#ff5c8a;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.4-8-11a4.5 4.5 0 0 1 8-2.7A4.5 4.5 0 0 1 20 10c0 5.6-8 11-8 11z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5.4-8-11a4.5 4.5 0 0 1 8-2.7A4.5 4.5 0 0 1 20 10c0 5.6-8 11-8 11z'/%3E%3C/svg%3E") center/contain no-repeat}
@keyframes catHeart{0%{opacity:0;translate:0 0;scale:.5}15%{opacity:1}100%{opacity:0;translate:var(--hx,0px) -70px;scale:1.2}}

@media(max-width:700px){.cat{width:100px;height:93px}.cat .cat-img{width:100px}.cat-bubble{font-size:1rem}}
@media (prefers-reduced-motion:reduce){.cat.walk .cat-inner,.cat:not(.walk) .cat-inner,.cat[data-emo] .cat-inner,.cat .cat-img,.cat .fx>*{animation:none!important}.cat .fx>*{opacity:1}}
@media print{.cat{display:none}}

/* ================= funny things the cat does ================= */
.cat{width:132px}
.cat-props{position:absolute;inset:0;pointer-events:none}
.cat-props .prop-mug{position:absolute;left:-24px;bottom:6px;width:38px;height:38px;display:none}
.cat-props .prop-mug svg{width:100%;height:100%;overflow:visible}
.cat-props .steam{animation:catSteam 1.4s ease-in-out infinite}
@keyframes catSteam{0%,100%{opacity:.4;translate:0 0}50%{opacity:1;translate:0 -3px}}
.cat-note{position:absolute;bottom:60px;font:800 20px 'Plus Jakarta Sans',sans-serif;color:#7a4fd0;animation:catNote 1.6s ease-out forwards;text-shadow:0 1px 0 #fff}
@keyframes catNote{0%{opacity:0;translate:0 0;rotate:-10deg}20%{opacity:1}100%{opacity:0;translate:-14px -80px;rotate:14deg}}

/* coffee break */
.cat.act-coffee .prop-mug{display:block;animation:fxPop .35s cubic-bezier(.3,1.8,.5,1)}
.cat.act-coffee .cat-img{animation:catSip 1.5s ease-in-out infinite!important}
@keyframes catSip{0%,100%{rotate:0deg;translate:-50% 0}45%,60%{rotate:-5deg;translate:-52% 2px}}
/* dance */
.cat.act-dance .cat-inner{animation:catDance .56s ease-in-out infinite!important}
@keyframes catDance{0%,100%{rotate:-7deg;translate:0 0}25%{translate:0 -9px}50%{rotate:7deg;translate:0 0}75%{translate:0 -9px}}
/* peek-a-boo: slides off the edge and comes back */
.cat.act-peek .cat-inner{animation:catPeek 3.6s ease-in-out!important}
@keyframes catPeek{0%{translate:0 0}22%,68%{translate:150px 0}85%{translate:100px 0}100%{translate:0 0}}
/* zoomies */
.cat.act-zoom .cat-img{animation:catRush .16s linear infinite!important}
@keyframes catRush{0%,100%{rotate:-6deg}50%{rotate:6deg}}
.cat.act-zoom .cat-shadow{width:110%;margin-left:-55%;opacity:.5}
.cat.act-zoom::after{content:"";position:absolute;right:48%;top:30%;width:70px;height:36px;background:repeating-linear-gradient(0deg,transparent 0 6px,rgba(122,79,208,.4) 6px 8px);opacity:.8;animation:fxTwinkle .5s ease-in-out infinite}
/* bug: shaking, glitching */
.cat.act-bug .cat-inner{animation:catShake .12s linear infinite!important}
@keyframes catShake{0%,100%{translate:-3px 0}50%{translate:3px 0}}
.cat.act-bug .cat-img{filter:hue-rotate(-40deg) saturate(1.6) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)!important;animation:catGlitch .5s steps(2) infinite!important}
@keyframes catGlitch{0%{clip-path:inset(0 0 0 0)}50%{clip-path:inset(12% 0 55% 0);translate:-47% 0}100%{clip-path:inset(0 0 0 0)}}
.cat.act-bug .fx-x{display:block;animation:fxPop .3s cubic-bezier(.3,1.8,.5,1) forwards,fxShake .3s ease-in-out infinite}
/* stretch */
.cat.act-stretch .cat-inner{animation:catStretch 3s ease-in-out!important}
@keyframes catStretch{0%,100%{scale:1 1}25%,70%{scale:.88 1.2}45%{scale:1.14 .86}}
/* dizzy after scrolling too fast */
.cat.act-dizzy .cat-inner{animation:catWobble .7s ease-in-out infinite!important}
@keyframes catWobble{0%,100%{rotate:-8deg}50%{rotate:8deg}}
.cat .fx-dz{width:16px;height:16px;left:50%;top:6px;margin-left:-8px}
.cat.act-dizzy .fx-dz{display:block;opacity:1;animation:catOrbit 1s linear infinite}
.cat.act-dizzy .fx-dz.d2{animation-delay:-.33s}.cat.act-dizzy .fx-dz.d3{animation-delay:-.66s}
@keyframes catOrbit{from{transform:rotate(0) translateX(34px) rotate(0)}to{transform:rotate(360deg) translateX(34px) rotate(-360deg)}}
/* secret: spins around */
.cat.act-spin .cat-inner{animation:catSpin 1s cubic-bezier(.3,1.3,.5,1)!important}
@keyframes catSpin{0%{rotate:0deg;translate:0 0}40%{translate:0 -36px}100%{rotate:720deg;translate:0 0}}

/* things that fly across the screen */
.cat-plane{position:fixed;z-index:61;width:44px;height:28px;pointer-events:none;filter:drop-shadow(0 4px 3px rgba(20,16,28,.25));animation:catPlane 3s cubic-bezier(.4,.1,.5,1) forwards}
.cat-plane svg{width:100%;height:100%}
@keyframes catPlane{0%{opacity:0;transform:translate(0,0) rotate(-8deg) scale(.5)}8%{opacity:1}50%{transform:translate(calc(var(--dx) * .5),calc(var(--dy) * 1.4 - 40px)) rotate(8deg) scale(1)}100%{opacity:0;transform:translate(var(--dx),calc(var(--dy) + 60px)) rotate(-16deg) scale(.9)}}
.cat-confetti{position:fixed;z-index:61;width:8px;height:12px;pointer-events:none;border-radius:1px;animation:catConfetti 1.6s cubic-bezier(.2,.6,.3,1) forwards}
@keyframes catConfetti{0%{opacity:1;transform:translate(0,0)}100%{opacity:0;transform:translate(var(--cx),calc(var(--cy) + 160px)) rotate(540deg)}}

/* on phones the cat peeks in from the right edge, so the bubble opens to the left */
@media(max-width:700px){
  .cat .cat-bubble{left:auto;right:38%;translate:none}
  .cat .cat-bubble::after{left:auto;right:16px;margin-left:0}
  .cat.act-peek .cat-inner{animation-duration:3.6s}
}
@media (prefers-reduced-motion:reduce){.cat[class*="act-"] .cat-inner,.cat[class*="act-"] .cat-img{animation:none!important}}
