/* style.css - Project Tech Alignment Fix & Continued Mobile Friendliness */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #0077b6; 
    --secondary-color: #0096c7; 
    --accent-color: #caf0f8; 
    --text-color: #34495e; 
    --heading-color: #2c3e50; 
    --background-color: #f8f9fa; 
    --card-background: #ffffff;
    --border-color: #e0e7ef; 
    
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); 
    --box-shadow-hover: 0 7px 20px rgba(0, 0, 0, 0.09);
    --border-radius: 12px; 
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-secondary);
    line-height: 1.75; 
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden; 
}

.container {
    width: 100%; 
    max-width: 1140px; 
    margin: auto;
    padding: 0 30px; 
}

/* --- Header --- */
header {
    background-color: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(12px); 
    padding: 1.2rem 0; 
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07); 
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1140px; 
    margin: auto;
    padding: 0 30px; 
    width: 100%;
}

header .logo {
    font-family: var(--font-primary);
    font-size: 1.9rem; 
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

header .nav-links { list-style: none; display: flex; }
header .nav-links li { margin-left: 32px; } 

header .nav-links a {
    font-family: var(--font-primary);
    text-decoration: none;
    color: var(--heading-color); 
    font-weight: 500;
    font-size: 0.9rem; 
    transition: color var(--transition-speed) ease;
    position: relative;
    padding-bottom: 6px; 
}

header .nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2.5px; 
    bottom: 0;
    left: 50%;
    transform: translateX(-50%); 
    background-color: var(--secondary-color);
    transition: width var(--transition-speed) ease;
}

header .nav-links a:hover { color: var(--primary-color); }
header .nav-links a:hover::after { width: 100%; }


.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem; 
    color: var(--heading-color);
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
}
.hamburger:hover { transform: scale(1.1); }

main {
    padding-top: 100px; 
}

.section {
    padding: 70px 0; 
    border-bottom: 1px solid var(--border-color);
}
.section:last-of-type { border-bottom: none; }

.section h2 {
    font-family: var(--font-primary);
    font-size: 2.6rem; 
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 50px; 
    text-align: center;
    position: relative;
    letter-spacing: -0.25px;
}
.section h2 i {
    margin-right: 15px; 
    color: var(--primary-color); 
}

.section h2::after { 
    content: '';
    display: block;
    width: 70px; 
    height: 3.5px; 
    background: var(--primary-color); 
    margin: 18px auto 0; 
    border-radius: 2px;
}

/* --- Hero Section (About Me) --- */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--card-background);
    padding: 60px 0; 
    text-align: center;
    border-bottom: none;
    display: flex; 
    align-items: center; 
}

.hero-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px; 
    width: 100%; 
    max-width: 960px; 
    margin: 0 auto; 
    text-align: left; 
}

.hero-image-container { flex-shrink: 0; }

.profile-pic {
    width: 180px; 
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid rgba(255, 255, 255, 0.8); 
    box-shadow: 0 5px 20px rgba(0,0,0,0.25); 
}

.hero-text-container {}

.hero-section .hero-text-container h1 {
    font-family: var(--font-primary);
    font-size: 3.2rem; 
    font-weight: 700;
    margin-bottom: 1rem; 
    letter-spacing: -1.2px; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.hero-section .contact-info {
    margin-top: 15px; 
    display: flex;
    flex-direction: column; 
    gap: 10px; 
}

.hero-section .contact-info p {
    font-size: 1.05rem; 
    display: flex;
    align-items: center;
    font-family: var(--font-secondary);
    font-weight: 400; 
}

.hero-section .contact-info i {
    color: var(--accent-color); 
    margin-right: 12px;
    font-size: 1.15rem; 
    width: 22px; 
    text-align: center;
}

.hero-section .contact-info a {
    color: var(--card-background);
    text-decoration: none;
    transition: color var(--transition-speed) ease, border-color var(--transition-speed) ease; 
    border-bottom: 1px solid transparent;
    font-weight: 600; 
}

.hero-section .contact-info a:hover {
    color: var(--accent-color); 
    border-bottom: 1px solid var(--accent-color);
}


/* General Card Style */
.card-style {
    background-color: var(--card-background);
    padding: 30px; 
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed) ease-out, box-shadow var(--transition-speed) ease-out, border-color var(--transition-speed) ease; 
    border: 1px solid var(--border-color); 
}
.card-style:hover {
    transform: translateY(-6px); 
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color); 
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; 
}

