/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Light Theme Palette */
    --bg-color: #f3f4f6;
    --second-bg-color: #ffffff;
    --text-color: #334155;
    --heading-color: #0f172a;
    --main-color: #4f46e5;
    --accent-color: #818cf8;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 2.5rem;
    color: var(--main-color);
    font-weight: 800;
    cursor: default;
    letter-spacing: 1px;
}

.navbar a {
    font-size: 1.6rem;
    color: var(--text-color);
    margin-left: 3.5rem;
    font-weight: 500;
    transition: 0.3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--heading-color);
    display: none;
    cursor: pointer;
}

/* Sections */
section {
    min-height: auto;
    padding: 4rem 9% 2rem;
}

/* Reusable Components */
.heading {
    text-align: center;
    font-size: 4rem;
    color: var(--heading-color);
    margin-bottom: 5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 1rem;
}

.heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background: var(--main-color);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 1.2rem 2.8rem;
    background: var(--main-color);
    border-radius: 2rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    font-size: 1.6rem;
    color: white;
    letter-spacing: .5px;
    font-weight: 500;
    transition: 0.3s ease;
    border: 2px solid var(--main-color);
}

.btn:hover {
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
    background: #4338ca;
}

.btn.secondary {
    background: transparent;
    color: var(--main-color);
}

.btn.secondary:hover {
    background: rgba(79, 70, 229, 0.05);
}

/* Home Section */
.home {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding-top: 12rem;
    /* Adjusted for mobile view */
}

