/* The mascot (docs/MASCOT.md): its twelve moods and their motions. Shared by the app (index.php) and the landing page. */
.mascot { display: block; height: auto; flex: none; overflow: visible; }
.mascot.big { width: 92px; margin: 0 auto 14px; filter: drop-shadow(0 10px 14px rgba(108, 92, 231, 0.22)); }
.mascot.md { width: 44px; } .mascot.sm { width: 32px; } .mascot.xs { width: 24px; }
.mascot .eyes { transform-box: fill-box; transform-origin: center; animation: mascotBlink 5.5s infinite; }
@keyframes mascotBlink { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(0.1); } }
.mascot.pop { animation: mascotPop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes mascotPop { from { transform: scale(0.4); opacity: 0; } }
.mascot.breathe { animation: mascotBreathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes mascotBreathe { 50% { transform: scale(1.03, 0.97); } }
.mascot.shake { animation: mascotShake 0.5s ease-in-out 2; }
@keyframes mascotShake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
/* dark theme: a faint light edge, so the grey and the dark faces don't sink into the background */
:root[data-theme="dark"] .mascot .body { stroke: rgba(255, 255, 255, 0.16); stroke-width: 6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mascot .body { stroke: rgba(255, 255, 255, 0.16); stroke-width: 6; } }
/* More Happy doesn't blink: it does a little happy dance — rocks side to side on its base, its arched eyes bouncing
   up on every beat — then rests a moment and dances again. */
.mascot.m-more-happy { transform-origin: 50% 100%; animation: mascotDance 3s ease-in-out infinite; }
.mascot.m-more-happy.pop { animation: mascotPop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both, mascotDance 3s ease-in-out 0.6s infinite; }
.mascot.m-more-happy .eyes { animation: mascotBounce 3s ease-in-out infinite; }
@keyframes mascotDance { 0%, 70%, 100% { transform: rotate(0) translateY(0); } 10% { transform: rotate(-7deg) translateY(-4%); } 25% { transform: rotate(7deg) translateY(-4%); } 40% { transform: rotate(-7deg) translateY(-4%); } 55% { transform: rotate(7deg) translateY(-4%); } }
@keyframes mascotBounce { 0%, 70%, 100% { transform: translateY(0); } 10%, 25%, 40%, 55% { transform: translateY(-14px); } 17.5%, 32.5%, 47.5%, 62.5% { transform: translateY(0); } }
/* Broken doesn't blink (its eyes are crosses): the two Xs sway left and right around their own centres, softly,
   like a dazed head — each X is a group (class "x"), since its bars carry their own rotate(-45). */
.mascot.m-broken .eyes { animation: none; }
.mascot.m-broken .x { transform-box: fill-box; transform-origin: center; animation: mascotDizzy 2.6s ease-in-out infinite; }
@keyframes mascotDizzy { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(22deg); } 75% { transform: rotate(-22deg); } }
/* Off doesn't blink (its eyes are dead lines): now and then they flicker, like a screen trying to come back on —
   two quick sparks of light — and go dark again. */
.mascot.m-off .eyes { animation: none; }
.mascot.m-off .eyes rect { animation: mascotFlicker 4.5s steps(1, end) infinite; }
@keyframes mascotFlicker { 0%, 68% { fill: #211e33; } 70% { fill: #fff; } 72% { fill: #211e33; } 75% { fill: #fff; } 80%, 100% { fill: #211e33; } }
/* Sleeping doesn't blink (its eyes are shut): it breathes slowly, and little Zs float up out of the corner and fade */
.mascot.m-sleeping { transform-origin: 50% 100%; animation: mascotBreathe 4s ease-in-out infinite; }
.mascot.m-sleeping .eyes { animation: none; }
.mascot.m-sleeping .z { transform-box: fill-box; transform-origin: center; opacity: 0; animation: mascotZ 4s ease-out infinite; }
.mascot.m-sleeping .z + .z { animation-delay: 2s; }
@keyframes mascotZ { 0% { opacity: 0; transform: translate(-14px, 18px) scale(0.6); } 25% { opacity: 1; } 70% { opacity: 0.9; } 100% { opacity: 0; transform: translate(10px, -26px) scale(1.15); } }
/* The logo doesn't blink: it looks left (as drawn), glances over to the right, and comes back to its own look.
   Pupils: the circles, drawn 12.5 units left of each eye's centre; +25 puts them 12.5 to the right. */
.mascot.m-logo .eyes { animation: none; }
.mascot.m-logo .eyes circle { animation: mascotGlance 5.5s ease-in-out infinite; }
@keyframes mascotGlance { 0%, 35%, 90%, 100% { transform: translateX(0); } 48%, 72% { transform: translateX(25px); } }
/* Upset doesn't blink: its eyes open up a little, as if trying, then slowly droop back to the heavy-lidded band.
   The whites are whole circles cut by a clip (their own inline inset is the resting band); pupils: the 3rd and 4th circles. */
.mascot.m-upset .eyes { animation: none; }
.mascot.m-upset .eyes circle:nth-of-type(-n+2) { animation: mascotDroop 5s ease-in-out infinite; }
@keyframes mascotDroop { 0%, 12%, 100% { clip-path: inset(35.9% 0 32.7% 0); } 30%, 44% { clip-path: inset(10% 0 9% 0); } 80% { clip-path: inset(35.9% 0 32.7% 0); } }
/* Complainant doesn't blink: its two half-eyes (left one open below, right one open above) flip over now and then —
   the right one down, the left one up — hold that doubtful look, and flip back. Each white half flips across the eye
   line (y = 256 in the SVG's own units: y' = 512 − y); the pupils stay. */
.mascot.m-complainant .eyes { animation: none; }
.mascot.m-complainant .eyes path { animation: mascotSwap 4.4s ease-in-out infinite; }
@keyframes mascotSwap { 0%, 38%, 96%, 100% { transform: translateY(0) scaleY(1); } 50%, 84% { transform: translateY(512px) scaleY(-1); } }
/* Angry doesn't blink: every few seconds it fumes — puffs up and trembles, its eyes narrow under the frown and the
   pupils glare inward. Pupils: the 1st circle (right eye) and the 2nd (left eye). */
.mascot.m-angry { transform-origin: 50% 100%; animation: mascotFume 3.2s ease-in-out infinite; }
.mascot.m-angry .eyes { transform-origin: 50% 0; animation: mascotGlare 3.2s ease-in-out infinite; }
.mascot.m-angry .eyes circle:nth-of-type(1) { animation: mascotGlareR 3.2s ease-in-out infinite; }
.mascot.m-angry .eyes circle:nth-of-type(2) { animation: mascotGlareL 3.2s ease-in-out infinite; }
@keyframes mascotFume { 0%, 55%, 92%, 100% { transform: translateX(0) scale(1); } 62% { transform: translateX(0) scale(1.06); } 66%, 74%, 82% { transform: translateX(-2.5%) scale(1.06); } 70%, 78%, 86% { transform: translateX(2.5%) scale(1.06); } }
@keyframes mascotGlare { 0%, 55%, 92%, 100% { transform: scaleY(1); } 62%, 86% { transform: scaleY(0.78); } }
@keyframes mascotGlareR { 0%, 55%, 92%, 100% { transform: translateX(0); } 62%, 86% { transform: translateX(-16px); } }
@keyframes mascotGlareL { 0%, 55%, 92%, 100% { transform: translateX(0); } 62%, 86% { transform: translateX(16px); } }
/* Happy doesn't blink: a little hop now and then (squash on landing), its smiling eyes squeezing tighter mid-air */
.mascot.m-happy { transform-origin: 50% 100%; animation: mascotHop 2.8s ease-in-out infinite; }
.mascot.m-happy.pop { animation: mascotPop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) both, mascotHop 2.8s ease-in-out 0.6s infinite; }
.mascot.m-happy .eyes { transform-origin: 50% 100%; animation: mascotSqueeze 2.8s ease-in-out infinite; }
@keyframes mascotHop { 0%, 55%, 100% { transform: translateY(0) scale(1); } 66% { transform: translateY(-9%) scale(0.97, 1.03); } 77% { transform: translateY(0) scale(1.06, 0.94); } 86% { transform: translateY(0) scale(1); } }
@keyframes mascotSqueeze { 0%, 55%, 86%, 100% { transform: scaleY(1); } 66%, 74% { transform: scaleY(0.72); } }
/* Thinking doesn't blink: the round eye's pupil drifts up and around (a thought being turned over), the half-closed
   eye follows a little, and the whole face tilts. Pupils: the 2nd circle (round eye) and the 3rd (half-closed eye). */
.mascot.m-thinking .eyes { animation: none; }
.mascot.m-thinking .eyes circle:nth-of-type(2) { animation: mascotPonder 4.8s ease-in-out infinite; }
.mascot.m-thinking .eyes circle:nth-of-type(3) { animation: mascotPonderHalf 4.8s ease-in-out infinite; }
.mascot.m-thinking { transform-origin: 50% 100%; animation: mascotTilt 4.8s ease-in-out infinite; }
@keyframes mascotPonder { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(24px, -20px); } 45% { transform: translate(0, -30px); } 70% { transform: translate(-24px, -20px); } 85% { transform: translate(0, 0); } }
@keyframes mascotPonderHalf { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(16px); } 45% { transform: translateX(0); } 70% { transform: translateX(-16px); } 85% { transform: translateX(0); } }
@keyframes mascotTilt { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(2deg); } 70% { transform: rotate(-2deg); } 85% { transform: rotate(0); } }
/* Shame doesn't blink: it peeks to the other side, slowly, and looks back (its pupils are the circles) */
.mascot.m-shame .eyes { animation: none; }
.mascot.m-shame .eyes circle { animation: mascotPeek 5s ease-in-out infinite; }
@keyframes mascotPeek { 0%, 30%, 88%, 100% { transform: translateX(0); } 48%, 70% { transform: translateX(-50px); } }
@media (prefers-reduced-motion: reduce) { .mascot, .mascot .body, .mascot .eyes, .mascot .eyes circle, .mascot .eyes path, .mascot .eyes rect, .mascot .x, .mascot .z { animation: none !important; opacity: 1; } }
