/* Hero Section - Mobile First Approach */
.hero-section {
    position: relative;
    width: 100%;
    min-height: auto;
    /* Natural height by default */
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: space-between;
    /* Spread items */
    padding: 80px 4% 40px;
    /* Balanced padding */
    flex-direction: row-reverse;
    /* Text Left, Image Right (since image is 1st in DOM) */
    text-align: left;
    overflow: hidden;
    background-color: transparent;
    transition: background-color 0.5s ease;
}

/* =========================================
   Cinematic Entrance Animations
   ========================================= */
@keyframes heroFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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


/* Vignette for darker corners */
.hero-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Extremely strong vignette for purely black corners */
    background: radial-gradient(circle at center, transparent 15%, rgba(0, 0, 0, 0.98) 100%);
    pointer-events: none;
    z-index: 2;
    /* Between background/blobs and content */
}

[data-theme="light"] .hero-vignette {
    /* Visible corner darkening in light mode */
    background: radial-gradient(circle at center, transparent 20%, rgba(0, 0, 0, 0.15) 100%);
}

/* Animated Dust Particles - Front Layer */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    /* Behind text (10) and image (5), but above vignette (2) */
    overflow: hidden;
    pointer-events: none;
}

#hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* CSS pseudo-particles removed in favor of dynamic Canvas particles */

/* Concentrated Purple Center Glow - Reference Style */
.hero-glow {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    bottom: -10%;
    right: 5%;
    transform: translate(0, 0);
    background: radial-gradient(circle, #7B3FF2 0%, #5928C5 30%, transparent 70%);
    filter: blur(120px);
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
}

/* Remove side blobs for cleaner reference look */
.hero-section::before,
.hero-section::after {
    display: none;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 30px) scale(1.1);
    }
}

@keyframes orbPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Hero Image Styling */
.hero-image-wrap {
    position: relative;
    /* In flow for flex layout */
    width: 42%;
    /* Mobile width */
    max-width: 350px;
    right: auto;
    bottom: auto;
    z-index: 5;
    pointer-events: none;
    animation: floatImage 6s infinite ease-in-out;
    margin-right: -20px;
    /* Allow slight overflow to right */
    opacity: 0;
    /* Start invisible for entrance */
    animation: heroFadeIn 0.6s ease-out 0.05s forwards, floatImage 6s infinite ease-in-out 0.65s;
    /* Entrance then Float */
}

.hero-char-img {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 3;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.5));
    /* Fade is now baked into the image file - no CSS mask needed */
}

/* Ground Shadow */
.hero-char-shadow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
    filter: blur(20px);
    z-index: 1;
}

/* Bottom Fog Effect - Enhanced */
.hero-char-fog {
    position: absolute;
    bottom: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 130%;
    height: 250px;
    background:
        radial-gradient(ellipse at center, rgba(123, 63, 242, 0.5) 0%, rgba(89, 40, 197, 0.3) 30%, rgba(147, 51, 234, 0.2) 50%, transparent 80%),
        radial-gradient(ellipse at 30% 80%, rgba(168, 85, 247, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.25) 0%, transparent 60%);
    filter: blur(50px);
    z-index: 2;
    animation: fogPulse 6s infinite ease-in-out;
}

@keyframes fogPulse {

    0%,
    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.03);
    }
}

/* Smoke/Mist Effect - Enhanced */
.hero-char-smoke {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 180px;
    background:
        radial-gradient(ellipse at 25% 100%, rgba(255, 255, 255, 0.12) 0%, rgba(168, 85, 247, 0.1) 30%, transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.1) 0%, rgba(139, 92, 246, 0.08) 30%, transparent 60%),
        radial-gradient(ellipse at 75% 100%, rgba(255, 255, 255, 0.11) 0%, rgba(147, 51, 234, 0.09) 30%, transparent 60%);
    filter: blur(30px);
    z-index: 4;
    animation: smokeRise 10s infinite ease-in-out;
}

@keyframes smokeRise {
    0% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateX(-50%) translateY(-30px) scale(1.05);
        opacity: 0.3;
    }

    100% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 0.6;
    }
}