.skill-category {} 

.skill-category h3 {
    font-family: var(--font-primary);
    font-size: 1.4rem; 
    color: var(--primary-color);
    margin-bottom: 20px; 
    border-bottom: 2.5px solid var(--secondary-color); 
    padding-bottom: 10px; 
    display: inline-block;
}

.skill-category ul { list-style: none; padding-left: 0; }
.skill-category ul li {
    background-color: var(--accent-color); 
    color: var(--heading-color); 
    padding: 10px 15px; 
    margin-bottom: 10px; 
    border-radius: 8px; 
    font-size: 0.9rem; 
    font-weight: 500; 
    border-left: 4px solid var(--primary-color);
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease, color var(--transition-speed) ease;
    line-height: 1.5; 
    word-break: break-word; 
}
.skill-category ul li:hover {
    background-color: var(--primary-color); 
    color: var(--card-background); 
    transform: translateX(6px); 
}

/* Experience Section - Timeline */
.timeline {
    position: relative;
    max-width: 850px; 
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 3.5px; 
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color) 70%, var(--accent-color)); 
    top: 15px; 
    bottom: 15px; 
    left: 50%;
    margin-left: -1.75px; 
    border-radius: 3px;
}

.timeline-item {
    padding: 15px 40px; 
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

.timeline-item::after { 
    content: '';
    position: absolute;
    width: 18px; 
    height: 18px;
    right: -9px; 
    background-color: var(--card-background);
    border: 4px solid var(--primary-color); 
    top: 35px; 
    border-radius: 50%;
    z-index: 1;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
}
.timeline-item:hover::after {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: scale(1.15); 
}
.timeline-item:nth-child(even)::after { left: -9px; }

.timeline-content { position: relative; } 
.timeline-item:nth-child(odd) .timeline-content { margin-right: 25px; } 
.timeline-item:nth-child(even) .timeline-content { margin-left: 25px; }

.experience-header { 
    display: flex;
    align-items: center; 
    gap: 15px; 
    margin-bottom: 10px; 
}
.company-logo {
    max-width: 75px; 
    max-height: 40px; 
    object-fit: contain;
    flex-shrink: 0; 
}
.experience-title {
    flex-grow: 1; 
}

.timeline-content h3 { 
    font-family: var(--font-primary);
    color: var(--heading-color);
    font-size: 1.3rem; 
    margin-bottom: 2px; 
    font-weight: 600; 
}
.timeline-content .job-title {
    font-weight: 500; 
    font-size: 1rem; 
    color: var(--primary-color); 
    margin-bottom: 8px; 
}
.timeline-content .date-location {
    font-size: 0.85rem; 
    color: #7f8c8d; 
    margin-bottom: 18px; 
    font-style: italic;
}
.timeline-content ul { list-style-type: none; padding-left: 0; }
.timeline-content ul li {
    margin-bottom: 10px; 
    font-size: 0.9rem; 
    padding-left: 20px; 
    position: relative;
    line-height: 1.6; 
}
.timeline-content ul li::before {
    content: '\f0da'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px; 
    color: var(--secondary-color);
    font-size: 0.9em; 
}


/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
}

.project-card { display: flex; flex-direction: column; } 
.project-card h3 { /* Project Title - FIX FOR ALIGNMENT */
    font-family: var(--font-primary);
    color: var(--heading-color);
    font-size: 1.35rem; 
    margin-bottom: 8px; 
    font-weight: 600;
    line-height: 1.4; 
    /* Ensures space for up to 3 lines, aligning tech tags below consistently */
    min-height: calc(1.35rem * 1.4 * 3); /* Approx 5.67rem */
    /* If you prefer to truncate very long titles instead of letting them take more space: */
    /* display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden; */
}
.project-card .project-tech { /* Technology Tag */
    font-size: 0.85rem; 
    color: var(--primary-color); 
    font-weight: 600; 
    margin-top: 0; /* Ensure it sits right below the title space */
    margin-bottom: 18px; 
    font-style: normal; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    line-height: 1.3; 
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(0.85rem * 1.3); 
}

