:root {
    --bg-color: #030305;
    --card-bg: rgba(10, 10, 20, 0.7);
    --primary: #e0e0e0;
    --secondary: #a0a0ff;
    --accent: #00ff9d;
    /* Neon Green */
    --accent-purple: #d500f9;
    /* Neon Purple */
    --accent-glow: rgba(0, 255, 157, 0.3);
    --border: #333;
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Space Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default;
}

/* CRT Scanline & Grain Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.95;
    }

    50% {
        opacity: 0.92;
    }

    100% {
        opacity: 0.95;
    }
}

/* Retro 3D Grid Background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(0, 255, 157, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 157, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center bottom;
    transform: perspective(500px) rotateX(60deg) scale(2);
    transform-origin: center bottom;
    z-index: -2;
    animation: moveGrid 5s linear infinite;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 60%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 60%);
}

@keyframes moveGrid {
    0% {
        background-position: center 0;
    }

    100% {
        background-position: center 40px;
    }
}

/* Cursor Glow */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(213, 0, 249, 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: -1;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 3, 5, 0.9);
    backdrop-filter: blur(5px);
    z-index: 100;
    border-bottom: 2px solid var(--border);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--accent-glow);
}

.logo .dot {
    color: var(--accent-purple);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

.external-link {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent) !important;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    box-shadow: 0 0 5px rgba(0, 255, 157, 0.2);
}

.external-link:hover {
    background: var(--accent);
    color: #000 !important;
    box-shadow: 0 0 15px var(--accent-glow);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    padding-top: 4rem;
}

.hero-content {
    max-width: 600px;
}

.greeting {
    color: var(--accent-purple);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 3px;
}

@keyframes glitch {
    0% {
        text-shadow: 2px 2px 0px var(--accent-purple), -2px -2px 0px var(--accent);
    }

    25% {
        text-shadow: -2px 2px 0px var(--accent-purple), 2px -2px 0px var(--accent);
    }

    50% {
        text-shadow: 2px -2px 0px var(--accent-purple), -2px 2px 0px var(--accent);
    }

    75% {
        text-shadow: -2px -2px 0px var(--accent-purple), 2px 2px 0px var(--accent);
    }

    100% {
        text-shadow: 2px 2px 0px var(--accent-purple), -2px -2px 0px var(--accent);
    }
}

@keyframes btn-flicker {
    0% {
        opacity: 1;
        box-shadow: 4px 4px 0px var(--accent-purple);
    }

    50% {
        opacity: 0.8;
        box-shadow: 2px 2px 0px var(--accent-purple);
    }

    100% {
        opacity: 1;
        box-shadow: 6px 6px 0px var(--accent-purple);
    }
}

.hero h1.name {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 2px 2px 0px var(--accent-purple);
    background: none;
    -webkit-text-fill-color: initial;
    animation: glitch 20s infinite alternate-reverse;
    /* Constant subtle glitch */
}

.role {
    font-size: 1.2rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
}

.bio {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 2.5rem;
    max-width: 450px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 0px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn.primary {
    background: var(--accent);
    color: #000;
    border: none;
    box-shadow: 4px 4px 0px var(--accent-purple);
}

.btn.primary:hover {
    transform: translate(-2px, -2px);
    background: #fff;
    animation: btn-flicker 0.2s infinite;
    /* Rapid flicker on hover */
}

.btn.secondary {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn.secondary:hover {
    background: rgba(0, 255, 157, 0.1);
    box-shadow: 0 0 10px var(--accent-glow);
    animation: btn-flicker 0.2s infinite;
}

/* Code Block Visual - Retro Terminal */
.code-block-decoration {
    background: #111;
    border: 2px solid var(--border);
    border-radius: 4px;
    /* Slight roundness */
    padding: 0;
    /* Header handles top padding, content handles rest */
    width: 100%;
    max-width: 480px;
    box-shadow: 15px 15px 0px rgba(0, 0, 0, 0.5);
    /* Deep shadow */
    position: relative;
    font-size: 0.95rem;
    overflow: hidden;
    /* Hide overflow from container */
    transition: transform 0.1s ease-out;
    /* Smooth tilt */
}

.code-header {
    display: flex;
    gap: 8px;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.code-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    /* Scroll horizontally if needed */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) #111;
}

/* Custom Scrollbar */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #111;
}

pre::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 0;
}

code {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #abb2bf;
    display: block;
}

.keyword {
    color: #c678dd;
    font-weight: bold;
}

.variable {
    color: #e06c75;
}

.string {
    color: #98c379;
}

.key {
    color: #d19a66;
}

/* About Section */
.about {
    padding: 6rem 10%;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px var(--accent);
}

.section-header .line {
    width: 100px;
    height: 4px;
    background: var(--accent-purple);
    border-radius: 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.about-card {
    padding: 2.5rem;
    border-radius: 0px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: var(--card-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.about-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-5px);
}

.about-card .icon {
    font-size: 2rem;
    color: var(--accent-purple);
    margin-bottom: 1.5rem;
}

.about-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.about-card p {
    color: var(--primary);
}

/* Connect Section */
.connect {
    padding: 6rem 10%;
    margin-bottom: 4rem;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.social-card {
    border-radius: 0;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s ease;
}

.social-card:hover {
    border-color: var(--accent);
    background: rgba(0, 255, 157, 0.05);
    color: var(--accent);
    transform: translate(-3px, -3px);
    box-shadow: 3px 3px 0px var(--accent-purple);
}

.social-card i {
    color: var(--accent-purple);
    font-size: 1.5rem;
}

.social-card:hover i {
    color: var(--accent);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 2px solid var(--border);
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
}

footer i {
    color: var(--accent-purple);
}

/* Animations */
.reveal-text {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.reveal-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 900px) {
    .hero {
        flex-direction: column-reverse;
        justify-content: center;
        gap: 3rem;
        padding-top: 6rem;
        text-align: center;
    }

    .hero-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .role {
        border-left: none;
        border-bottom: 3px solid var(--accent);
        padding-left: 0;
        padding-bottom: 0.5rem;
    }

    .bio {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(3, 3, 5, 0.95);
        border-bottom: 2px solid var(--border);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        backdrop-filter: blur(10px);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-btn {
        display: block;
    }

    .hero h1.name {
        font-size: 2.2rem;
    }

    .about,
    .connect {
        padding: 4rem 5%;
    }

    .social-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .social-card {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding: 1rem;
    }
}