/* ============================================================
   animations.css — Apex Properties Motion & Interaction Layer
   All animations use transform/opacity only for GPU acceleration
   ============================================================ */

/* ── 1. Custom Cursor (desktop only, injected by JS) ───────── */
#cursor-dot,
#cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

#cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--color-brand-gold);
    transition: transform 0.1s ease, opacity 0.2s ease, width 0.25s ease, height 0.25s ease;
}

#cursor-ring {
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-brand-gold);
    opacity: 0.6;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s ease,
                border-color 0.3s ease;
}

/* Expand state — when hovering interactive elements */
html.has-cursor.cursor-on-interactive #cursor-ring {
    width: 64px;
    height: 64px;
    opacity: 0.4;
    border-color: var(--color-brand-gold);
    background: rgba(245, 158, 11, 0.08);
}

html.has-cursor.cursor-on-interactive #cursor-dot {
    transform: translate(-50%, -50%) scale(1.6);
}

html.has-cursor.cursor-on-cta #cursor-ring {
    width: 52px;
    height: 52px;
    opacity: 0.9;
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Hide native cursor sitewide when custom is active */
html.has-cursor,
html.has-cursor * {
    cursor: none !important;
}

/* ── 2. Magnetic Button Base ───────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-gold {
    will-change: transform;
    transition:
        background-color 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

/* Shimmer pseudo-element on btn-primary & btn-gold */
.btn-primary::before,
.btn-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 20%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 80%
    );
    transform: skewX(-20deg);
    transition: left 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.btn-primary:hover::before,
.btn-gold:hover::before {
    left: 160%;
}

.btn-primary:hover,
.btn-gold:hover {
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25), 0 2px 8px rgba(15, 23, 42, 0.12);
}

.btn-secondary:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

/* ── 3. Scroll Reveal — Initial Hidden States ──────────────── */
/* These are set via JS (.is-animated class added to <html>)    */
/* so non-JS users always see content                           */
html.is-animated .reveal-up {
    opacity: 0;
    transform: translateY(40px);
    will-change: opacity, transform;
}

html.is-animated .reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    will-change: opacity, transform;
}

html.is-animated .reveal-right {
    opacity: 0;
    transform: translateX(50px);
    will-change: opacity, transform;
}

html.is-animated .reveal-scale {
    opacity: 0;
    transform: scale(0.88);
    will-change: opacity, transform;
}

html.is-animated .reveal-fade {
    opacity: 0;
    will-change: opacity;
}

/* ── 4. Inline Text Link Underline ─────────────────────────── */
/* Applied to nav links and inline "Learn More" links           */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: currentColor;
    transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.link-underline:hover::after,
.link-underline:focus-visible::after {
    width: 100%;
}

/* Opacity + scale micro-transition on text links */
a.link-underline {
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

a.link-underline:hover {
    opacity: 1;
    transform: translateY(-1px);
}

/* ── 5. Card hover — enhanced depth ───────────────────────── */
.card-hover {
    transition:
        transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.card-hover:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 50px -8px rgba(15, 23, 42, 0.14);
}

/* Icon bounce on card hover */
.card-hover:hover .icon-container {
    transform: scale(1.12) rotate(-5deg);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s ease;
}

/* ── 6. Hero Image Parallax Container ─────────────────────── */
#hero-section {
    overflow: hidden;
}

.hero-parallax-bg {
    will-change: transform;
    transform-origin: center center;
}

/* ── 7. Process Step Number Pulse ──────────────────────────── */
.step-number {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease;
}

.step-number:hover,
.step-item:hover .step-number {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.15);
}

/* ── 8. Stat Counter Highlight Flash ──────────────────────── */
.stats-counter.counting {
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* ── 9. Testimonial card quote icon ───────────────────────── */
.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 24px;
    font-size: 80px;
    line-height: 1;
    color: var(--color-brand-gold);
    opacity: 0.12;
    font-family: Georgia, serif;
    pointer-events: none;
}

.testimonial-card {
    position: relative;
}

/* ── 10. Scroll Progress Bar (top of viewport) ─────────────── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #f43f5e, #14b8a6);
    z-index: 9998;
    pointer-events: none;
    will-change: width;
    transition: width 0.05s linear;
}

/* ── 11. Section heading accent line ──────────────────────── */
.section-label {
    position: relative;
    display: inline-block;
}

.section-label::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-brand-gold);
    animation: labelPulse 2s ease-in-out infinite;
}

@keyframes labelPulse {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.5); opacity: 0.5; }
}

