/* --- 1. Variables & Reset --- */
:root {
    --bg-dark: #050505;
    --primary: #8A2BE2; /* BlueViolet */
    --accent: #00E5FF;  /* Cyan */
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    /* Subtle Grain Overlay */
    background-image: radial-gradient(circle at 15% 50%, rgba(138, 43, 226, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.15), transparent 25%);
    color: var(--text);
    overflow-x: hidden;
}

/* --- 2. Ultra-Secure Loader (Mobile Fixed) --- */
#loader {
    position: fixed;
    inset: 0; /* Full screen top/bottom/left/right */
    background: #000;
    z-index: 99999; /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    position: relative;
    width: 80px;
    height: 80px;
}

.loader-logo {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: var(--text);
}

.spinner-ring {
    width: 100%; height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- 3. Custom Cursor (Desktop Only) --- */
@media (pointer: fine) {
    #cursor {
        position: fixed;
        width: 10px; height: 10px;
        background: var(--accent);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
    }
    #cursor-blur {
        position: fixed;
        width: 200px; height: 200px;
        background: rgba(138, 43, 226, 0.15);
        filter: blur(50px);
        border-radius: 50%;
        pointer-events: none;
        z-index: 1; /* Behind content */
        transform: translate(-50%, -50%);
        transition: 0.1s;
    }
}

/* --- 4. Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.section-pad {
    padding: 100px 0; /* Clear spacing between sections */
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    color: transparent;
}

/* --- 5. Navigation --- */
.glass-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
}

.nav-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.logo span { color: var(--primary); }

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.btn-glow {
    padding: 10px 25px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: 0.3s;
}
.btn-glow:hover { box-shadow: 0 0 20px rgba(0, 229, 255, 0.4); }

.menu-toggle { display: none; font-size: 1.5rem; color: #fff; cursor: pointer; }

/* --- 6. Hero Section --- */
.hero {
    min-height: 100vh; /* Changed from fixed height */
    padding-top: 120px; /* Space for navbar */
    padding-bottom: 50px;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem); /* Responsive Font */
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
}

.btn-group { display: flex; gap: 15px; }

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary { background: #fff; color: #000; }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid var(--border); }

/* Hero Image & Floating Badges */
.hero-visual { position: relative; display: flex; justify-content: center; }

.profile-card {
    padding: 15px;
    position: relative;
    max-width: 400px;
    width: 100%;
}

.profile-card img {
    width: 100%;
    border-radius: 15px;
    display: block;
}

.floating-badge {
    position: absolute;
    background: rgba(20, 20, 20, 0.9);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.badge-1 { top: 30px; left: -30px; }
.badge-2 { bottom: 40px; right: -30px; }

/* --- 7. Stats Section --- */
.stats-container {
    padding: 20px 0;
    margin-top: 20px;
}
.stats-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    padding: 30px;
}
.stat h2 { font-size: 2.5rem; color: var(--accent); }
.stat p { color: var(--text-muted); font-size: 0.9rem; }

/* --- 8. Grid Systems (Projects & Blog) --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Project Card */
.project-card, .blog-card {
    overflow: hidden;
    transition: transform 0.3s;
}
.project-card:hover, .blog-card:hover { transform: translateY(-10px); }

.card-img, .blog-img {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-img img, .blog-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: 0.5s;
}

.project-card:hover img, .blog-card:hover img { transform: scale(1.1); }

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.3s;
}
.project-card:hover .card-overlay { opacity: 1; }

.icon-btn {
    width: 50px; height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: #000;
}

.card-info, .blog-content { padding: 25px; }

.tags span {
    font-size: 0.8rem;
    padding: 5px 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    margin-right: 5px;
    color: var(--accent);
}

/* --- 9. Blog Specific Styling --- */
.category {
    position: absolute;
    top: 15px; left: 15px;
    background: var(--primary);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}
.date { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 10px; }
.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* --- 10. Contact Section --- */
.contact-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 50px;
}
.contact-form { display: flex; flex-direction: column; gap: 15px; }
.contact-form input, .contact-form textarea {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 10px;
    color: #fff;
    outline: none;
}
.contact-form input:focus { border-color: var(--primary); }

footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border);
    margin-top: 50px;
    color: var(--text-muted);
}

/* --- 11. ANIMATIONS --- */
@keyframes spin { to { transform: rotate(360deg); } }

.fade-up { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* --- 12. RESPONSIVE MEDIA QUERIES (Important!) --- */
@media (max-width: 900px) {
    .hero-grid, .contact-box { grid-template-columns: 1fr; text-align: center; }
    .hero-text { order: 2; margin-top: 30px; }
    .hero-visual { order: 1; }
    .btn-group { justify-content: center; }
    .profile-card { max-width: 300px; margin: 0 auto; }
    
    /* Mobile Menu */
    .menu-toggle { display: block; }
    .nav-menu {
        position: fixed;
        top: 70px; right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0,0,0,0.95);
        flex-direction: column;
        justify-content: center;
        transition: 0.4s;
    }
    .nav-menu.active { right: 0; }
    
    /* Fix Stats overlap on mobile */
    .stats-box { grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 480px) {
    .stats-box { grid-template-columns: 1fr; }
    .floating-badge { display: none; } /* Hide floating elements on very small screens to save space */
    h1 { font-size: 2.2rem; }
    .contact-box { padding: 25px; }
}