/* --- Variables & Reset --- */
:root {
    --bg-color: #0a0a0a;
    --card-bg: #111;
    --text-primary: #e6f1ff;
    --text-secondary: #8892b0;
    --accent: #00ff41; /* Terminal Green */
    --accent-dim: rgba(0, 255, 65, 0.1);
    --font-mono: 'Fira Code', monospace;
    --nav-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* --- Utilities --- */
.container {
    max-width: 1200px; /* Wider desktop view */
    margin: 0 auto;
    padding: 0 25px;
    width: 100%;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
.highlight { color: var(--accent); }
.line { height: 1px; background: #333; flex-grow: 1; margin-left: 20px; }

/* --- Scanlines Overlay --- */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 118, 0.06));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none; z-index: 9999; opacity: 0.6;
}

/* --- Navbar (Fixed Desktop Issue) --- */
.navbar {
    height: var(--nav-height);
    display: flex; justify-content: center; align-items: center;
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    z-index: 1000;
}

.nav-container {
    display: flex; justify-content: space-between; align-items: center;
}

.logo { font-size: 1.1rem; font-weight: bold; color: var(--accent); z-index: 1002; }

.nav-menu { display: flex; align-items: center; gap: 30px; }

.nav-link { font-size: 0.9rem; color: var(--text-secondary); }
.nav-link:hover { color: var(--accent); }
.nav-link::before { content: "// "; color: var(--accent); opacity: 0; transition: 0.3s; }
.nav-link:hover::before { opacity: 1; }

/* Hamburger Menu Icon */
.menu-toggle {
    display: none; cursor: pointer; z-index: 1002;
}
.bar {
    display: block; width: 25px; height: 3px; margin: 5px auto;
    background-color: var(--accent); transition: all 0.3s ease-in-out;
}

/* --- Hero Section --- */
header {
    height: 100vh; display: flex; align-items: center; padding-top: var(--nav-height);
}
.hero-container { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.system-msg { color: var(--accent); margin-bottom: 15px; font-size: 0.9rem; }
h1 { font-size: 4rem; color: #fff; line-height: 1.1; margin-bottom: 10px; }
h2 { font-size: 1.5rem; color: var(--text-secondary); margin-bottom: 30px; height: 1.5em; }

.btn {
    padding: 14px 28px; border: 1px solid var(--accent); color: var(--accent);
    margin-right: 15px; display: inline-block; font-size: 0.95rem; font-weight: 500;
}
.btn:hover { background: var(--accent-dim); transform: translateY(-2px); }

/* --- About & Grids --- */
section { padding: 100px 0; }
.section-header { display: flex; align-items: center; margin-bottom: 50px; }
.section-header h3 { font-size: 1.8rem; color: #fff; white-space: nowrap; }

.about-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 50px; align-items: center; }
.about-img img { width: 100%; border-radius: 5px; border: 1px solid var(--accent); filter: grayscale(100%); transition: 0.3s; }
.about-img img:hover { filter: none; transform: translate(-5px, -5px); box-shadow: 5px 5px 0 var(--accent); }

.terminal-box { background: #1e1e1e; border-radius: 5px; padding: 15px; margin-top: 20px; border: 1px solid #333; }
.terminal-header { display: flex; gap: 8px; margin-bottom: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }
.cmd { color: var(--text-secondary); } .output { color: var(--accent); margin-bottom: 10px; }

/* Grid Layouts (3 Columns) */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }

.card {
    background: var(--card-bg); padding: 30px; border: 1px solid #333; transition: 0.3s;
    display: flex; flex-direction: column; height: 100%;
}
.card:hover { border-color: var(--accent); transform: translateY(-5px); }
.card i { font-size: 2rem; color: var(--accent); margin-bottom: 20px; }
.card h4 { font-size: 1.2rem; color: #fff; margin-bottom: 15px; }
.card ul li { margin-bottom: 8px; font-size: 0.9rem; color: var(--text-secondary); }
.card ul li::before { content: "> "; color: var(--accent); }

/* Projects */
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card.project p { margin-bottom: 20px; flex-grow: 1; font-size: 0.95rem; color: var(--text-secondary); }
.tags span { font-size: 0.75rem; color: var(--accent); margin-right: 10px; }

/* Contact Form */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.5fr; gap: 50px; }
.contact-item { margin-bottom: 15px; color: var(--text-secondary); }
.contact-item i { width: 25px; color: var(--accent); }

input, textarea {
    width: 100%; background: #151515; border: 1px solid #333; color: #fff;
    padding: 15px; margin-bottom: 20px; font-family: var(--font-mono); font-size: 1rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

footer { text-align: center; padding: 40px; color: #555; font-size: 0.8rem; }

/* --- MOBILE RESPONSIVE (Fixed Menu Logic) --- */
@media (max-width: 968px) {
    .container { max-width: 100%; }
    .about-grid { grid-template-columns: 1fr; }
    h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
    /* 1. Show Hamburger */
    .menu-toggle { display: block; }

    /* 2. Hide Menu by default & Position Fixed */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: #111;
        width: 75%;
        height: 100%;
        justify-content: center;
        transition: 0.4s;
        border-right: 1px solid #333;
        box-shadow: 10px 0 20px rgba(0,0,0,0.5);
    }

    /* 3. Class to slide it in */
    .nav-menu.active {
        left: 0;
    }

    /* 4. Hamburger Animation classes */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* General Layout Adjustments */
    .contact-wrapper { grid-template-columns: 1fr; }
    header { padding-top: 100px; text-align: left; }
    h1 { font-size: 2.5rem; }
    .cta-group { display: flex; flex-direction: column; gap: 15px; }
    .btn { margin-right: 0; text-align: center; }
}