/* --- 1. SETTINGS & VARS --- */
:root {
    --bg-dark: #080808; /* Slightly deeper black */
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.1);
    --primary: #ffffff;
    --secondary: #b0b0b0; /* Lightened for better readability */
    --accent: #7b2cbf;
    --accent-glow: #9d4edd;
    --gradient: linear-gradient(135deg, #9d4edd 0%, #3a86ff 100%);
    
    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--primary);
    font-family: var(--font-body); /* Standard readable font */
    overflow-x: hidden;
    line-height: 1.7; /* Improved readability */
    font-size: 16px;
}

/* --- 2. BACKGROUND ANIMATION --- */
.background-blob {
    position: fixed;
    top: 20%;
    left: 20%;
    width: 600px;
    height: 600px;
    background: var(--gradient);
    filter: blur(180px);
    border-radius: 50%;
    opacity: 0.35;
    animation: moveBlob 25s infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes moveBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30vw, 15vh) scale(1.1); }
}

/* --- 3. NAVIGATION --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 100;
}

.logo { 
    font-family: var(--font-heading);
    font-size: 1.8rem; 
    font-weight: 700; 
    letter-spacing: -1px; 
}
.dot { color: var(--accent-glow); }

.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a { 
    color: var(--secondary); 
    text-decoration: none; 
    font-size: 0.95rem; 
    font-weight: 400;
    transition: 0.3s; 
}
.nav-links a:hover { color: var(--primary); }

.cta-btn {
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: all 0.3s ease;
}
.cta-btn:hover { 
    border-color: var(--primary); 
    background: rgba(255,255,255,0.08); 
}

/* --- 4. HERO SECTION --- */
#home {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 10%;
}

.hero-content { max-width: 900px; }

.tagline { 
    color: var(--accent-glow); 
    text-transform: uppercase; 
    font-size: 0.85rem; 
    letter-spacing: 3px; 
    font-weight: 600;
    margin-bottom: 25px; 
    display: block;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem; /* Large, bold type */
    line-height: 1.05;
    margin-bottom: 35px;
    font-weight: 700;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#home p {
    font-size: 1.2rem;
    color: var(--secondary);
    max-width: 600px;
    margin-bottom: 45px;
}

.hero-btns { display: flex; gap: 20px; }

.btn {
    padding: 16px 45px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
}

.btn.primary { background: var(--primary); color: #000; }
.btn.primary:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 15px 30px rgba(255,255,255,0.15); 
}

.btn.secondary { border: 1px solid var(--border); color: white; }
.btn.secondary:hover { 
    border-color: white; 
    background: rgba(255,255,255,0.05); 
}

/* --- 5. GLASS CARDS & SECTIONS --- */
section { padding: 120px 10%; }

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    padding: 70px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

#about p {
    font-size: 1.15rem;
    color: var(--secondary);
    max-width: 800px;
}

.stats {
    display: flex;
    gap: 80px;
    margin-top: 50px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}
.stats h3 { 
    font-family: var(--font-heading);
    font-size: 2.8rem; 
    color: var(--accent-glow); 
    margin-bottom: 5px; 
}
.stats span {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
}

/* --- 6. PROJECTS GRID --- */
.section-title { 
    font-family: var(--font-heading);
    font-size: 3.5rem; 
    margin-bottom: 10px; 
}
.subtitle { 
    color: var(--secondary); 
    margin-bottom: 70px; 
    font-size: 1.1rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 50px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card:hover {
    transform: translateY(-12px);
    border-color: var(--accent-glow);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.card-image { overflow: hidden; height: 260px; }
.card-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0.9; 
    transition: 0.5s; 
}
.project-card:hover img { opacity: 1; transform: scale(1.08); }

.card-content { padding: 35px; }
.card-content h3 { 
    font-family: var(--font-heading);
    font-size: 1.6rem; 
    margin-bottom: 12px; 
}
.card-content p {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.tags span {
    font-size: 0.75rem;
    padding: 6px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    margin-right: 8px;
    color: var(--primary);
    font-weight: 500;
}
.arrow-link { 
    display: inline-block; 
    margin-top: 25px; 
    color: var(--accent-glow); 
    font-weight: 600; 
    font-size: 0.9rem;
}
.arrow-link:hover { text-decoration: underline; }

/* --- 7. CERTIFICATES (Netflix Style) --- */
.netflix-wrapper { position: relative; display: flex; align-items: center; }

.cert-rail {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    padding: 50px 10px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.cert-rail::-webkit-scrollbar { display: none; }

.cert-item {
    min-width: 320px;
    height: 190px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    cursor: pointer;
}

.cert-item img { width: 100%; height: 100%; object-fit: cover; }

.cert-item:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    border-color: var(--accent-glow);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,1), transparent);
    opacity: 0;
    transition: 0.3s;
}
.cert-item:hover .overlay { opacity: 1; }
.overlay span { font-weight: 600; font-size: 1rem; }

