/* The SunMates: how a figure moves while it works (as in the web app), and the small ones
   spread over the page. */

/* ---- a figure at work ---- */
.sunmate { display: block; width: 100%; height: 100%; overflow: visible; }
.sunmate.is-working .sunmate-eyes { animation: sunmate-look 3.6s ease-in-out infinite; }
.sunmate.is-working .sunmate-ray { animation: sunmate-reach 1.25s ease-in-out infinite; animation-delay: calc(var(--i) * 0.13s); }
.sunmate.is-working .sunmate-tail { animation: sunmate-stream 0.8s ease-in infinite; animation-delay: calc(var(--i) * 0.2s); }
.sunmate.is-working .sunmate-bob { animation: sunmate-bob 1.25s ease-in-out infinite; }
.sunmate.is-working .sunmate-shake { animation: sunmate-shake 0.4s ease-in-out infinite alternate; }
.sunmate.is-working .sunmate-cradle { transform-origin: 46px 82px; animation: sunmate-cradle 1.6s ease-in-out infinite alternate; }
.sunmate.is-working .sunmate-star { transform-origin: 71px 34px; animation: sunmate-glint 1.3s var(--spring) infinite; }
.sunmate.is-working .sunmate-spark { transform-origin: 48px 48px; animation: sunmate-twinkle 1.5s var(--spring) infinite; }
.sunmate.is-working .sunmate-ring { transform-origin: 48px 52px; animation: sunmate-hula 1s ease-in-out infinite alternate; }

@keyframes sunmate-blink { 0%, 7%, 100% { transform: scaleY(1); } 3.5% { transform: scaleY(0.1); } }
@keyframes sunmate-look {
  0%, 12% { transform: translateX(0) scaleY(1); }
  22%, 40% { transform: translateX(-2.6px) scaleY(1); }
  52%, 72% { transform: translateX(2.6px) scaleY(1); }
  84%, 90% { transform: translateX(0) scaleY(1); }
  94% { transform: translateX(0) scaleY(0.1); }
  98%, 100% { transform: translateX(0) scaleY(1); }
}
@keyframes sunmate-reach { 0%, 55%, 100% { transform: translate(0, 0); } 28% { transform: translate(calc(var(--dx) * 5px), calc(var(--dy) * 5px)); } }
@keyframes sunmate-stream {
  0% { transform: translate(calc(var(--dx) * -4px), calc(var(--dy) * -4px)); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 9px), calc(var(--dy) * 9px)); opacity: 0; }
}
@keyframes sunmate-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes sunmate-shake { from { transform: translate(-0.8px, 0.8px); } to { transform: translate(0.8px, -0.8px); } }
@keyframes sunmate-cradle { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes sunmate-glint { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(0.45) rotate(45deg); } 70% { transform: scale(1.15) rotate(90deg); } }
@keyframes sunmate-twinkle { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(40deg) scale(0.8); } 65%, 100% { transform: rotate(90deg) scale(1); } }
@keyframes sunmate-hula { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes schweben { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* a figure standing on a page, without a disc: it breathes in place and wobbles like jelly when touched */
.mate { display: block; aspect-ratio: 1; filter: drop-shadow(0 12px 12px rgba(8,16,80,.3)); animation: mate-atmen var(--atem, 6s) ease-in-out var(--atem-d, 0s) infinite; -webkit-tap-highlight-color: transparent; }
.mate .sunmate { transform-origin: 50% 60%; }
.mate .sunmate:not(.is-working) .sunmate-eyes { animation: sunmate-blink 4.4s var(--atem-d, .8s) infinite; }
.mate:hover .sunmate { animation: mate-wackeln 2.2s ease-in-out both; }
@keyframes mate-atmen { 0%, 100% { transform: translateY(2.5%) rotate(-2deg) scale(1.02, .98); } 50% { transform: translateY(-3.5%) rotate(2deg) scale(.98, 1.03); } }
@keyframes mate-wackeln {
  0%, 100% { transform: none; }
  12% { transform: scale(1.14, .88) rotate(-3deg); }
  28% { transform: scale(.9, 1.1) rotate(3deg); }
  44% { transform: scale(1.08, .93) rotate(-2deg); }
  60% { transform: scale(.95, 1.05) rotate(1.5deg); }
  76% { transform: scale(1.03, .98); }
  90% { transform: scale(.99, 1.01); }
}
@media (prefers-reduced-motion: reduce) { .mate { animation: none; } }

/* small teammates spread over the page: decoration only */
.deko { position: absolute; z-index: 1; top: clamp(28px, 5vw, 76px); width: clamp(44px, 5.4vw, 84px); aspect-ratio: 1; pointer-events: none; animation: schweben 4.6s ease-in-out infinite; }
.deko--rechts { right: var(--gutter); rotate: 9deg; }
.deko--scheibe { right: var(--gutter); top: clamp(32px, 6vw, 96px); padding: 1.1%; border-radius: 50%; background: #fff; rotate: -8deg; box-shadow: 0 24px 40px -22px rgba(8,16,80,.7); }
.deko .sunmate:not(.is-working) .sunmate-eyes { animation: sunmate-blink 4.2s 1.1s infinite; }
@media (prefers-reduced-motion: reduce) { .deko { animation: none; } }
@media (prefers-reduced-motion: reduce) { .sunmate * { animation: none !important; } }
