:root {
    /* Colors - Matrix/Cyberpunk Aesthetic */
    --bg-color: #0a0a0a;
    --bg-secondary: #111111;
    --accent-color: #00ff41;
    /* Cyber Green */
    --accent-dim: rgba(0, 255, 65, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;

    /* Typography */
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* CRT Scanline Effect */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    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: 1000;
}

/* Matrix Background */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Header */
header {
    padding: 2rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid #1f1f1f;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Ensure nav takes full width */
    overflow: hidden;
    /* Prevent parent scroll */
}

.logo {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    /* Prevent logo shrinking */
    margin-right: 1.5rem;
    /* Gap between logo and nav items */
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    /* Prevent text wrapping */
}

.nav-links a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-color);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        /* Tighter gap */
        width: 100%;
        padding: 0 1rem;
        /* Add side padding to container */
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0;
        -webkit-overflow-scrolling: touch;
        gap: 1.5rem;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
        /* Ensure items start from left */
        justify-content: flex-start;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links li:last-child {
        padding-right: 1rem;
    }

    .logo {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    /* Changed from height: 100vh to min-height */
    height: auto;
    /* Allow auto height for mobile content */
    display: flex;
    align-items: center;
    padding-top: 6rem;
    /* Ensure clearance for fixed header */
    padding-bottom: 4rem;
}

.terminal-text {
    font-family: var(--font-mono);
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    /* Responsive H1 */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    border: 1px solid var(--accent-color);
    cursor: pointer;
}

.btn.primary {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-dim);
}

.btn.primary:hover {
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.4);
}

.btn.secondary {
    background: transparent;
    color: var(--accent-color);
}

.btn.secondary:hover {
    background: var(--accent-dim);
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-top: 1px solid #1f1f1f;
    margin-top: 4rem;
}

/* --- New Section Styles --- */

.section {
    padding: 6rem 2rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    font-weight: 800;
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    text-transform: lowercase;
}

