/* ============================================
   BLACKGATE CONSULTING - Enhanced Animations
   ============================================ */

/* --- Hero logo special entrance --- */
.hero-logo.animate-in {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}
.hero-logo.animate-in.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Scroll reveal --- */
.animate-in {
    opacity: 0; transform: translateY(30px);
}
.animate-in.visible {
    opacity: 1; transform: translateY(0);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* Stagger approach steps */
.approach-right .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.approach-right .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.approach-right .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.approach-right .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* Stagger service cards */
.services-grid .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.services-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.services-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.services-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* Stagger proof stats */
.proof-stats .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.proof-stats .animate-on-scroll:nth-child(3) { transition-delay: 0.1s; }
.proof-stats .animate-on-scroll:nth-child(5) { transition-delay: 0.2s; }
.proof-stats .animate-on-scroll:nth-child(7) { transition-delay: 0.3s; }

/* --- Tilt via JS --- */
[data-tilt] { transform-style: preserve-3d; will-change: transform; }

/* --- Button glow follow --- */
.btn::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.12), transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.btn:hover::before { opacity: 1; }

/* --- Package item selection pop --- */
.package-item { transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.package-item.selected { animation: select-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes select-bounce { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* --- Service card animated border on hover --- */
.service-card::after {
    content: ''; position: absolute; inset: -1px;
    border-radius: var(--radius); z-index: -1;
    background: conic-gradient(from var(--card-angle, 0deg), transparent, rgba(239,68,68,0.25), transparent, rgba(139,92,246,0.2), transparent);
    opacity: 0; transition: opacity 0.5s;
}
.service-card:hover::after { opacity: 1; }

/* --- Loading spinner for forms --- */
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading { pointer-events: none; position: relative; color: transparent !important; }
.btn.loading::after {
    content: ''; position: absolute;
    width: 20px; height: 20px; border: 2px solid transparent;
    border-top-color: var(--bg); border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* --- Step card left border accent on hover --- */
.step-card { position: relative; }
.step-card::after {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 2px; background: var(--gradient);
    opacity: 0; transition: all var(--transition);
}
.step-card:hover::after { opacity: 1; top: 10%; bottom: 10%; }

/* --- Contact card hover glow --- */
.contact-card-mini::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit;
    background: linear-gradient(135deg, rgba(239,68,68,0.08), transparent); opacity: 0;
    transition: opacity var(--transition); z-index: -1;
}
.contact-card-mini { position: relative; overflow: hidden; }
.contact-card-mini:hover::before { opacity: 1; }

/* --- Marquee pause on hover --- */
.logo-marquee:hover .logo-track { animation-play-state: paused; }

/* --- Manifesto quote fade-in special --- */
.manifesto-quote.visible { transition-delay: 0.1s; }
.manifesto-author.visible { transition-delay: 0.3s; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .animate-in, .animate-on-scroll { opacity: 1; transform: none; }
    .logo-track { animation: none; }
    .hero-blob { animation: none; }
}
