:root {
    --bg-color: #000000;
    --text-color: #0F0;
    --dim-text: #008F11;
    --accent-color: #00FF41;
    --font-mono: 'Courier New', Courier, monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    overflow-x: hidden;
    height: 100vh;
}

/* Canvas Background */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.9) 100%);
    pointer-events: none;
    z-index: 0;
}

/* CRT Scanline Effect */
body::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: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

/* Header & Nav */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--dim-text);
    margin-bottom: 40px;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 5px var(--accent-color);
}

nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--dim-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-color);
}


/* Profile Image */
.profile-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) sepia(100%) hue-rotate(80deg) brightness(1.2) contrast(1.2);
    opacity: 0.9;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    animation: scan 2.5s linear infinite;
    z-index: 5;
    opacity: 0.7;
}

@keyframes scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* Typography & Effects */
.glitch {
    font-size: 4rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
    0.025em 0.04em 0 #fffc00;
    animation: glitch 725ms infinite;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00; }
    15% { text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00; }
    16% { text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff, -0.05em -0.05em 0 #fffc00; }
    49% { text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff, -0.05em -0.05em 0 #fffc00; }
    50% { text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff, 0 -0.04em 0 #fffc00; }
    99% { text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff, 0 -0.04em 0 #fffc00; }
    100% { text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff, -0.04em -0.025em 0 #fffc00; }
}

.typing-container {
    font-size: 1.2rem;
    margin-top: 20px;
    min-height: 1.5em;
}

.cursor {
    display: inline-block;
    width: 10px;
    background-color: var(--accent-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Sections */
.section {
    margin-bottom: 60px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--dim-text);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--dim-text);
    padding-bottom: 10px;
    display: inline-block;
}

/* Grid for Skills */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    border: 1px solid var(--dim-text);
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.2);
    background: rgba(0, 255, 65, 0.05);
}

.card h3 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.card ul {
    list-style-type: none;
}

.card li::before {
    content: "> ";
    color: var(--dim-text);
}

/* Project List (Index Page) */
.project-item {
    border-left: 2px solid var(--dim-text);
    padding-left: 20px;
    margin-bottom: 30px;
}

.project-item h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.project-item p {
    margin-bottom: 5px;
    color: #ccc;
}

/* Portfolio Gallery (Portfolio Page) */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-card {
    border: 1px solid var(--dim-text);
    background: rgba(0, 20, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.portfolio-img-container {
    height: 200px;
    background: #000;
    border-bottom: 1px solid var(--dim-text);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.img-placeholder {
    color: var(--dim-text);
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-img {
    transform: scale(1.05);
}

.portfolio-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portfolio-content h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tech-stack span {
    font-size: 0.8rem;
    border: 1px solid var(--dim-text);
    padding: 2px 6px;
    border-radius: 2px;
    color: #ccc;
}

.portfolio-content p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: #ddd;
    line-height: 1.4;
    flex-grow: 1;
}

.portfolio-links {
    display: flex;
    gap: 10px;
}

.btn-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--bg-color);
    background-color: var(--dim-text);
    padding: 5px 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-link:hover {
    background-color: var(--accent-color);
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: var(--accent-color);
}

input, textarea {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--dim-text);
    color: var(--text-color);
    font-family: var(--font-mono);
    padding: 10px;
    outline: none;
}

input:focus, textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.btn-submit {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 10px 20px;
    font-family: var(--font-mono);
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

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

.social-links {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid var(--dim-text);
    font-size: 0.8rem;
    color: var(--dim-text);
}

/* Media Queries */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .glitch {
        font-size: 2.5rem;
    }
}