.hash {
    color: var(--accent-color);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.typewriter-text {
    font-family: var(--font-mono);
    color: var(--accent-color) !important;
    min-height: 1.6em;
}

.profile-card {
    height: 300px;
    background: #111;
    border: 1px solid #333;
    position: relative;
}

.glitch-img {
    width: 100%;
    height: 100%;
    background: #222 url('https://via.placeholder.com/400x400/000000/00ff41?text=USER_IMG') center/cover;
    filter: grayscale(100%) contrast(1.2);
    position: relative;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid #333;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.folder-icon {
    font-size: 1.5rem;
}

.project-card h3 {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-stack span {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent-color);
    background: rgba(0, 255, 65, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
}

.src-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #fff;
    text-decoration: underline;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    font-family: var(--font-mono);
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tags span {
    border: 1px solid #333;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #0f0f0f;
    transition: all 0.3s ease;
}

.skill-tags span:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

/* how_i_work Interactive Element */
.how-i-work-wrapper {
    position: relative;
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.work-trigger {
    display: inline-block;
    border: 1px solid #333;
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #0f0f0f;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.work-trigger:hover,
.work-trigger.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.work-popup {
    display: none;
    position: absolute;
    bottom: 130%;
    /* Position above the trigger */
    left: 50%;
    transform: translateX(-50%);
    background: #0d0d0d;
    border: 1px solid var(--accent-color);
    padding: 1rem;
    width: max-content;
    max-width: 90vw;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.8);
    font-family: var(--font-mono);
}

/* Show popup on hover or when active class is present */
.work-trigger:hover+.work-popup,
.work-trigger.active+.work-popup {
    display: block;
}

.popup-title {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px dashed #333;
    padding-bottom: 0.2rem;
}

.work-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.work-list li {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    opacity: 0.9;
}

/* Mobile: Ensure it doesn't go off screen if centered */
@media (max-width: 480px) {
    .work-list li {
        white-space: normal;
    }

    .work-popup {
        width: 280px;
    }
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
}

.terminal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.9rem;
}

.terminal-form input,
.terminal-form textarea {
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.terminal-form input:focus,
.terminal-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #0f0f0f;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
}

.social-btn {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    padding: 1rem;
    border: 1px solid #333;
    text-align: center;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: var(--accent-color);
    color: #000;
}

@media (max-width: 768px) {

    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        /* Reduce gap on mobile */
    }

    h1 {
        /* Already handled by clamp, but can force if needed */
        font-size: 2.5rem;
    }

    /* Mobile Spacing Improvements */
    .section {
        padding: 2rem 1rem;
        /* Significantly reduced */
    }

    .section-title {
        margin-bottom: 1.5rem;
        font-size: 1.75rem;
    }

    .hero {
        padding-top: 5.5rem;
        /* Just enough to clear header */
        padding-bottom: 1rem;
        height: auto;
        min-height: auto;
        /* Allow natural flow */
        display: block;
        /* Disable flex centering on mobile to avoid vertical gap issues */
    }

    .hero .container {
        padding-top: 2rem;
        /* Add internal spacing */
    }

    .timeline-container {
        margin-top: 1.5rem;
        padding-bottom: 0;
    }

    .project-card,
    .terminal-window {
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .profile-card {
        height: auto;
        /* Allow auto height on mobile */
        min-height: 300px;
    }

    /* Mobile Grid Adjustments */
    .projects-grid,
    .skills-grid {
        grid-template-columns: 1fr;
        /* Force single column */
    }

    /* Horizontal Timeline for Mobile (Swipeable) */
    .timeline-container {
        overflow-x: auto;
        padding-bottom: 1rem;
        margin-top: 1rem;
        /* Re-enable scrollbars so users know they can swipe, 
           or keep hidden if minimal aesthetic is preferred. 
           User asked for minimal, but snap helps specific feel. */
        scrollbar-width: none;
        /* Hide scrollbar Firefox */
        -ms-overflow-style: none;
        /* Hide scrollbar IE/Edge */
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll */
        scroll-snap-type: x mandatory;
        /* Snap behavior */
    }

    .timeline-container::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar Chrome/Safari */
    }

    .timeline {
        flex-direction: row;
        /* Force horizontal */
        min-width: max-content;
        /* Ensure it expands */
        padding: 0 1rem;
        align-items: flex-start;
        position: relative;
    }

    /* Horizontal Line Restoration */
    .timeline::before {
        width: 100%;
        height: 2px;
        left: 0;
        top: 9px;
        /* Align with node center (10px - 1px) */
    }

    .timeline-item {
        display: block;
        /* Stack content vertically within item */
        text-align: center;
        padding: 0 1rem;
        margin-bottom: 0;
        width: 280px;
        /* Fixed width for consistent snap points */
        position: relative;
        flex: 0 0 auto;
        /* Prevent shrinking */
        scroll-snap-align: center;
        /* Snap to center */
    }

    .timeline-node {
        margin: 0 auto 1rem auto;
        /* Center node */
        flex-shrink: 0;
        position: relative;
        z-index: 2;
        background: #0a0a0a;
    }

    .timeline-content {
        padding-bottom: 0;
        flex: none;
        min-width: auto;
    }

    .timeline-role {
        word-wrap: break-word;
        line-height: 1.3;
        font-size: 0.95rem;
        /* Slight mobile adjustment */
    }

    .timeline-company,
    .timeline-date {
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.85rem;
    }

    .terminal-body {
        padding: 1rem;
    }
}

/* Contact Section - Terminal Style */
.contact-wrapper {
    display: block;
    /* Override grid */
    max-width: 800px;
    margin: 0 auto;
}

.terminal-window {
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono);
}

.terminal-header {
    background: #1a1a1a;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.control.close {
    background: #ff5f56;
}

.control.minimize {
    background: #ffbd2e;
}

.control.maximize {
    background: #27c93f;
}

.terminal-title {
    color: #888;
    font-size: 0.8rem;
    flex-grow: 1;
    text-align: center;
}

