/* ==========================================================================
   BeraLabs Modern Scroll Reveal & Interactive Motion System
   Fluid, Hardware-Accelerated 60/120fps Transitions & Ambient Micro-Interactions
   ========================================================================== */

:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
    --anim-duration-fast: 0.35s;
    --anim-duration-normal: 0.55s;
    --anim-duration-slow: 0.75s;
}

/* --------------------------------------------------------------------------
   Keyframes: Entrances, Floats, Shimmers & Ambient Glows
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 35px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -25px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale3d(0.92, 0.92, 1) translate3d(0, 25px, 0);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
    }
}

@keyframes fadeInUpChild {
    from {
        opacity: 0;
        transform: translate3d(0, 16px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes floatBadge {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes shimmerSweep {
    0% {
        transform: translateX(-150%) skewX(-20deg);
    }
    100% {
        transform: translateX(200%) skewX(-20deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.9), 0 0 30px rgba(6, 182, 212, 0.5);
    }
}

@keyframes orbDrift1 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.45;
    }
    33% {
        transform: translate3d(40px, -30px, 0) scale(1.1);
        opacity: 0.65;
    }
    66% {
        transform: translate3d(-25px, 25px, 0) scale(0.95);
        opacity: 0.4;
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.45;
    }
}

@keyframes orbDrift2 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.4;
    }
    33% {
        transform: translate3d(-35px, 35px, 0) scale(1.12);
        opacity: 0.6;
    }
    66% {
        transform: translate3d(30px, -20px, 0) scale(0.92);
        opacity: 0.35;
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.4;
    }
}

/* --------------------------------------------------------------------------
   Ambient Glowing Background Orbs
   -------------------------------------------------------------------------- */
.ambient-orbs-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    will-change: transform, opacity;
}

.ambient-orb.orb-primary {
    width: 520px;
    height: 520px;
    top: 10%;
    left: 5%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0) 70%);
    animation: orbDrift1 18s ease-in-out infinite;
}

.ambient-orb.orb-accent {
    width: 480px;
    height: 480px;
    top: 40%;
    right: 5%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, rgba(6, 182, 212, 0) 70%);
    animation: orbDrift2 22s ease-in-out infinite;
}

.ambient-orb.orb-violet {
    width: 420px;
    height: 420px;
    bottom: 10%;
    left: 30%;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, rgba(236, 72, 153, 0) 70%);
    animation: orbDrift1 25s ease-in-out infinite reverse;
}

/* --------------------------------------------------------------------------
   Header & Badge Initial Motion
   -------------------------------------------------------------------------- */
header {
    animation: fadeInDown 0.7s var(--ease-out-expo) forwards;
}

.hero .badge,
.badge-float,
.float-badge {
    animation: floatBadge 3.6s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
}

.badge-dot {
    animation: pulseGlow 2.8s infinite ease-in-out !important;
}

/* --------------------------------------------------------------------------
   Scroll-Triggered Reveal Classes (Intersection Observer)
   -------------------------------------------------------------------------- */
.reveal,
.reveal-up,
.bl-reveal,
.scroll-reveal {
    opacity: 0;
    transform: translate3d(0, 36px, 0);
    transition: opacity var(--anim-duration-slow) var(--ease-out-expo),
                transform var(--anim-duration-slow) var(--ease-out-expo);
    will-change: opacity, transform;
}

.reveal.is-visible,
.reveal.revealed,
.reveal-up.is-visible,
.reveal-up.revealed,
.bl-reveal.bl-revealed,
.bl-reveal.is-visible,
.scroll-reveal.is-visible,
.scroll-reveal.revealed {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
}

.reveal-fade,
.bl-reveal-fade {
    opacity: 0;
    transition: opacity var(--anim-duration-slow) var(--ease-smooth);
    will-change: opacity;
}

.reveal-fade.is-visible,
.reveal-fade.revealed,
.bl-reveal-fade.bl-revealed,
.bl-reveal-fade.is-visible {
    opacity: 1 !important;
}

.reveal-scale,
.reveal-zoom,
.bl-reveal-scale {
    opacity: 0;
    transform: scale3d(0.92, 0.92, 1) translate3d(0, 28px, 0);
    transition: opacity var(--anim-duration-slow) var(--ease-out-expo),
                transform var(--anim-duration-slow) var(--ease-out-expo);
    will-change: opacity, transform;
}

