/* ----------------- CSS Variables / Color Palette ----------------- */
:root {
    /* 1. Backgrounds */
    --bg-color: #ffffff;           /* Main Background */
    --bg-secondary: #f3f4f6;       /* Inputs/Cards */

    /* 2. Text */
    --text-main: #111827;          /* Deep Charcoal */
    --text-secondary: #4b5563;     /* Medium Gray */

    /* 3. Accents (Indigo Theme) */
    --primary-color: #4f46e5;      
    --accent-color: #4338ca;       /* Darker Indigo for Hover */
    --text-highlight: #f00048;     /* Red/Pink for special highlights */
    
    /* 4. Feedback & Overlay */
    --success-color: #16a34a;      
    --overlay-color: rgba(255, 255, 255, 0.90); 
}

/* ----------------- Global Styles ----------------- */
* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-color);
    color: var(--text-main);
}

.container {
    padding: 10px 10%;
}

/* ----------------- Navigation (Fixed/Sticky) ----------------- */
nav {
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the inner container */
    flex-wrap: wrap;
    
    /* FIXING IT TO THE TOP */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Highest priority: Stays above everything */
    
    /* GLASS EFFECT */
    background: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    backdrop-filter: blur(10px); /* Blurs content behind it */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle shadow */
    transition: 0.3s;
}

/* This ensures the logo and menu align with your page content width */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 10%; /* Matches your global container padding */
}

nav h1 span {
    color: var(--primary-color);
}

nav ul li {
    display: inline-block;
    list-style: none;
    margin: 10px 20px;
}

nav ul li a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 18px;
    position: relative;
    font-weight: 500;
}

nav ul li a::after {
    content: '';
    width: 0;
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    left: 0;
    bottom: -6px;
    transition: 0.3s;
}

nav ul li a:hover::after {
    width: 100%;
}

/* ----------------- Header (Parallax Logic) ----------------- */
#header {
    width: 100%;
    height: 100vh; 
    background-size: cover;
    background-position: center;
    
    position: fixed; /* Pins header to the background */
    top: 0;
    left: 0;
    z-index: 1; /* Lower priority: stays behind other content */
}

#header .container {
    height: 100%; /* Ensures container fills the fixed header */
    padding-top: 80px; /* Pushes content down so it's not hidden behind Nav */
}

/* ----------------- Intro Text (Centered) ----------------- */
.header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 70%; 
    font-size: 20px;
}

.header-text h1 {
    font-size: 60px;
    margin-top: 20px;
    color: var(--text-main);
    line-height: 1.2;
}

.header-text h1 span {
    color: var(--primary-color);
    display: inline-block;
    transition: transform 0.3s;
}

.header-text h1 span:hover {
    transform: translateY(-5px);
}

#portfolio {
    /* --- PARALLAX FIX START --- */
    margin-top: 85vh; /* Pushes About sectio below the fixed header */
    position: relative; /* Brings it back into layout flow */
    z-index: 2; /* Higher priority: Slides OVER the header */
    background: var(--bg-color); /* Solid background so header doesn't show through */
    box-shadow: 0 -10px 25px rgba(0,0,0,0.05); /* Optional shadow for depth */
    /* --- PARALLAX FIX END --- */
}

#portfolio, .copyright {
    position: relative;
    z-index: 2;
    background: var(--bg-color);
}

#portfolio {
    padding: 50px 0;
}

.work-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 40px;
    margin-top: 50px;
}

.work {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); 
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.work img {
    width: 100%;
    height: 100%; 
    object-fit: cover;
    border-radius: 10px;
    display: block;
    transition: transform 0.5s;
}

.layer {
    width: 100%;
    height: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), var(--primary-color));
    border-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 0 30px;
    text-align: center;
    transition: height 0.5s;
}

.layer h3 {
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff; 
}

.layer p {
    font-size: 14px;
    color: #f3f4f6;
    margin-bottom: 15px;
}

