/* ===== Hero Section ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes textShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes floatX {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.hero {
    position: relative;
    min-height: 70vh;
    min-height: 70dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: white;
    isolation: isolate;
    margin: 0;
    box-sizing: border-box;
    padding: calc(var(--header-height) + 2rem) 0 4rem 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 20%),
        linear-gradient(-45deg, #0f172a, #1e1b4b, #1e293b, #1e1b4b);
    background-size: 400% 400%;
    animation: gradientBG 18s ease infinite;
    
    /* Optimize for animation performance */
    will-change: transform, opacity, background-position;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Smooth scroll behavior */
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    scroll-padding-top: var(--header-height);
    
    /* Performance optimizations */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 30%),
        url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.05)" /></svg>') center/20px 20px;
    opacity: 0.8;
    z-index: -1;
    animation: float 10s ease-in-out infinite;
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 1100px;
    width: 90%;
    margin: 2rem auto;
    padding: 3rem 2rem;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
    will-change: transform, opacity;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-badge {
    display: inline-block;
    background: var(--gradient);
    color: white;
    pointer-events: none; /* Disable hover effects */
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s var(--ease-out-quint) 0.5s forwards;
    animation-delay: 0.5s;
    box-shadow: 0 4px 20px -5px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    will-change: transform, opacity, box-shadow;
}

.hero-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.5);
    animation: pulse 2s infinite ease-in-out;
}

.hero-badge.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.1rem 2.5rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    box-shadow: 0 4px 15px -5px rgba(0, 0, 0, 0.2);
    will-change: transform, box-shadow;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px -5px rgba(99, 102, 241, 0.4);
    transform: translateY(0);
    will-change: transform, box-shadow;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #9f7aea 0%, #818cf8 100%);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px -3px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 7px 20px -5px rgba(0, 0, 0, 0.2);
}

.btn-outline:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px -3px rgba(0, 0, 0, 0.1);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:active::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(50, 50);
        opacity: 0;
    }
}

.hero .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px -5px rgba(0, 0, 0, 0.3);
}

.hero .btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px -3px rgba(0, 0, 0, 0.2);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.hero-badge:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px -5px rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.hero-badge i {
    color: #818cf8;
}

@keyframes statPulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 5rem;
    flex-wrap: wrap;
    margin: 4rem auto 0;
    max-width: 1200px;
    padding: 0 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-out-quint) 1.5s forwards;
}

.stat-item {
    text-align: center;
    padding: 2rem 3rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s var(--ease-out-quint);
    transform: translateY(0);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-out-quint) forwards;
    will-change: transform, opacity, box-shadow;
    min-width: 220px;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-item:hover .stat-icon {
    transform: scale(1.1) translateY(-5px);
    animation: none;
}

/* Stat icon styling */
.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}

.stat-icon i {
    color: #8b5cf6;
    font-size: 3rem;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes countUp {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, #8b5cf6, #6366f1, #8b5cf6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: inline-block;
    min-width: 100px;
    animation: countUp 1s ease-out forwards;
    will-change: background-position, opacity;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: all 0.3s var(--ease-out-quint);
}

.stat-item:hover .stat-label::after {
    opacity: 1;
    width: 60px;
}

/* Scroll Indicator */
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.hero-scroll:hover {
    color: white;
    transform: translate(-50%, -5px);
}

.hero-scroll::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: var(--gradient);
    margin-top: 1rem;
    animation: scrollIndicator 2s infinite;
    transition: all 0.3s ease;
}

.hero-scroll:hover::after {
    height: 50px;
    animation-duration: 1.5s;
}

@keyframes scrollIndicator {
    0% { transform: translateY(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}
/* Animation for scroll indicator */
@keyframes scrollPulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* 3D Elements */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-3d-element {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    z-index: -1;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: float 8s ease-in-out infinite;
    will-change: transform, opacity;
    pointer-events: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    perspective: 1000px;
    -webkit-perspective: 1000px;
    -webkit-font-smoothing: subpixel-antialiased;
}

.hero-3d-element:nth-child(odd) {
    animation-delay: 0.5s;
}

.hero-3d-element:hover {
    opacity: 0.25;
    transform: scale(1.1);
}

/* Fade in 3D elements when they come into view */
.hero-3d-element.visible {
    opacity: 0.6;
}

.hero-3d-element:nth-child(1) {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    top: 20%;
    left: 10%;
    animation-duration: 12s;
    animation-name: floatX;
    animation-delay: 0.5s;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-3d-element:nth-child(2) {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    bottom: 15%;
    right: 10%;
    animation-duration: 15s;
    animation-name: floatY;
    animation-delay: 0.5s;
    opacity: 0;
    transition: opacity 1s ease-in-out 0.3s;
}

.hero-3d-element:nth-child(3) {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    top: 60%;
    left: 20%;
    animation-duration: 10s;
    animation-name: float;
    animation-delay: 1s;
    opacity: 0;
    transition: opacity 1s ease-in-out 0.6s;
}

/* Add a subtle glow effect on hover */
.hero-3d-element:hover {
    filter: blur(30px) brightness(1.2);
    opacity: 0.8 !important;
    transform: scale(1.1);
}

/* Responsive adjustments for 3D elements */
@media (max-width: 1024px) {
    .hero-3d-element:nth-child(1) {
        width: 250px;
        height: 250px;
        left: 5%;
    }
    
    .hero-3d-element:nth-child(2) {
        width: 150px;
        height: 150px;
        right: 5%;
    }
    
    .hero-3d-element:nth-child(3) {
        width: 120px;
        height: 120px;
        left: 10%;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
        background-size: 200% auto;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-3d-element {
        filter: blur(40px);
    }
    
    .hero-3d-element:nth-child(1) {
        width: 200px;
        height: 200px;
        top: 10%;
        left: 5%;
    }
    
    .hero-3d-element:nth-child(2) {
        width: 250px;
        height: 250px;
        bottom: 10%;
        right: 5%;
    }
    
    .hero-3d-element:nth-child(3) {
        width: 150px;
        height: 150px;
        top: 70%;
        left: 10%;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-item {
        padding: 1.5rem 2rem;
        min-width: 180px;
    }
    
    .stat-icon {
        font-size: 2.5rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* Smooth scroll behavior is handled in style.css */

/* Ensure hero content is above 3D elements */
.hero-content {
    position: relative;
    z-index: 2;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-3d-element {
        display: none;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        gap: 2.5rem;
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-item {
        padding: 1.25rem 1.5rem;
        min-width: 150px;
    }
    
    .stat-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
}
