/* css/avatar.css — Avatar container, expression transitions, mouth animation */

.avatar-container {
  width: 120px;
  height: 180px;
  margin: 0 auto 16px;
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  flex-shrink: 0;
}

.avatar-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.avatar-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--color-accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: opacity 0.8s ease;
}

/* Closed mouth on top by default */
.avatar-mouth-closed {
  z-index: 2;
  opacity: 1;
}

.avatar-mouth-open {
  z-index: 1;
  opacity: 0;
}

/* When speaking, crossfade between the two */
.avatar-mouth-closed.mouth-open {
  opacity: 0;
}

.avatar-mouth-open.mouth-open {
  opacity: 1;
}

/* Expression change crossfade */
.avatar-image.expression-change {
  animation: expression-shift 0.3s ease;
}

@keyframes expression-shift {
  0% { opacity: 0.7; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* Idle breathing animation */
.avatar-container.visible {
  animation: idle-breathe 4s ease-in-out infinite;
}

@keyframes idle-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(0) scale(1.01); }
}
