/* =====================================================================
   iOSSpecialist Expert — Animations Library
   GSAP companion + CSS Keyframes + 3D Utilities
   ===================================================================== */

/* ---- Entry Animations (used with GSAP & ScrollTrigger) ---- */
.anim-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 600ms cubic-bezier(0.0, 0, 0.2, 1),
                transform 600ms cubic-bezier(0.0, 0, 0.2, 1);
}
.anim-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.anim-fade-in {
    opacity: 0;
    transition: opacity 700ms ease;
}
.anim-fade-in.is-visible { opacity: 1; }

.anim-scale-in {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.anim-scale-in.is-visible {
    opacity: 1;
    transform: scale(1);
}

.anim-slide-left {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.0, 0, 0.2, 1);
}
.anim-slide-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.anim-slide-right {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.0, 0, 0.2, 1);
}
.anim-slide-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered children delay */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children > *:nth-child(8) { transition-delay: 560ms; }

/* ---- CSS Keyframes Library ---- */

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33%       { transform: translateY(-12px) rotate(1deg); }
    66%       { transform: translateY(-6px) rotate(-0.5deg); }
}
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: float 9s ease-in-out infinite; }
.animate-float-delay { animation: float 6s 2s ease-in-out infinite; }

/* Pulsing glow */
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0,122,255,0.3), 0 0 40px rgba(0,122,255,0.1); }
    50%       { box-shadow: 0 0 40px rgba(0,122,255,0.5), 0 0 80px rgba(0,122,255,0.2); }
}
.animate-glow-pulse { animation: glow-pulse 3s ease-in-out infinite; }

/* Border glow spin */
@keyframes border-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shimmer sweep */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.shimmer-text {
    background: linear-gradient(90deg, #fff 0%, #007AFF 40%, #5AC8FA 50%, #007AFF 60%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

/* Counter number animation */
@keyframes count-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Typing cursor */
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
.typing-cursor::after {
    content: '|';
    animation: blink-cursor 1s ease-in-out infinite;
    color: #007AFF;
}

/* Particle drift */
@keyframes particle-drift {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0.7; }
    33%  { transform: translateY(-30px) translateX(15px) scale(1.1); opacity: 1; }
    66%  { transform: translateY(-15px) translateX(-10px) scale(0.9); opacity: 0.8; }
    100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.7; }
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,122,255,0.4);
    pointer-events: none;
    animation: particle-drift linear infinite;
}

/* Gradient wave */
@keyframes gradient-wave {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-wave 8s ease infinite;
}

/* Spin slow */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.animate-spin-slow { animation: spin-slow 20s linear infinite; }

/* Scale pulse */
@keyframes scale-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}
.animate-scale-pulse { animation: scale-pulse 3s ease-in-out infinite; }

/* Slide up ticker */
@keyframes ticker-up {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}
.ticker-wrap {
    overflow: hidden;
    height: 24px;
}
.ticker-content {
    animation: ticker-up 12s linear infinite;
}

/* ---- 3D Tilt Container ---- */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1200px;
    transition: transform 400ms cubic-bezier(0.03, 0.98, 0.52, 0.99);
    will-change: transform;
}

.tilt-card-inner {
    transform-style: preserve-3d;
    transition: inherit;
}

.tilt-card:hover {
    transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale3d(1.02, 1.02, 1.02);
}

/* 3D depth layers */
.tilt-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 300ms ease;
}
.tilt-card:hover .tilt-shine { opacity: 1; }

/* ---- Page Transition ---- */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9998;
    transform: translateY(100%);
    pointer-events: none;
}
.page-transition-overlay.entering {
    animation: page-enter 400ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
.page-transition-overlay.leaving {
    animation: page-leave 400ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes page-enter {
    from { transform: translateY(100%); }
    to   { transform: translateY(0%); }
}
@keyframes page-leave {
    from { transform: translateY(0%); }
    to   { transform: translateY(-100%); }
}

/* ---- Custom Cursor ---- */
#ios-cursor {
    width: 10px;
    height: 10px;
    background: #007AFF;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 100ms ease, width 200ms ease, height 200ms ease, opacity 200ms ease;
}
#ios-cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(0,122,255,0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: transform 300ms cubic-bezier(0.03, 0.98, 0.52, 0.99),
                width 200ms ease, height 200ms ease, border-color 200ms ease, opacity 200ms ease;
}
body.cursor-hover #ios-cursor {
    width: 6px;
    height: 6px;
}
body.cursor-hover #ios-cursor-ring {
    width: 50px;
    height: 50px;
    border-color: rgba(0,122,255,0.25);
}
@media (hover: none) {
    #ios-cursor, #ios-cursor-ring { display: none; }
}

/* ---- Scroll Progress Bar ---- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #007AFF, #5AC8FA);
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
    box-shadow: 0 0 8px rgba(0,122,255,0.6);
}

/* ---- Number Counter ---- */
.counter-number {
    font-variant-numeric: tabular-nums;
}

/* ---- Animated Gradient Border Card ---- */
.gradient-border-card {
    position: relative;
    border-radius: 20px;
    background: var(--bg-elevated);
    padding: 1px;
}
.gradient-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from 0deg, #007AFF, #5AC8FA, #AF52DE, #007AFF);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: border-spin 4s linear infinite;
    opacity: 0;
    transition: opacity 300ms ease;
}
.gradient-border-card:hover::before { opacity: 1; }
.gradient-border-card-inner {
    background: var(--bg-elevated);
    border-radius: 19px;
    padding: 24px;
    height: 100%;
}
