/* Hero Section Styles */
.hero {
    padding: 18rem 0 10rem;
    position: relative;
    overflow: hidden;
    background: 
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.1), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.1), transparent 40%),
        radial-gradient(circle at 60% 20%, rgba(16, 185, 129, 0.05), transparent 30%),
        linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    position: relative;
    perspective: 1000px;
}

/* Morphing Blob */
.blob-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
    opacity: 0.5;
    mix-blend-mode: soft-light;
}

.blob {
    position: absolute;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(124, 58, 237, 0.3));
    border-radius: 50%;
    animation: blobAnimation 20s infinite ease-in-out;
    transform-origin: center center;
}

.blob:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob:nth-child(2) {
    width: 300px;
    height: 300px;
    top: 50%;
    right: -50px;
    animation-delay: -5s;
}

@keyframes blobAnimation {
    0%, 100% {
        border-radius: 50%;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        border-radius: 65% 35% 45% 55%;
        transform: translate(50px, 30px) scale(1.1) rotate(90deg);
    }
    50% {
        border-radius: 35% 65% 55% 45%;
        transform: translate(0, 50px) scale(0.9) rotate(180deg);
    }
    75% {
        border-radius: 45% 55% 35% 65%;
        transform: translate(-30px, 20px) scale(1.05) rotate(270deg);
    }
}

/* Grain Texture Overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Geometric Patterns */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h100v100H0z' fill='none'/%3E%3Cpath d='M20 20h2v2h-2zM40 20h2v2h-2zM60 20h2v2h-2zM80 20h2v2h-2zM20 40h2v2h-2zM40 40h2v2h-2zM60 40h2v2h-2zM80 40h2v2h-2zM20 60h2v2h-2zM40 60h2v2h-2zM60 60h2v2h-2zM80 60h2v2h-2zM20 80h2v2h-2zM40 80h2v2h-2zM60 80h2v2h-2zM80 80h2v2h-2z' fill='currentColor' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

/* Floating Elements Animation */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    perspective: 1000px;
    transform-style: preserve-3d;
    z-index: 2;
}

.floating-element {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
    transform-origin: center center;
}

.floating-element:nth-child(1) {
    background: var(--color-primary);
    top: 10%;
    right: 30%;
    animation: float1 8s ease-in-out infinite;
    width: 400px;
    height: 400px;
}

.floating-element:nth-child(2) {
    background: var(--color-secondary);
    top: 50%;
    left: 20%;
    animation: float2 12s ease-in-out infinite;
    width: 350px;
    height: 350px;
}

.floating-element:nth-child(3) {
    background: var(--gradient-accent);
    bottom: 20%;
    right: 40%;
    animation: float3 10s ease-in-out infinite;
    width: 250px;
    height: 250px;
}

@keyframes float1 {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(20px, 20px, 50px) rotate(5deg);
    }
    50% {
        transform: translate3d(0, 40px, 100px) rotate(10deg);
    }
    75% {
        transform: translate3d(-20px, 20px, 50px) rotate(5deg);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(-30px, 30px, -50px) rotate(-5deg);
    }
    50% {
        transform: translate3d(0, 60px, -100px) rotate(-10deg);
    }
    75% {
        transform: translate3d(30px, 30px, -50px) rotate(-5deg);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(25px, -25px, 25px) rotate(3deg);
    }
    50% {
        transform: translate3d(0, -50px, 50px) rotate(6deg);
    }
    75% {
        transform: translate3d(-25px, -25px, 25px) rotate(3deg);
    }
}

/* Hero Content */
.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 60rem;
}

.hero-title {
    font-size: 6.4rem;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-title span {
    display: inline-block;
    position: relative;
    color: var(--color-primary);
}

.hero-title span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: var(--gradient-accent);
    opacity: 0.2;
    z-index: -1;
    transform: skewX(-15deg);
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--color-text);
    opacity: 0.8;
    margin-bottom: 4rem;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 2rem;
    margin-bottom: 6rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 6rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-number {
    font-family: var(--font-secondary);
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    font-size: 1.4rem;
    color: var(--color-text);
    opacity: 0.7;
}

/* Hero Image */
.hero-image {
    position: relative;
    width: 100%;
    padding-bottom: 45%;
}

.hero-image picture, .hero-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: heroImage 5s ease-in-out infinite;
    transition: transform 0.2s ease-out;
    will-change: transform;
}

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    backdrop-filter: invert(1);
    mix-blend-mode: difference;
    transition: width 0.2s, height 0.2s;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
}

/* Dynamic Grain */
.grain-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grainAnimation 0.5s steps(1) infinite;
}

@keyframes grainAnimation {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-2%, 2%); }
    40% { transform: translate(2%, -2%); }
    50% { transform: translate(-1%, 1%); }
    60% { transform: translate(1%, -1%); }
    70% { transform: translate(-2%, -2%); }
    80% { transform: translate(2%, 2%); }
    90% { transform: translate(-1%, 2%); }
}

@keyframes heroImage {
    0%, 100% {
        transform: translateY(0) scale(1.05);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

.hero-image-overlay {
    display: none;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .hero {
        padding: 16rem 0 8rem;
    }

    .hero-title {
        font-size: 5.6rem;
    }

    .hero-stats {
        gap: 4rem;
    }
}

@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-image {
        grid-row: 1;
        padding-bottom: 60%;
    }

    .hero-image picture, .hero-image img {
        transform: scale(1);
    }

    @keyframes heroImage {
        0%, 100% {
            transform: translateY(0) scale(1);
        }
        50% {
            transform: translateY(-8px) scale(1);
        }
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 12rem 0 6rem;
    }

    .hero-title {
        font-size: 4.2rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-stats {
        gap: 3rem;
    }

    .stat-number {
        font-size: 3.2rem;
    }
}
