/* Hero Section */
.hero {
    position: relative;
    z-index: 1; /* Lowest layer */
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #0d0d0d 100%);
    padding: 40px 0;
    transform: translateZ(0); /* Create stacking context */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255, 38, 62, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 38, 62, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(255, 100, 120, 0.08) 0%, transparent 40%);
    animation: backgroundPulse 8s ease-in-out infinite;
    transition: all 0.3s ease;
}

.floating-shapes {
    display: none; /* Remove all floating shapes */
}

/* Enhanced particle effect - optimized for performance */
.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 31px 17px, rgba(0, 0, 0, 0.8), transparent),
        radial-gradient(2px 2px at 89px 71px, rgba(255, 100, 120, 0.6), transparent),
        radial-gradient(1px 1px at 156px 23px, rgba(255, 38, 62, 0.7), transparent),
        radial-gradient(3px 3px at 203px 89px, rgba(255, 100, 120, 0.5), transparent),
        radial-gradient(1px 1px at 67px 134px, rgba(255, 38, 62, 0.9), transparent),
        radial-gradient(2px 2px at 178px 156px, rgba(255, 100, 120, 0.4), transparent),
        radial-gradient(1px 1px at 45px 201px, rgba(255, 38, 62, 0.6), transparent),
        radial-gradient(2px 2px at 234px 67px, rgba(255, 100, 120, 0.7), transparent);
    background-repeat: repeat;
    background-size: 280px 220px;
    animation: sparkleOptimized 25s linear infinite;
    opacity: 0.6;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes floatOptimized {
    0% {
        transform: translate3d(0px, 0px, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(-15px, -25px, 0) rotate(87deg);
    }
    50% {
        transform: translate3d(12px, -8px, 0) rotate(178deg);
    }
    75% {
        transform: translate3d(-8px, -32px, 0) rotate(267deg);
    }
    100% {
        transform: translate3d(0px, 0px, 0) rotate(360deg);
    }
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes sparkleOptimized {
    0% {
        transform: translate3d(0px, 0px, 0) scale(1);
    }
    100% {
        transform: translate3d(-280px, 0px, 0) scale(1);
    }
}

/* Remove the reactive background animations for better performance */
.hero-background.reactive,
.floating-shapes.reactive .shape,
.floating-shapes.reactive::before,
.floating-shapes.reactive::after {
    /* Remove all reactive animations to improve performance */
}

@keyframes backgroundReact {
    /* Keep empty to disable */
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--color-white);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    overflow: visible;
    letter-spacing: 0.1em;
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.8s ease forwards;
    overflow: visible;
    white-space: nowrap;
}

.title-line:nth-child(1) {
    animation-delay: 0.2s;
}

.title-line:nth-child(2) {
    animation-delay: 0.4s;
}

.animated-breaks {
    display: inline-flex;
    align-items: baseline;
    background: linear-gradient(45deg, #ff1744, #ff6b7a, #ff1744);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    cursor: pointer;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    overflow: visible;
    white-space: nowrap;
    vertical-align: baseline;
    line-height: inherit;
}

.animated-breaks .chaotic-char {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    background: linear-gradient(45deg, #ff1744, #ff6b7a, #ff1744);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    vertical-align: baseline;
    line-height: inherit;
    text-align: center;
    overflow: visible;
    transform-origin: center center;
    will-change: transform;
    box-sizing: border-box;
    width: 0.8em;
    height: auto;
    flex-shrink: 0;
    transition: transform 0.5s ease-out, color 0.4s ease-out, text-shadow 0.4s ease-out, filter 0.5s ease-out;
    animation: idleBreaksGlow 4s ease-in-out infinite;
}

.animated-breaks .chaotic-char:nth-child(1) {
    animation-delay: 0s;
}

.animated-breaks .chaotic-char:nth-child(2) {
    animation-delay: 0.3s;
}

.animated-breaks .chaotic-char:nth-child(3) {
    animation-delay: 0.6s;
}

.animated-breaks .chaotic-char:nth-child(4) {
    animation-delay: 0.9s;
}

.animated-breaks .chaotic-char:nth-child(5) {
    animation-delay: 1.2s;
}

.animated-breaks .chaotic-char:nth-child(6) {
    animation-delay: 1.5s;
}

.animated-breaks .chaotic-char.idle-active {
    animation: idleBreaksGlow 4s ease-in-out infinite, idleFloat 6s ease-in-out infinite;
}

.animated-breaks .chaotic-char.idle-glitch {
    animation: idleBreaksGlow 4s ease-in-out infinite, idleGlitchPulse 8s ease-in-out infinite;
}

.animated-breaks:hover .chaotic-char {
    transition: transform 0.3s ease, color 0.3s ease;
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scaleX(0.8);
    }

    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes glitchPulse {
    0%,
    100% {
        filter: brightness(2) contrast(1.5) saturate(1.5);
        transform: translateY(0) scale(1) rotate(0deg);
    }

    25% {
        filter: brightness(3) contrast(2) hue-rotate(90deg) saturate(2);
        transform: translateY(-2px) scale(1.1) rotate(-2deg);
    }

    50% {
        filter: brightness(3.5) contrast(2.5) hue-rotate(180deg) saturate(2.5);
        transform: translateY(2px) scale(1.15) rotate(2deg);
    }

    75% {
        filter: brightness(3) contrast(2) hue-rotate(270deg) saturate(2);
        transform: translateY(-1px) scale(1.05) rotate(-1deg);
    }
}

@keyframes intensitySpike {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(2.5) saturate(2);
    }

    30% {
        transform: translateY(-4px) scale(1.3) rotate(8deg);
        filter: brightness(4) saturate(3) drop-shadow(0 0 12px #ff1744) drop-shadow(0 0 20px #ff6b7a);
    }

    60% {
        transform: translateY(2px) scale(1.2) rotate(-5deg);
        filter: brightness(3.5) saturate(2.5) drop-shadow(0 0 8px #ff1744);
    }

    100% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(2.5) saturate(2);
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.8s;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 1s;
    margin-bottom: 4rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.4s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button.primary {
    background: linear-gradient(45deg, var(--color-primary), #ff4757);
    color: var(--color-white);
    box-shadow: 0 8px 25px rgba(255, 38, 62, 0.3);
    border: 2px solid transparent;
}

.cta-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 38, 62, 0.4);
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

/* Hero Responsive Design */
@media (max-width: 1024px) {
    .hero {
        padding: 30px 0;
        min-height: calc(100vh - 60px);
    }

    .hero-background::after {
        background-image: 
            radial-gradient(1px 1px at 31px 17px, rgba(255, 38, 62, 0.7), transparent),
            radial-gradient(2px 2px at 89px 71px, rgba(255, 100, 120, 0.5), transparent),
            radial-gradient(1px 1px at 156px 23px, rgba(255, 38, 62, 0.6), transparent),
            radial-gradient(2px 2px at 203px 89px, rgba(255, 100, 120, 0.4), transparent),
            radial-gradient(1px 1px at 67px 134px, rgba(255, 38, 62, 0.8), transparent);
        background-size: 220px 180px;
        animation-duration: 20s;
        opacity: 0.5;
    }
    
    .hero-content {
        padding: 0 1.5rem;
    }

    .hero-cta {
        gap: 1.2rem;
        margin-bottom: 3.5rem;
        /* Adjusted for tablet */
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: calc(100vh - 50px);
        padding: 25px 0;
    }

    .hero-background::after {
        background-image: 
            radial-gradient(1px 1px at 31px 17px, rgba(255, 38, 62, 0.6), transparent),
            radial-gradient(1px 1px at 89px 71px, rgba(255, 100, 120, 0.4), transparent),
            radial-gradient(1px 1px at 156px 23px, rgba(255, 38, 62, 0.7), transparent),
            radial-gradient(2px 2px at 67px 134px, rgba(255, 100, 120, 0.5), transparent);
        background-size: 180px 140px;
        animation-duration: 15s;
        opacity: 0.4;
    }
    
    .hero-content {
        padding: 0 1rem;
        overflow: visible;
    }

    .hero-title {
        margin-bottom: 1.2rem;
        line-height: 1.1;
        overflow: visible;
    }

    .title-line {
        overflow: visible;
        white-space: nowrap;
    }

    .animated-breaks {
        display: inline-flex;
        align-items: baseline;
        white-space: nowrap;
        vertical-align: baseline;
        overflow: visible;
    }

    .animated-breaks .chaotic-char {
        display: inline-flex;
        align-items: baseline;
        justify-content: center;
        vertical-align: baseline;
        text-align: center;
        width: 0.7em;
        height: auto;
        line-height: inherit;
        box-sizing: border-box;
        overflow: visible;
        flex-shrink: 0;
        background: linear-gradient(45deg, #ff1744, #ff6b7a, #ff1744);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        transition: transform 0.4s ease-out, color 0.3s ease-out, text-shadow 0.3s ease-out, filter 0.4s ease-out;
    }

    .hero-subtitle {
        margin-bottom: 1.8rem;
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-bottom: 3rem;
        /* Adjusted for mobile */
    }

    .cta-button {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 0.9rem 1.8rem;
        font-size: 0.95rem;
    }

    .hero-scroll-indicator {
        bottom: 2rem;
        /* Adjusted for mobile */
    }

    .scroll-text {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    .scroll-animation {
        width: 20px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 20px 0;
        min-height: calc(100vh - 70px);
    }

    .hero-background::after {
        background-image: 
            radial-gradient(1px 1px at 31px 17px, rgba(255, 38, 62, 0.5), transparent),
            radial-gradient(1px 1px at 89px 71px, rgba(255, 100, 120, 0.3), transparent),
            radial-gradient(1px 1px at 67px 134px, rgba(255, 38, 62, 0.6), transparent);
        background-size: 120px 100px;
        animation-duration: 12s;
        opacity: 0.3;
    }
    
    .hero-content {
        padding: 0 0.5rem;
        overflow: visible;
    }

    .title-line {
        white-space: nowrap;
        overflow: visible;
    }

    .animated-breaks {
        display: inline-flex;
        align-items: baseline;
        overflow: visible;
    }

    .animated-breaks .chaotic-char {
        width: 0.6em;
        height: auto;
        font-size: inherit;
        box-sizing: border-box;
        flex-shrink: 0;
        background: linear-gradient(45deg, #ff1744, #ff6b7a, #ff1744);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        transition: transform 0.3s ease-out, color 0.25s ease-out, text-shadow 0.25s ease-out, filter 0.3s ease-out;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .cta-button {
        font-size: 0.9rem;
        padding: 0.8rem 1.6rem;
        max-width: 250px;
    }

    .hero-cta {
        margin-bottom: 2.5rem;
        /* Adjusted for small mobile */
    }

    .hero-scroll-indicator {
        bottom: 1.5rem;
        /* Adjusted for small mobile */
    }
}

/* Add smooth scroll behavior for the scroll indicator click */
.scroll-indicator[data-target] {
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes idleBreaksGlow {
    0%, 100% {
        filter: brightness(1) saturate(1);
        text-shadow: 0 0 5px rgba(255, 23, 68, 0.3);
    }
    25% {
        filter: brightness(1.2) saturate(1.3);
        text-shadow: 0 0 8px rgba(255, 23, 68, 0.5), 0 0 12px rgba(255, 107, 122, 0.3);
    }
    50% {
        filter: brightness(1.4) saturate(1.5);
        text-shadow: 0 0 10px rgba(255, 23, 68, 0.7), 0 0 15px rgba(255, 107, 122, 0.4);
    }
    75% {
        filter: brightness(1.2) saturate(1.3);
        text-shadow: 0 0 8px rgba(255, 23, 68, 0.5), 0 0 12px rgba(255, 107, 122, 0.3);
    }
}

@keyframes idleFloat {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    33% {
        transform: translateY(-2px) scale(1.02) rotate(1deg);
    }
    66% {
        transform: translateY(1px) scale(0.98) rotate(-0.5deg);
    }
}

@keyframes idleGlitchPulse {
    0%, 85%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        filter: brightness(1) saturate(1);
    }
    87% {
        transform: translateY(-1px) scale(1.05) rotate(2deg);
        filter: brightness(1.8) saturate(2) hue-rotate(30deg);
    }
    89% {
        transform: translateY(1px) scale(0.95) rotate(-1deg);
        filter: brightness(2.2) saturate(2.5) hue-rotate(-20deg);
    }
    91% {
        transform: translateY(0) scale(1.02) rotate(0.5deg);
        filter: brightness(1.5) saturate(1.8);
    }
}