.project-card ul { list-style-type: none; padding-left: 0; flex-grow: 1; }
.project-card ul li {
    margin-bottom: 10px; 
    font-size: 0.9rem; 
    padding-left: 20px; 
    position: relative;
    line-height: 1.6;
}
.project-card ul li::before { 
    content: '\f0da'; 
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px; 
    color: var(--secondary-color);
    font-size: 0.9em;
}

/* Publications Section */
.publications-list .publication-item { 
    margin-bottom: 20px; 
    padding: 25px; 
    border-left: 6px solid var(--primary-color); 
}
.publications-list .publication-item p { font-size: 1rem; line-height: 1.65; }

.publication-link {
    text-decoration: none;
    color: var(--heading-color); 
    transition: color var(--transition-speed) ease;
}
.publication-link:hover strong, .publication-link:focus strong {
    color: var(--primary-color); 
    text-decoration: underline;
    text-decoration-thickness: 1.5px; 
    text-underline-offset: 3px; 
}
.publication-link strong {
    font-family: var(--font-primary);
    font-weight: 600; 
    transition: color var(--transition-speed) ease; 
}


/* Education Section */
.education-item-wrapper {
    max-width: 750px; 
    margin: 0 auto;
}
.education-item { text-align: center; } 

.education-image-container {
    margin-bottom: 18px; 
}
.education-logo {
    max-height: 60px; 
    max-width: 200px; 
    object-fit: contain;
}

.education-item h3 {
    font-family: var(--font-primary);
    color: var(--heading-color);
    font-size: 1.4rem; 
    margin-bottom: 10px; 
    font-weight: 600;
}
.education-item .degree {
    font-size: 1.05rem; 
    font-weight: 500; 
    color: var(--primary-color); 
    margin-bottom: 8px; 
}
.education-item .cgpa {
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--text-color); 
    margin-bottom: 8px; 
}
.education-item .duration-location {
    font-size: 0.9rem; 
    color: #7f8c8d; 
    font-style: italic;
}


/* Footer */
footer {
    background-color: var(--heading-color); 
    color: var(--accent-color); 
    text-align: center;
    padding: 30px 0; 
    margin-top: 50px; 
}
footer p {
    font-family: var(--font-secondary);
    font-size: 0.85rem; 
    font-weight: 400; 
}

/* --- Responsive Design - MOBILE FRIENDLINESS FOCUS --- */

/* Common mobile adjustments */
@media (max-width: 768px) {
    .container { padding: 0 20px; } 
    main { padding-top: 75px; } 
    .section { padding: 50px 0; } 
    
    .section h2 { font-size: 1.8rem; margin-bottom: 30px;}
    .section h2::after { width: 50px; height: 3px; margin-top: 12px; }

    .card-style { padding: 20px; } 
}


/* Header on Mobile */
@media (max-width: 768px) {
    header nav { padding: 0 20px; } 
    header .logo { font-size: 1.6rem; }
    header .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; 
        left: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px); 
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-color);
    }
    header .nav-links.active { display: flex; }
    header .nav-links li { margin: 0; width: 100%; }
    header .nav-links a {
        display: block;
        padding: 1rem; 
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        font-size: 1rem; 
    }
    header .nav-links a::after { display: none; } 
    header .nav-links li:last-child a { border-bottom: none; }
    .hamburger { display: block; font-size: 1.6rem; }
}

/* Hero Section on Mobile */
@media (max-width: 768px) {
    .hero-section { padding: 40px 0;  }
    .hero-content-wrapper {
        flex-direction: column; 
        text-align: center; 
        gap: 25px; 
    }
    .hero-text-container { text-align: center; } 
    .hero-section .contact-info { align-items: center; } 
    
    .profile-pic { width: 130px; height: 130px; } 
    .hero-section .hero-text-container h1 { font-size: 2rem; } 
    .hero-section .contact-info p { font-size: 0.95rem; }
    .hero-section .contact-info i { font-size: 1.1rem; }
}

/* Skills Section on Mobile */
@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    .skill-category h3 { font-size: 1.2rem; margin-bottom: 15px; padding-bottom: 8px;}
    .skill-category ul li { font-size: 0.85rem; padding: 8px 12px; margin-bottom: 8px;}
}

