/* ─── Page entry animation — only opacity to avoid layout shift ── */
@keyframes page-entry {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body {
    animation: page-entry 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Fade-Up Animation ──────────────────────────────────────── */
/*
   CRITICAL: Elements are VISIBLE by default.
   The animation is purely progressive enhancement —
   if JS fails or is slow, content is always readable.
   JS adds .visible class via IntersectionObserver to trigger the
   subtle slide-up transition.
*/
.fade-up {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* When JS has loaded, enable the hidden initial state */
.js-animations-ready .fade-up:not(.visible) {
    opacity: 0;
    transform: translateY(32px);
}

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

/* Staggered delays for grid children — only apply when JS is ready */
.js-animations-ready .features-grid .fade-up:nth-child(2),
.js-animations-ready .pricing-grid .fade-up:nth-child(2),
.js-animations-ready .testimonials-grid .fade-up:nth-child(2) {
    transition-delay: 0.1s;
}

.js-animations-ready .features-grid .fade-up:nth-child(3),
.js-animations-ready .pricing-grid .fade-up:nth-child(3),
.js-animations-ready .testimonials-grid .fade-up:nth-child(3) {
    transition-delay: 0.2s;
}

.js-animations-ready .features-grid .fade-up:nth-child(4) { transition-delay: 0.1s; }
.js-animations-ready .features-grid .fade-up:nth-child(5) { transition-delay: 0.2s; }
.js-animations-ready .features-grid .fade-up:nth-child(6) { transition-delay: 0.3s; }

.js-animations-ready .stepper-grid .fade-up:nth-child(2) { transition-delay: 0.12s; }
.js-animations-ready .stepper-grid .fade-up:nth-child(3) { transition-delay: 0.24s; }

/* ─── Fade-In Scale (for hero & section headers) ─────────────── */
@keyframes fade-in-scale {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-content {
    animation: fade-in-scale 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

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

/* ─── Glow Pulse for featured pricing card — uses opacity + pseudo-element to avoid repaints ── */
.pricing-card.featured {
    position: relative;
}
.pricing-card.featured::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(139,92,246,0.1));
    opacity: 0;
    animation: glow-pulse-opacity 3s ease-in-out infinite;
    z-index: -1;
    filter: blur(8px);
    transition: opacity 0.3s ease;
}

@keyframes glow-pulse-opacity {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

/* ─── Mockup Card Hover — GPU-accelerated ─────────────────────── */
.mockup-card {
    will-change: transform;
    transition: box-shadow 0.5s cubic-bezier(0.19,1,0.22,1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Marquee Scroll ─────────────────────────────────────────── */
.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

/* ─── Glow Blobs Drift ───────────────────────────────────────── */
.glow-blob {
    will-change: transform;
}

/* ─── Pricing Card Mouse Spotlight ───────────────────────────── */
.pricing-card {
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* ─── Button Shimmer ─────────────────────────────────────────── */
@keyframes btn-shimmer {
    0%   { left: -70%; opacity: 0; }
    20%  { opacity: 1; }
    100% { left: 140%; opacity: 0; }
}

/* ─── Header Scroll Transition ───────────────────────────────── */
#main-header {
    transition: background 0.35s ease, box-shadow 0.35s ease, border-bottom-color 0.35s ease;
}

/* ─── FAQ Smooth Expand ──────────────────────────────────────── */
.faq-content {
    transition:
        max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease;
}

/* ─── KPI Item Hover ─────────────────────────────────────────── */
.kpi-item {
    transition: background 0.25s ease;
}

.kpi-item:hover {
    background: rgba(99,102,241,0.05);
}

/* ─── Step Icon Hover Pulse ──────────────────────────────────── */
.step:hover .step-icon {
    background: rgba(99,102,241,0.16);
    border-color: rgba(99,102,241,0.32);
    transform: scale(1.06);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Counter Number Animation ───────────────────────────────── */
.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ─── Pulse for Live Indicators ──────────────────────────────── */
@keyframes pulse-green {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #22c55e; }
    50%      { opacity: 0.4; box-shadow: 0 0 2px #22c55e; }
}

/* ─── Feature Card Hover ─────────────────────────────────────── */
.feature-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(99,102,241,0.18);
    border-color: rgba(99,102,241,0.25) !important;
}

/* ─── Testimonial Card Hover ─────────────────────────────────── */
.testimonial-card {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.35s ease;
}

/* ─── Badge Shimmer — removed (was causing repaints on solid background) ── */

/* ─── Reduce Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .fade-up { opacity: 1 !important; transform: none !important; }
    .js-animations-ready .fade-up:not(.visible) {
        opacity: 1 !important;
        transform: none !important;
    }
    .marquee-content { animation: none !important; }
}
