/* ============================================
   SCROLL-REVEAL ANIMATION SYSTEM
   
   How it works:
   - Elements start hidden (opacity: 0, slightly offset)
   - IntersectionObserver adds .revealed when element enters viewport
   - CSS transitions handle the animation
   - data-delay attribute staggers children
   
   Usage: Add reveal-up, reveal-left, or reveal-right to any element.
   
   Zero dependencies. ~2KB with scroll-reveal.js.
   ============================================ */

/* --- Base: hidden state --- */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-60px); }
.reveal-right { transform: translateX(60px); }
.reveal-scale { transform: scale(0.92); }

/* --- Revealed state (added by IntersectionObserver) --- */
.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed,
.reveal-scale.revealed {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* --- Stagger delays via data-delay attribute --- */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }

/* --- Respect reduced motion preference --- */
@media (prefers-reduced-motion: reduce) {
  .reveal-up, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-delay] {
    transition-delay: 0s !important;
  }
  .hero-section::before {
    animation: none !important;
  }
  .proof-point::after {
    animation: none !important;
  }
}

/* ============================================
   ANIMATED STAT COUNTERS
   ============================================ */

.stat-value.counting {
  animation: pulse-glow 0.6s ease-out;
}

@keyframes pulse-glow {
  0%   { text-shadow: 0 0 0 transparent; }
  50%  { text-shadow: 0 0 20px rgba(37, 99, 235, 0.4); }
  100% { text-shadow: 0 0 0 transparent; }
}

/* ============================================
   MOBILE HERO REORDER
   Move SVG illustration directly below the H1
   on feature & industry pages (< 900px).
   ============================================ */

@media (max-width: 899px) {
  .hero-section {
    padding: clamp(1rem, 3vw, 1.5rem) 0 !important;
  }
  .hero-inner {
    row-gap: 0 !important;
  }
  .hero-inner > .hero-text {
    display: contents !important;
  }
  .hero-inner > .hero-text > .hero-badge        { order: 1; margin-bottom: 0.5rem !important; }
  .hero-inner > .hero-text > .hero-title        { order: 2; margin-bottom: 0.5rem !important; }
  .hero-inner > .hero-visual                    { order: 3; margin-bottom: 0.625rem !important; }
  .hero-inner > .hero-text > .hero-subtitle     { order: 4; margin-bottom: 0.5rem !important; }
  .hero-inner > .hero-text > .hero-proof-points {
    order: 5;
    margin-bottom: 0.5rem !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }
  .hero-inner > .hero-text > .hero-proof-points .proof-point {
    white-space: normal !important;
    justify-content: center;
    font-size: 0.78rem !important;
    text-align: center;
  }
  .hero-inner > .hero-text > .hero-actions      { order: 6; width: 100% !important; }
  .hero-inner > .hero-text > .hero-actions .btn  { width: 100% !important; display: block !important; text-align: center; }
  .hero-inner > .hero-text > .hero-disclaimer   { order: 7; width: 100% !important; text-align: center; }
}

/* ============================================
   STICKY CTA - Mobile bottom bar
   Shows when hero CTA scrolls out of view.
   Shared across all feature/industry pages.
   ============================================ */
.sticky-cta {
  display: none;
}

@media (max-width: 1023px) {
  .sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.98);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    display: block;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  .sticky-cta.sticky-cta-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .sticky-cta .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* ============================================
   HERO AMBIENT ANIMATION
   Subtle background gradient drift for hero sections
   ============================================ */

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 40%,
    rgba(37, 99, 235, 0.06) 0%,
    transparent 50%
  );
  animation: hero-gradient-drift 15s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes hero-gradient-drift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(5%, 3%); }
}

/* Ensure hero content sits above the gradient */
.hero-section > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   PROOF POINT SHIMMER
   Subtle shine on hero value prop pills
   ============================================ */

.proof-point {
  position: relative;
  overflow: hidden;
}

.proof-point::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  animation: shimmer 5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { left: -100%; }
  50%      { left: 100%; }
}

/* ============================================
   FEATURE IMAGE HOVER LIFT
   Subtle depth effect on feature screenshots
   ============================================ */

.feature-image img,
.screenshot-flow-step img {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.feature-image img:hover,
.screenshot-flow-step img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(255,255,255,0.06);
}

/* ============================================
   TESTIMONIAL QUOTE DECORATION
   ============================================ */

.testimonial-card {
  position: relative;
}

.testimonial-card::before {
  content: '\201C'; /* Left double quotation mark */
  position: absolute;
  top: -0.25rem;
  left: 1rem;
  font-size: 4rem;
  color: rgba(37, 99, 235, 0.15);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  pointer-events: none;
}

/* ============================================
   HERO BADGE ENTRANCE
   ============================================ */

.hero-badge {
  display: inline-block;
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(37, 99, 235, 0.25);
  margin-bottom: 1rem;
}

/* ============================================
   INTERACTIVE DEMO WRAPPER
   Glow is now on .fem-phone-frame in phone-demo.js.
   .demo-wrapper kept as a transparent pass-through
   for any pages still using it.
   ============================================ */

.demo-wrapper {
  position: relative;
  display: inline-block;
}
