/* GENERAL STYLES */
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #f6f6f6;
    color: #333;
    line-height: 1.6;
}

h1, h2, h3 {
    color: #1a1a1a;
}

a {
    text-decoration: none;
    transition: color 0.3s ease;
}

/* SECTION STYLES (Adjusted for responsiveness by default) */
section {
    padding: 6rem 10%;
    min-height: 100vh;
    box-sizing: border-box;
}

.section__text__p1 {
    text-align: center;
    font-size: 1.5rem;
    color: #555;
}

.title { /* Removed unused .section-title selector */
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

/* --- HEADER AND NAVIGATION (Base) --- */

header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#desktop-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%; 
    background-color: #B22222;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: #F4F4F4;
    font-family: Playfair Display (Serif);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    font-family: Playfair Display (Serif);
}

.nav-links li a {
    font-size: 1.7rem;
    font-weight: 600;
    color: #F4F4F4;
    font-family: Playfair Display (Serif);
}

.nav-links li a:hover {
    color: black;
    text-decoration: none;
}


#hamburger-nav {
    display: none; 
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%; 
    background-color: #B22222;
}

/* --- PROFILE SECTION --- */

#profile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5rem;
    max-width: 1550px;
    margin: 0 auto;
    padding-top: 5rem;
    scroll-margin-top: 60px;
}

.section__pic-container {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 450px; 
    width: 100%; 
}

#marco-profile-img {
    width: 500px; 
    height: auto; 
    border-style: solid;
    border-width: 0;
    border-radius: 20px;
    height: 600px;
}

.section__text {
    flex: 2;
    text-align: center;
}

.section__text__p2 {
    font-size: 2.5rem;
    color: #555;
    margin-bottom: 2rem;
}

.btn-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 10px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 350;
    transition: all 0.3s ease;
    border: 2px solid;
}

.btn-color {
    background-color: #B22222;
    color: #F4F4F4;
    border-color: #B22222;
}

.btn-color:hover {
    background-color: #F4F4F4;
    color: #B22222;
    border-color: #B22222;
}

.btn-color-2 {
    background-color: #B22222;
    color: #F4F4F4;
    border-color: #B22222;
}

.icon {
    width: 2rem;
    height: 2rem;
}

/* --- ABOUT SECTION --- */

#about {
    background-color: #fff;
    padding: 3rem 10%;
    min-height: 100vh;
    box-sizing: border-box;
    scroll-margin-top: 60px;
}

.about_title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 0rem;
    color: #1a1a1a;
}
.section__text__about {
    text-align: center;
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 3rem;
}
.section-container {
    display: flex;
    gap: 3rem;
    align-items: center;
    max-width: 1550px;
    margin: 0 auto;
}

.about-details-container {
    flex: 1;
}

.about-containers {
    display: flex;
    gap: 2rem;
    margin-bottom: 4rem;
}

.details-container {
    flex: 1;
    padding: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 15px;
    text-align: center;
    background-color: #f9f9f9;
}

.details-container h2 {
    margin: 0.5rem 0 0.5rem;
}

.details-container p {
    margin: 0;
    font-size: 1.4rem;
}

.details-container .icon {
    width: 4rem;
    height: 4rem;
}

.text-container p {
    margin: auto;
    font-size: 1.5rem;
    color: black;
    text-align: justify;
    width: 80%;
}

/* --- EXPERIENCE SECTION --- */

#experience {
    background-color: #f6f6f6;
    min-height: 90vh;
    box-sizing: border-box;
    scroll-margin-top: 60px;
    padding-bottom: 0%;
    padding-top: 2%;
}

.experience_title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 0rem;
    color: #1a1a1a;
}
.section__text__experience {
    text-align: center;
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 1rem;
}


