/* Base styles and custom properties */
        :root {
            --bg-color: #0d0e15;
            --text-color: #e0e0e0;
            --accent-primary: #00ff00; /* Retro green */
            --accent-secondary: #ff00ff; /* Retro magenta */
            --accent-tertiary: #00ffff; /* Retro cyan */
            --scanline-color: rgba(0, 0, 0, 0.15);
        }

        body {
            font-family: 'Courier New', Courier, monospace; /* Fallback for readable text */
            background-color: var(--bg-color);
            color: var(--text-color);
            overflow-x: hidden;
            margin: 0;
            padding: 0;
            cursor: crosshair;
        }

        /* Pixel font for headings and special elements */
        .pixel-font {
            font-family: 'Press Start 2P', cursive;
            line-height: 1.5;
        }

        /* CRT Screen Effect - Scanlines */
        body::before {
            content: " ";
            display: block;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            background: linear-gradient(
                to bottom,
                rgba(18, 16, 16, 0) 50%,
                var(--scanline-color) 50%
            );
            background-size: 100% 4px;
            z-index: 50;
            pointer-events: none;
        }

        /* CRT Screen Effect - Flicker/Vignette */
        body::after {
            content: " ";
            display: block;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4) 100%);
            z-index: 51;
            pointer-events: none;
            animation: flicker 0.15s infinite;
        }

        @keyframes flicker {
            0% { opacity: 0.95; }
            50% { opacity: 1; }
            100% { opacity: 0.95; }
        }

        /* Glitch Effect for Text */
        .glitch-wrapper {
            position: relative;
        }
        
        .glitch {
            position: relative;
            color: var(--accent-primary);
            font-size: clamp(1.5rem, 4vw, 3rem);
            font-weight: bold;
            z-index: 1;
        }

        .glitch::before,
        .glitch::after {
            content: attr(data-text);
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-color);
        }

        .glitch::before {
            left: 2px;
            text-shadow: -2px 0 var(--accent-secondary);
            clip: rect(44px, 450px, 56px, 0);
            animation: glitch-anim 5s infinite linear alternate-reverse;
        }

        .glitch::after {
            left: -2px;
            text-shadow: -2px 0 var(--accent-tertiary);
            clip: rect(44px, 450px, 56px, 0);
            animation: glitch-anim2 5s infinite linear alternate-reverse;
        }

        @keyframes glitch-anim {
            0% { clip: rect(13px, 9999px, 83px, 0); }
            20% { clip: rect(61px, 9999px, 32px, 0); }
            40% { clip: rect(49px, 9999px, 80px, 0); }
            60% { clip: rect(81px, 9999px, 7px, 0); }
            80% { clip: rect(67px, 9999px, 14px, 0); }
            100% { clip: rect(11px, 9999px, 59px, 0); }
        }

        @keyframes glitch-anim2 {
            0% { clip: rect(72px, 9999px, 14px, 0); }
            20% { clip: rect(21px, 9999px, 63px, 0); }
            40% { clip: rect(54px, 9999px, 31px, 0); }
            60% { clip: rect(18px, 9999px, 90px, 0); }
            80% { clip: rect(87px, 9999px, 43px, 0); }
            100% { clip: rect(32px, 9999px, 11px, 0); }
        }

        /* 8-bit Buttons */
        .btn-8bit {
            display: inline-block;
            padding: 10px 20px;
            background-color: var(--bg-color);
            color: var(--accent-primary);
            border: 4px solid var(--accent-primary);
            text-transform: uppercase;
            text-decoration: none;
            position: relative;
            transition: all 0.1s;
            cursor: pointer;
            box-shadow: 
                inset -4px -4px 0px rgba(0,0,0,0.5),
                4px 4px 0px rgba(0,0,0,0.5);
        }

        .btn-8bit:hover, .btn-8bit:focus {
            background-color: var(--accent-primary);
            color: var(--bg-color);
            box-shadow: 
                inset 4px 4px 0px rgba(255,255,255,0.5),
                2px 2px 0px rgba(0,0,0,0.5);
            transform: translate(2px, 2px);
            outline: none;
        }

        .btn-8bit:active {
            box-shadow: inset 4px 4px 0px rgba(0,0,0,0.8);
            transform: translate(4px, 4px);
        }

        /* Nav Links */
        .nav-link {
            position: relative;
            color: var(--text-color);
            text-decoration: none;
            transition: color 0.3s;
        }

        .nav-link:hover {
            color: var(--accent-tertiary);
        }

        .nav-link::before {
            content: '>';
            position: absolute;
            left: -20px;
            opacity: 0;
            color: var(--accent-primary);
            animation: blink 1s step-end infinite;
        }

        .nav-link:hover::before {
            opacity: 1;
        }

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

        /* Project Cards (Cartridges) */
        .project-card {
            background: #2a2a2a;
            border: 4px solid #555;
            border-radius: 8px 8px 0 0;
            position: relative;
            transition: transform 0.3s ease;
            image-rendering: pixelated;
        }

        .project-card:hover {
            transform: translateY(-10px);
            border-color: var(--accent-primary);
            box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
        }

        .project-card::before {
            content: '';
            position: absolute;
            bottom: -15px;
            left: -4px;
            right: -4px;
            height: 15px;
            background: #1a1a1a;
            border-left: 4px solid #555;
            border-right: 4px solid #555;
            border-bottom: 4px solid #555;
        }

        .project-card:hover::before {
            border-color: var(--accent-primary);
        }
        
        .project-label {
            background: #eee;
            color: #000;
            padding: 10px;
            margin: 10px;
            border: 2px solid #000;
            border-radius: 4px;
        }

        /* Skill Bars */
        .skill-container {
            width: 100%;
            background-color: #333;
            border: 2px solid #555;
            margin-bottom: 1rem;
            position: relative;
            height: 24px;
        }

        .skill-bar {
            height: 100%;
            background-color: var(--accent-primary);
            width: 0%; /* Set via inline style or JS */
            transition: width 1s ease-in-out;
            position: relative;
            box-shadow: inset 0 -4px 0 rgba(0,0,0,0.3);
        }
        
        .skill-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: rgba(255,255,255,0.3);
        }

        .skill-text {
            position: absolute;
            top: 50%;
            left: 10px;
            transform: translateY(-50%);
            color: #fff;
            text-shadow: 1px 1px 0 #000;
            z-index: 10;
            font-size: 0.7rem;
        }

        /* Modal styling */
        #message-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            z-index: 100;
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background: var(--bg-color);
            border: 4px solid var(--accent-primary);
            padding: 2rem;
            max-width: 500px;
            text-align: center;
            box-shadow: 10px 10px 0px rgba(0,0,0,0.5);
        }

        /* Interactive Canvas Background */
        #gameCanvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.3; /* Keep it subtle */
        }
        
        /* Typewriter effect */
        .typewriter {
            overflow: hidden;
            border-right: .15em solid var(--accent-primary);
            white-space: nowrap;
            margin: 0 auto;
            letter-spacing: .15em;
            animation: 
                typing 3.5s steps(40, end),
                blink-caret .75s step-end infinite;
        }

        @keyframes typing {
            from { width: 0 }
            to { width: 100% }
        }

        @keyframes blink-caret {
            from, to { border-color: transparent }
            50% { border-color: var(--accent-primary); }
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 12px;
        }
        ::-webkit-scrollbar-track {
            background: var(--bg-color);
            border-left: 2px solid #333;
        }
        ::-webkit-scrollbar-thumb {
            background: #555;
            border: 2px solid var(--bg-color);
        }
        ::-webkit-scrollbar-thumb:hover {
            background: var(--accent-primary);
        }
        
        /* Utility classes */
        .text-shadow {
            text-shadow: 2px 2px 0px #000;
        }
        
        .border-retro {
            border: 4px solid #555;
            box-shadow: 
                inset -4px -4px 0px rgba(0,0,0,0.5),
                4px 4px 0px rgba(0,0,0,0.5);
        }

        #ai-terminal-input {
            background: transparent;
            border: none;
            color: var(--accent-primary);
            font-family: 'Courier New', Courier, monospace;
            width: 80%;
            outline: none;
        }

        #ai-terminal-input::placeholder {
            color: rgba(0, 255, 0, 0.5);
        }

        .terminal-message {
            margin-bottom: 0.5rem;
            word-wrap: break-word;
        }
        
        .terminal-user {
            color: var(--accent-tertiary);
        }
        
        .terminal-ai {
            color: var(--accent-primary);
        }
        
        .terminal-system {
            color: var(--accent-secondary);
        }