/* ═══════════════════════════════════════════════════════════
   LOADING SCREEN — APTIX AI Canvas Animation (White)
   ═══════════════════════════════════════════════════════════ */

/* ─── LOADING SCREEN ────────────────────────────────────── */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0, 1),
                visibility 0s linear 0s;
    visibility: visible;
    height: 100vh;
    height: 100dvh;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0, 1),
                visibility 0s linear 0.9s;
}

.loading-screen canvas {
    display: block;
    width: 100%;
    height: 100%;
}


/* ═══════════════════════════════════════════════════════════
   SCROLL-TRIGGERED REVEAL ANIMATIONS
   Apex.AI style — elements slide/fade/scale in on scroll
   ═══════════════════════════════════════════════════════════ */

/* BASE: all animatable elements start hidden */
[data-reveal] {
    opacity: 0;
    will-change: transform, opacity;
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
}

/* ─── FADE UP (default) ─────────────────────────────────── */
[data-reveal="fade-up"] {
    transform: translateY(48px);
}

/* ─── FADE DOWN ─────────────────────────────────────────── */
[data-reveal="fade-down"] {
    transform: translateY(-48px);
}

/* ─── SLIDE LEFT (comes from the left) ──────────────────── */
[data-reveal="slide-left"] {
    transform: translateX(-80px);
}

/* ─── SLIDE RIGHT (comes from the right) ────────────────── */
[data-reveal="slide-right"] {
    transform: translateX(80px);
}

/* ─── ZOOM IN ───────────────────────────────────────────── */
[data-reveal="zoom-in"] {
    transform: scale(0.85);
}

/* ─── ZOOM OUT ──────────────────────────────────────────── */
[data-reveal="zoom-out"] {
    transform: scale(1.1);
}

/* ─── CLIP REVEAL (wipes up like a curtain) ─────────────── */
[data-reveal="clip-up"] {
    clip-path: inset(100% 0 0 0);
}

/* ─── CLIP REVEAL LEFT ──────────────────────────────────── */
[data-reveal="clip-left"] {
    clip-path: inset(0 100% 0 0);
}

/* ─── ROTATE IN ─────────────────────────────────────────── */
[data-reveal="rotate-in"] {
    transform: perspective(800px) rotateY(-15deg) translateX(-40px);
}

/* ─── FLIP UP ───────────────────────────────────────────── */
[data-reveal="flip-up"] {
    transform: perspective(600px) rotateX(12deg) translateY(40px);
}

/* ─── STAGGERED CHILDREN ────────────────────────────────── */
[data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal-stagger].revealed > * {
    opacity: 1;
    transform: none;
}


/* ═══════════════════════════════════════════════════════════
   HERO TEXT SPLIT ANIMATION — words slide up into view
   ═══════════════════════════════════════════════════════════ */
.hero__title .word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    margin-right: 0.22em;
}

.hero__title .word-inner {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

body.page-loaded .hero__title .word-inner {
    transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════
   SECTION DIVIDER LINES — animated gradient borders
   ═══════════════════════════════════════════════════════════ */
.section-divider {
    display: block;
    width: 100%;
    height: 1px;
    border: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(37, 99, 235, 0.3) 20%,
        rgba(255, 106, 0, 0.3) 50%,
        rgba(37, 99, 235, 0.2) 80%,
        transparent 100%
    );
    margin: 0;
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-divider.revealed {
    opacity: 1;
    transform: scaleX(1);
}


/* ═══════════════════════════════════════════════════════════
   CARD HOVER — 3D tilt & glow on hover (Apex product cards)
   ═══════════════════════════════════════════════════════════ */
.tilt-card {
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.4s ease;
}

.tilt-card:hover {
    z-index: 2;
}


/* ═══════════════════════════════════════════════════════════
   SECTION HEADING LINE ACCENT (animated underline)
   ═══════════════════════════════════════════════════════════ */
.section__title-animated::after {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, #2563eb, #ff6a00);
    border-radius: 3px;
    transition: width 1s 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.section__title-animated.revealed::after {
    width: 60px;
}


/* ═══════════════════════════════════════════════════════════
   SCROLL PROGRESS INDICATOR (top bar)
   ═══════════════════════════════════════════════════════════ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #ff6a00, #ff9500);
    z-index: 10000;
    width: 0%;
    transition: width 0.15s linear;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}


/* ═══════════════════════════════════════════════════════════
   FLOATING BADGE ANIMATION
   ═══════════════════════════════════════════════════════════ */
body.page-loaded .hero__badge {
    animation: badgeFloat 4s 1.5s ease-in-out infinite;
}

@keyframes badgeFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}


/* ═══════════════════════════════════════════════════════════
   BUTTON RIPPLE EFFECT
   ═══════════════════════════════════════════════════════════ */
.btn__ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: btnRipple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes btnRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}


/* ═══════════════════════════════════════════════════════════
   MAGNETIC BUTTON
   ═══════════════════════════════════════════════════════════ */
.btn--magnetic {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ═══════════════════════════════════════════════════════════
   LEGACY fade-up/fade-in compat
   ═══════════════════════════════════════════════════════════ */
.fade-in {
    opacity: 0;
    transform: translateY(32px);
}

body.page-loaded .fade-in {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    [data-reveal] {
        transition-duration: 0.5s !important;
    }

    /* Smaller translate on mobile to prevent content jumping */
    [data-reveal="fade-up"] {
        transform: translateY(24px);
    }

    [data-reveal="fade-down"] {
        transform: translateY(-24px);
    }

    [data-reveal="slide-left"] {
        transform: translateX(-40px);
    }

    [data-reveal="slide-right"] {
        transform: translateX(40px);
    }

    .fade-in {
        transform: translateY(16px);
    }

    .scroll-progress {
        height: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal],
    [data-reveal-stagger] > *,
    .hero__title .word-inner,
    .section-divider,
    .hero__badge {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        animation: none !important;
        transition: none !important;
    }

    .section__title-animated::after {
        width: 60px !important;
    }
}