.experience-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.skill-card {
    flex: 1;
    padding: 2rem;
    border: 1px solid #ccc;
    border-radius: 15px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.skill-header {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #007bff;
}

.skill-header i { 
    font-size: 2rem;
    margin-right: 0.5rem;
}

.skill-header h2 {
    display: inline;
    font-size: 1.7rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem 1rem;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid black;
    padding-bottom: 0.5rem;
}

.skill-item h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.skill-level {
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
    color: #fff;
}

.experienced { background-color: #28a745; }
.intermediate { background-color: #ffc107; color: #333; }
.basic { background-color: #007bff; }
.learning { background-color: #6c757d; }

/* --- PROJECTS SECTION --- */

#projects {
    background-color: #fff;
    scroll-margin-top: 60px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.projects_section {
    text-align: center;
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 1rem;
    padding-bottom: 0%;
}

.projects_title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 0rem;
    color: #1a1a1a;
}

.details-container.color-container {
    flex: 0 0 calc(30% - 3rem); /* 3 items per row on desktop */
    max-width: calc(100% - 0.5rem);
    background-color: #f9f9f9;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.details-container.color-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.articale-container {
    margin-bottom: 1rem;
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.project-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    color: #1a1a1a;
}

.project-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-technologies {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.tech-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e9ecef;
    color: #555;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* --- FOOTER SECTION --- */

footer {
    padding: 2rem 10%;
    background-color: #1a1a1a;
    color: #f4f4f4;
    text-align: center;
    font-size: 1rem;
}

.footer-contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

footer .contact-info-container {
    background-color: transparent;
    border: none;
    padding: 0;
    color: #f4f4f4;
    display: flex;
    align-items: center; /* ALIGNMENT FIX: Vertically centers icon and text */
}

footer .contact-info-container p { /* ALIGNMENT FIX: Removes default paragraph margin */
    margin: 0;
}

footer .contact-info-container a {
    color: #f4f4f4;
    font-size: 1rem;
    margin-left: 0.5rem;
}

footer .contact-icon {
    width: 2rem;    
    height: 2rem;
}

footer .contact-info-container p a:hover {
    color: #B22222;
}

footer .nav-links-container {
    display: flex;
    justify-content: center;
}

footer .nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

footer .nav-links li a {
    font-size: 1rem;
    font-weight: 400;
    color: #f4f4f4;
}

footer .nav-links li a:hover {
    color: #B22222;
}

/* --- HAMBURGER MENU / OFF-CANVAS STYLES --- */

.hamburger-menu {
    position: relative;
    display: inline-block;
}

#menu-toggle {
    display: none; /* Hide the checkbox */
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    cursor: pointer;
    padding: 5px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

.menu-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 75vw;
    height: 100vh;
    background-color: #B22222;
    list-style: none;
    padding: 5rem 2rem;
    margin: 0;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 999;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-links li a {
    font-size: 1.5rem;
    color: #F4F4F4;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(244, 244, 244, 0.1);
}

.menu-links li:last-child a {
    border-bottom: none;
}

.menu-links li a:hover {
    color: black;
}

/* --- Toggle and Animation Logic (The Checkbox Hack) --- */

#menu-toggle:checked ~ .menu-links {
    right: 0;
}

#menu-toggle:checked ~ .hamburger-icon .hamburger-line:nth-child(1) {
    /* Updated for a cleaner, centered X for all screen sizes */
    transform: rotate(45deg) translate(7.5px, 7.5px); 
}

#menu-toggle:checked ~ .hamburger-icon .hamburger-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle:checked ~ .hamburger-icon .hamburger-line:nth-child(3) {
    /* Updated for a cleaner, centered X for all screen sizes */
    transform: rotate(-45deg) translate(7.5px, -7.5px);
}


/* --- MERGED MEDIA QUERIES FOR RESPONSIVENESS --- */

/* 1200px: Switch to mobile navigation, medium screen padding/layout */
@media screen and (max-width: 1200px) {
    #desktop-nav {
        display: none; 
    }
    #hamburger-nav {
        display: flex; 
        padding: 1rem 5%; 
    }
    section {
        padding: 4rem 5%; 
    }
    .details-container.color-container {
        flex: 0 0 calc(50% - 2rem); /* 2 items per row */
        max-width: calc(50% - 2rem);
        align-items: center; /* Centering project buttons */
    }

    .category-title{
        font-size: 1.5rem;
        color: #B22222;
    }
}

/* 992px: Stack major sections, tablet text sizing */
@media screen and (max-width: 992px) {
    /* Layout Adjustments (Stacking) */
    #profile, .section-container, .experience-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    #profile {
        gap: 3rem;
    }
    .section__pic-container {
        order: -1; 
        max-width: 350px; 
    }
    .about-containers {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem; 
    }
    .details-container.color-container {
        flex: 0 0 100%; /* 1 item per row */
        max-width: 100%;
        align-items: center; /* Centering project buttons */
    }

    /* Text Sizing and Spacing Adjustments */
    .title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }
    .about_title {
        font-size: 3rem;
    }
    .section__text__p2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    .text-container p {
        font-size: 1.2rem;
        width: 100%;
    }
    .about-containers {
        margin-bottom: 2rem; /* Reduce from 4rem in desktop view */
    }
    .skill-header h2 {
        font-size: 1.5rem;
    }
    .skills-grid {
        gap: 1rem 0.5rem;
    }
}

/* 600px: Smallest phone screens, fixed padding, smallest text */
@media screen and (max-width: 600px) {
    /* Critical: Reduce overall section padding and allow height to collapse */
    section {
        padding: 2rem 5%; 
        min-height: auto; 
    }

    
    /* Layout & Image Sizing */
    #desktop-nav, #hamburger-nav {
        padding: 0.5rem 1rem;
    }
    .logo {
        font-size: 1.2rem; 
    }
    .section__pic-container {
        max-width: 250px; 
        margin-bottom: 1rem;
    }
    #marco-profile-img {
        width: 350px; 
        height: 350px;
    }

    #experience {
        padding-bottom: 2rem;
        padding-top: 1rem;
    }

    .btn-container {
        flex-direction: column;
        gap: 1rem;
    }
    .footer-contact-links {
        flex-direction: column; /* Stack the contact links vertically */
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    footer .nav-links {
        gap: 0.75rem;
    }
    footer {
        padding: 2rem 1rem;
    }
    
    /* Heading Sizing */
    .title { /* Removed unused .section-title selector */
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }
    .about_title {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }
    .section__text__p2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    /* Text Sizing */
    .text-container p {
        font-size: 0.9rem;
        text-align: left;
    }
    .project-title {
        font-size: 1.3rem;
        margin: 0.3rem 0;
    }
    .project-description {
        font-size: 0.9rem;
    }
    .skill-item h3 {
        font-size: 0.95rem;
    }
    .contact-info-container {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .details-container p{
        font-size: 1rem;
    }

    .experience_title{
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }

    .projects_title {
        font-size: 2.5rem;
    }

    #profile {
        padding-top: 15%;
        gap: 0.5rem;
    }

}