/* ==========================================================================
   PRISM Shared Animations — scroll reveals, counters, hover effects
   ========================================================================== */

/* ---- Scroll-reveal base ---- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
    will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(-40px); }
.reveal.reveal-right { transform: translateX(40px); }
.reveal.reveal-scale { transform: scale(0.92); }
.reveal.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Staggered children — set --i via JS or inline style */
.reveal-stagger > .reveal {
    transition-delay: calc(var(--i, 0) * 0.09s);
}

/* ---- Gradient shimmer on headings ---- */
.shimmer-text {
    background: linear-gradient(90deg, #1e40af 0%, #3b82f6 40%, #06b6d4 60%, #1e40af 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ---- Floating icon bob ---- */
.float-icon {
    animation: floatBob 3s ease-in-out infinite;
}
@keyframes floatBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ---- Card hover lift ---- */
.card-hover {
    transition: transform 0.35s cubic-bezier(.22,1,.36,1), box-shadow 0.35s cubic-bezier(.22,1,.36,1);
}
.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(30,64,175,0.12);
}

/* ---- Stat box pulse on reveal ---- */
.stat-pop {
    animation: statPop 0.5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes statPop {
    0%   { transform: scale(0.7); opacity: 0; }
    70%  { transform: scale(1.06); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Gradient border glow ---- */
.glow-border {
    position: relative;
    overflow: hidden;
}
.glow-border::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, #3b82f6 25%, transparent 50%);
    animation: borderSpin 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}
.glow-border:hover::after {
    opacity: 0.15;
}
@keyframes borderSpin {
    100% { transform: rotate(360deg); }
}

/* ---- Typing cursor for hero text ---- */
.typing-cursor::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
    color: #3b82f6;
    font-weight: 300;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* ---- Smooth gradient divider ---- */
.gradient-divider {
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #3b82f6 30%, #06b6d4 70%, transparent 100%);
    border: none;
    margin: 40px auto;
    border-radius: 2px;
    max-width: 600px;
    opacity: 0.5;
}

/* ---- Ripple button ---- */
.btn-ripple {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.3s;
}
.btn-ripple:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30,64,175,0.25);
}
.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* ---- Progress bar fill ---- */
.progress-fill {
    width: 0;
    transition: width 1.2s cubic-bezier(.22,1,.36,1);
}
.progress-fill.active {
    width: var(--fill, 0%);
}

/* ---- Particle-style dots background ---- */
.dot-bg {
    position: relative;
}
.dot-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #3b82f6 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}
.dot-bg > * { position: relative; z-index: 1; }

/* ---- Counter number ---- */
.counter-num {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .reveal { transition: none; opacity: 1; transform: none; }
    .shimmer-text { animation: none; }
    .float-icon { animation: none; }
    .card-hover:hover { transform: none; }
    .stat-pop { animation: none; }
    .glow-border::after { animation: none; }
    .typing-cursor::after { animation: none; }
    .counter-num { transition: none; }
}
