/* --- RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --card-border: #334155;
    --hero-img-size: 300px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Strongly locks out horizontal scrolling */
    position: relative;
    width: 100%;
}

/* --- BACKGROUND ANIMATION --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(white, rgba(255, 255, 255, .2) 2px, transparent 3px),
        radial-gradient(white, rgba(255, 255, 255, .15) 1px, transparent 2px),
        radial-gradient(white, rgba(255, 255, 255, .1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    z-index: -1;
    animation: backgroundFly 120s linear infinite;
    opacity: 0.15;
}

@keyframes backgroundFly {
    0% {
        background-position: 0 0, 40px 60px, 130px 270px;
    }

    100% {
        background-position: 550px 1100px, 390px 760px, 630px 570px;
    }
}

/* --- UTILITIES --- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 5rem 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 50px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-main);
    text-decoration: none;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

/* --- HERO SECTION --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
}

.hero-subtitle {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-image-container {
    width: var(--hero-img-size);
    height: var(--hero-img-size);
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.15);
    background-color: var(--bg-secondary);
    flex-shrink: 0;
}

.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cta-btn {
    display: inline-block;
    background-color: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2);
}

/* --- ABOUT SECTION --- */
.about-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.profile-img-container {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
    width: 100%;
}

.profile-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

.profile-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- TECH STACK (SKILLS) --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background-color: rgba(56, 189, 248, 0.03);
}

.icon-placeholder {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 10px;
    aspect-ratio: 1 / 1;
}

.icon-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.skill-card span {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

/* --- PROJECTS SECTION --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.project-img-placeholder {
    width: 100%;
    height: 220px;
    background-color: #1a2234;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

.project-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.tag {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 600;
}

/* --- CONTACT SECTION --- */
#contact {
    text-align: center;
    padding-bottom: 10rem;
}

.contact-box {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--card-border);
    padding: 3rem 2rem;
    border-radius: 10px;
    width: 100%;
}

.contact-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* HARD OVERFLOW RESOLUTION FOR EMAIL */
.contact-box .cta-btn {
    word-break: break-all !important;
    white-space: normal !important;
    display: inline-block;
    max-width: 100%;
    padding: 0.8rem 1rem;
    /* slightly less horizontal padding for mobile ease */
}

.contact-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #24292e;
    color: white;
    border: 1px solid #444;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-btn.linkedin {
    background-color: #0077b5;
}

.social-btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}


/* --- RESPONSIVE DESIGN (CRITICAL MOBILE REBUILD) --- */
@media (max-width: 768px) {

    /* Fixed structural overlay shift for mobile navigation */
    .navbar {
        position: fixed;
    }

    .nav-container {
        flex-direction: column !important;
        height: auto !important;
        padding: 0.8rem 0;
        gap: 0.6rem;
    }

    /* Force visible list layout under your logo */
    .nav-links {
        display: flex !important;
        gap: 1.2rem;
        justify-content: center;
        width: 100%;
        padding: 0;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    #hero {
        padding-top: 140px;
        /* More clearance for the stacked mobile nav */
    }

    .hero-layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-image-container {
        margin: 0 auto;
        order: -1;
        width: 200px;
        height: 200px;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .hero-description {
        font-size: 1rem;
        margin: 0 auto 2.5rem auto;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .profile-img-container {
        order: -1;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.8rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-box {
        padding: 2rem 1rem;
    }
}