/* ============================================
   Scroll Animations & Transitions
   ============================================ */

/* Fade in from bottom on scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Floating animation for hero mockup */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.float-animation {
  animation: float 4s ease-in-out infinite;
}

/* Pulse for CTA badges */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(160, 160, 160, 0.4); }
  50% { box-shadow: 0 0 20px 4px rgba(160, 160, 160, 0.15); }
}

.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Gradient text shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.shimmer-text {
  background: linear-gradient(90deg, #ffffff 0%, #a0a0a0 50%, #ffffff 100%);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

/* Step connector line animation */
@keyframes draw-line {
  from { width: 0; }
  to { width: 100%; }
}

.step-connector.visible::after {
  animation: draw-line 0.8s ease-out forwards;
}

/* Card hover lift */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Pricing toggle slide */
.toggle-slider {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* FAQ accordion */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* Theme cards hover */
.theme-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-card:hover {
  transform: scale(1.05);
}

/* Review carousel smooth scroll */
.reviews-track {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Navbar scroll state */
.navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Workflow demo animations */
@keyframes flow-horizontal {
  0% { transform: translateX(0) scale(0.75); opacity: 0; }
  15% { opacity: 1; }
  55% { opacity: 1; }
  100% { transform: translateX(58px) scale(1); opacity: 0; }
}

@keyframes flow-vertical {
  0% { transform: translateY(0) scale(0.75); opacity: 0; }
  15% { opacity: 1; }
  55% { opacity: 1; }
  100% { transform: translateY(22px) scale(1); opacity: 0; }
}

@keyframes chip-focus {
  0%, 100% { transform: scale(1); opacity: 0.72; box-shadow: 0 0 0 rgba(220, 220, 220, 0); }
  50% { transform: scale(1.08); opacity: 1; box-shadow: 0 0 18px rgba(220, 220, 220, 0.22); }
}

@keyframes summary-type {
  0%, 20% { width: 0; opacity: 0.45; }
  45%, 75% { width: 100%; opacity: 1; }
  100% { width: 0; opacity: 0.45; }
}

@keyframes summary-type-short {
  0%, 20% { width: 0; opacity: 0.45; }
  50%, 75% { width: 68%; opacity: 1; }
  100% { width: 0; opacity: 0.45; }
}

@keyframes reply-type {
  0%, 20% { opacity: 0.5; transform: translateY(6px); }
  55%, 80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.5; transform: translateY(6px); }
}

@keyframes node-breathe {
  0%, 100% { transform: translateY(0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
  50% { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
}

.workflow-demo-card:hover .workflow-node {
  animation: node-breathe 2.4s ease-in-out infinite;
}

.summary-lane .workflow-arrow .workflow-dot,
.reply-lane .workflow-arrow .workflow-dot {
  animation: flow-horizontal 2.4s ease-in-out infinite;
}

.summary-lane .workflow-arrow:nth-of-type(2) .workflow-dot,
.reply-lane .workflow-arrow:nth-of-type(2) .workflow-dot {
  animation-delay: 0.9s;
}

.summary-formats .format-chips span,
.tone-selector .tone-tags span {
  animation: chip-focus 1.8s ease-in-out infinite;
}

.summary-formats .format-chips span:nth-child(2),
.tone-selector .tone-tags span:nth-child(2) {
  animation-delay: 0.25s;
}

.summary-formats .format-chips span:nth-child(3),
.tone-selector .tone-tags span:nth-child(3) {
  animation-delay: 0.5s;
}

.summary-formats .format-chips span:nth-child(4) {
  animation-delay: 0.75s;
}

.summary-output .typing-line {
  animation: summary-type 2.8s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
}

.summary-output .typing-line.short {
  animation-name: summary-type-short;
}

.reply-output .reply-bubble {
  animation: reply-type 3.2s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
  .summary-lane .workflow-arrow .workflow-dot,
  .reply-lane .workflow-arrow .workflow-dot {
    animation-name: flow-vertical;
  }
}
