/* --- Hero Section --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 0 8%;
    padding-top: 80px;
    gap: 20px;
}

/* Fix for particles interacting with flexbox */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.hero-text {
    flex: 1;
}

.hero-text h3 {
    color: var(--primary);
    font-size: 1.2rem;
    min-height: 1.6em;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 5px var(--primary), 0 0 20px var(--primary);
    position: relative;
}

.hero-text h1::before,
.hero-text h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.hero-text h1::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.hero-text h1::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    5% {
        clip: rect(70px, 9999px, 90px, 0);
    }

    10% {
        clip: rect(40px, 9999px, 60px, 0);
    }

    15% {
        clip: rect(20px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(90px, 9999px, 10px, 0);
    }

    25% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    30% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    35% {
        clip: rect(30px, 9999px, 60px, 0);
    }

    40% {
        clip: rect(80px, 9999px, 20px, 0);
    }

    45% {
        clip: rect(60px, 9999px, 40px, 0);
    }

    50% {
        clip: rect(10px, 9999px, 100px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 70px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(60px, 9999px, 30px, 0);
    }

    5% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    10% {
        clip: rect(90px, 9999px, 20px, 0);
    }

    15% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    20% {
        clip: rect(50px, 9999px, 60px, 0);
    }

    25% {
        clip: rect(20px, 9999px, 90px, 0);
    }

    30% {
        clip: rect(80px, 9999px, 30px, 0);
    }

    35% {
        clip: rect(40px, 9999px, 50px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    45% {
        clip: rect(70px, 9999px, 20px, 0);
    }

    50% {
        clip: rect(30px, 9999px, 60px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 90px, 0);
    }
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 35px;
    max-width: 600px;
}

/* --- Profile Image Container --- */
.hero-img {
    flex: 1;
    z-index: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid var(--primary);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
    animation: glow-pulse 3s infinite alternate;
}

/* --- New Double Ring Animation --- */
/* Outer Ring */
.hero-img::before {
    content: '';
    position: absolute;
    width: 390px;
    height: 390px;
    border-radius: 50%;
    border: 1px dashed var(--primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-cw 20s linear infinite;
    z-index: -1;
    opacity: 0.3;
}

/* Inner Ring */
.hero-img::after {
    content: '';
    position: absolute;
    width: 365px;
    height: 365px;
    border-radius: 50%;
    border: 2px dotted var(--primary);
    border-top-color: transparent;
    border-bottom-color: transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-ccw 10s linear infinite;
    z-index: -1;
    opacity: 0.6;
}

@keyframes rotate-cw {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotate-ccw {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

@keyframes glow-pulse {
    from {
        color: var(--primary);
        box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
    }

    to {
        box-shadow: 0 20px 60px rgba(37, 99, 235, 0.5);
    }
}

/* --- Background Particles --- */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: white;
    opacity: 0.3;
    animation: particle-color-shift 6s infinite alternate;
}

@keyframes particle-color-shift {
    0% {
        background: #ffffff;
        opacity: 0.3;
        box-shadow: 0 0 0 transparent;
    }

    50% {
        background: var(--primary);
        opacity: 0.6;
        box-shadow: 0 0 10px var(--primary);
    }

    100% {
        background: #a855f7;
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        justify-content: center;
        padding: 120px 5% 50px 5%;
        gap: 50px;
        min-height: auto;
    }

    .hero-text {
        padding-right: 0;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .hero-img {
        margin-bottom: 20px;
    }

    .hero-img img {
        width: 250px;
        height: 250px;
    }

    /* Mobile adjustments for ring */
    .hero-img::before {
        width: 270px;
        height: 270px;
    }

    .hero-img::after {
        width: 245px;
        /* Approx relative size */
        height: 245px;
    }
}