.layer p span {
    color: #fff; 
    font-weight: bold;
}

.layer a {
    color: var(--primary-color);
    background: #fff;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    text-align: center;
    font-size: 18px;
    transition: 0.3s;
}

.layer a:hover {
    transform: scale(1.1);
}

.work:hover img {
    transform: scale(1.1);
}

.work:hover .layer {
    height: 100%;
}

/* ----------------- Buttons ----------------- */
.btn {
    display: block;
    margin: 50px auto;
    width: fit-content;
    border: 1px solid var(--primary-color);
    padding: 14px 50px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.5s, color 0.5s;
}

.btn:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.btn.btn2 {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    border: none;
    margin-top: 20px;
    cursor: pointer;
}

.btn.btn2:hover {
    background: var(--accent-color);
}

.copyright {
    width: 100%;
    text-align: center;
    padding: 25px 0;
    background: var(--bg-secondary);
    font-weight: 300;
    margin-top: 50px;
}

/* ----------------- Mobile CSS (Final Responsive Parallax) ----------------- */
nav .fa-solid {
    display: none;
}

@media only screen and (max-width: 680px) {
    
    /* 0. GLOBAL SAFETY FIX */
    html, body {
        overflow-x: hidden; /* Prevents horizontal scrolling */
        width: 100%;
        position: relative;
    }

    /* 1. FIXED HEADER (The Bottom Layer) */
    #header {
        position: fixed; 
        top: 0;
        left: 0;
        
        width: 100vw; 
        max-width: 100%;
        height: 100vh; 
        
        overflow: hidden; 
        z-index: 1; 
        background: #ffffff; 
        padding-bottom: 50px;
        
        display: flex;
        align-items: center; 
        justify-content: center;
    }

    /* 2. SCROLLING SECTIONS (The Top Layer) */
    #portfolio, .copyright {
        position: relative;
        z-index: 100; 
        background-color: #ffffff !important; 
        width: 100%; 
    }
    
    /* 4. FLUID HEADER TEXT */
    .header-text {
        margin-top: 0;
        padding: 0 15px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    .header-text h1 {
        font-size: clamp(24px, 8vw, 35px);
        line-height: 1.3;
        word-wrap: break-word;
    }

    .header-text h1 span {
        display: inline-block;
    }

    .header-text p {
        font-size: clamp(14px, 4vw, 16px);
        margin-top: 10px;
    }

    /* 6. MOBILE NAVIGATION */
    .nav-container {
        padding: 15px 5%; 
        background: rgba(255, 255, 255, 0.95);
        z-index: 1000;
    }
    
    nav .fa-bars {
        display: block;
        font-size: 25px;
        color: #111827;
        cursor: pointer;
    }

    nav ul {
        background: #4f46e5;
        position: fixed;
        top: 0;
        right: -200px; 
        width: 200px;
        height: 100vh;
        padding-top: 50px;
        z-index: 2000; 
        transition: right 0.5s;
        display: block; 
    }
    
    nav ul li {
        display: block;
        margin: 25px;
    }
    
    nav ul li a {
        color: #fff; 
    }
    
    nav ul .fa-circle-xmark {
        display: block;
        position: absolute;
        top: 25px;
        left: 25px;
        font-size: 25px;
        color: #fff;
        cursor: pointer;
    }

    /* 7. GENERAL LAYOUT & TITLES */
    .container {
        padding: 10px 5%; /* Less padding on small screens */
        width: 100%;
        overflow: hidden;
    }

    .Sub-title {
        /* Fluid Font: shrink automatically */
        font-size: clamp(35px, 10vw, 50px);
        margin-bottom: 20px;
        line-height: 1.2;
    }

     /* 10. PROJECTS GRID FIX */
    .work-list {
        grid-template-columns: 1fr; /* Single column */
        gap: 30px;
    }

    .copyright {
        font-size: 14px;
    }
}