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

body {
    line-height: 1.6;
    background: #f4f4f4;
    color: #333;
}

/* Header */
header.home-section {
    height: 100vh;
    background: url('../images/home3.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
}

header .overlay {
    background-color: rgba(0, 0, 0, 0.669);
    padding: 30px 20px;
    text-align: center;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
}

/* Navbar */
nav.navbar {
    position: sticky;
    top: 0;
    background: #222;
    opacity: 80%;
    z-index: 100;
}

nav.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

nav.navbar ul li {
    margin: 0 15px;
}

nav.navbar ul li a {
    color: #fff;
    text-decoration: none;
    padding: 15px 0;
    display: block;
}

nav.navbar ul li a:hover {
    color: #007bff;
}

/* Sections */
section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: auto;
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #222;
}

/* About / Contact / Skills */
.about p, .contact p {
    font-size: 18px;
    line-height: 1.7;
}

.contact form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: auto;
}

.contact form input,
.contact form textarea,
.contact form button {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.contact form button {
    background: #007bff;
    color: #fff;
    border: none;
    cursor: pointer;
}

.contact form button:hover {
    background: #0056b3;
}

/* Projects */
.project-filter {
    text-align: center;
    margin-bottom: 20px;
}

.filter-btn {
    background: #fff;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 7px 15px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: #007bff;
    color: #fff;
}

.projects ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    list-style: none;
    padding: 0;
}

.project-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-self:start;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-card img,
.project-iframe {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: none;
    border-radius: 8px 8px 0 0;
}

.project-card h3 {
    padding: 10px;
    color: #333;
}

.project-card p {
    padding: 0 10px 20px;
    font-size: 14px;
    overflow: hidden;
    max-height: 44px;
    line-height: 1.5em;
    transition: max-height 0.3s ease;
}

.project-card p.expanded {
    max-height: 1000px;
}

.toggle-btn {
    margin: 5px 10px 15px;
    padding: 5px 10px;
    font-size: 13px;
    background-color: transparent;
    border: none;
    color: #007bff;
    cursor: pointer;
    align-self: flex-start;
}

.toggle-btn:hover {
    text-decoration: underline;
}

/* Skills */
.skills ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    padding: 0;
}

.skills li {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-size: 16px;
    display: flex;
    flex-direction: column;
}

.skills .skill-bar {
    height: 8px;
    background: #007bff;
    border-radius: 5px;
    width: 0%;
    margin-top: 8px;
    transition: width 1s ease;
}

/* Contact */
.contact i {
    margin-right: 8px;
    color: #007bff;
}

.contact a {
    text-decoration: none;
    color: inherit;
}

.contact a:hover {
    color: #007bff;
    text-decoration: underline;
}
.contact div {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap; 
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #222;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    header.home-section {
        background-size: cover;
        background-attachment: scroll;
    }
    header .overlay {max-width: 90%; margin: auto;
        padding: 20px 15px;
    }
     header .overlay h1 {
        font-size: 25px;
    }
    header .overlay p {
        font-size: 16px;
    }
    section {max-width: 95%; margin: auto;
    }
    nav.navbar ul {
        flex-wrap: wrap; /* allow links to break into two lines if needed */
    }
    nav.navbar ul li {
        margin: 5px 8px;
    }
    nav.navbar ul li a {
        padding: 10px 0;
    }

    .projects ul {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .skills ul {
        grid-template-columns: 1fr;
    }
    .project-card img,
    .project-iframe {
        height: 180px;
    }
    .project-card p {
        font-size: 15px;
    }
}
@media (min-width: 600px) and (max-width: 767px) {
    .projects ul {
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
    }
}
.contact div {
    display: flex;
    flex-direction: column; /* stack items vertically */
    align-items: flex-start; /* move items to the left */
    gap: 2px;
    margin-top: 10px;}
    .contact div p {
        text-align: center;
        margin: 0%;
    }

/* Extra small devices - 320px fix */
@media (max-width: 400px) {
    body {
        font-size: 14px; /* smaller base font */
    }

    header .overlay {max-width: 90%; margin: auto;
        padding: 15px 10px;
        width: 95%;
    }
 header .overlay h1 {
        font-size: 20px;
    }
    header .overlay p {
        font-size: 14px;
    }
    nav.navbar ul {
        flex-wrap: wrap; /* allow links to break into two lines if needed */
    }
    nav.navbar ul li {
        margin: 5px 8px;
    }
    nav.navbar ul li a {
        font-size: 13px;
        padding: 10px 0;
    }

    section {max-width: 90%; margin: auto;
        padding: 30px 10px;
    }

    h2 {
        font-size: 18px;
    }

    .about p, .contact p {
        font-size: 15px;
    }

    .projects ul{
        grid-template-columns: 1fr; /* single column */
        gap: 15px;
    }
.skills ul {
        grid-template-columns: 1fr;
    gap: 15px;}
    .project-card img,
    .project-iframe {
        height: 140px; /* reduce card image height */
    }

    .project-card h3 {
        font-size: 16px;
    }

    .project-card p {
        font-size: 13px;
    }

    .filter-btn {
        font-size: 12px;
        padding: 5px 10px;
        margin: 3px;
    }

    footer {
        font-size: 12px;
        padding: 10px;
    }
}
