/* ============================================================
   AYARN TRUST — Premium UI Animations
   Desktop/Tablet Only (disabled on touch/mobile via media query)
   ============================================================ */

/* 1. Custom Cursor */
.custom-cursor-outer,
.custom-cursor-inner {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    will-change: transform;
}
.custom-cursor-outer {
    width: 36px;
    height: 36px;
    border: 2px solid #0046cd;
    opacity: 0.55;
    transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease, background 0.25s ease;
    transform: translate(-50%, -50%);
}
.custom-cursor-inner {
    width: 8px;
    height: 8px;
    background-color: #0046cd;
    transform: translate(-50%, -50%);
    transition: transform 0.08s linear;
}
body.cursor-hover .custom-cursor-outer {
    width: 54px;
    height: 54px;
    opacity: 0.12;
    background-color: #0046cd;
}
body.cursor-clicking .custom-cursor-inner {
    transform: translate(-50%, -50%) scale(0.6);
}

/* 2. Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0046cd 0%, #38b6ff 100%);
    z-index: 99998;
    box-shadow: 0 0 8px rgba(0,70,205,0.5);
    transition: width 0.08s linear;
}

/* 3. Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #0046cd, #1e68f6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(0,70,205,0.35);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}
#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
#back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,70,205,0.5);
}

/* 4. Section Scroll Reveal with Stagger */
.reveal-section {
    opacity: 0;
    transform: translateY(45px);
    transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-section .col-lg-4:nth-child(1),
.reveal-section .col-md-6:nth-child(1),
.reveal-section .col-md-4:nth-child(1) { transition-delay: 0.05s; }
.reveal-section .col-lg-4:nth-child(2),
.reveal-section .col-md-6:nth-child(2),
.reveal-section .col-md-4:nth-child(2) { transition-delay: 0.15s; }
.reveal-section .col-lg-4:nth-child(3),
.reveal-section .col-md-6:nth-child(3),
.reveal-section .col-md-4:nth-child(3) { transition-delay: 0.25s; }
.reveal-section .col-lg-4:nth-child(4),
.reveal-section .col-md-6:nth-child(4) { transition-delay: 0.35s; }
.reveal-section .col-lg-4:nth-child(5),
.reveal-section .col-md-6:nth-child(5) { transition-delay: 0.45s; }
.reveal-section .col-lg-4:nth-child(6),
.reveal-section .col-md-6:nth-child(6) { transition-delay: 0.55s; }

/* 5. Typewriter blink caret */
.typewriter-text::after {
    content: '|';
    animation: blink-caret 0.75s step-end infinite;
    color: #38b6ff;
    font-weight: 200;
    margin-left: 3px;
}
.typewriter-text.done::after {
    display: none;
}
@keyframes blink-caret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

/* 6. Stat icon ping */
@keyframes icon-ping {
    0% { transform: scale(1); opacity: 0.7; }
    80% { transform: scale(2.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}
.stat-icon-wrap {
    position: relative;
    display: inline-block;
}
.stat-icon-wrap::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: rgba(0, 70, 205, 0.10);
    animation: icon-ping 2.5s ease-out infinite;
}

/* 7. Ripple on cards */
.ripple-card {
    position: relative;
    overflow: hidden;
}
.ripple-card .ripple-fx {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 70, 205, 0.07);
    transform: scale(0);
    animation: ripple-anim 0.65s linear forwards;
    pointer-events: none;
}
/* 8. Magnetic Buttons */
.magnetic-btn {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

/* ── MOBILE / TOUCH DEVICE DISABLE ── */
@media (max-width: 767px) {
    .custom-cursor-outer,
    .custom-cursor-inner { display: none !important; }

    .reveal-section {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .reveal-section [class*="col-"] {
        transition-delay: 0s !important;
    }

    .typewriter-text::after { display: none; }
    .stat-icon-wrap::before { display: none; }
}
