@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes bounce3Dots {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

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

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-slide-up {
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-scale-in {
  animation: scaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stagger-1 { animation-delay: 80ms; }
.stagger-2 { animation-delay: 160ms; }
.stagger-3 { animation-delay: 240ms; }
.stagger-4 { animation-delay: 320ms; }
.stagger-5 { animation-delay: 400ms; }
.stagger-6 { animation-delay: 480ms; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.is-visible {
  animation: slideInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.spin {
  animation: spin 1s linear infinite;
}

.skeleton {
  min-height: 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  background-color: var(--color-bg-tertiary);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--color-accent-cyan);
  border-radius: 50%;
  animation: bounce3Dots 1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 240ms;
}

.typing-cursor,
.is-typing:empty::after,
.is-typing > *:last-child::after,
.is-typing > ul:last-child > li:last-child::after,
.is-typing > ol:last-child > li:last-child::after,
.is-typing > blockquote:last-child > *:last-child::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 1.1em;
  background-color: var(--color-accent-cyan);
  vertical-align: text-bottom;
  margin-left: 4px;
  border-radius: 2px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Hide ::after on wrapper block elements to prevent double cursors */
.is-typing > ul:last-child::after,
.is-typing > ol:last-child::after,
.is-typing > blockquote:last-child::after {
  display: none;
}

body.cursor-blink-state .typing-cursor,
body.cursor-blink-state .is-typing:empty::after,
body.cursor-blink-state .is-typing > *:last-child::after,
body.cursor-blink-state .is-typing > ul:last-child > li:last-child::after,
body.cursor-blink-state .is-typing > ol:last-child > li:last-child::after,
body.cursor-blink-state .is-typing > blockquote:last-child > *:last-child::after {
  opacity: 0.2;
}