.reveal-scale.is-visible,
.reveal-scale.revealed,
.reveal-zoom.is-visible,
.reveal-zoom.revealed,
.bl-reveal-scale.bl-revealed,
.bl-reveal-scale.is-visible {
    opacity: 1 !important;
    transform: scale3d(1, 1, 1) translate3d(0, 0, 0) !important;
}

.reveal-left,
.bl-reveal-left {
    opacity: 0;
    transform: translate3d(-45px, 0, 0);
    transition: opacity var(--anim-duration-slow) var(--ease-out-expo),
                transform var(--anim-duration-slow) var(--ease-out-expo);
    will-change: opacity, transform;
}

.reveal-left.is-visible,
.reveal-left.revealed,
.bl-reveal-left.bl-revealed,
.bl-reveal-left.is-visible {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
}

.reveal-right,
.bl-reveal-right {
    opacity: 0;
    transform: translate3d(45px, 0, 0);
    transition: opacity var(--anim-duration-slow) var(--ease-out-expo),
                transform var(--anim-duration-slow) var(--ease-out-expo);
    will-change: opacity, transform;
}

.reveal-right.is-visible,
.reveal-right.revealed,
.bl-reveal-right.bl-revealed,
.bl-reveal-right.is-visible {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Stagger Delays for Grid & Cascading Elements */
.delay-50,  .stagger-1, .bl-stagger-1 { transition-delay: 0.06s; }
.delay-100, .stagger-2, .bl-stagger-2 { transition-delay: 0.12s; }
.delay-150, .stagger-3, .bl-stagger-3 { transition-delay: 0.18s; }
.delay-200, .stagger-4, .bl-stagger-4 { transition-delay: 0.24s; }
.delay-250, .stagger-5, .bl-stagger-5 { transition-delay: 0.30s; }
.delay-300, .stagger-6, .bl-stagger-6 { transition-delay: 0.36s; }
.delay-400, .stagger-7, .bl-stagger-7 { transition-delay: 0.44s; }
.delay-500, .stagger-8, .bl-stagger-8 { transition-delay: 0.52s; }
.delay-600, .stagger-9, .bl-stagger-9 { transition-delay: 0.60s; }

/* --------------------------------------------------------------------------
   Cascading Inner Children Animations
   When a card or container is revealed, inner elements animate progressively
   -------------------------------------------------------------------------- */
.is-visible > .card-icon,
.revealed > .card-icon,
.is-visible > .flow-card-icon,
.revealed > .flow-card-icon {
    animation: fadeInUpChild 0.55s var(--ease-out-expo) backwards;
    animation-delay: 0.08s;
}

.is-visible > h3,
.revealed > h3,
.is-visible > h4,
.revealed > h4,
.is-visible > .product-header,
.revealed > .product-header {
    animation: fadeInUpChild 0.6s var(--ease-out-expo) backwards;
    animation-delay: 0.14s;
}

.is-visible > p,
.revealed > p,
.is-visible > .product-desc,
.revealed > .product-desc {
    animation: fadeInUpChild 0.65s var(--ease-out-expo) backwards;
    animation-delay: 0.20s;
}

.is-visible > ul,
.revealed > ul,
.is-visible > .product-features-list,
.revealed > .product-features-list {
    animation: fadeInUpChild 0.7s var(--ease-out-expo) backwards;
    animation-delay: 0.26s;
}

.is-visible > .product-actions,
.revealed > .product-actions,
.is-visible > .emails,
.revealed > .emails {
    animation: fadeInUpChild 0.75s var(--ease-out-expo) backwards;
    animation-delay: 0.32s;
}

/* --------------------------------------------------------------------------
   Shimmer Buttons & Interactive Micro-Interactions
   -------------------------------------------------------------------------- */
.btn-shimmer,
.shimmer-btn,
.cta-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--ease-out-expo),
                box-shadow 0.3s var(--ease-out-expo),
                background 0.3s ease;
}

.btn-shimmer::before,
.shimmer-btn::before,
.cta-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        60deg,
        transparent,
        rgba(255, 255, 255, 0.28),
        transparent
    );
    transform: translateX(-150%) skewX(-20deg);
    transition: none;
    pointer-events: none;
}

.btn-shimmer:hover::before,
.shimmer-btn:hover::before,
.cta-btn:hover::before {
    animation: shimmerSweep 0.85s var(--ease-out-expo);
}

.cta-btn:hover,
.btn-shimmer:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px -4px rgba(99, 102, 241, 0.65), 0 0 18px rgba(6, 182, 212, 0.4);
}

.cta-btn:active,
.btn-shimmer:active {
    transform: translateY(-1px) scale(0.98);
}

