*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Montserrat, sans-serif;
    overflow-x: hidden;
}


.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-size: 1.4rem;
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

.nav-container a {
    color: white;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    font-size: 1.4rem;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
}

.nav-container a:hover {
    color: #ffe082;
}

#welcome-section {   
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to right, #89f7fe, #66a6ff);
}

.welcome-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    width: 90%;
    height: 100%;
}

.welcome-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    gap: 1rem;
    max-width: 700px;
    transform: translateX(70px);

}

.profile-pic {
    max-width: 850px;
    object-fit: contain;
    align-self: end;
    justify-self: end;
    right: 400px;
    flex-basis: 35%;
    margin-left: auto;
    margin-right: 40rem;
    transform: translateX(120px);
    display: block;
}

h1 {
    font-weight: 900;
    font-size: 3.5rem;
    margin: 0.5rem;
    color: white;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

h4 {
    color: #ffe082;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
    font-size: 1.3rem;  
}

.tagline {
    margin-top: 1rem;
    background: linear-gradient(to right, #ffca28, #f57f17);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: none;
}

.sub-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #073b4c;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    margin-top: 0.25rem;
    margin-top: 2.5rem;
    
}

@keyframes slideFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    animation: slideFadeIn 0.8s ease-out forwards;
}

h4.sub-tagline {
    animation: slideFadeIn 0.8s ease-out 0.3s forwards;
}

h4.tagline {
    animation: slideFadeIn 0.8s ease-out 0.6s forwards;
}

.projects-section {
    background-color: #0f172a;
    color: white;
    align-items: center;
    text-align: center;
    padding: 1rem;
    margin: 0;
}

.projects-display {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}

.project1,
.project2,
.project3 {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    background-color: #1e293b;
    border-radius: 8px;
    flex: 1 1 300px;
    max-width: 400px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 380px;
}

section {
    scroll-margin-top: 80px;
}

.project1:hover,
.project2:hover,
.project3:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.project-desc {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 0.4rem;
    line-height: 1.3;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}


h3 {
    font-size: 2rem;
    display: inline-block;
    border-bottom: 2px solid #ffe082;
    padding-bottom: 0.4rem;
}

h5 {
    font-size: 1.5rem;
    color: #ffe082;
    margin-top: 0.4rem;
}

.project1 img,
.project2 img,
.project3 img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

#about {
    background-color: #334155;
    color: #f1f5f9;
    padding: 1rem;
    text-align: center;
}

#about h3 {
    text-align: center;
}

#about p {
    max-width: 700px;
    margin: 0 auto 1rem auto;
    line-height: 1.6;
    font-size: 1.1rem;
    text-align: left;
}

.certificate {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center !important;
    margin-top: 2rem;
}

.certificate img {
    max-width: 300px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.certificate img:hover {
    transform: scale(1.05);
}

.certificate p {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: #ffe082;
}

#contact {
    background-color: #1e293b;
    margin: 0;
    padding: 1rem;
    text-align: center;
}

#contact h4 {
    font-size: 1.6rem;
    margin-top: 0.8rem;
}


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

.contact-links a {
    color: white;
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-container a, .contact-links a {
    cursor: pointer;
}

.contact-links a:hover {
    color: #999;
}

#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #ffe082;
    color: #1e293b;
    border: none;
    padding: 0.7rem 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1001;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    opacity: 0;
}

#backToTop.show {
    display: block;
    animation: fadeSlideIn 0.5s ease forwards;
}

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive styles */

@media (max-width: 1024px) {
    .welcome-container {
        grid-template-columns: 1fr 1fr;
        max-width: 900px;
    }

    .profile-pic {
        max-width: 850px;
        transform: translateX(60px);
    }

    .welcome-text {
        max-width: 500px;
        transform: translateX(40px);
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 600px) {
    body {
        font-size: 1rem;
    }

    .projects-display {
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .nav {
        font-size: 1.5rem;
        padding: 1rem 0;
    }

    .nav-container {
        padding: 0 4rem;
    }

    .projects-display {
        justify-content: center;
        gap: 2.5rem;
    }

    #about,
    #contact {
        padding: 2rem 4rem;
    }

    .contact-links a {
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    .nav {
        padding: 0.5rem 0;
        font-size: 1.2rem;
    }

    .nav-container a {
        margin: 0 1rem;
    }
}


@media (max-width: 768px) {
    #welcome-section {
        background-image: url('images/profile-pic.png');
        background-size: 160% auto;
        background-position: 20% bottom;
        background-repeat: no-repeat;
        background-blend-mode: lighten;
        background-color: rgba(255, 255, 255, 0.6);
        position: relative;
        overflow: hidden;
    }

    .welcome-container {
        display: flex !important;
        flex-direction: column;
        overflow: hidden;
    }

    .profile-pic {
        display: none ;
        
    }

        .welcome-text {
            transform: none !important;
            text-align: center;
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: auto;
            margin-right: auto;
            margin-top: 6rem;
            justify-self: center;
            align-self: center;
            justify-content: flex-start !important;
            height: 100vh;
            padding: 1rem;
        }

        .nav {
            padding: 0.5rem 0.5rem;  
        }

        .nav-container {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .nav-container a {
            font-size: 1rem;
            padding: 0.3rem 0.6rem;
            text-align: center;
            white-space: nowrap;
            color: #f57f17;
            text-shadow: none;
            transition: color 0.3s ease;
        }

        .nav-container.dark-bg a {
            color: white;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
        }

        .nav-container a:hover {
            text-shadow: none;
            color: #ffe082;
        }
}

@media (min-width: 769px) and (max-width: 1148px) {
    .welcome-container {
        max-width: 95vw;
        padding: 0 1rem;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .profile-pic {
        max-width: 225%;
        transform: none;
        margin-right: 3rem;
        padding-right: 10rem;
    }

    .welcome-text {
        padding: 1rem;
        text-align: left;
        max-width: 100%;
        transform: none;
    }
}
