:root {
    --pico-font-family-monospace: 'Fira Code', 'Share Tech Mono', 'Courier New', monospace;
    --pico-background-color: #0c0c0c; 
    --pico-color: #00ff00; 
    --pico-primary: #00d4ff; 
    --crt-bg: rgba(5, 5, 5, 0.80);
}

html, body {
    font-family: var(--pico-font-family-monospace);
    letter-spacing: 0.05em;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #111 url('https://www.transparenttextures.com/patterns/dark-circles.png'); 
    color: #ccc;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden { display: none !important; }

h1, h2, h3, h4, nav, .cmd-line, .terminal-logo, footer, #splash-sequence {
    text-transform: uppercase;
}

.chrome-heading, h3, .label, a, nav a, .prompt, #welcome-text {
    text-shadow: 0 0 8px var(--pico-color), 0 0 2px var(--pico-color);
    color: var(--pico-color);
}

/* --- MAIN MONITOR FRAME --- */
.main-monitor-frame {
    width: 100vw;
    height: 100vh;
    max-width: 1200px; 
    position: relative;
    padding: 30px;
    box-sizing: border-box;
    background: #333; 
    border-radius: 40px;
    box-shadow: inset 5px 5px 20px rgba(255,255,255,0.1), inset -5px -5px 20px rgba(0,0,0,0.4), 0 20px 40px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen-bezel {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 30px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: inset 0 0 30px rgba(0,0,0,1);
    position: relative;
    overflow: hidden;
}

.crt-screen {
    width: 100%;
    height: 100%;
    background: var(--crt-bg);
    border-radius: 15px;
    position: relative;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
    z-index: 5;
    box-shadow: inset 0 0 100px rgba(0,255,0,0.03);
}

/* Scanlines overlay */
.crt-screen::after {
    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% 4px, 6px 100%;
    pointer-events: none;
    opacity: 0.8;
}

/* Background matrix rain inside the monitor */
#matrix-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    opacity: 0.25;
    pointer-events: none;
}

/* --- UI COMPONENTS --- */
header { border-bottom: 2px solid var(--pico-primary); padding-bottom: 20px; margin-bottom: 40px; }
.terminal-logo { width: 100%; max-width: 300px; display: block; margin: 0 auto; filter: drop-shadow(0 0 8px var(--pico-primary)); }
.terminal-window { min-height: 300px; color: #fff; }
.prompt { color: var(--pico-primary); }
.output-line { display: none; margin-top: 5px; margin-bottom: 20px; color: #ccc; }
.cursor { display: inline-block; width: 10px; height: 1.2em; background-color: var(--pico-color); vertical-align: middle; animation: blink 1s infinite; }
nav ul { justify-content: center; gap: 20px; }
nav a { font-weight: bold; text-decoration: none; transition: all 0.2s ease; cursor: pointer; }
nav a:hover, nav a.active { color: #000 !important; background-color: var(--pico-primary); border-radius: 4px; padding: 2px 8px; text-shadow: none; }

/* SPA sections */
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.4s ease-in; }
.info-card { background: #111; border: 1px solid #2a2a2a; border-radius: 8px; padding: 30px; box-shadow: inset 0 0 15px rgba(0,0,0,0.5); color: #ccc; line-height: 1.8; }
.project-card { background: #111; border: 1px solid #333; border-radius: 8px; overflow: hidden; transition: all 0.3s; }
.project-card:hover { border-color: var(--pico-color); transform: scale(1.03); }
.project-card img { width: 100%; height: 150px; object-fit: cover; border-bottom: 1px solid #333; }
.project-card .card-details { padding: 15px; }
.project-card h3 { color: var(--pico-primary); }
.tag { font-size: 0.8rem; color: #888; text-transform: uppercase; }

/* --- SPLASH SEQUENCE --- */
#splash-sequence {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 9999;
    display: flex; justify-content: center; align-items: center; flex-direction: column;
}

/* Phase 1: CRT snap-on line (0s - 1.2s) */
.crt-start-line {
    position: absolute;
    width: 0; height: 2px;
    background: #fff;
    box-shadow: 0 0 10px #fff, 0 0 20px var(--pico-color);
    animation: crt-snap-open 1.2s forwards ease-out;
    z-index: 2;
}

@keyframes crt-snap-open {
    0% { width: 0; opacity: 1; height: 2px; }
    50% { width: 100vw; opacity: 1; height: 2px; background: #fff; }
    70% { width: 100vw; height: 2px; background: var(--pico-color); }
    100% { width: 100vw; height: 100vh; opacity: 0; background: var(--pico-color); }
}

/* Phase 2: Welcome text - SLOWED DOWN: fades in at 1.2s, holds, fades out by 3.5s */
#welcome-text {
    position: absolute; color: var(--pico-color);
    font-size: clamp(1.5rem, 6vw, 2.5rem); 
    text-shadow: 0 0 15px var(--pico-color);
    opacity: 0; text-align: center;
    z-index: 1;
    animation: welcome-text-hold 2.5s 2.2s forwards;
}

@keyframes welcome-text-hold {
    0% { opacity: 0; transform: scale(0.95); }
    20% { opacity: 1; transform: scale(1); }
    75% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.02); }
}

/* --- TRANSITION CURTAIN CANVAS (full screen, above everything) --- */
#curtain-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 10000;
    display: none;
    pointer-events: none;
}

/* --- STATUS MODAL (for contact form feedback) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: flex; justify-content: center; align-items: center;
    animation: fadeIn 0.3s ease-in;
}

.modal-box {
    background: #0a0a0a;
    border: 2px solid var(--pico-color);
    box-shadow: 0 0 30px var(--pico-color), inset 0 0 20px rgba(0,255,0,0.05);
    border-radius: 8px;
    padding: 40px 50px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    color: var(--pico-color);
    font-family: var(--pico-font-family-monospace);
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--pico-color);
}

.modal-box p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-box.error {
    border-color: #ff3333;
    box-shadow: 0 0 30px #ff3333, inset 0 0 20px rgba(255,0,0,0.05);
}

.modal-box.error p {
    color: #ff3333;
    text-shadow: 0 0 8px #ff3333;
}

.modal-btn {
    background: transparent;
    border: 1px solid var(--pico-color);
    color: var(--pico-color);
    font-family: var(--pico-font-family-monospace);
    font-size: 0.9rem;
    padding: 10px 30px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: var(--pico-color);
    color: #000;
}

.modal-box.error .modal-btn {
    border-color: #ff3333;
    color: #ff3333;
}

.modal-box.error .modal-btn:hover {
    background: #ff3333;
    color: #000;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- MOBILE --- */
@media (max-width: 768px) {
    .main-monitor-frame { padding: 10px; border-radius: 15px; }
    .screen-bezel { padding: 10px; border-radius: 10px; }
    nav ul { gap: 10px; font-size: 0.8rem; }
}
