/***************************************** 
       1. GLOBAL RESET & BASE STYLES
******************************************/
html {
    scroll-behavior: smooth;
}

body {
    font-family: "Poppins", sans-serif;
    margin: 0;
    padding: 0;
    background:#fff; 
}

section {
    display: flex;
    flex-direction: column;
    align-items: center;    
    text-align: center;
    width: 100%;
    max-width: 400px;       
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

h4, p {
    margin: 0;
}

.wrk-pad {
    margin-bottom: 20px;
}


.btn {
    display: inline-block;
    padding: 16px;
    width: 120px;
    background-color: rgb(55,130,211);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 300ms ease;
    box-sizing: border-box;
}

.btn:hover {
    background-color: rgb(27,90,157);
}

/***************************************** 
               2. HERO STYLES
******************************************/

#hero {
    background-color: #ffffff;
}

#hero h1 {
    margin: 0;
}

#hero h2, #hero p {
    color: rgb(85, 85, 85);
    font-weight: 500;
    margin: 10px 0;
}

.hero-container {
    height: 200px;
    width: 200px;
    border-radius: 50%;
    overflow: hidden;
    background-color: lightcoral;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center -10px;
}

span .btn  {
    margin-left: 20px;
}

/***************************************** 
       3. ABOUT & EXPERIENCE STYLES
******************************************/

.container {
    display: flex;
    flex-direction: row;
    gap: 40px;          /* Matches the 40px column gap of your project grid */
    width: 100%;
    max-width: 840px;   /* The magic number: balances the cards with your projects */
    margin: 0 auto; 
}

.common-container {
    flex: 1;
    background-color: rgba(234, 234, 234, 0.5);
    border-radius: 12px;
    padding: 15px 10px 20px 10px;
    box-sizing: border-box;
    max-width: 400px;
}

#about h2 {
    margin-bottom: 80px;
}

.common-container h4 {
    margin-bottom: 10px;
}

#about > p {
    text-align: justify;
    font-size: 14px;
    line-height: 1.6;
    color: rgb(85, 85, 85);
}

.about-text {
max-width:650px;
margin:auto;
line-height:1.8;
}

#experience h2 {
    margin-bottom: 90px;
}

/***************************************** 
         4. MOBILE PROJECT STYLES
******************************************/

.project-layout-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 45px; /* Spaces out your vertical project list */
    box-sizing: border-box;
    margin-bottom: 100px;
}

.project-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

#projects h4 {
    font-size: 18px;
    color: rgb(40, 40, 40);
    margin: 0 0 15px 0;
}

/* Fixes the mobile alignment bug: forces image to center completely */
.project-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto; /* Centers the image frame inside its container */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.project-desc {
    font-size: 14px;
    line-height: 1.5;
    color: rgb(90, 90, 90);
    margin: 15px 0 6px 0;
    width: 100%;
}

.project-tech {
    font-size: 13px;
    color: rgb(55, 130, 211);
    /* margin: 0 0 20px 0; */
    width: 100%;
}

.project-buttons {
    display: flex;
    justify-content: center; 
    width: 100%;
    margin-top: 20px; 
}

.project-buttons .btn {
    margin: 0 auto; 
    width: 140px;  
    margin: 15px;
}


/************************** 
      NETLIFY FORM STYLES
***************************/

#form-section {
    width: 100%;
    box-sizing: border-box;
}

.form-subtitle {
    font-size: 14px;
    color: rgb(110, 110, 110);
    margin-bottom: 25px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
}

.form-row {
    display: flex;
    flex-direction: column; /* Stacked on mobile views */
    gap: 15px;
    width: 100%;
}

.contact-form input, 
.contact-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* Curves matching your master global buttons */
    background-color: #fafdff;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.contact-form textarea {
    height: 150px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    justify-content: center; /* Centered on mobile screens */
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

/* Form Primary Button Override */
.btn-form-submit {
    background-color: rgb(55, 130, 211);
    color: #ffffff;
    border: none;
    width: 150px; /* Wider for form text clearance */
}

.btn-form-submit:hover {
    background-color: rgb(27, 90, 157);
}

/* Form Secondary Button Override */
.btn-form-reset {
    background-color: transparent;
    color: rgb(120, 120, 120);
    border: 2px solid rgb(210, 210, 210);
    width: 120px;
}

.btn-form-reset:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: rgb(60, 60, 60);
    border-color: rgb(160, 160, 160);
}


/***************************************** 
         5. CONTACT & FOOTER STYLES
******************************************/
#contact .container {
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
}

#contact button {
    height: 50px;
    width: 50px;
    background: none;
    padding: 0;
    border: none;
    cursor: pointer;
}

#contact img {
    height: 100%;
    width: 100%;
}

footer {
    text-align: center;
    color: rgb(85, 85, 85);
    margin: 50px auto;
    font-size: 14px;
}

/***************************************** 
     6. CLEAN DESKTOP MEDIA QUERY
******************************************/
@media (min-width: 768px) {
    section {
        max-width: 900px; /* Unlocks canvas width for desktops */
        padding: 0;
    }

    .container {
        gap: 30px;
    }

    /* Switches projects list from infinite vertical scroll to 2-column grid */
    .project-layout-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 60px 40px; 
    }

    .project-container {
        max-width: 400px;
        height: 100%; /* Keeps neighboring cards perfectly balanced */
    }

    /* Sets exact, horizontal matching baselines for mockup displays */
    .project-img {
        height: 240px;
        object-fit: cover;
        object-position: top;
    }

    /* Normalizes height space allocations for wrapped lines */
    #projects h4 {
        min-height: 28px;
    }

    .project-desc {
        min-height: 65px;
    }

    .project-tech {
        min-height: 40px;
    }
     #experience, #projects {
        width: 100%;
        max-width: 900px;
        margin: 40px auto;
        padding: 0 40px; /* Aligns the internal content anchors perfectly */
        box-sizing: border-box;
    }
}
