:root {
    --bg-color: #050505;
    --primary-color: #00ff41;
    /* Hacker Green */
    --secondary-color: #008F11;
    /* Darker Green */
    --accent-color: #00f3ff;
    /* Cyan */
    --error-color: #ff003c;
    /* Cyber Red */
    --text-color: #e0e0e0;
    --font-mono: 'Fira Code', 'Share Tech Mono', monospace;
    --font-heading: 'Orbitron', sans-serif;
    --scanline-color: rgba(0, 255, 65, 0.04);
    --glass-bg: rgba(10, 20, 10, 0.7);
    --border-color: rgba(0, 255, 65, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Effects */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    opacity: 0.15;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            var(--scanline-color) 50%,
            rgba(0, 0, 0, 0) 50%);
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none;
    animation: scanline-move 10s linear infinite;
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    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");
}

@keyframes scanline-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.logo-container h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 5px;
    position: relative;
    text-align: center;
    /* Centered on mobile by default */
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--error-color);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--accent-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 100px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 40px, 0);
    }

    60% {
        clip: rect(40px, 9999px, 60px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(70px, 9999px, 120px, 0);
    }
}

.version {
    font-size: 0.7rem;
    color: var(--secondary-color);
    display: block;
    text-align: right;
}

/* Nav */
nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    justify-content: center;
    /* Center nav items */
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: 0.3s;
}

.nav-link::before {
    content: '[';
    margin-right: 5px;
    color: var(--primary-color);
    opacity: 0;
    transition: 0.3s;
}

.nav-link::after {
    content: ']';
    margin-left: 5px;
    color: var(--primary-color);
    opacity: 0;
    transition: 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
}

.nav-link:hover::before,
.nav-link:hover::after {
    opacity: 1;
}

/* Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.console-prefix {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: block;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    line-height: 1.1;
    word-break: break-word;
    /* Prevent overflow */
}

.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.subtitle {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 40px;
}

/* Buttons */
.cyber-btn {
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    border: 1px solid var(--primary-color);
    background: transparent;
    overflow: hidden;
    transition: 0.3s;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: 0.4s;
    z-index: -1;
    opacity: 0.2;
}

.cyber-btn:hover {
    box-shadow: 0 0 15px var(--primary-color);
}

.cyber-btn:hover::before {
    left: 0;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.section-header h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-right: 20px;
}

.line {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(to right, var(--accent-color), transparent);
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.cyber-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    padding: 2px;
    /* For easy border effect container */
    position: relative;
}

.cyber-card .card-header {
    background: rgba(0, 255, 65, 0.1);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.cyber-card .icon {
    font-family: var(--font-heading);
    color: var(--secondary-color);
}

.cyber-card .card-body {
    padding: 20px;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

.project-card {
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    transition: 0.3s;
}

.project-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.2);
}

.project-image {
    height: 200px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.img-placeholder {
    font-family: var(--font-heading);
    color: #333;
    font-size: 1.5rem;
    z-index: 2;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(0, 255, 65, 0.1) 40%, rgba(0, 255, 65, 0.1) 60%, transparent 60%);
    background-size: 10px 10px;
}

.project-info {
    padding: 20px;
}

.tags span {
    display: inline-block;
    font-size: 0.7rem;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 2px 8px;
    margin-right: 5px;
    margin-bottom: 10px;
}

.link-btn {
    display: inline-block;
    color: var(--accent-color);
    margin-top: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.link-btn:hover {
    text-shadow: 0 0 5px var(--accent-color);
    padding-left: 5px;
}

/* Terminal Contact */
.contact-terminal {
    background: #000;
    border: 1px solid #333;
    max-width: 600px;
    margin: 0 auto;
    font-family: monospace;
}

.terminal-header {
    background: #222;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.buttons span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.close {
    background: #ff5f57;
}

.minimize {
    background: #febc2e;
}

.maximize {
    background: #28c840;
}

.title {
    color: #888;
    font-size: 0.8rem;
}

.terminal-body {
    padding: 20px;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

label {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 0.8rem;
}

input,
textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    color: var(--text-color);
    font-family: var(--font-mono);
    padding: 5px;
    outline: none;
}

input:focus,
textarea:focus {
    border-bottom-color: var(--primary-color);
}

.sm.cyber-btn {
    padding: 8px 20px;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    margin-top: 80px;
    font-size: 0.8rem;
    color: #666;
}

.status-online {
    color: var(--primary-color);
    animation: blink 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        padding-top: 40px;
    }

    .logo-container h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    nav ul {
        gap: 15px;
        flex-direction: row;
        /* Keep horizontal but wrap */
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 5px;
    }

    .hero {
        height: auto;
        min-height: 80vh;
        /* Allow scrolling content */
        padding: 100px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
        padding: 0 10px;
    }

    .project-grid,
    .card-grid {
        grid-template-columns: 1fr;
        /* Force single column */
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header h3 {
        margin-bottom: 10px;
    }

    .line {
        width: 100%;
    }
}