/* ============================================================
   EpiphanyMade v2 — Animation System
   Standalone replacement for animations.css.
   Modified timings + new transitions per redesign spec.
   ============================================================ */

/* ----------------------------------------------------------
   SCROLL-TRIGGERED ANIMATIONS
   Reduced translateY from 30px → 20px (subtler entrance)
   ---------------------------------------------------------- */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1),
              transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-in--left {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1),
              transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.animate-in--left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-in--right {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1),
              transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.animate-in--right.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-in--scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1),
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.animate-in--scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.stagger > .animate-in:nth-child(1) { transition-delay: 0s; }
.stagger > .animate-in:nth-child(2) { transition-delay: 0.1s; }
.stagger > .animate-in:nth-child(3) { transition-delay: 0.2s; }
.stagger > .animate-in:nth-child(4) { transition-delay: 0.3s; }
.stagger > .animate-in:nth-child(5) { transition-delay: 0.4s; }
.stagger > .animate-in:nth-child(6) { transition-delay: 0.5s; }
.stagger > .animate-in:nth-child(7) { transition-delay: 0.6s; }
.stagger > .animate-in:nth-child(8) { transition-delay: 0.7s; }

/* ----------------------------------------------------------
   KEYFRAME DEFINITIONS (carried over from v1)
   ---------------------------------------------------------- */

@keyframes float-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(8px, -12px) rotate(5deg); }
  50%  { transform: translate(-5px, 8px) rotate(-3deg); }
  75%  { transform: translate(10px, 5px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes float-slow {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-14px); }
  100% { transform: translateY(0); }
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%       { transform: translateY(8px); opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.3); }
  50%       { box-shadow: 0 0 20px 6px rgba(8, 145, 178, 0.12); }
}

@keyframes pulse-glow-lime {
  0%, 100% { box-shadow: 0 0 0 0 rgba(132, 204, 22, 0.3); }
  50%       { box-shadow: 0 0 20px 6px rgba(132, 204, 22, 0.15); }
}

@keyframes cell-fill {
  0%   { background: rgba(8, 145, 178, 0.2); }
  100% { background: transparent; }
}

@keyframes cell-pulse {
  0%, 100% { background: rgba(8, 145, 178, 0.04); }
  50%       { background: rgba(8, 145, 178, 0.12); }
}

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

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

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

@keyframes chatbot-pulse {
  0%   { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(132,204,22,0.5); }
  70%  { transform: scale(1.3); opacity: 0.7; box-shadow: 0 0 0 8px rgba(132,204,22,0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(132,204,22,0); }
}

@keyframes chatbot-ring {
  0%   { box-shadow: 0 4px 24px rgba(8,145,178,0.45), 0 0 0 0 rgba(8,145,178,0.15); }
  60%  { box-shadow: 0 4px 24px rgba(8,145,178,0.45), 0 0 0 14px rgba(8,145,178,0); }
  100% { box-shadow: 0 4px 24px rgba(8,145,178,0.45), 0 0 0 0 rgba(8,145,178,0); }
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.4); }
  70%       { box-shadow: 0 0 0 14px rgba(8, 145, 178, 0); }
}

@keyframes waveform-bar {
  0%, 100% { transform: scaleY(0.3); }
  50%       { transform: scaleY(1); }
}

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