/* ── 12. Reduced motion override ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html.is-animated .reveal-up,
    html.is-animated .reveal-left,
    html.is-animated .reveal-right,
    html.is-animated .reveal-scale,
    html.is-animated .reveal-fade {
        opacity: 1 !important;
        transform: none !important;
    }

    .btn-primary::before,
    .btn-gold::before {
        display: none;
    }

    .card-hover {
        transition: none;
    }

    #cursor-dot,
    #cursor-ring,
    #scroll-progress {
        display: none;
    }
}

/* ── 13. Mobile / Touch — disable cursor & heavy effects ──── */
@media (hover: none), (pointer: coarse) {
    #cursor-dot,
    #cursor-ring {
        display: none !important;
    }

    html.has-cursor,
    html.has-cursor * {
        cursor: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   14. HERO MOTION GRAPHICS LAYER
   Wrapper pattern: .hml-pos (GSAP parallax x+y)
                    .hero-float-badge / .hero-deco (CSS float y)
   No transform conflict between GSAP and CSS animations.
═══════════════════════════════════════════════════════════════ */

/* ── Mouse spotlight glow ─────────────────────────────────── */
#hero-mouse-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    transition: background 0.15s ease;
}

/* ── Position wrappers (GSAP moves these) ─────────────────── */
.hml-pos {
    position: absolute;
    will-change: transform;
}

/* Badge positions */
.hml-pos-1 { top: 22%; left: 2.5%; display: none; }
.hml-pos-2 { bottom: 26%; left: 2%; display: none; }
.hml-pos-3 { top: 20%; right: 2.5%; display: none; }
.hml-pos-4 { bottom: 24%; right: 2%; display: none; }

/* Deco positions */
.hml-deco-pos-1 { top: 44%; left: 7%; display: none; }
.hml-deco-pos-2 { top: 10%; right: 11%; display: none; }
.hml-deco-pos-3 { bottom: 16%; left: 13%; display: none; }
.hml-deco-pos-4 { top: 60%; right: 8%; display: none; }

/* Show on lg+ screens */
@media (min-width: 1024px) {
    .hml-pos-1, .hml-pos-2, .hml-pos-3, .hml-pos-4,
    .hml-deco-pos-1, .hml-deco-pos-2, .hml-deco-pos-3, .hml-deco-pos-4 {
        display: block;
    }
}

/* ── Floating Badge card ──────────────────────────────────── */
.hero-float-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 11px 15px;
    box-shadow:
        0 8px 32px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid rgba(255, 255, 255, 0.35);
    pointer-events: auto;
    white-space: nowrap;
    animation: badgeFloat 4s ease-in-out infinite;
    will-change: transform;
    cursor: default;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-float-badge:hover {
    box-shadow:
        0 12px 40px rgba(15, 23, 42, 0.2),
        0 4px 12px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px) scale(1.03) !important;
}

.badge-gold {
    background: rgba(245, 158, 11, 0.92) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

/* Badge sub-elements */
.hfb-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hfb-label {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    margin: 0;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.hfb-value {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.hfb-label-dark {
    font-size: 10px;
    font-weight: 500;
    color: rgba(15, 23, 42, 0.6);
    margin: 0;
    line-height: 1.2;
}

.hfb-value-dark {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.hfb-stars {
    display: flex;
    gap: 1px;
    margin-bottom: 3px;
    color: #f59e0b;
    font-size: 10px;
}

/* Pulsing live-activity dot on Badge 1 */
.hfb-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-left: auto;
    flex-shrink: 0;
    animation: liveDotPulse 2s ease-in-out infinite;
}

@keyframes liveDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); opacity: 1; }
    50%       { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); opacity: 0.8; }
}

/* ── Floating CSS animation (y-only, never conflicts with GSAP x/y on wrapper) */
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0px);   }
    50%       { transform: translateY(-9px);  }
}

/* ── Decorative Icon Bubbles ────────────────────────────────── */
.hero-deco {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    pointer-events: auto;
    cursor: default;
    animation: decoSpin 6s ease-in-out infinite;
    will-change: transform;
}

.deco-glass {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    width: 52px;
    height: 52px;
}

.deco-teal  { background: rgba(20, 184, 166, 0.75);  }
.deco-coral { background: rgba(244, 63, 94, 0.72);    }
.deco-gold  { background: rgba(245, 158, 11, 0.88);   }

@keyframes decoSpin {
    0%, 100% { transform: translateY(0) rotate(0deg);    }
    33%       { transform: translateY(-10px) rotate(8deg);  }
    66%       { transform: translateY(4px) rotate(-5deg); }
}

/* Give each deco a unique timing */
.hml-deco-pos-1 .hero-deco { animation-duration: 7s;   animation-delay: -1s;   }
.hml-deco-pos-2 .hero-deco { animation-duration: 5.5s; animation-delay: -3.2s; }
.hml-deco-pos-3 .hero-deco { animation-duration: 6.5s; animation-delay: -2s;   }
.hml-deco-pos-4 .hero-deco { animation-duration: 5s;   animation-delay: -0.5s; }

