/* ========================================= */
/* 1. VARIABLES (Linux Terminal Theme)       */
/* ========================================= */
:root {
    --bg-color: #0d1117;
    /* GitHub Dark Background */
    --card-bg: #161b22;
    /* Slightly lighter dark for cards */
    --nav-bg: rgba(13, 17, 23, 0.9);
    /* Dark Navbar */
    --text-main: #c9d1d9;
    /* Terminal White text */
    --text-secondary: #8b949e;
    /* Grey text */
    --accent: #2ea043;
    /* Main Highlight (Green) */
    --accent-green: #2ea043;
    /* Terminal Green */
    --border: #30363d;
    /* Subtle borders */
    --font-mono: 'Consolas', 'Courier New', monospace;

    /* Terminal & Footer Specifics (Default Dark) */
    --terminal-bg: #000000;
    --terminal-header: #30363d;
    --terminal-text: #c9d1d9;
    --footer-bg: #000000;
    --system-bar-bg: rgba(13, 17, 23, 0.95);
}

/* Light Mode Override */
body.light-mode {
    --bg-color: #ffffff;
    --card-bg: #f3f4f6;
    --nav-bg: rgba(255, 255, 255, 0.95);
    /* White Navbar */
    --text-main: #1f2937;
    /* Dark Text */
    --text-secondary: #4b5563;
    --accent: #1a7f37;
    /* Darker Green for light mode */
    --border: #e5e7eb;

    /* Terminal & Footer Specifics (Switch to White) */
    --terminal-bg: #ffffff;
    --terminal-header: #e5e7eb;
    --terminal-text: #1f2937;
    --footer-bg: #ffffff;
    --system-bar-bg: #e5e7eb;
}

/* ========================================= */
/* 2. GLOBAL RESET                           */
/* ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-mono);
}

body {
    background-color: var(--bg-color);

    /* >>> PCB / BREADBOARD DOT GRID PATTERN (Everywhere) <<< */
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 20px 20px;
    /* Spacing of the dots */

    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 40px;
    /* Space for status bar */
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- MATRIX RAIN CANVAS (Hidden by default) --- */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    /* Behind content */
    display: none;
    opacity: 0.15;
}

/* ========================================= */
/* 3. NAVIGATION                             */
/* ========================================= */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(5px);
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: -1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--accent);
}

.btn-nav {
    padding: 6px 15px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-nav:hover {
    background: var(--accent);
    color: var(--bg-color);
}

.theme-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.theme-btn:hover {
    color: #eab308;
}

/* ========================================= */
/* 4. HERO SECTION                           */
/* ========================================= */
/* SECTION BORDER (The faint separating line) */
.section-border {
    border-bottom: 1px solid var(--border);
}

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    background: transparent;
}

.hero-container.center-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
}

.hero-img img {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    box-shadow: 0 0 25px rgba(46, 160, 67, 0.2);
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: var(--text-main);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.hero-desc {
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-secondary);
}

.terminal-alert {
    color: var(--accent);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

.justify-center {
    justify-content: center;
}

.btn {
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    border: 1px solid var(--text-secondary);
    color: var(--text-main);
}

.btn-secondary:hover {
    border-color: var(--text-main);
}

.typewriter {
    color: var(--accent);
    border-right: 2px solid var(--accent);
    padding-right: 5px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* ========================================= */
/* 5. ABOUT SECTION                          */
/* ========================================= */
.section {
    padding: 80px 0;
    background: transparent;
}

.about-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 60px;
}

/* Terminal Cards */
.terminal-card {
    background: var(--terminal-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s;
}

.terminal-header {
    background: var(--terminal-header);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
    cursor: pointer;
}

.yellow {
    background: #ffbd2e;
    cursor: pointer;
}

.green {
    background: #27c93f;
}

.terminal-title {
    margin-left: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.terminal-body {
    padding: 20px;
    font-size: 0.95rem;
    color: var(--terminal-text);
}

/* Image Slot */
.about-image-slot {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Slideshow Container */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #000;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: fadeLoop 8s infinite;
}

.slide:nth-child(1) {
    animation-delay: 0s;
}

.slide:nth-child(2) {
    animation-delay: 4s;
}

@keyframes fadeLoop {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    45% {
        opacity: 1;
    }

    55% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* ========================================= */
/* 6. SKILLS SECTION                         */
/* ========================================= */
.skills-wrapper {
    margin-top: 20px;
}

.skills-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--accent);
}

.skill-category h4 {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.tags span {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--accent);
}

/* ========================================= */
/* 7. PROJECTS SECTION                       */
/* ========================================= */
.bg-contrast {
    background-color: transparent;
}

.center {
    text-align: center;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 50px;
    font-size: 0.9rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    background: var(--card-bg);
    /* Cards keep their solid color */
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 25px;
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-icon {
    color: var(--accent);
    font-size: 1.2rem;
}

.project-card h3 {
    font-size: 1.1rem;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    min-height: 60px;
}

.tech-stack span {
    color: var(--accent);
    font-size: 0.8rem;
    margin-right: 8px;
}

.link-text {
    display: block;
    margin-top: 15px;
    color: var(--text-main);
    font-size: 0.9rem;
}

.link-text:hover {
    color: var(--accent);
}

/* ========================================= */
/* 8. FOOTER                                 */
/* ========================================= */
footer {
    background: transparent;
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    transition: background-color 0.3s;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.social-btn {
    color: var(--text-secondary);
    font-size: 1rem;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--card-bg);
}

.social-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========================================= */
/* 9. SYSTEM BAR                             */
/* ========================================= */
.system-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: var(--system-bar-bg);
    border-top: 1px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    z-index: 2500;
    transition: background-color 0.3s;
}

.status-item {
    margin-right: 20px;
    font-weight: bold;
}

.status-item i {
    color: var(--accent);
    margin-right: 5px;
}

.clickable {
    cursor: pointer;
    transition: 0.2s;
}

.clickable:hover {
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent);
}

/* ========================================= */
/* 10. CLI TERMINAL                          */
/* ========================================= */
.cli-window {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 400px;
    height: 300px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 2500;
    font-family: 'Consolas', monospace;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0s, height 0s, top 0s, left 0s;
}

.cli-window.dragging {
    transition: none;
    opacity: 0.95;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.cli-window.minimized {
    transform: translateY(260px) !important;
    opacity: 0.8;
}

.cli-window.closed {
    display: none;
}

.cli-header {
    background: var(--card-bg);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.cli-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cli-controls {
    display: flex;
    gap: 8px;
}

.cli-body {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-main);
}

.input-line {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.prompt {
    color: var(--accent);
    margin-right: 8px;
    font-weight: bold;
}

#cli-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    flex-grow: 1;
    outline: none;
    font-family: inherit;
    font-size: inherit;
}

.cmd-highlight {
    color: var(--accent);
    font-weight: bold;
}

.response-line {
    margin-bottom: 5px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* BOOT SCREEN */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 9999;
    padding: 20px;
    font-family: 'Consolas', monospace;
    overflow: hidden;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.boot-msg {
    color: #bbb;
    font-size: 14px;
    margin-bottom: 2px;
}

.boot-ok {
    color: #2ea043;
    font-weight: bold;
    margin-right: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .about-split {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        padding-top: 50px;
        transition: 0.3s;
    }

    .nav-menu.active {
        left: 0;
    }

    .menu-toggle {
        display: block;
        color: var(--text-main);
        font-size: 1.5rem;
        cursor: pointer;
    }

    .system-bar {
        display: none;
    }

    .cli-window {
        display: none;
    }
}