@keyframes wf-node-reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wf-connector-draw {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes flow-dot-travel {
  0%   { left: 0; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: calc(100% - 6px); opacity: 0; }
}

@keyframes data-packet-flow {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { left: calc(100% - 8px); opacity: 0; }
}

@keyframes wf-badge-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes wf-trigger-pulse {
  0%, 100% { box-shadow: 0 2px 16px rgba(8,145,178,0.12), 0 0 0 0 rgba(8,145,178,0.4); }
  50%      { box-shadow: 0 2px 16px rgba(8,145,178,0.12), 0 0 0 12px rgba(8,145,178,0); }
}

@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes border-beam {
  to { --beam-angle: 360deg; }
}

@keyframes wf-branch-reveal {
  from { opacity: 0; transform: translateX(10px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes connector-glow-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(8,145,178,0.2); }
  50%      { box-shadow: 0 0 14px rgba(8,145,178,0.4); }
}

@keyframes cell-flash {
  0%   { opacity: 0; background: rgba(8,145,178,0.3); }
  35%  { opacity: 1; background: rgba(8,145,178,0.15); }
  100% { opacity: 1; background: transparent; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes mockup-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(8,145,178,0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(8,145,178,0); }
}

/* ----------------------------------------------------------
   NEW v2 ANIMATIONS
   ---------------------------------------------------------- */

/* Segmented control sliding pill */
.segmented-pill {
  transition: transform 0.3s ease, width 0.3s ease;
}

/* Workflow toggle state transition */
.wf-toggle-content {
  transition: filter 0.6s ease, opacity 0.6s ease;
}
.wf-toggle-content--manual {
  filter: grayscale(1);
  opacity: 0.5;
}

/* FAQ accordion icon rotation */
.faq__icon-v2 {
  transition: transform 0.3s ease;
}
.faq__item.open .faq__icon-v2 {
  transform: rotate(45deg);
}

/* Mobile workflow card stagger */
@keyframes wf-card-slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Mobile sticky bar entrance */
@keyframes sticky-bar-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ----------------------------------------------------------
   COMPONENT ANIMATION CLASSES
   ---------------------------------------------------------- */

.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(8, 145, 178, 0.2);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner--lg { width: 40px; height: 40px; border-width: 3px; }

.accent-dot {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 1;
}
.accent-dot--1 { width: 6px; height: 6px; background: var(--teal-light, #06B6D4); animation: float-drift 8s ease-in-out infinite; }
.accent-dot--2 { width: 4px; height: 4px; background: var(--lime, #84CC16); animation: float-drift 11s ease-in-out infinite reverse; }
.accent-dot--3 { width: 8px; height: 8px; border: 1px solid rgba(8, 145, 178, 0.3); background: transparent; animation: float-drift 14s ease-in-out infinite; }
.accent-dot--4 { width: 5px; height: 5px; background: rgba(132, 204, 22, 0.4); animation: float-drift 9s ease-in-out infinite; animation-delay: -3s; }

.waveform { display: flex; align-items: center; gap: 3px; height: 32px; }
.waveform__bar {
  width: 3px; height: 100%;
  background: var(--teal, #0891B2); border-radius: 2px;
  transform-origin: bottom; transform: scaleY(0.3);
}

.slide-up { animation: slide-up 0.4s cubic-bezier(0.19, 1, 0.22, 1) both; }

/* Section label badges */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--teal, #0891B2);
  margin-bottom: 12px;
  padding: 4px 12px;
  border: 1px solid rgba(8, 145, 178, 0.25);
  border-radius: 20px;
  background: rgba(8, 145, 178, 0.05);
}
.section-label--light {
  color: var(--teal-light, #06B6D4);
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.08);
}
.section-label--lime {
  color: var(--lime, #84CC16);
  border-color: rgba(132, 204, 22, 0.3);
  background: rgba(132, 204, 22, 0.05);
}

/* Gradient border */
.gradient-border { position: relative; }

/* ----------------------------------------------------------
   REDUCED MOTION OVERRIDES
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .animate-in--left,
  .animate-in--right,
  .animate-in--scale {
    opacity: 1;
    transform: none;
    transition-duration: 0.01ms;
  }

  .accent-dot,
  .waveform__bar {
    animation: none !important;
  }

  .spinner { animation-duration: 1.5s; }

  .wf-flow__node,
  .wf-flow__branch,
  .wf-flow__connector,
  .wf-flow__connector-dot,
  .wf-flow__connector-packet,
  .wf-flow__connector-badge {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .wf-flow::before {
    animation: none !important;
    opacity: 0 !important;
  }

  .segmented-pill,
  .wf-toggle-content,
  .faq__icon-v2 {
    transition-duration: 0.01ms;
  }

  .mobile-sticky-bar {
    animation: none;
  }

  @keyframes float-drift { to {} }
  @keyframes float-slow { to {} }
  @keyframes scroll-bounce { to {} }
}
