:root {
    --bg-color: #0d1117;
    --term-green: #00ff41;
    --term-amber: #ffb000;
    --term-blue: #00f2ff;
    --term-purple: #bd34fe;
    --term-red: #ff3333;
    --ui-font: 'Fira Code', monospace;
    --game-font: 'Press Start 2P', cursive;
    --crt-opacity: 0.15;
}

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

body {
    background-color: var(--bg-color);
    color: var(--term-green);
    font-family: var(--ui-font);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* CRT Scanline Effect Overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 100;
}

.flicker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    pointer-events: none;
    z-index: 101;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.02;
    }

    100% {
        opacity: 0.08;
    }
}

/* Layout */
.terminal-window {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-bar {
    padding: 20px 40px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    display: flex;
    gap: 30px;
    z-index: 20;
}

.nav-item {
    color: var(--term-green);
    text-decoration: none;
    font-family: var(--game-font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--bg-color);
    background: var(--term-green);
    box-shadow: 0 0 10px var(--term-green);
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--game-font);
    margin-bottom: 20px;
}

.typing-text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.prompt {
    color: var(--term-blue);
    margin-right: 10px;
}

.command {
    color: #fff;
}

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.5s;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Grid for Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
    width: 100%;
}

.project-card {
    border: 1px solid rgba(0, 255, 65, 0.3);
    background: rgba(13, 17, 23, 0.9);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    transition: 0.3s ease;
}

.project-card:hover {
    border-color: var(--term-green);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.project-slider {
    width: 100%;
    max-width: 100%;
    height: 250px;
    flex: none;
    position: relative;
    background: #000;
    border-right: none;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    cursor: zoom-in;
    overflow: hidden;
    min-width: 0;
}

.slider-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
    flex-grow: 0;
    background: #000;
}

.slider-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 15px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: 0.3s;
}

.project-card:hover .slider-nav {
    opacity: 1;
}

.slider-btn {
    background: rgba(13, 17, 23, 0.9);
    color: var(--term-green);
    border: 1px solid var(--term-green);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    font-family: var(--game-font);
    font-size: 0.8rem;
    transition: 0.2s;
}

.slider-btn:hover {
    background: var(--term-green);
    color: var(--bg-color);
}

.project-info {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 300px;
    /* Prevent text from being crushed */
}

.project-card h3 {
    font-size: 1.4rem;
    color: var(--term-green);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.tag {
    font-size: 0.75rem;
    border: 1px solid var(--term-blue);
    padding: 4px 8px;
    color: var(--term-blue);
    background: rgba(0, 242, 255, 0.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid var(--term-green);
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.2);
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--term-green);
    font-size: 40px;
    cursor: pointer;
    font-family: var(--ui-font);
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* About Section */
.about-content {
    max-width: 800px;
    line-height: 1.6;
}

.stat-row {
    display: flex;
    margin-bottom: 10px;
}

.stat-label {
    width: 150px;
    color: var(--term-amber);
}

.stat-value {
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--term-green);
}