.home-content h1 {
    font-size: 5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

/* Typing name style */
.typing-name {
    color: var(--main-color);
    font-weight: 600;
}

.home-content h3 {
    font-size: 2.4rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.home-content p {
    font-size: 1.6rem;
    margin: 0 auto 3rem;
    max-width: 700px;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
}

.home-content .btn-box {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

/* About Section */
.about {
    background: var(--second-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding-top: 6rem;
    /* Increased for better separation */
}

.about-container {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.about-content {
    flex: 1;
    min-width: 300px;
}

.about-content h3 {
    font-size: 2.6rem;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--main-color);
    padding-left: 1rem;
}

.about-content p {
    font-size: 1.8rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-weight: 300;
}

.education-box {
    flex: 1;
    min-width: 300px;
}

.edu-card {
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--main-color);
    margin-bottom: 2rem;
    transition: 0.3s;
}

.edu-card:hover {
    transform: translateY(-5px);
}

.edu-card h4 {
    font-size: 1.8rem;
    color: var(--main-color);
    margin-bottom: 0.5rem;
}

.edu-card h3 {
    font-size: 2rem;
    color: var(--heading-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.edu-card p {
    font-size: 1.4rem;
    color: var(--text-color);
}

/* Skills Section */
.skills {
    background: var(--bg-color);
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
}

.skill-card {
    background: var(--second-bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    width: 140px;
    height: 140px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.skill-card i {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--heading-color);
}

/* Colors for specific icons */
.skill-card i.fa-flutter {
    color: #02569B;
}

.skill-card i.fa-mobile-alt {
    color: #555;
}

.skill-card i.fa-cuttlefish {
    color: #00599C;
}

.skill-card i.fa-python {
    color: #3776AB;
}

.skill-card i.fa-js {
    color: #F7DF1E;
}

.skill-card i.fa-fire {
    color: #FFCA28;
}

.skill-card i.fa-node-js {
    color: #339933;
}

.skill-card i.fa-database {
    color: #47A248;
}

.skill-card i.fa-network-wired {
    color: #333;
}

.skill-card i.fa-git-alt {
    color: #F05032;
}

/* Experience Section */
.experience {
    background: var(--second-bg-color);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: var(--main-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 50px;
    position: relative;
    width: 50%;
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--second-bg-color);
    border: 4px solid var(--main-color);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.left::after {
    right: -10px;
}

.timeline-item.right::after {
    left: -10px;
}

.timeline-content {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--main-color);
    position: relative;
    transition: 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.timeline-date {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: #e0e7ff;
    color: var(--main-color);
    border-radius: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-content h3 {
    font-size: 2rem;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 500;
    font-style: italic;
    margin-bottom: 1rem;
}

.timeline-content p {
    font-size: 1.4rem;
    line-height: 1.6;
}

/* Projects Section (Redesigned) */
.projects {
    background: var(--bg-color);
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    padding: 2rem 0;
}

.project-card-new {
    background: var(--second-bg-color);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    position: relative;
    transition: 0.3s;
    border-top: 5px solid transparent;
}

.project-card-new:hover {
    border-top: 5px solid var(--main-color);
    transform: translateY(-5px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-header h3 {
    font-size: 2.2rem;
    color: var(--main-color);
    font-weight: 700;
}

.project-header a {
    color: var(--text-color);
    font-size: 2.4rem;
    transition: 0.3s;
}

.project-header a:hover {
    color: var(--main-color);
}

.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.project-tech-tags span {
    font-size: 1.2rem;
    background: #e2e8f0;
    /* Gray pill */
    color: var(--text-color);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 500;
}

.project-desc {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.project-points {
    list-style: none;
}

.project-points li {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    line-height: 1.5;
}

.project-points li i {
    color: var(--main-color);
    margin-top: 0.3rem;
}

/* Achievements Section (Cards) */
.achievements {
    background: var(--second-bg-color);
}

.achievements-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    /* Wider cards to force fewer per row */
    gap: 3rem;
}

.achievement-card {
    background: var(--bg-color);
    padding: 3.5rem;
    /* Increased padding slightly */
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border-left: 5px solid var(--main-color);
    transition: 0.3s;
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-icon {
    font-size: 3.5rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.achievement-card h3 {
    font-size: 2rem;
    color: var(--heading-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.achievement-card p {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Contact Section (Cards) */
.contact {
    background: var(--bg-color);
    /* Match screenshot bg */
    padding-top: 2rem;
    /* Reduced top padding */
    padding-bottom: 4rem;
    /* Reduced bottom padding */
    margin-bottom: 0;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 2rem;
    /* Reduced margin */
}

.contact-card {
    background: var(--second-bg-color);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    width: 300px;
    text-align: center;
    transition: 0.3s;
    border-top: 4px solid var(--main-color);
    /* As per screenshot */
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-card i {
    font-size: 3rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}

.contact-card p,
.contact-card a {
    font-size: 1.6rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--main-color);
    color: white;
    padding: 1rem 1.4rem;
    border-radius: 50%;
    font-size: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: 0.4s ease;
    z-index: 1000;
}

.scroll-top.active {
    opacity: 1;
    pointer-events: auto;
    bottom: 3rem;
    /* Slide up slightly */
}

.scroll-top:hover {
    background: #4338ca;
    transform: translateY(-3px);
}

/* --------------------
   Responsive Media Queries 
   -------------------- */

@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 3%;
    }

    section {
        padding: 4rem 3% 2rem;
    }

    .about-content h3 {
        font-size: 2.3rem;
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block;
        /* Show hamburger */
    }

    .navbar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 3%;
        background: var(--second-bg-color);
        /* White bg */
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.1);
        display: none;
        /* Hide default */
        flex-direction: column;
    }

    .navbar.active {
        display: flex;
        /* Show when toggled */
    }

    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 1.5rem 0;
        /* Add vertical spacing */
        color: var(--heading-color);
    }

    .home {
        padding-top: 8rem;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 60px;
        padding-right: 10px;
    }

    .timeline-item.right {
        left: 0;
    }

    .timeline-item.left::after,
    .timeline-item.right::after {
        left: 21px;
    }

    .home-content h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 617px) {
    .contact-container {
        flex-direction: column;
        align-items: center;
    }

    .contact-card,
    .edu-card,
    .achievement-card {
        width: 100%;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 50%;
        /* Scale down a bit more */
    }

    .contact-card {
        width: 100%;
    }

    .home-content h1 {
        font-size: 3rem;
    }
}