:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --neon-cyan: #00f3ff;
    --neon-pink: #ff00ff;
    --neon-purple: #bc13fe;
    --matrix-green: #0aff0a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-color: #333;

    --font-header: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- CRT / Scanline Effects --- */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
    opacity: 0.6;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    opacity: 0.03;
    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");
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.logo {
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}


.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 8px var(--neon-pink);
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
}

.hero-content {
    max-width: 600px;
    z-index: 10;
}

h1.glitch {
    font-size: 5rem;
    font-weight: 900;
    position: relative;
    color: white;
    text-shadow: 2px 2px var(--neon-purple), -2px -2px var(--neon-cyan);
}

.hero-sub {
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    margin-bottom: 2rem;
    font-size: 1rem;
    letter-spacing: 1px;
}

/* --- Cyber Button --- */
.cyber-btn {
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    font-family: var(--font-header);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    color: var(--bg-color);
    background: var(--neon-cyan);
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.2s;
}

.cyber-btn:hover {
    background: var(--neon-pink);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--neon-purple);
}

/* --- Projects Section --- */
#work {
    padding: 5rem 10%;
    min-height: 100vh;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    border-left: 5px solid var(--neon-pink);
    padding-left: 20px;
}

/* --- Hero Animation (Cyber Circle) --- */
.cyber-circle {
    width: 300px;
    height: 300px;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 20px var(--neon-cyan);
    animation: pulse 4s infinite ease-in-out;
}

.cyber-circle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px dashed var(--neon-pink);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.cyber-circle::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid var(--neon-purple);
    border-radius: 50%;
    animation: spin-reverse 7s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--neon-cyan);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px var(--neon-cyan), 0 0 10px var(--neon-pink);
    }
}

/* --- Projects Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.project-card:hover::before {
    transform: translateX(100%);
}

.project-title {
    font-size: 1.5rem;
    color: var(--neon-pink);
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tech-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    padding: 2px 8px;
    border-radius: 2px;
}

.project-links a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-right: 1rem;
    border-bottom: 1px solid var(--neon-purple);
    transition: color 0.2s;
}

.project-links a:hover {
    color: var(--neon-purple);
}

/* --- About Section --- */
#about {
    padding: 5rem 10%;
    background: linear-gradient(180deg, var(--bg-color) 0%, #0d0d0d 100%);
}

.about-content {
    max-width: 800px;
    font-size: 1.1rem;
    color: #ccc;
}

.about-content p {
    margin-bottom: 1.5rem;
}

.about-content strong {
    color: var(--neon-cyan);
}

.skill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skill-cloud span {
    border: 1px solid var(--neon-purple);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--neon-purple);
    transition: all 0.3s;
}

.skill-cloud span:hover {
    background: var(--neon-purple);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--neon-purple);
}

/* --- Contact Section --- */
#contact {
    padding: 5rem 10%;
    text-align: center;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.contact-box p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
}

.social-links {
    margin-top: 3rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-header);
    font-size: 1.2rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.social-links a:hover {
    color: var(--neon-cyan);
    border-bottom: 2px solid var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* --- Mobile Optimization (Corrected) --- */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        /* Strict limit */
    }

    /* Navbar */
    .navbar {
        flex-direction: column;
        padding: 1rem;
        background: rgba(5, 5, 5, 0.95);
    }

    .nav-links {
        margin-top: 1rem;
        gap: 1rem;
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Hero */
    #hero {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: 140px;
        overflow: hidden;
    }

    .hero-content {
        margin-bottom: 3rem;
        width: 100%;
        padding: 0 1rem;
    }

    h1.glitch {
        font-size: clamp(1.8rem, 8vw, 3rem);
        /* Fluid font size */
        word-break: break-word;
        line-height: 1.2;
    }

    .hero-sub {
        font-size: 0.8rem;
        padding: 0 1rem;
    }

    .cyber-circle {
        width: clamp(150px, 50vw, 250px);
        /* Fluid size */
        height: clamp(150px, 50vw, 250px);
        margin: 0 auto;
    }

    /* Projects */
    #work {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: clamp(1.2rem, 6vw, 2rem);
        /* Fluid font size */
        border-left: 3px solid var(--neon-pink);
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
        /* Extra safety */
    }

    /* About & Contact */
    #about,
    #contact {
        padding: 3rem 1rem;
        padding-bottom: 5rem;
    }

    .skill-cloud {
        justify-content: center;
    }
}