/* Experience Section (Timeline) on Mobile */
@media (max-width: 768px) {
    .timeline { max-width: 100%; padding: 0 10px; } 
    .timeline::after { left: 20px; margin-left:0;  }
    .timeline-item {
        width: 100%;
        padding-left: 45px; 
        padding-right: 0; 
        margin-bottom: 20px; 
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0; 
        padding-top: 0; 
    }
    .timeline-item::after { 
        left: 11px; 
        top: 10px; 
        width: 16px; height: 16px; border-width: 3px; 
    }
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 0; 
        margin-right: 0;
    }
    .experience-header {
        flex-direction: row; 
        align-items: center; 
        gap: 10px;
    }
    .company-logo { max-width: 60px; max-height: 30px; }
    .timeline-content h3 { font-size: 1.15rem; }
    .timeline-content .job-title { font-size: 0.9rem; }
    .timeline-content .date-location { font-size: 0.8rem; margin-bottom: 12px;}
    .timeline-content ul li { font-size: 0.85rem; margin-bottom: 8px; padding-left: 18px;}
    .timeline-content ul li::before { top: 1px; font-size: 0.85em; }
}

/* Projects Section on Mobile */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr; 
        gap: 20px;
    }
    .project-card h3 { 
        font-size: 1.2rem; 
        margin-bottom: 6px; 
        min-height: auto; /* Reset min-height on mobile, let it flow naturally */
        /* If truncation is still desired on mobile for titles: */
        /* display: -webkit-box; 
        -webkit-line-clamp: 3; 
        -webkit-box-orient: vertical;
        overflow: hidden; */
    }
    .project-card .project-tech { 
        font-size: 0.75rem; 
        margin-bottom: 12px; 
        -webkit-line-clamp: 3; 
        min-height: auto; /* Reset min-height */
    }
    .project-card ul li { font-size: 0.85rem; margin-bottom: 8px; padding-left: 18px;}
    .project-card ul li::before { top: 1px; font-size: 0.85em; }
}

/* Education & Publications on Mobile */
@media (max-width: 768px) {
    .education-item h3 { font-size: 1.2rem; }
    .education-item .degree { font-size: 1rem; }
    .education-item .cgpa { font-size: 0.9rem; }
    .education-item .duration-location { font-size: 0.85rem; }
    .education-logo { max-height: 50px; }

    .publications-list .publication-item p { font-size: 0.9rem; }
    .publications-list .publication-item { padding: 20px; border-left-width: 5px;}
}


/* Very Small Mobile Screens */
@media (max-width: 480px) {
    .container { padding: 0 15px; } 
    main { padding-top: 70px; } 
    .section { padding: 40px 0; }
    .section h2 { font-size: 1.5rem; margin-bottom: 25px;}
    .section h2::after { width: 45px; height: 2.5px; margin-top: 10px; }

    .card-style { padding: 15px; }

    header .logo { font-size: 1.4rem; }
    .hamburger { font-size: 1.4rem; }
    header .nav-links a { padding: 0.9rem; font-size: 0.95rem; }


    .profile-pic { width: 100px; height: 100px; border-width: 4px;} 
    .hero-section .hero-text-container h1 { font-size: 1.6rem; }
    .hero-section .contact-info p { font-size: 0.85rem; }
    .hero-section .contact-info i { font-size: 1rem; margin-right: 8px; width: 18px;}

    .skill-category h3 { font-size: 1.1rem; }
    .skill-category ul li { font-size: 0.8rem; padding: 6px 10px; }

    .timeline::after { left: 15px; } 
    .timeline-item { padding-left: 35px; } 
    .timeline-item::after { left: 7px; width:14px; height:14px; border-width: 2.5px; top: 8px;} 
    .company-logo { max-width: 50px; max-height: 25px; }
    .timeline-content h3 { font-size: 1rem; }
    .timeline-content .job-title { font-size: 0.8rem; }
    .timeline-content .date-location { font-size: 0.75rem;}
    .timeline-content ul li { font-size: 0.8rem;}

    .project-card h3 { font-size: 1.1rem; }
    .project-card .project-tech { font-size: 0.7rem; }
    .project-card ul li { font-size: 0.8rem;}

    .education-item h3 { font-size: 1.1rem; }
    .education-item .degree { font-size: 0.9rem; }
    .education-item .cgpa { font-size: 0.85rem; }
    .education-logo { max-height: 40px; }

    .publications-list .publication-item p { font-size: 0.85rem; }
    .publications-list .publication-item { padding: 15px; }

    footer p { font-size: 0.75rem; }
}