@keyframes floatImage {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Hero Content Styling - Mobile First */
.hero-container {
    position: relative;
    z-index: 10;
    width: 58%;
    /* Conserve space for text */
    max-width: 800px;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-right: 10px;
}

.hero-label {
    display: block;
    font-family: var(--font-heading);
    color: #e9565e;
    font-weight: 600;
    letter-spacing: 3px;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 1.1;
    font-weight: 800;
    color: #ffffff;
    /* Bright text for dark background */
    margin-bottom: 2rem;
    letter-spacing: -2px;
    opacity: 0;
    animation: heroSlideUp 0.6s ease-out 0.1s forwards;
}

.title-gradient {
    background: linear-gradient(135deg, #6B21A8, #8B5CF6, #7B3FF2, #6B21A8);
    /* Darker purple gradient loop */
    background-size: 300% 300%;
    /* Enlarged for movement */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    white-space: nowrap;
    animation: gradientFlow 8s ease infinite;
    /* Forces single line in PC view */
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 991px) {
    .title-gradient {
        white-space: normal;
        /* Allow wrapping on small screens */
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 3.5rem;
    font-weight: 400;
    opacity: 0;
    animation: heroSlideUp 0.6s ease-out 0.2s forwards;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    opacity: 0;
    animation: heroSlideUp 0.6s ease-out 0.3s forwards;
}

/* Desktop Styles (992px and above) */
@media (min-width: 992px) {
    .hero-section {
        min-height: 80vh;
        /* Minimum height for impact */
        height: auto;
        /* Allow growth if content needs it */
        max-height: 950px;
        /* Prevent it from being too huge */
        align-items: center;
        justify-content: flex-start;
        padding: 80px 8% 40px;
        /* Standard padding */
        flex-direction: row;
        /* Standard row, not reverse */
        text-align: left;
    }

    .hero-container {
        max-width: clamp(550px, 50vw, 850px);
        /* Fluid container width */
        margin: 0;
        /* Left align on desktop */
        text-align: left;
        align-items: flex-start;
    }

    .hero-subtitle {
        margin-left: 0;
        margin-bottom: 2rem;
        text-align: left;
    }

    .hero-btns {
        justify-content: flex-start;
    }

    .hero-label {
        margin-bottom: 1rem;
    }

    .hero-title {
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        margin-bottom: 2rem;
    }

    .hero-image-wrap {
        position: absolute;
        /* Restore absolute positioning for PC */
        right: 18%;
        /* Repositioned towards middle */
        bottom: 15%;
        /* Repositioned higher (little top) */
        top: auto;
        transform: none;
        width: clamp(900px, 90vw, 1500px);
        /* Increased size even more */
        max-height: none;
        z-index: 5;
        pointer-events: none;
        animation: heroFadeIn 1s ease-out 0.2s forwards, floatImage 6s infinite ease-in-out 1s;
    }
}

/* Mobile Fine-tuning (below 992px) - Stacked Responsive Layout */
@media (max-width: 991px) {
    .hero-section {
        flex-direction: column-reverse;
        /* Text Top, Image Bottom (if image is 1st in DOM, this might need swapping) */
        /* Let's assume standard stack: Content Top, Image Bottom or vice versa. 
           If Image is DOM 1st: column-reverse => DOM 2 (Text) Top, DOM 1 (Image) Bottom. 
           This is a safe standard mobile layout. */
        padding: 100px 20px 60px;
        justify-content: center;
        align-items: center;
        min-height: auto;
        overflow: hidden;
        gap: 40px;
        /* Space between text and image */
    }

    .hero-container {
        width: 100%;
        max-width: 600px;
        text-align: center;
        align-items: center;
        padding: 0;
        margin: 0;
        z-index: 10;
        /* Ensure text is above if overlaps occur, but we are stacking now */
    }

    .hero-label {
        margin: 0 auto 1rem;
        font-size: 0.85rem;
    }

    .hero-title {
        font-size: clamp(3rem, 10vw, 4.5rem);
        line-height: 1.1;
        margin-bottom: 1.5rem;
        position: relative;
        opacity: 1;
        /* Remove the giant margin hack */
    }

    .title-gradient {
        white-space: normal;
        display: block;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin: 0 auto 2rem;
        max-width: 100%;
        text-shadow: none;
        background: none;
        padding: 0;
    }

    .hero-btns {
        justify-content: center;
        width: 100%;
        gap: 1rem;
        padding-bottom: 0;
    }

    /* Resurrect standard image stacking */
    .hero-image-wrap {
        position: relative;
        width: 100%;
        max-width: 450px;
        /* Reasonable mobile size */
        z-index: 5;
        animation: heroFadeIn 1s ease-out 0.2s forwards, floatImage 6s infinite ease-in-out 1s;
    }

    .hero-glow {
        position: absolute;
        width: 100%;
        max-width: 600px;
        height: 600px;
        top: 20%;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0.4;
        background: radial-gradient(circle at center, #7B3FF2 0%, transparent 70%);
        z-index: 0;
    }
}

/* Landscape Mobile & Small Tablets */
@media (max-width: 991px) and (max-height: 550px) {
    .hero-section {
        min-height: 120vh;
        /* Allow scrolling in landscape */
        padding-top: 20px;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 120px;
    }

    .hero-image-wrap {
        top: 60px;
        width: 40%;
        max-width: 250px;
    }

    .hero-subtitle {
        margin-bottom: 1rem;
    }
}

/* Ultra-large screens */
@media (min-width: 1800px) {
    .hero-container {
        max-width: 1100px;
    }

    .hero-title {
        font-size: 6rem;
    }
}

/* Bright Uniform Grid - Reference Style */
.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 60px 60px;
    /* Remove fade - uniform grid */
    mask-image: none;
    -webkit-mask-image: none;
    pointer-events: none;
    z-index: 2;
}

.hero-dust {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

/* Dark Mode Overrides */
[data-theme="light"] .hero-section {
    background-color: #ffffff;
}

[data-theme="light"] .hero-title {
    color: #111111;
}

[data-theme="light"] .hero-subtitle {
    color: #444;
    text-shadow: none;
    background: transparent;
}

[data-theme="light"] .hero-section::before,
[data-theme="light"] .hero-section::after,
[data-theme="light"] .hero-glow {
    opacity: 0.18;
}

[data-theme="dark"] .hero-section {
    background-color: #000000;
}

[data-theme="dark"] .hero-title {
    color: #ffffff;
}

[data-theme="dark"] .hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .hero-section::before,
[data-theme="dark"] .hero-section::after,
[data-theme="dark"] .hero-glow {
    opacity: 0.5;
    /* Full visibility for the mesh orbs */
}

[data-theme="dark"] .hero-grid {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
}

[data-theme="light"] .hero-grid {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 1px, transparent 1px);
}