/* Base Styles & Variables */
:root {
    --bg-color: #0a0a0a;
    --text-main: #e0e0e0;
    --accent-blue: #00f0ff;
    --accent-green: #00ff41; /* Classic Matrix Green */
    --accent-hover: #00ccff;
    --nav-bg: rgba(10, 10, 10, 0.85);
    --card-bg: #111111;
    --border-color: #333;
    --terminal-bg: #000;
    --terminal-header: #222;
    --font-mono: 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

/* Background Effects */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    opacity: 0.15;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, transparent 0%, #0a0a0a 100%);
    z-index: -1;
    pointer-events: none;
}

/* Common Classes */
.accent {
    color: var(--accent-green);
}

.prompt {
    color: var(--accent-green);
    font-weight: bold;
}

.path {
    color: var(--accent-blue);
}

.blink {
    animation: blinker 1s linear infinite;
    display: inline-block;
    width: 10px;
    background-color: var(--accent-green);
    height: 1.2em;
    vertical-align: middle;
}

@keyframes blinker {
    50% { opacity: 0; }
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
}

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

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

.nav-links a::before {
    content: '>';
    position: absolute;
    left: -15px;
    opacity: 0;
    color: var(--accent-green);
    transition: opacity 0.3s ease;
}

.nav-links a:hover::before {
    opacity: 1;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content Wrapper */
main {
    padding-top: 80px; /* Offset for fixed nav */
}

section {
    min-height: 100vh;
    padding: 5rem 10%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
#hero {
    align-items: center;
    padding-top: 10rem;
}

.hero-content {
    max-width: 800px;
}

.glitch {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-main);
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.title {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Terminal Box */
.terminal-box {
    background-color: var(--terminal-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    margin: 2rem auto 0;
}

.terminal-header {
    background-color: var(--terminal-header);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.close { background-color: #ff5f56; }
.min { background-color: #ffbd2e; }
.max { background-color: #27c93f; }

.terminal-title {
    margin: 0 auto;
    font-size: 0.8rem;
    color: #888;
}

.terminal-body {
    padding: 1.5rem;
    font-size: 1rem;
}

.terminal-body p {
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.terminal-body .output {
    color: #aaa;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.terminal-body .highlight {
    color: var(--accent-blue);
}

/* About Section */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .about-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.profile-pic {
    width: 280px;
    height: 280px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 3px solid var(--accent-green);
    object-fit: cover;
    object-position: center 10%;
    box-shadow: 0 0 20px var(--accent-glow);
    background-color: var(--card-bg);
}

.resume-btn {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-family: var(--font-mono);
    position: relative;
    overflow: hidden;
    z-index: 1;
    display: inline-block;
    text-align: center;
}

.resume-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.resume-btn:hover {
    color: var(--bg-color);
}

.resume-btn:hover::before {
    transform: scaleX(1);
}

.about-text {
    flex-grow: 1;
}

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

.focus-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.focus-item {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 5px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.focus-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.focus-item i {
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.skill-category h3 {
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.skill-category li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-green);
}

.certs h3 {
    color: #ffbd2e;
}
.certs::before {
    background: #ffbd2e;
}

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

.project-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.1);
    border-color: var(--accent-blue);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header .fa-folder-open {
    font-size: 2rem;
    color: var(--accent-green);
}

.github-link {
    color: var(--text-main);
    font-size: 1.5rem;
    transition: color 0.3s;
}

.github-link:hover {
    color: var(--accent-blue);
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.project-desc {
    color: #aaa;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.tech-stack span {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

/* CTF Section */
.ctf-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.ctf-platform {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.ctf-platform:hover {
    background: rgba(255, 255, 255, 0.02);
}

.platform-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 2rem;
    border-radius: 5px;
}

.htb { color: #9fef00; background: rgba(159, 239, 0, 0.1); }
.thm { color: #d03030; background: rgba(208, 48, 48, 0.1); }
.pico { color: #158fc2; background: rgba(21, 143, 194, 0.1); }

.platform-info h3 {
    margin-bottom: 0.5rem;
}

.platform-info .rank {
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.platform-info .stats {
    color: #aaa;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info .terminal-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 1.5rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--accent-blue);
    color: var(--bg-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 240, 255, 0.3);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--accent-green);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    border-radius: 3px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.submit-btn {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 3px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.submit-btn:hover {
    color: var(--bg-color);
}

.submit-btn:hover::before {
    transform: scaleX(1);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--nav-bg);
}

footer p {
    color: #888;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none; /* Hide by default on mobile, can toggle with JS */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        padding: 2rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .glitch {
        font-size: 1.8rem;
        word-break: normal;
        text-align: center;
        width: 100%;
    }

    .title {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    section {
        padding: 4rem 5%;
        min-height: auto;
    }

    .section-title {
        font-size: 1.2rem;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .section-title .accent {
        font-size: 1.5rem;
    }

    .skills-grid, .projects-grid, .focus-areas {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .skill-category, .project-card, .focus-item {
        flex: 1 1 auto;
        width: 100%;
    }

    .contact-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .contact-info .terminal-text {
        font-size: 1rem;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .profile-pic {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 400px) {
    .section-title {
        font-size: 1rem;
        gap: 4px;
    }
    
    .section-title .accent {
        font-size: 1.2rem;
    }
    
    .glitch {
        font-size: 1.8rem;
    }
}