.nav-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: 20;
    font-size: 1.5rem;
    transition: 0.3s;
    cursor: pointer;
    backdrop-filter: blur(5px);
}
.nav-btn:hover { background: var(--accent); }
.left-btn { position: absolute; left: -25px; }
.right-btn { position: absolute; right: -25px; }


/* --- 8. CONTACT & FOOTER --- */
#contact { text-align: center; }
.center-text h2 { 
    font-family: var(--font-heading);
    font-size: 2.5rem; 
    margin-bottom: 20px; 
}
.center-text p { margin-bottom: 40px; margin-left: auto; margin-right: auto; }

footer {
    margin-top: 80px;
    color: var(--secondary);
    font-size: 0.9rem;
}

/* --- 9. MODAL & ANIMATIONS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-body {
    background: #0f0f0f;
    padding: 20px;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: scaleUp 0.3s forwards;
}
@keyframes scaleUp { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-body img { width: 100%; border-radius: 10px; margin-bottom: 15px; }
.close-icon { 
    position: absolute; 
    top: -40px; 
    right: 0; 
    font-size: 2rem; 
    color: white; 
    cursor: pointer;
    transition: 0.3s;
}
.close-icon:hover { color: var(--accent-glow); }

/* Scroll Animation Classes */
.hidden { opacity: 0; transform: translateY(60px); transition: all 1s ease; }
.show { opacity: 1; transform: translateY(0); }

/* Mobile Tweaks */
@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    .nav-links { display: none; }
    .project-grid { grid-template-columns: 1fr; }
    section { padding: 80px 5%; }
}

/* --- SOCIAL BUTTONS --- */
.social-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
}

.social-btn svg { stroke: var(--secondary); transition: 0.3s; }

/* Hover Effects */
.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(123, 44, 191, 0.2); /* Glow effect */
}

.social-btn:hover svg { stroke: var(--accent-glow); }

/* --- TOAST NOTIFICATION (POPUP) --- */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    border: 1px solid var(--accent);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

/* Class to show the toast */
.toast.show-toast {
    visibility: visible;
    opacity: 1;
    bottom: 50px; /* Slight slide up animation */
}

/* ============================= */
/* MOBILE USABILITY FIX (ONLY)   */
/* ============================= */
@media (max-width: 768px) {

    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }

    /* NAVBAR */
    nav {
        padding: 1.2rem 6%;
        position: fixed;
        background: rgba(8,8,8,0.8);
        backdrop-filter: blur(12px);
    }

    .logo {
        font-size: 1.4rem;
    }

    .cta-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    /* HERO SECTION */
    #home {
        height: auto;
        min-height: 100vh;
        padding: 120px 6% 80px;
    }

    h1 {
        font-size: 2.6rem;
        line-height: 1.15;
    }

    #home p {
        font-size: 1rem;
        margin-bottom: 35px;
    }

    .hero-btns {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
        padding: 15px;
    }

    /* SECTIONS */
    section {
        padding: 80px 6%;
    }

    .glass-card {
        padding: 35px 25px;
        border-radius: 18px;
    }

    /* STATS */
    .stats {
        flex-direction: column;
        gap: 30px;
        text-align: left;
    }

    .stats h3 {
        font-size: 2.2rem;
    }

    /* PROJECT GRID */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .card-image {
        height: 220px;
    }

    /* Disable hover lift on touch devices */
    .project-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* CERTIFICATES */
    .cert-item {
        min-width: 260px;
        height: 160px;
    }

    .cert-item:hover {
        transform: none;
        z-index: auto;
    }

    .nav-btn {
        display: none;
    }

    /* MODAL */
    .modal-body {
        padding: 15px;
    }

    .close-icon {
        top: -30px;
        font-size: 1.6rem;
    }

    /* SOCIAL BUTTONS */
    .social-container {
        gap: 12px;
    }

    .social-btn {
        width: 100%;
        justify-content: center;
    }
}