/* Secondary Button Hover */
.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.4);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
}

/* Product Buttons */
.btn-product {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.28),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-out-expo);
    pointer-events: none;
}

.btn-product:hover::before {
    transform: translateX(100%);
}

.btn-product:hover {
    transform: translateY(-3px) scale(1.025);
}

.btn-product.pw:hover {
    box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.55);
}

.btn-product.cod:hover {
    box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.55);
}

.btn-product.geo:hover {
    box-shadow: 0 8px 24px -4px rgba(139, 92, 246, 0.55);
}

.btn-product:active {
    transform: translateY(-1px) scale(0.98);
}

/* Cards & Grid Micro-Interactions */
.card,
.flow-card,
.comp-card,
.step-card {
    transition: transform 0.4s var(--ease-out-expo),
                box-shadow 0.4s var(--ease-out-expo),
                border-color 0.4s var(--ease-out-expo),
                background 0.4s var(--ease-out-expo);
}

.card:hover,
.flow-card:hover,
.step-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7),
                0 0 25px -5px rgba(99, 102, 241, 0.2);
}

.card-icon,
.flow-card-icon {
    transition: transform 0.4s var(--ease-spring), background 0.3s ease, border-color 0.3s ease;
}

.card:hover .card-icon,
.flow-card:hover .flow-card-icon {
    transform: scale(1.12) rotate(4deg);
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.5);
}

/* Product Cards */
.product-card {
    transition: transform 0.45s var(--ease-out-expo),
                box-shadow 0.45s var(--ease-out-expo),
                border-color 0.45s var(--ease-out-expo);
}

.product-card:hover {
    transform: translateY(-8px) scale(1.012);
}

.product-card.pw:hover {
    box-shadow: 0 24px 50px -15px rgba(0, 0, 0, 0.75),
                0 0 35px -8px rgba(16, 185, 129, 0.25);
}

.product-card.cod:hover {
    box-shadow: 0 24px 50px -15px rgba(0, 0, 0, 0.75),
                0 0 35px -8px rgba(245, 158, 11, 0.25);
}

.product-card.geo:hover {
    box-shadow: 0 24px 50px -15px rgba(0, 0, 0, 0.75),
                0 0 35px -8px rgba(139, 92, 246, 0.25);
}

.product-badge {
    transition: transform 0.3s var(--ease-spring);
}

.product-card:hover .product-badge {
    transform: scale(1.06);
}

/* Stat Box Polish */
.stat-box,
.metric-item {
    transition: transform 0.35s var(--ease-out-expo),
                border-color 0.35s var(--ease-out-expo),
                box-shadow 0.35s var(--ease-out-expo);
}

.stat-box:hover,
.metric-item:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5),
                0 0 20px -5px rgba(99, 102, 241, 0.15);
}

.stat-num,
.metric-val {
    display: inline-block;
    transition: transform 0.35s var(--ease-spring);
}

.stat-box:hover .stat-num,
.metric-item:hover .metric-val {
    transform: scale(1.08);
}

/* Contact Box Interactive Pulse */
.contact-box,
.cta-card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s var(--ease-out-expo);
}

.contact-box:hover,
.cta-card:hover {
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.6),
                0 0 40px -10px rgba(99, 102, 241, 0.2);
    transform: translateY(-3px);
}

/* Email Pill Hover */
.email-pill {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out-expo);
}

.email-pill:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
}

.email-pill:active {
    transform: translateY(-1px) scale(0.97);
}

/* --------------------------------------------------------------------------
   Accessibility: prefers-reduced-motion (Strict WCAG 2.1 AAA Compliance)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .reveal-up,
    .reveal-down,
    .reveal-fade,
    .reveal-scale,
    .reveal-zoom,
    .reveal-left,
    .reveal-right,
    .bl-reveal,
    .bl-reveal-fade,
    .bl-reveal-scale,
    .bl-reveal-left,
    .bl-reveal-right,
    .scroll-reveal,
    .hero .badge,
    .badge-float,
    .float-badge,
    .hero h1,
    .hero p,
    .hero .hero-actions,
    header,
    .ambient-orb {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .badge-dot {
        animation: none !important;
    }

    .cta-btn:hover,
    .btn-shimmer:hover,
    .btn-secondary:hover,
    .btn-product:hover,
    .card:hover,
    .product-card:hover,
    .stat-box:hover,
    .email-pill:hover,
    .contact-box:hover {
        transform: none !important;
    }
}
