:root {
            --primary: #0033ff;
            --primary-glow: rgba(0, 51, 255, 0.4);
            --bg-dark: #010010;
            --card-bg: rgba(10, 10, 35, 0.8);
            --text-main: #ffffff;
            --text-dim: #aeb5d9;
            --accent: #3b82f6;
            --sidebar-width: clamp(240px, 20vw, 300px);
        }

        * { 
            margin: 0; 
            padding: 0; 
            box-sizing: border-box; 
            font-family: 'Poppins', sans-serif; 
        }
        
        body {
            background: var(--bg-dark);
            color: var(--text-main);
            overflow-x: hidden;
            min-height: 100vh;
            display: flex;
            flex-direction: column; /* Mobile first stack */
        }

        /* --- Ambient Background --- */
        .bg-glow {
            position: fixed;
            inset: 0;
            background: 
                radial-gradient(circle at 15% 20%, #1a1a50aa, transparent 40%),
                radial-gradient(circle at 85% 70%, #0033ff44, transparent 40%);
            filter: blur(80px); /* Slightly reduced blur for mobile performance */
            z-index: -2;
        }

        .grid-overlay {
            position: fixed;
            inset: 0;
            background-image: linear-gradient(rgba(10, 10, 42, 0.2) 1px, transparent 1px),
                              linear-gradient(90deg, rgba(10, 10, 42, 0.2) 1px, transparent 1px);
            background-size: 50px 50px;
            z-index: -1;
        }

        /* --- Mobile Overlay --- */
        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .sidebar-overlay.active {
            display: block;
            opacity: 1;
        }

        /* --- Sidebar (Mobile First) --- */
        nav.sidebar {
            position: fixed;
            left: 0;
            top: 0;
            height: 100vh;
            width: 280px; /* Fixed mobile width */
            background: rgba(2, 2, 20, 0.9);
            backdrop-filter: blur(15px);
            border-right: 1px solid rgba(255, 255, 255, 0.05);
            display: flex;
            flex-direction: column;
            padding: 2.5rem 1.5rem;
            z-index: 1000;
            transform: translateX(-100%); /* Hidden by default on mobile */
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            overflow-y: auto;
        }

        nav.sidebar.active { transform: translateX(0); }

        .profile-container { text-align: center; margin-bottom: 2rem; }

        .profile-img {
            width: 100%;
            max-width: 100px;
            aspect-ratio: 1 / 1;
            border-radius: 50%;
            border: 3px solid var(--primary);
            padding: 5px;
            box-shadow: 0 0 20px var(--primary-glow);
            object-fit: cover;
        }

        .nav-links { display: flex; flex-direction: column; gap: 0.5rem; }

        .nav-links a {
            display: flex; align-items: center; padding: 0.75rem 1rem;
            color: var(--text-dim); text-decoration: none;
            border-radius: 12px; transition: 0.3s; font-size: 0.95rem;
        }

        .nav-links a i { width: 25px; font-size: 1.1rem; }
        .nav-links a span { margin-left: 10px; }

        .nav-links a:hover, .nav-links a.active {
            background: rgba(0, 51, 255, 0.15); color: #fff; transform: translateX(5px);
        }

        /* --- Mobile Toggle Button --- */
        .mobile-toggle {
            display: flex; align-items: center; justify-content: center;
            position: fixed; top: 1rem; right: 1rem; z-index: 2000;
            background: var(--primary); width: 3rem; height: 3rem;
            border-radius: 12px; border: none; color: white;
            font-size: 1.5rem; cursor: pointer;
            box-shadow: 0 4px 15px var(--primary-glow); transition: transform 0.2s;
        }
        .mobile-toggle:active { transform: scale(0.95); }

        /* --- Main Content Layout --- */
        main {
            flex: 1;
            width: 100%;
            padding: 5rem 1.5rem 6rem 1.5rem; /* Space for mobile header and footer */
            transition: 0.4s;
        }

        .projects-header {
            text-align: center;
            margin-bottom: 2.5rem;
            animation: fadeInDown 0.8s ease;
        }

        .projects-header h1 {
            font-size: clamp(2.2rem, 5vw, 3rem); /* Fluid typography */
            margin-bottom: 0.5rem;
            background: linear-gradient(to right, #fff, var(--accent));
            background-clip: text;
            -webkit-text-fill-color: transparent;
            line-height: 1.2;
        }
        
        .projects-header p {
            font-size: clamp(0.85rem, 3vw, 1rem);
        }

        /* --- Projects Grid --- */
        .projects-grid {
            display: grid;
            /* Using min() ensures it doesn't break on screens smaller than 320px */
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
            gap: 1.5rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        /* --- Project Card --- */
        .project-card {
            background: var(--card-bg);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            padding: 2rem 1.5rem;
            position: relative;
            backdrop-filter: blur(20px);
            transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex;
            flex-direction: column;
            animation: slideUp 0.6s ease-out forwards;
            opacity: 0;
        }

        .project-card:hover {
            transform: translateY(-5px); /* Slightly less aggressive jump on mobile */
            border-color: var(--primary);
            box-shadow: 0 15px 40px rgba(0, 51, 255, 0.2);
        }

        .card-dots {
            position: absolute; top: 15px; left: 20px;
            display: flex; gap: 6px;
        }
        .dot { width: 8px; height: 8px; border-radius: 50%; }
        .red { background: #ff5f56; }
        .yellow { background: #ffbd2e; }
        .green { background: #27c93f; }

        .project-card i.main-icon {
            font-size: 2.5rem;
            color: var(--accent);
            margin: 10px 0 15px;
        }

        .project-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
        
        .project-card p {
            color: var(--text-dim);
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 1.5rem;
            flex-grow: 1; /* Pushes button to bottom */
        }

        /* Tech Badges */
        .tech-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem; }
        .badge {
            background: rgba(59, 130, 246, 0.1); color: var(--accent);
            padding: 4px 10px; border-radius: 6px; font-size: 0.75rem;
            font-family: 'JetBrains Mono', monospace; border: 1px solid rgba(59, 130, 246, 0.2);
        }

        /* Card Button */
        .btn-card {
            display: flex; align-items: center; justify-content: center; gap: 10px;
            background: var(--primary); color: white; padding: 0.8rem; border-radius: 12px;
            text-decoration: none; font-weight: 500; transition: 0.3s; font-size: 0.95rem;
        }
        .btn-card:hover { background: #1a4aff; transform: scale(1.02); }
        .btn-locked { background: rgba(255,255,255,0.05); color: #666; cursor: not-allowed; pointer-events: none;}

        /* --- Footer --- */
        footer {
            position: fixed; bottom: 0; width: 100%; padding: 1rem;
            text-align: center; font-size: 0.8rem; color: var(--text-dim);
            background: rgba(1, 0, 16, 0.8); backdrop-filter: blur(10px);
            border-top: 1px solid rgba(255,255,255,0.05); z-index: 100;
        }

        /* --- Animations --- */
        @keyframes fadeInDown {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes slideUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* =========================================
           RESPONSIVE BREAKPOINTS
           ========================================= */

        /* --- Tablet (768px and up) --- */
        @media (min-width: 768px) {
            main { padding: 5rem 2.5rem 6rem; }
            .projects-grid { gap: 2rem; }
            .project-card { padding: 2.5rem 2rem; }
            .project-card:hover { transform: translateY(-10px); } /* Restore larger jump */
        }
 /* d */
        /* --- Desktop (1024px and up) --- */
        @media (min-width: 1024px) {
            body { flex-direction: row; }
            .mobile-toggle { display: none; }
            .sidebar-overlay { display: none !important; }
            
            nav.sidebar {
                transform: translateX(0);
                width: var(--sidebar-width);
            }
            
            main {
                margin-left: var(--sidebar-width);
                padding: 4rem 3rem 6rem;
            }

            footer {
                width: calc(100% - var(--sidebar-width));
                left: var(--sidebar-width);
            }

            .bg-glow { filter: blur(120px); }
        }