.terminal-body {
    padding: 2rem;
    color: var(--accent-color);
}

.terminal-log p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    color: var(--accent-color);
    opacity: 0.9;
}

.status-ready {
    color: var(--accent-color);
    margin-bottom: 2rem !important;
}

.terminal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.terminal-form input,
.terminal-form textarea {
    width: 100%;
    background: rgba(0, 255, 65, 0.05);
    border: none;
    border-bottom: 1px solid #333;
    color: var(--text-primary);
    font-family: var(--font-mono);
    padding: 0.5rem;
    font-size: 1rem;
}

.terminal-form input:focus,
.terminal-form textarea:focus {
    outline: none;
    border-bottom-color: var(--accent-color);
    background: rgba(0, 255, 65, 0.1);
}

.terminal-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 1rem;
}

.terminal-btn:hover {
    box-shadow: 0 0 15px var(--accent-dim);
}

.submission-feedback p {
    margin: 0.5rem 0;
    color: var(--accent-color);
}

.privacy-notice {
    margin-top: 3rem;
    border-top: 1px dashed #333;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.notice-header {
    color: #888;
    margin-bottom: 0.5rem;
}

/* Submission Feedback Styling */
.submission-feedback {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Left align like terminal output */
}

/* Override previous p styles if needed to be very clean */
.submission-feedback p {
    margin: 0.2rem 0;
    color: var(--accent-color);
    font-size: 1rem;
    font-family: var(--font-mono);
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Direct Contact Block */
.direct-contact {
    margin-top: 2rem;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border: 1px dashed #333;
    /* Subtle bordered container */
    background: rgba(0, 0, 0, 0.2);
}

.dc-command {
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.dc-output p {
    color: var(--accent-color);
    opacity: 0.8;
    /* Dimmer green */
    margin-bottom: 0.3rem;
    white-space: pre-wrap;
    /* Allow wrapping on small screens */
}

.dc-output a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
}

.dc-output a:hover {
    opacity: 1;
}


/* Experience Timeline */
.timeline-container {
    overflow-x: auto;
    padding: 2rem 0;
    margin-top: 2rem;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.timeline-container::-webkit-scrollbar {
    display: none;
}

.timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-width: 900px;
    /* Ensure scrolling on small screens */
    position: relative;
    padding: 0 1rem;
}

/* Horizontal Line */
.timeline::before {
    content: '';
    position: absolute;
    top: 9px;
    /* Align check */
    left: 0;
    width: 100%;
    height: 2px;
    background: #333;
    z-index: 0;
}

.timeline-item {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    padding: 0 10px;
}

.timeline-node {
    width: 18px;
    height: 18px;
    background: #0a0a0a;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    /* Hide line behind node */
}

/* Highlight most recent */
.timeline-item:last-child .timeline-node {
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-dim);
}

.timeline-content {
    font-family: var(--font-mono);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.timeline-item:hover .timeline-content {
    opacity: 1;
}

.timeline-item:hover .timeline-node {
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--accent-color);
}

.timeline-date {
    display: block;
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.timeline-role {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.timeline-company {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Status Panel (Replaces Profile Card) */
.status-panel {
    background: #0d0d0d;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    /* Scaled down to fit */
    overflow: hidden;
}

.terminal-session {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
}

.command-line {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 0.25rem;
    margin-top: 1rem;
    line-height: 1.2;
}

.command-line:first-child {
    margin-top: 0;
}

.command-output {
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-left: 0.2rem;
    line-height: 1.3;
}

.output-line {
    white-space: pre;
    /* Force terminal-like spacing */
    display: block;
    opacity: 0.9;
}

.chk-box {
    color: var(--text-secondary);
}

.chk-done {
    color: var(--text-primary);
}

.prompt {
    margin-right: 0.5rem;
}

/* Override profile card height to auto to fit content if needed, 
   but try to keep it consistent with design */
.profile-card {
    min-height: 320px;
    height: auto;
}