:root {
            /* Dark Mode Defaults */
            --bg-base: #000000;
            --text-main: #ffffff;
            --text-muted: #888888;
            --accent-red: #ff3333;
            --glow-red: rgba(255, 50, 50, 0.4);
            --glass-bg: rgba(20, 20, 20, 0.6);
            --glass-border: rgba(255, 255, 255, 0.08);
            --glass-highlight: rgba(255, 50, 50, 0.3);
            --shadow-base: rgba(0,0,0,0.6);
            --shadow-heavy: rgba(0,0,0,0.8);
            --hero-glow-bg: rgba(200, 10, 10, 0.15);
            --placeholder-bg: rgba(0,0,0,0.6);
            --footer-grad: rgba(20, 0, 0, 0.5);
            --font-primary: 'Inter', -apple-system, sans-serif;
            --font-title: 'Space Grotesk', sans-serif;
        }
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
        body.light-mode {
            /* Light Mode Overrides */
            --bg-base: #f2f2f7; 
            --text-main: #111111;
            --text-muted: #666666;
            --accent-red: #d30000;
            --glow-red: rgba(211, 0, 0, 0.3);
            --glass-bg: rgba(255, 255, 255, 0.6);
            --glass-border: rgba(0, 0, 0, 0.05);
            --glass-highlight: rgba(211, 0, 0, 0.2);
            --shadow-base: rgba(0,0,0,0.05);
            --shadow-heavy: rgba(0,0,0,0.1);
            --hero-glow-bg: rgba(211, 0, 0, 0.08);
            --placeholder-bg: rgba(0,0,0,0.05);
            --footer-grad: rgba(255, 200, 200, 0.3);
        }

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

        html {
            scroll-behavior: smooth;
            font-size: 110%;
        }

        body {
            background-color: var(--bg-base);
            color: var(--text-main);
            font-family: var(--font-primary);
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            transition: background-color 0.5s ease, color 0.5s ease;
        }

        nav {
            position: fixed;
            top: 24px;
            left: 50%;
            transform: translateX(-50%);
            width: 90%;
            height: 10%;
            max-width: 950px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 24px;
            background: var(--glass-bg);
            backdrop-filter: blur(24px) saturate(150%);
            -webkit-backdrop-filter: blur(24px) saturate(150%);
            border: 1px solid var(--glass-border);
            border-radius: 100px;
            z-index: 100;
            box-shadow: 0 20px 40px var(--shadow-heavy), inset 0 1px 0 rgba(255,255,255,0.05);
            transition: all 0.5s ease;
        }

        .nav-left, .nav-right {
            display: flex;
            align-items: center;
            gap: 15px;
            }
        .brand-logo {
            font-family: 'Space Grotesk', sans-serif;
            font-weight: 900;
            font-size: 1.3rem;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--text-main);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
            z-index: 101;
        }

        .brand-logo::before {
            content: '';
            display: inline-block;
            width: 12px; height: 12px;
            background: var(--accent-red);
            border-radius: 50%;
            box-shadow: 0 0 15px var(--accent-red);
            transition: all 0.3s ease;
        }

        .brand-logo:hover::before {
            transform: scale(1.2);
            box-shadow: 0 0 25px var(--accent-red);
        }

        .nav-links {
            display: flex;
            gap: 30px;
            list-style: none;
        }

        .nav-links a {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 600;
            letter-spacing: 1px;
            text-transform: uppercase;
            transition: color 0.3s ease, text-shadow 0.3s ease;
            font-family: var(--font-title);
        }

        .nav-links a:hover, .nav-links a.active {
            color: var(--accent-red);
            text-shadow: 0 0 10px rgba(255, 50, 50, 0.5);
        }

        .control-btn {
            background: transparent;
            border: none;
            color: var(--text-main);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 42px;
            height: 42px;
            border-radius: 50%;
            background: rgba(128,128,128,0.1);
            transition: all 0.3s ease;
        }
        .control-btn:hover {
            background: rgba(128,128,128,0.2);
            color: var(--accent-red);
            transform: scale(1.05);
        }
        .control-btn svg { width: 18px; height: 18px; fill: currentColor; }
        .sun-icon { display: none; }
        body.light-mode .sun-icon { display: block; }
        body.light-mode .moon-icon { display: none; }

        .menu-toggle {
            display: none;
            flex-direction: column;
            gap: 5px;
            cursor: pointer;
            z-index: 101;
            padding: 5px;
        }
        .menu-toggle span {
            width: 24px; height: 2px;
            background: var(--text-main);
            border-radius: 2px;
            transition: 0.3s;
        }

        .mobile-menu-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            opacity: 0; pointer-events: none; transition: opacity 0.4s ease; z-index: 998;
        }
        .mobile-menu-overlay.active { opacity: 1; pointer-events: all; }

        .bottom-sheet {
            position: fixed; bottom: 0; left: 0; width: 100%;
            background: var(--glass-bg); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
            border-top: 1px solid var(--glass-border); border-radius: 30px 30px 0 0;
            padding: 20px 30px 50px; transform: translateY(100%); transition: transform 0.5s cubic-bezier(0.3, 1, 0.2, 1);
            z-index: 999; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        }
        .bottom-sheet.active { transform: translateY(0); }
        .sheet-handle { width: 50px; height: 4px; background: rgba(128, 128, 128, 0.4); border-radius: 4px; margin: 0 auto 30px; }
        .sheet-links { list-style: none; display: flex; flex-direction: column; gap: 20px; text-align: center; }
        .sheet-links a { color: var(--text-main); text-decoration: none; font-size: 1.5rem; font-family: var(--font-title); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; transition: color 0.3s; }
        .sheet-links a:hover { color: var(--accent-red); }

        .work-header {
            padding: 160px 5% 40px;
            max-width: 1200px;
            margin: 0 auto;
            position: relative;
            text-align: center;
        }

        .work-glow {
            position: absolute;
            width: 80vw; height: 45vh;
            background: radial-gradient(ellipse at top, var(--hero-glow-bg) 0%, transparent 70%);
            top: 0; left: 50%;
            transform: translateX(-50%);
            filter: blur(60px);
            z-index: -1; pointer-events: none;
        }

        .work-header h1 {
            font-family: var(--font-title);
            font-size: clamp(3rem, 7vw, 5.5rem);
            font-weight: 900;
            letter-spacing: -0.05em;
            margin-bottom: 20px;
            text-transform: uppercase;
            background: linear-gradient(180deg, var(--text-main) 0%, var(--text-muted) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        body.light-mode .work-header h1 {
            background: linear-gradient(180deg, #111 0%, #777 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .work-header p {
            color: var(--text-muted);
            font-size: 1.2rem;
            max-width: 600px;
            margin: 0 auto 40px;
            line-height: 1.6;
        }

        .filter-tabs {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 50px;
        }

        .filter-pill {
            padding: 12px 24px;
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            border-radius: 50px;
            color: var(--text-muted);
            font-family: var(--font-title);
            font-weight: 600;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            cursor: pointer;
            backdrop-filter: blur(10px);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .filter-pill:hover, .filter-pill.active {
            background: var(--accent-red);
            border-color: var(--accent-red);
            color: #ffffff;
            box-shadow: 0 5px 20px rgba(255, 50, 50, 0.3);
            transform: translateY(-2px);
        }

        .projects-grid {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px 120px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
            gap: 40px;
        }

        .project-card {
            background: var(--glass-bg);
            backdrop-filter: blur(25px);
            -webkit-backdrop-filter: blur(25px);
            border: 1px solid var(--glass-border);
            border-radius: 30px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            cursor: pointer;
            box-shadow: 0 15px 35px var(--shadow-base);
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
        }

        .project-card::before {
            content: '';
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(135deg, rgba(255,50,50,0.05), transparent);
            opacity: 0;
            transition: opacity 0.4s;
        }

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

        .project-card:hover {
            border-color: var(--glass-highlight);
            box-shadow: 0 30px 60px var(--shadow-heavy), 0 0 35px var(--glow-red);
            transform: translateY(-8px);
        }

        .project-media {
            width: 100%;
            height: 240px;
            border-radius: 20px;
            overflow: hidden;
            background: var(--placeholder-bg);
            position: relative;
            border: 1px solid var(--glass-border);
        }

        .project-media img {
            width: 100%; height: 100%; object-fit: cover;
            transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .project-card:hover .project-media img {
            transform: scale(1.06);
        }

        .project-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .tag {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 700;
            padding: 5px 12px;
            border-radius: 50px;
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--glass-border);
            color: var(--text-muted);
        }

        .project-card:hover .tag {
            border-color: rgba(255,50,50,0.2);
            color: var(--text-main);
        }

        .project-info h3 {
            font-family: var(--font-title);
            font-size: 1.5rem;
            line-height: 1.3;
            font-weight: 700;
            margin-bottom: 8px;
            transition: color 0.3s;
        }

        .project-card:hover h3 { color: var(--accent-red); }

        .project-info p {
            color: var(--text-muted);
            font-size: 0.95rem;
            line-height: 1.6;
        }

        .project-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text-main);
            font-family: var(--font-title);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 1px;
            margin-top: 10px;
            transition: color 0.3s;
        }

        .project-link span {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px; height: 32px;
            border-radius: 50%;
            background: rgba(128,128,128,0.2);
            transition: transform 0.3s, background 0.3s;
        }

        .project-card:hover .project-link { color: var(--accent-red); }
        .project-card:hover .project-link span { transform: translateX(5px); background: var(--accent-red); color: white; }

        .modal {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.4s ease;
            padding: 20px;
        }

        .modal.active {
            opacity: 1;
            pointer-events: all;
        }

        .modal-content {
            background: #0a0a0a;
            border: 1px solid var(--glass-border);
            border-radius: 30px;
            width: 100%;
            max-width: 850px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 30px 70px rgba(0,0,0,0.8);
            transform: scale(0.95);
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            overflow: auto;
            /* Firefox */
            scrollbar-width: none;

            /* IE & Edge */
            -ms-overflow-style: none;
        }

        body.light-mode .modal-content {
            background: #ffffff;
        }

        .modal.active .modal-content {
            transform: scale(1);
        }

        .modal-close {
            position: absolute;
            top: 20px; right: 20px;
            width: 40px; height: 40px;
            border-radius: 50%;
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--glass-border);
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 1010;
            transition: background 0.3s, color 0.3s;
        }

        .modal-close:hover {
            background: var(--accent-red);
            color: white;
        }

        .modal-body {
            padding: 40px;
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        .modal-media {
            width: 100%;
            height: 380px;
            border-radius: 20px;
            overflow: hidden;
            border: 1px solid var(--glass-border);
        }

        .modal-media img {
            width: 100%; height: 100%; object-fit: cover;
        }

        .modal-desc h2 {
            font-family: var(--font-title);
            font-size: 2.2rem;
            margin-bottom: 15px;
        }

        .modal-desc p {
            color: var(--text-muted);
            line-height: 1.8;
            font-size: 1.05rem;
            margin-bottom: 25px;
            white-space: pre-wrap; /* Added to keep markdown line breaks */
        }

        .glass-footer {
            margin-top: 50px;
            padding: 100px 20px 50px;
            border-top: 1px solid rgba(255, 50, 50, 0.1);
            background: linear-gradient(to top, var(--footer-grad), transparent);
            position: relative;
            z-index: 10;
        }
        .footer-container { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 60px; }
        .footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 40px; }
        .footer-brand { display: flex; flex-direction: column; gap: 15px; }
        .footer-brand h2 { font-family: 'Space Grotesk', sans-serif; font-size: 3rem; letter-spacing: -1px; display: flex; align-items: center; gap: 12px; }
        .footer-brand h2::before { content: ''; display: inline-block; width: 16px; height: 16px; background: var(--accent-red); border-radius: 50%; box-shadow: 0 0 20px var(--accent-red); }
        .footer-brand p { color: var(--text-muted); font-size: 1.1rem; max-width: 350px; line-height: 1.6; }
        .footer-socials { display: flex; gap: 20px; }
        
        .social-icon { 
            width: 55px; height: 55px; 
            border-radius: 50%; 
            border: 1px solid var(--glass-border); 
            background: var(--glass-bg); 
            display: flex; align-items: center; justify-content: center; 
            color: var(--text-main); 
            transition: all 0.4s ease; 
            text-decoration: none; 
        }
        .social-icon svg { width: 24px; height: 24px; fill: currentColor; transition: transform 0.4s; }
        .social-icon:hover { 
            border-color: var(--accent-red); 
            background: var(--glow-red); 
            color: var(--accent-red); 
            transform: translateY(-5px); 
            box-shadow: 0 10px 25px rgba(255, 50, 50, 0.2); 
        }
        .social-icon:hover svg { transform: scale(1.1); }
        .footer-bottom { text-align: center; color: var(--text-muted); font-size: 0.9rem; letter-spacing: 1.5px; padding-top: 40px; border-top: 1px solid var(--glass-border); text-transform: uppercase; font-family: var(--font-title); }

        /* Animation classes */
        .reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
        .reveal.active { opacity: 1; transform: translateY(0); }

        @media (max-width: 900px) {
            .footer-top { flex-direction: column; text-align: center; align-items: center; }
            .footer-brand h2 { justify-content: center; }
        }

        @media (max-width: 768px) {
            html { font-size: 95%; }
            nav { height: 10vh; padding: 0 15px; }
            .nav-links { display: none; } 
            .menu-toggle { display: flex; } 
            .brand-logo { font-size: 1.1rem; }
            .control-btn { width: 34px; height: 34px; }
            .control-btn svg { width: 16px; height: 16px; }
            
            .work-header { padding-top: 130px; }
            .work-header h1 { font-size: 3rem; }
            .filter-tabs { gap: 8px; }
            .filter-pill { padding: 8px 16px; font-size: 0.8rem; }
            .projects-grid { grid-template-columns: 1fr; gap: 30px; }
            .project-card { padding: 16px; height: auto; }
            .project-media { height: 180px; }
            .modal-body { padding: 25px; }
            .modal-media { height: 220px; }
        }


img, svg { max-width: 100%; }
@media (max-width: 520px) {
    nav { max-width: calc(100% - 24px); }
}