/* ── Hero mockup 3-D tilt setup ────────────────────────────── */
#hero-section .hero-fade:last-child > div {
    transform-style: preserve-3d;
    transition: box-shadow 0.4s ease;
}

/* ── Bottom Stats Strip ─────────────────────────────────────── */
#hero-stats-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 10px 20px;
    pointer-events: auto;
    z-index: 5;
}

.hss-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.hss-item i {
    color: #f59e0b;
    font-size: 11px;
}

.hss-sep {
    color: rgba(255, 255, 255, 0.25);
    font-size: 18px;
    line-height: 1;
    display: none;
}

@media (min-width: 480px) {
    .hss-sep { display: block; }
}

/* ── Entrance animation — badges fly in from edges on load ── */
@keyframes badgeEnterLeft  { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes badgeEnterRight { from { opacity: 0; transform: translateX(30px);  } to { opacity: 1; transform: translateX(0); } }

.hml-pos-1, .hml-pos-2, .hml-deco-pos-1, .hml-deco-pos-3 {
    animation: badgeEnterLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.hml-pos-3, .hml-pos-4, .hml-deco-pos-2, .hml-deco-pos-4 {
    animation: badgeEnterRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Stagger the entrance delays */
.hml-pos-1       { animation-delay: 1.0s; }
.hml-pos-2       { animation-delay: 1.3s; }
.hml-pos-3       { animation-delay: 1.1s; }
.hml-pos-4       { animation-delay: 1.5s; }
.hml-deco-pos-1  { animation-delay: 1.7s; }
.hml-deco-pos-2  { animation-delay: 1.6s; }
.hml-deco-pos-3  { animation-delay: 1.9s; }
.hml-deco-pos-4  { animation-delay: 1.8s; }

/* After entrance, restore normal CSS float animation on the inner badge */
.hml-pos-1, .hml-pos-2, .hml-pos-3, .hml-pos-4 {
    /* wrapper entrance only — inner .hero-float-badge handles float */
}

/* ── Reduced-motion overrides ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hero-float-badge,
    .hero-deco,
    .hfb-live-dot,
    .hml-pos-1, .hml-pos-2, .hml-pos-3, .hml-pos-4,
    .hml-deco-pos-1, .hml-deco-pos-2, .hml-deco-pos-3, .hml-deco-pos-4 {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    #hero-mouse-glow { display: none; }
}


/* ═══════════════════════════════════════════════════════════════
   15.  HERO TORCH / FLASHLIGHT EFFECT
   ───────────────────────────────────────────────────────────────
   Paint order (same stacking context = hero section):
     [0] Background image
     [1] ::before  – lighter base overlay (so lit zone looks bright)
     [1] #hero-torch – JS-driven dark mask with radial cutout at cursor
     [2] float-shapes, content, badges (z-index:2 from overlay-dark > *)
    [20] #hero-torch-tip – warm gold glow drawn above all content
═══════════════════════════════════════════════════════════════ */

/* ── Lighten the base overlay so the "lit" zone contrasts clearly ── */
#hero-section.overlay-dark::before {
    /* Original was 0.8→0.4. Now 0.38→0.18 — cursor area shows background richly. */
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.38) 0%,
        rgba(15, 23, 42, 0.18) 100%
    );
    /* Keep z-index:1 from the base rule — no change needed */
}

/* ── Dark mask overlay (the actual torch "shadow") ──────────── */
#hero-torch {
    /*
     * Default = solid dark to compensate for the lighter ::before.
     * Combined with ::before ≈ original 0.78 overall darkness.
     * JS replaces this with a radial-gradient on every mousemove.
     */
    background: rgba(15, 23, 42, 0.50);
    /* NO CSS transition — JS lerps manually for 60fps smoothness  */
}

/* ── Warm tip glow (above all content) ──────────────────────── */
#hero-torch-tip {
    /* Starts invisible; JS paints it on mousemove */
    background: transparent;
    mix-blend-mode: screen;   /* adds light on top of dark without blocking text */
}

/* ── Mobile: hide torch elements, restore original base opacity ── */
@media (hover: none), (pointer: coarse) {
    #hero-torch,
    #hero-torch-tip {
        display: none !important;
    }
    /* Restore full darkness on touch since torch is off */
    #hero-section.overlay-dark::before {
        background: linear-gradient(
            135deg,
            rgba(15, 23, 42, 0.80) 0%,
            rgba(15, 23, 42, 0.40) 100%
        );
    }
}

/* ── Reduced-motion: same restore ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #hero-torch,
    #hero-torch-tip {
        display: none !important;
    }
    #hero-section.overlay-dark::before {
        background: linear-gradient(
            135deg,
            rgba(15, 23, 42, 0.80) 0%,
            rgba(15, 23, 42, 0.40) 100%
        );
    }
}


