/* =========================================
   1. VARIABLES & RESET
   ========================================= */
   :root {
    /* Color Palette - Deep Dark Theme */
    --bg: #050505;
    --card-bg: #101010;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    
    /* Typography Colors */
    --text-primary: #ffffff;
    --text-secondary: #888888;
    
    /* Accents */
    --accent: #3b82f6; /* Electric Blue */
    --accent-glow: rgba(59, 130, 246, 0.4);
    
    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* =========================================
   2. TEXTURE OVERLAY (NOISE)
   ========================================= */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* =========================================
   ABOUT SECTION (Split Layout)
   ========================================= */
   .about-split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Text takes slightly more space */
    gap: 4rem;
    align-items: center; /* Vertically centers the text with the image */
    margin-bottom: 6rem; /* Space between About and Projects */
    padding-top: 2rem;
}

.about-text h2 {
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    /* Optional: Adds a subtle glow behind the image */
    box-shadow: 0 0 30px rgba(0,0,0,0.5); 
}

.about-image-container img {
    width: 100%;
    height: auto;
    display: block;
    /* Optional: subtle grayscale that fades in on hover */
    filter: grayscale(30%); 
    transition: 0.3s;
}

.about-image-container:hover img {
    filter: grayscale(0%);
}

/* Mobile: Stack them */
@media (max-width: 768px) {
    .about-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    /* Optional: If you want image on top on mobile, use order: -1; */
}

/* =========================================
   3. NAVIGATION (FLOATING GLASS)
   ========================================= */
/* --- New Top Navigation --- */
.top-nav {
    position: absolute; /* Sits on top of the hero/background */
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 1000;
    background: transparent; /* No bar background */
    border: none;
}

/* Ensure the nav content matches your site width */
.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand { 
    font-family: var(--font-heading); 
    font-weight: 700; 
    font-size: 1.5rem; /* Slightly larger logo */
    letter-spacing: -0.5px; 
}

.nav-links { display: flex; gap: 2.5rem; }

.nav-item { 
    font-size: 1rem; 
    color: var(--text-secondary); 
    font-weight: 500;
    transition: 0.2s;
}

.nav-item:hover { 
    color: var(--text-primary); 
    text-shadow: 0 0 10px rgba(255,255,255,0.3); /* Subtle glow on hover */
}

.nav-content { display: flex; justify-content: space-between; align-items: center; }
.brand { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.5px; }
.dot { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; }
.nav-item { font-size: 0.9rem; color: var(--text-secondary); }
.nav-item:hover { color: var(--text-primary); }

/* =========================================
   4. LAYOUT & TYPOGRAPHY UTILITIES
   ========================================= */
main {
    max-width: 1200px;
    margin: 0 auto; /* Removed the 140px top margin */
    padding: 0 2rem;
    padding-bottom: 4rem;
}

h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.03em; }
.text-muted { color: var(--text-secondary); }

.section-title { 
    font-size: 1.5rem; 
    margin-bottom: 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-top: 2rem;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--card-border); }

/* =========================================
   5. HERO SECTION (WITH SHADER SUPPORT)
   ========================================= */
.hero { 
    position: relative; 
    height: 80vh; 
    min-height: 500px;
    display: flex;
    align-items: center; 
    overflow: hidden;
    padding: 0;
    margin-bottom: 4rem;

    /* The Breakout Magic */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* REALIGN TEXT (Put the text back in the center box) */
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px; /* Match main width */
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Ensure Canvas fills the new full-width hero */
#hero-canvas {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    z-index: 1; 
    opacity: 0.6;
}

/* Hero Typography */
.hero h1 { 
    font-size: 4rem; 
    line-height: 1.1; 
    margin-bottom: 1rem; 
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8); /* Shadow for readability over shader */
}

.hero p { 
    font-size: 1.2rem; 
    color: #ddd; /* Lighter text for contrast over shader */
    max-width: 600px; 
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Tech Badges */
.tech-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1rem; }
.badge { 
    font-family: var(--font-code); 
    font-size: 0.75rem; 
    background: rgba(0, 0, 0, 0.6); /* Darker background for readability */
    padding: 4px 8px; 
    border-radius: 4px; 
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    backdrop-filter: blur(4px);
}

/* =========================================
   6. BENTO GRID (PROJECTS)
   ========================================= */
.bento-grid {
    display: grid;
    /* Changed 300px to 450px -> forces cards to be much wider/larger */
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px; /* Increased gap for cleaner look */
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--card-hover-border);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.card-img-container {
    height: 300px; /* Was 200px - Taller images look much better */
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid var(--card-border);
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr; /* Stack vertically on phone */
    }
}

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

.card:hover .card-img-container img { transform: scale(1.05); }

.card-content { padding: 1.5rem; }
.card-content h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.card-content p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; }
.card-link { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--text-primary); 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
}
.card-link i { font-size: 0.7rem; transition: transform 0.2s; }
.card:hover .card-link i { transform: translateX(3px); }

/* =========================================
   7. ARTICLE LIST
   ========================================= */
.article-list { display: flex; flex-direction: column; gap: 0; }
.article-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--card-border);
    transition: 0.2s;
}
.article-item:hover { transform: translateX(10px); }
.article-item h3 { font-size: 1.1rem; font-weight: 400; }
.article-date { font-family: var(--font-code); font-size: 0.8rem; color: var(--text-secondary); }

/* =========================================
   8. PROJECT DETAIL & MARKDOWN CONTENT
   ========================================= */
.project-detail, .post-detail { 
    margin-top: 120px; /* Gives space for the nav on project pages */ 
}

.prose { font-size: 1.1rem; color: #ccc; max-width: 800px; }
.prose h2 { color: #fff; margin-top: 3rem; margin-bottom: 1rem; font-size: 1.8rem; }
.prose p { margin-bottom: 1.5rem; line-height: 1.8; }
.prose pre { 
    background: #111; 
    padding: 1.5rem; 
    border-radius: 8px; 
    border: 1px solid var(--card-border); 
    overflow-x: auto; 
    margin: 2rem 0; 
}
.prose code { font-family: var(--font-code); font-size: 0.9rem; color: var(--accent); }
.prose img { max-width: 100%; border-radius: 8px; margin: 2rem 0; border: 1px solid var(--card-border); }

/* =========================================
   9. FOOTER & RESPONSIVE
   ========================================= */
footer { 
    margin-top: 6rem; 
    border-top: 1px solid var(--card-border); 
    padding: 3rem 0; 
    color: var(--text-secondary); 
    font-size: 0.9rem; 
}
.footer-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0 2rem; 
}
.socials a { font-size: 1.2rem; margin-left: 1rem; }
.socials a:hover { color: var(--text-primary); }

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .glass-nav { width: 95%; bottom: 20px; top: auto; } /* Bottom nav on mobile */
    .article-item { flex-direction: column; gap: 0.5rem; }
    .project-detail { margin-top: 40px; }
    .hero-content { padding-left: 0; text-align: center; }
    .tech-badges { justify-content: center; }
}