/* ============================================
   INFIWITS Animations CSS v3.0
   Scroll-triggered classes + keyframes
   Apply via Elementor > Advanced > CSS Classes
   ============================================ */

/* ── Base: Hidden before animation ── */
.iw-fade-up,
.iw-fade-down,
.iw-fade-left,
.iw-fade-right,
.iw-scale-in,
.iw-rotate-in,
.iw-reveal {
    opacity: 0;
    will-change: transform, opacity;
}

.iw-fade-up    { transform: translateY(60px); }
.iw-fade-down  { transform: translateY(-60px); }
.iw-fade-left  { transform: translateX(-60px); }
.iw-fade-right { transform: translateX(60px); }
.iw-scale-in   { transform: scale(0.85); }
.iw-rotate-in  { transform: rotate(-8deg) scale(0.9); }
.iw-reveal     { clip-path: inset(0 100% 0 0); }

/* ── Animated state (added by JS) ── */
.iw-fade-up.iw-animated,
.iw-fade-down.iw-animated,
.iw-fade-left.iw-animated,
.iw-fade-right.iw-animated,
.iw-scale-in.iw-animated,
.iw-rotate-in.iw-animated {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.iw-reveal.iw-animated {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transition: clip-path 1s var(--ease), opacity 0.6s var(--ease);
}

/* ── Stagger children ── */
.iw-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
}

/* CSS-only fallback stagger delays */
.iw-stagger.iw-animated > * {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.iw-stagger.iw-animated > *:nth-child(1)  { transition-delay: 0s; }
.iw-stagger.iw-animated > *:nth-child(2)  { transition-delay: 0.1s; }
.iw-stagger.iw-animated > *:nth-child(3)  { transition-delay: 0.2s; }
.iw-stagger.iw-animated > *:nth-child(4)  { transition-delay: 0.3s; }
.iw-stagger.iw-animated > *:nth-child(5)  { transition-delay: 0.4s; }
.iw-stagger.iw-animated > *:nth-child(6)  { transition-delay: 0.5s; }
.iw-stagger.iw-animated > *:nth-child(7)  { transition-delay: 0.6s; }
.iw-stagger.iw-animated > *:nth-child(8)  { transition-delay: 0.7s; }
.iw-stagger.iw-animated > *:nth-child(9)  { transition-delay: 0.8s; }
.iw-stagger.iw-animated > *:nth-child(10) { transition-delay: 0.9s; }

/* ── Floating animation ── */
.iw-float {
    animation: iwFloat 4s ease-in-out infinite;
}

@keyframes iwFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

/* ── 3D Tilt card ── */
.iw-tilt {
    transform-style: preserve-3d;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
    will-change: transform;
}

.iw-tilt:hover {
    box-shadow: 0 20px 60px rgba(123, 47, 190, 0.25);
}

.iw-tilt .iw-tilt-inner,
.iw-tilt > *:first-child {
    transition: transform 0.4s var(--ease);
}

.iw-tilt:hover .iw-tilt-inner,
.iw-tilt:hover > *:first-child {
    transform: translateZ(30px);
}

/* ── Parallax depth layers ── */
.iw-depth-1, .iw-depth-2, .iw-depth-3 {
    will-change: transform;
}

/* ── Horizontal scroll container ── */
.iw-h-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 32px;
    will-change: transform;
}

.iw-h-scroll > * {
    flex: 0 0 auto;
    min-width: 200px;
}

/* ── Counter (digits) ── */
.iw-counter {
    font-variant-numeric: tabular-nums;
}

/* ── Glass card ── */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.glass-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(123, 47, 190, 0.2);
    border-color: rgba(123, 47, 190, 0.3);
}

/* ── Gradient text ── */
.gradient-text {
    background: linear-gradient(135deg, #7B2FBE, #00B4D8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Section label pill ── */
.section-label {
    display: inline-block;
    padding: 6px 18px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-violet, #7B2FBE);
    background: rgba(123, 47, 190, 0.12);
    border: 1px solid rgba(123, 47, 190, 0.2);
    border-radius: 100px;
}

/* ── Glow section background ── */
.glow-section {
    position: relative;
    overflow: hidden;
}

.glow-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(123, 47, 190, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Footer reveal ── */
.iw-footer-reveal {
    position: sticky;
    bottom: 0;
    z-index: 0;
}

/* ── 3D cursor glow ── */
.iw-cursor {
    position: fixed;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 47, 190, 0.5), transparent 70%);
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, opacity 0.3s;
    mix-blend-mode: screen;
    opacity: 0;
}

.iw-cursor.active { opacity: 1; }
.iw-cursor.hover  { width: 56px; height: 56px; }

/* ── Disable in Elementor editor ── */
.elementor-editor-active .iw-fade-up,
.elementor-editor-active .iw-fade-down,
.elementor-editor-active .iw-fade-left,
.elementor-editor-active .iw-fade-right,
.elementor-editor-active .iw-scale-in,
.elementor-editor-active .iw-rotate-in,
.elementor-editor-active .iw-reveal,
.elementor-editor-active .iw-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .iw-fade-up, .iw-fade-down, .iw-fade-left, .iw-fade-right,
    .iw-scale-in, .iw-rotate-in, .iw-reveal, .iw-stagger > *,
    .iw-float, .iw-tilt, .glass-card {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        animation: none !important;
        transition: none !important;
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .iw-fade-up    { transform: translateY(30px); }
    .iw-fade-down  { transform: translateY(-30px); }
    .iw-fade-left  { transform: translateX(-30px); }
    .iw-fade-right { transform: translateX(30px); }
    .iw-h-scroll > * { min-width: 180px; }
}
