#character-root {
  transform-origin: 50% 65%;
}

#head-bob {
  transform-origin: 50% 60%;
}

#cavity-rim,
#rim-top,
#head-shape,
#nose,
#mouth,
#ear,
#eye-white {
  paint-order: stroke;
}

#cavity-shimmer {
  animation: shimmer 3.6s ease-in-out infinite;
  transform-origin: 200px 160px;
}

#cavity-dust {
  animation: dust-drift 5.5s ease-in-out infinite;
}

#cavity-web {
  transition: opacity 260ms ease;
}

#brain-text-layer {
  isolation: isolate;
}

.brain-text-instance {
  transition: opacity 260ms ease, transform 320ms ease;
  transform-origin: 200px 180px;
  filter: drop-shadow(0 3px 5px rgba(45, 27, 84, 0.15));
}

.brain-text-instance text {
  fill: #2d1b54;
  stroke: #ffffff;
  stroke-width: 0.75px;
  paint-order: stroke;
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  letter-spacing: 0.4px;
}

.brain-text-instance textPath {
  dominant-baseline: middle;
}

.brain-reflow {
  animation: reflow 280ms ease-out;
}

.brain-empty {
  opacity: 0.65 !important;
}

.blink {
  animation: blink 0.16s ease-in-out forwards;
}

.idle-bob {
  animation: bob 4.2s ease-in-out infinite;
}

.idle-sway {
  animation: sway 5.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.6; transform: rotate(-1deg) scale(0.98); }
  50% { opacity: 0.15; transform: rotate(2deg) scale(1.04); }
}

@keyframes dust-drift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(8px, -6px) scale(0.85); opacity: 0.2; }
  100% { transform: translate(-2px, 6px) scale(1.05); opacity: 0.45; }
}

@keyframes blink {
  0% { opacity: 0; }
  50% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

@keyframes reflow {
  0% { transform: scale(1.04) translateY(2px); }
  60% { transform: scale(0.98) translateY(-1px); }
  100% { transform: scale(1); }
}
