/* ============================================
   CastLogic Modern Design System
   ============================================ */

/* --- Scroll Reveal Animations --- */
.reveal {
    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);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger > * {
    opacity: 0;
    transform: translateY(30px);
}
.stagger.active > * {
    animation: staggerFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger.active > *:nth-child(1) { animation-delay: 0.05s; }
.stagger.active > *:nth-child(2) { animation-delay: 0.1s; }
.stagger.active > *:nth-child(3) { animation-delay: 0.15s; }
.stagger.active > *:nth-child(4) { animation-delay: 0.2s; }
.stagger.active > *:nth-child(5) { animation-delay: 0.25s; }
.stagger.active > *:nth-child(6) { animation-delay: 0.3s; }
.stagger.active > *:nth-child(7) { animation-delay: 0.35s; }
.stagger.active > *:nth-child(8) { animation-delay: 0.4s; }
.stagger.active > *:nth-child(9) { animation-delay: 0.45s; }
.stagger.active > *:nth-child(10) { animation-delay: 0.5s; }
.stagger.active > *:nth-child(11) { animation-delay: 0.55s; }
.stagger.active > *:nth-child(12) { animation-delay: 0.6s; }

@keyframes staggerFadeUp {
    to { opacity: 1; transform: translateY(0); }
}


/* Video play button overlay for placeholder sections */
.video-placeholder {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #581c87 100%);
}
.video-placeholder::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.video-placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    border-left: 24px solid #1e3a8a;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    z-index: 1;
}
.video-placeholder:hover::after {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
}

/* --- Modern Card Styles --- */
.modern-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.modern-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Glass card */
.glass-card {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 1rem;
}

/* Dark glass card */
.glass-card-dark {
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
}

/* --- Gradient Accents --- */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-text-warm {
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-border {
    position: relative;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* --- Animated Background Elements --- */
.bg-grid {
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}
.bg-dots {
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Floating orbs for hero backgrounds */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatOrb 20s ease-in-out infinite;
}
.floating-orb:nth-child(2) { animation-delay: -7s; animation-duration: 25s; }
.floating-orb:nth-child(3) { animation-delay: -14s; animation-duration: 30s; }

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -50px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* --- Modern Button Styles --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    font-weight: 700;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: white;
    color: #374151;
    font-weight: 700;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-secondary:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

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

/* --- Feature Icon Modern --- */
.feature-icon-modern {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.875rem;
    font-size: 1.5rem;
    position: relative;
}
.feature-icon-modern::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 1rem;
    background: inherit;
    opacity: 0.15;
    z-index: -1;
}

/* --- Section Dividers --- */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.2) 50%, transparent 100%);
}

/* --- Marquee for logos/partners --- */
.marquee-track {
    display: flex;
    gap: 3rem;
    animation: marquee 30s linear infinite;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Screenshot/Image Frame --- */
.screenshot-frame {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
}
.screenshot-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.03) 0%, transparent 100%);
    z-index: 1;
}

/* --- Pulse Animation for CTAs --- */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 4px 32px rgba(79, 70, 229, 0.5); }
}
.pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* --- Smooth scroll --- */
html {
    scroll-behavior: smooth;
}

/* --- Mobile menu animation --- */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu.open {
    transform: translateX(0);
}
