:root {
    --bg-color: #0d0d0d;
    --text-primary: #33ff00;
    --text-secondary: #1ea300;
    --highlight: #baffab;
    --card-bg: #0d0d0d;
    --card-border: #33ff00;
    --overlay-color: rgba(18, 16, 16, 0.2);
}

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

body {
    font-family: 'VT323', monospace;
    background-color: #000;
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

/* CRT Effects wrapper */
.crt {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    padding: 20px;
    animation: textShadow 1.6s infinite;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    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));
    z-index: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes textShadow {
    0% { text-shadow: 0.4389924193300864px 0 1px rgba(0, 30, 255, 0.5), -0.4389924193300864px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    5% { text-shadow: 2.7928974010788217px 0 1px rgba(0, 30, 255, 0.5), -2.7928974010788217px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    10% { text-shadow: 0.02956275843481219px 0 1px rgba(0, 30, 255, 0.5), -0.02956275843481219px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    15% { text-shadow: 3.4028263155208914px 0 1px rgba(0, 30, 255, 0.5), -3.4028263155208914px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    20% { text-shadow: 1.7478673322197576px 0 1px rgba(0, 30, 255, 0.5), -1.7478673322197576px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    25% { text-shadow: 0.5050302822557551px 0 1px rgba(0, 30, 255, 0.5), -0.5050302822557551px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    30% { text-shadow: 0.3540203061218529px 0 1px rgba(0, 30, 255, 0.5), -0.3540203061218529px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    35% { text-shadow: 2.766324209590827px 0 1px rgba(0, 30, 255, 0.5), -2.766324209590827px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    40% { text-shadow: 2.0163351912952862px 0 1px rgba(0, 30, 255, 0.5), -2.0163351912952862px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    45% { text-shadow: 0.5518060856015507px 0 1px rgba(0, 30, 255, 0.5), -0.5518060856015507px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    50% { text-shadow: 0.709593237583648px 0 1px rgba(0, 30, 255, 0.5), -0.709593237583648px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    55% { text-shadow: 1.1378370783350284px 0 1px rgba(0, 30, 255, 0.5), -1.1378370783350284px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    60% { text-shadow: 1.4925721869818816px 0 1px rgba(0, 30, 255, 0.5), -1.4925721869818816px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    65% { text-shadow: 1.9567990117498715px 0 1px rgba(0, 30, 255, 0.5), -1.9567990117498715px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    70% { text-shadow: 1.341492212953265px 0 1px rgba(0, 30, 255, 0.5), -1.341492212953265px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    75% { text-shadow: 2.115858686645367px 0 1px rgba(0, 30, 255, 0.5), -2.115858686645367px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    80% { text-shadow: 0.05268481483863481px 0 1px rgba(0, 30, 255, 0.5), -0.05268481483863481px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    85% { text-shadow: 1.6375056767527663px 0 1px rgba(0, 30, 255, 0.5), -1.6375056767527663px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    90% { text-shadow: 3.4907994863339084px 0 1px rgba(0, 30, 255, 0.5), -3.4907994863339084px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    95% { text-shadow: 1.3090680650917633px 0 1px rgba(0, 30, 255, 0.5), -1.3090680650917633px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    100% { text-shadow: 2.766324209590827px 0 1px rgba(0, 30, 255, 0.5), -2.766324209590827px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
}

@keyframes flicker {
    0% { opacity: 0.015; }
    50% { opacity: 0.035; }
    100% { opacity: 0.015; }
}

/* Typography & Hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 40px 10px;
}

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

.hero h1 {
    font-size: 3rem;
    font-weight: normal;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.highlight {
    color: var(--highlight);
}

.cursor {
    display: inline-block;
    width: 20px;
    animation: blink 1s step-end infinite;
}

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

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

/* Portfolio Section */
.portfolio-section {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 40px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 30px;
    border-bottom: 2px dashed var(--text-secondary);
    padding-bottom: 10px;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Project Cards */
.project-card {
    text-decoration: none;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    color: var(--text-primary);
    transition: all 0.1s;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.card-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.2s ease;
    filter: grayscale(100%) sepia(100%) hue-rotate(65deg) saturate(500%) brightness(0.6) contrast(1.2);
    pointer-events: none;
}

.project-card:hover .card-thumbnail {
    opacity: 1;
}

.project-card:hover {
    background: transparent;
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--text-primary);
    text-shadow: none;
}

.card-content {
    position: relative;
    z-index: 2;
}

.card-content h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    font-weight: normal;
    text-shadow: 0 0 5px var(--bg-color);
}

.card-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.4;
    text-shadow: 0 0 5px var(--bg-color);
}

.project-card:hover .card-content h3,
.project-card:hover p, 
.project-card:hover .view-text {
    color: var(--bg-color);
    text-shadow: 0 0 5px var(--text-primary);
    font-weight: bold;
}

.view-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    border-top: 2px dashed var(--text-secondary);
    margin: 0 40px;
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
        display: block;
    }
    
    .crt {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        padding: 10px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hero {
        padding: 20px 10px 10px;
    }

    .portfolio-section {
        padding: 10px 10px;
    }

    footer {
        margin: 0 10px;
        padding: 15px 10px;
    }

    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1.2rem; }
}
