/*
1-Tipografia
2-Paleta de colores
3-Boxmodel & Base Styles
4-Header
5-Navbar (Including Sticky)
6-General Section & Container Styling (Consistency)
7-About Me
8-Skills
9-Portfolio (Enhanced)
10-Experience
11-Contact
12-Footer
13-Animations & Transitions
14-Responsive Adjustments
*/

/* 1- Tipografia ---------------------------------------------------*/
/* -----------------------------------------------------------------*/
@charset "utf-8";
@import url("https://fonts.googleapis.com/css?family=Raleway:400,700,800"); /* Removed 600 if not used, added 400 */
@import url("https://fonts.googleapis.com/css?family=Signika:400,600"); /* Keep if used, e.g., in form inputs */

/* 2- Paleta de colores-------------------------------------------- */
/* -----------------------------------------------------------------*/
:root {
    --blue: #1b325f;
    --lightblue: #9cc4e4;
    --light: #e9f2f9;
    --softBlue2: #3a89c9;
    --orange: #f26c4f;
    --rojo: rgb(218, 11, 11); /* Consider if rojo is actually used */
    --white: #ffffff;
    --black: rgba(0, 0, 0, 0.85); /* Slightly darker black */
    --softBlue: #1717e8ef; /* Consider if softBlue is used */
    --textColor: #f0f0f0;
    --ctaBackground: var(--blue); /* Use variable */
    --sectionPaddingY: 80px; /* Standard vertical padding */
    --sectionPaddingX: 20px; /* Standard horizontal padding */
    --containerWidth: 1140px; /* Standard container width */
    --cardBg: var(--white);
    --cardShadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --cardHoverShadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    --borderRadius: 8px;
}

/* 3- Boxmodel &  estilos base------------------------------------- */
/* -----------------------------------------------------------------*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    font-family: 'Raleway', Arial, sans-serif;
    overflow-x: hidden;
    color: var(--black); /* Default text color */
    background-color: var(--white); /* Default background */
    line-height: 1.6;
    margin: 0; /* <-- ADD OR ENSURE THIS LINE IS PRESENT */
    /* The padding-top is handled by JS for the sticky nav */
    padding-top: 0;
    transition: padding-top 0.4s ease;
}

/* 4- Header -------------------------------------------------------*/
/* -----------------------------------------------------------------*/
/* sticky navbar, menu fijo al scroll  */
body.navbar-sticky {
    /* The actual padding value will be set by JS */
}

a {
    color: var(--softBlue2);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--orange);
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Remove extra space below images */
}

h1, h2, h3, h4 {
    font-family: 'Raleway', sans-serif;
    color: var(--blue);
    margin-bottom: 0.8em; /* Consistent bottom margin */
    line-height: 1.3;
}

h1 { font-size: 2.8rem; font-weight: 800; }
h2 { font-size: 2.5rem; font-weight: 700; text-transform: uppercase; } /* Standardized H2 */
h3 { font-size: 1.6rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 400; color: var(--softBlue2); margin-top: -0.5em; margin-bottom: 1.5em;} /* Adjusted H4 */

p {
    margin-bottom: 1em;
    color: var(--black);
}

#home {
    padding: 0; /* Ensure the container section itself has NO padding */
    margin: 0;  /* And no margin */
    /* It should already be display: block by default */
}


.header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    width: 100%;
    /* Padding here is okay, it's inside the header element */
    padding: 0;
    text-align: center;
    color: var(--white);
    background-image: url('./img/header-only-min.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Optional */
    overflow: hidden;
}

/* Add overlay for better text readability */
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.5));
    z-index: 1;
}

/* mantiene el logo-title , con with flex centrado */
/* Make logo-title relative to header for proper stacking */
.logo-title {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 90%;
    padding: 2rem;
}

.logo-title img {
    max-height: 90px;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.logo-title h1 {
    font-size: 4rem;
    margin: 0 0 0.5rem;
    font-weight: 800;
    color: var(--white);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.logo-title h4 {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--textColor);
    margin: 0 0 2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.9;
}

/* Keep CTA button styles */
/* Enhanced CTA button */
.cta-button {
    display: inline-block;
    padding: 14px 32px;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--ctaBackground) 0%, var(--orange) 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--borderRadius);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    border: none;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.7s ease;
}

.cta-button:hover::before {
    left: 100%;
}

/* Animation classes */
.animate-element {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-title img.animate-element { animation-delay: 0.1s; }
.logo-title h1.animate-element { animation-delay: 0.3s; }
.logo-title h4.animate-element { animation-delay: 0.5s; }
.logo-title .cta-button.animate-element { animation-delay: 0.7s; }

/* Media Queries for better responsiveness */
@media (max-width: 768px) {
    .logo-title h1 {
        font-size: 3rem;
    }

    .nav-links {
        display: none; /* For mobile, consider adding a hamburger menu */
    }
}

@media (max-width: 480px) {
    .logo-title h1 {
        font-size: 2.5rem;
    }

    .logo-title h4 {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* 5- Navbar -------------------------------------------------------*/
/* -----------------------------------------------------------------*/
.navbar {
    display: flex;
    flex-direction: row;
    justify-content: center; /* Center links */
    align-items: center;
    background-color: var(--blue);
    padding: 10px 0; /* Reduced vertical padding */
    width: 100%;
    margin: 0 auto; /* Remove top margin, handled by section padding */
    position: relative; /* Changed from relative */
    z-index: 999; /* Below sticky */
    transition: all 0.4s ease; /* Smooth transition for sticky */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle bottom border */
}

/* Styles for the sticky navbar */
.navbar.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(27, 50, 95, 0.97); /* Slightly transparent blue */
    backdrop-filter: blur(5px); /* Optional: blur effect */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-bottom: none; /* Remove border when sticky */
}

.navbar a {
    color: var(--white);
    text-decoration: none;
    text-align: center;
    font-size: 0.9rem; /* Slightly smaller */
    text-transform: uppercase;
    font-weight: 700;
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 10px 15px; /* Adjusted padding */
    border-radius: 5px; /* Add border-radius for hover effect */
    margin: 4px 0; /* Space between links */
    width: 80%;
    display: block;
}

.navbar a:hover,
.navbar a.active { /* Add active class styling if desired (JS needed) */
    color: var(--white);
    background-color: var(--orange); /* Highlight on hover */
}

@media (max-width: 576px) {
    /* Further adjustments if needed for very small screens */
    .navbar a {
        font-size: 0.85rem;
        padding: 8px 10px;
        width: 90%;
    }
    /* Other 576px rules */
}

/* 6- General Section & Container Styling */
section {
    padding: var(--sectionPaddingY) var(--sectionPaddingX);
    overflow: hidden; /* Prevent horizontal scroll from animations */
}

/* Alternating backgrounds */
#aboutMe, #Portfolio, #contact {
    background-color: var(--white);
}

#skills, #clients {
    background-color: var(--blue);
}

#skills .section-title h2,
#skills .section-title h4,
#clients .section-title h2,
#clients .section-title h4 {
    color: var(--white); /* White titles on dark sections */
}
#skills .section-title h4,
#clients .section-title h4 {
    color: var(--lightblue); /* Lighter subtitle on dark sections */
}


.section-container {
    max-width: var(--containerWidth);
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 50px; /* Consistent margin below titles */
}


/* 7- About Me */
#aboutMe {
    /* Uses general section padding */
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Adjust ratio if needed */
    gap: 40px; /* Increased gap */
    align-items: center;
}

.about-image img {
    border-radius: var(--borderRadius);
    box-shadow: var(--cardShadow);
    width: 100%; /* Let grid handle size */
    max-width: 400px; /* Limit image size if needed */
    margin: 0 auto; /* Center if max-width is applied */
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--black);
}

/* 8- Skills */
#skills {
    /* Uses general section padding & dark background */
}
.skills-stacks {
    display: flex;
    flex-direction: column;
    gap: 50px; /* Increased gap */
}

.stack-group {
    background-color: rgba(255, 255, 255, 0.05); /* More subtle background */
    border-radius: var(--borderRadius);
    padding: 30px;
}

.stack-title {
    font-size: 1.6rem; /* Adjusted size */
    color: var(--lightblue);
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    font-weight: 700;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); /* Slightly smaller min */
    gap: 25px;
    justify-items: center;
}

/* Find the existing .skill-card rule */
.skill-card {
    background-color: var(--cardBg);
    border-radius: var(--borderRadius);
    padding: 25px 15px;
    /* text-align: center; */ /* << REMOVE THIS or comment out */

    /* --- ADD FLEXBOX --- */
    display: flex;            /* <<< Use Flexbox */
    flex-direction: column; /* <<< Stack icon and text vertically */
    align-items: center;    /* <<< Center icon and text horizontally */
    justify-content: center; /* Optional: Center vertically if height varies */
    /* --- END FLEXBOX --- */

    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: var(--cardShadow);
    width: 100%;
    max-width: 160px; /* Keep max-width */
    border: 1px solid rgba(0,0,0,0.05);
    min-height: 150px; /* Optional: Give cards a minimum height */
}

/* Keep the :hover styles for .skill-card as they are */
.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--cardHoverShadow);
    background-color: var(--orange);
}

/* Keep .skill-icon styles, but ensure margin is appropriate */
.skill-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 15px; /* Ensure space below icon */
    object-fit: contain;
    /* display: block; */ /* Not needed with flexbox */
    /* margin-left: auto; margin-right: auto; */ /* Not needed with flexbox */
}

/* Keep .skill-card h3 styles */
.skill-card h3 {
    font-size: 1rem;
    color: var(--blue);
    margin: 0; /* Text already centered by align-items */
    font-weight: 600;
    transition: color 0.3s ease;
    font-family: 'Signika', sans-serif;
    text-align: center; /* Explicitly center the text itself */
}

/* Keep .skill-card:hover h3 styles */
.skill-card:hover h3 {
    color: var(--white);
}


/* 9- Portfolio (Enhanced) */
#Portfolio {
    /* Uses general section padding */
}

/* Improved Filter Buttons */
.filter-buttons {
    margin-bottom: 40px; /* Increased space */
    text-align: center;
}

.filter-btn {
    padding: 10px 22px; /* Adjusted padding */
    margin: 5px;
    border: 1px solid var(--lightblue); /* Use theme color border */
    background-color: transparent; /* Transparent background */
    color: var(--blue); /* Theme color text */
    cursor: pointer;
    border-radius: 50px; /* Pill shape */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--blue);
    border-color: var(--blue);
    color: var(--white);
    transform: translateY(-2px);
}

/* Enhanced Project Grid & Cards */
.projects-grid {
    display: grid;
    /* Increased minmax for potentially larger cards */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; /* Increased gap */
}

.project-card {
    position: relative; /* Needed for absolute positioning of content */
    height: 280px; /* Slightly increased height */
    background-size: cover;
    background-position: center;
    border-radius: var(--borderRadius);
    overflow: hidden; /* Keep content contained */
    color: white;
    box-shadow: var(--cardShadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: block; /* Ensure display is block */
    border: none; /* Remove previous border */
    padding: 0; /* Remove previous padding */
    margin: 0; /* Remove previous margin */
    opacity: 1; /* Reset animation opacity */
    transform: none; /* Reset animation transform */
    animation: none; /* Remove old animation if not needed */
}

.project-card::before { /* Dark overlay */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 80%); /* Gradient overlay */
    opacity: 0.8; /* Start with some opacity */
    transition: opacity 0.4s ease;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02); /* Combined effect */
    box-shadow: var(--cardHoverShadow);
}

.project-card:hover::before {
    opacity: 0.95; /* Darken overlay on hover */
}

.project-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 25px; /* Adjusted padding */
    background: transparent; /* Remove background from content div */
    text-align: left;
    z-index: 2; /* Ensure content is above overlay */
    transform: translateY(30px); /* Start slightly hidden */
    opacity: 0; /* Start hidden */
    transition: transform 0.4s ease 0.1s, opacity 0.4s ease 0.1s; /* Delayed transition */
}

.project-card:hover .card-content {
    transform: translateY(0); /* Slide up on hover */
    opacity: 1; /* Fade in on hover */
}

.card-content h3 {
    margin: 0 0 8px 0; /* Adjusted margin */
    font-size: 1.4rem; /* Adjusted size */
    color: var(--white); /* Ensure text is white */
    font-weight: 700;
}

.card-content p {
    margin: 0 0 15px 0; /* Adjusted margin */
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9); /* Slightly transparent white */
    line-height: 1.5;
}

.card-content a {
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    gap: 8px; /* Space between text and icon */
    margin-top: 0; /* Removed top margin */
    padding: 8px 18px;
    background-color: var(--orange); /* Use orange for contrast */
    color: var(--white);
    text-decoration: none;
    border-radius: 50px; /* Pill shape */
    font-size: 0.85rem;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.card-content a i { /* Style for the icon */
    font-size: 0.8rem;
}

.card-content a:hover {
    background-color: var(--white); /* White background on hover */
    color: var(--orange); /* Orange text on hover */
    transform: translateY(-2px);
}

/* JS will hide/show these based on filter */
.project-card.hidden {
    display: none;
}


/* 10- Experience */
#clients {
    /* Uses general section padding & dark background */
}
.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.experience-card {
    background-color: var(--light);
    color: var(--blue);
    padding: 30px; /* Increased padding */
    border-radius: var(--borderRadius);
    box-shadow: var(--cardShadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid var(--orange); /* Keep accent */
}

.experience-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--cardHoverShadow);
}

.experience-header {
    margin-bottom: 15px;
}

.experience-role {
    font-size: 1.5rem; /* Adjusted size */
    color: var(--blue);
    font-weight: 700;
    margin-bottom: 5px;
}

.experience-company {
    font-size: 1rem; /* Adjusted size */
    color: var(--softBlue2);
    font-weight: 600;
    display: block;
    margin-bottom: 10px; /* Added margin */
}

.experience-dates {
    font-size: 0.9rem; /* Adjusted size */
    color: #506580;
    font-style: italic;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--lightblue);
    padding-bottom: 10px;
    font-family: 'Signika', sans-serif;
}

.experience-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--black);
}


/* 11- Contact */
#contact {
    /* Uses general section padding */
    background-color: var(--light); /* Ensure light background explicitly */
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px; /* Increased gap */
}

.contact-info, .contact-form {
    background-color: var(--white); /* White background for cards */
    padding: 45px; /* Increased padding */
    border-radius: var(--borderRadius);
    box-shadow: var(--cardShadow);
}

.contact-info h3, .contact-form h3 {
    color: var(--blue);
    font-size: 1.5rem;
    margin-bottom: 25px; /* Increased margin */
    text-align: left; /* Align left */
    border-bottom: 2px solid var(--lightblue); /* Add underline */
    padding-bottom: 10px;
    display: inline-block; /* Make border fit text */
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 25px; /* Gap between icon and text */
}

.contact-icon {
    width: 24px;
    height: 24px;
    /* Icons provided as images, keep size */
    flex-shrink: 0; /* Prevent icon shrinking */
}

.contact-item p {
    color: var(--black);
    font-size: 1rem;
    margin: 0; /* Remove default p margin */
}
.contact-item p a { /* Style links within contact items */
    color: var(--softBlue2);
    font-weight: 600;
}
.contact-item p a:hover {
    color: var(--orange);
    text-decoration: underline;
}


.social-links {
    display: flex;
    /* justify-content: center; Remove center */
    gap: 15px; /* Reduced gap */
    margin-top: 30px;
    padding-top: 20px; /* Add space above */
    border-top: 1px solid var(--lightblue); /* Separator */
}

.social-link img {
    width: 30px; /* Slightly smaller */
    height: 30px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.social-link:hover img {
    transform: scale(1.15); /* Increase scale effect */
    opacity: 1;
}

/* Contact Form */
.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px; /* Increased padding */
    border: 1px solid #ccc; /* Lighter border */
    border-radius: var(--borderRadius);
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(27, 50, 95, 0.15); /* Focus ring */
}

.submit-btn {
    background-color: var(--blue);
    color: var(--white);
    border: none;
    padding: 14px 30px; /* Increased padding */
    border-radius: var(--borderRadius);
    font-size: 1rem; /* Adjusted size */
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: auto; /* Don't force full width */
    display: inline-block; /* Align properly */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    background-color: var(--orange);
    transform: translateY(-2px);
}


/* 12- Footer */
footer {
    background-color: var(--blue);
    color: rgba(255, 255, 255, 0.8); /* Slightly transparent white */
    padding: 30px var(--sectionPaddingX); /* Increased padding */
    text-align: center;
}
.footer-container {
    max-width: var(--containerWidth);
    margin: 0 auto;
}

footer p {
    margin: 0 0 15px 0; /* Space below copyright */
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px; /* Row and column gap */
}

.footer-links a {
    color: var(--lightblue); /* Lighter color for links */
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--orange);
    text-decoration: none; /* No underline needed */
}

@media (max-width: 992px) {
    :root {
        --containerWidth: 960px;
        --sectionPaddingY: 70px;
    }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2.2rem; }
    h3 { font-size: 1.5rem; }

    .about-grid { grid-template-columns: 1fr; text-align: center; }
    .about-image img { max-width: 350px; margin-bottom: 30px; }
    .about-text { text-align: left; } /* Keep text left aligned */

    .contact-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 768px) {
    :root {
        --containerWidth: 720px;
        --sectionPaddingY: 60px;
        --sectionPaddingX: 15px; /* Reduce horizontal padding */
    }
    h1 { font-size: 2.2rem; }
    .logo-title h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1rem; }

    .header { min-height: 300px; padding: 60px var(--sectionPaddingX); }
    .logo-title img { max-height: 60px; }
    .logo-title h4 { font-size: 0.8rem; }
    .cta-button { padding: 10px 22px; font-size: 0.9rem; }

    /* Responsive Navbar */
    .navbar {
        /* Keep flex for sticky to work easily, maybe hide links */
        padding: 8px 0;
        justify-content: space-around; /* Or flex-end if adding a toggle */
    }
    /* Hide links for a potential mobile toggle menu later */
    .navbar a {
        font-size: 0.85rem;
        padding: 8px 12px;
        margin: 0 2px;
        /* display: none; */ /* Uncomment if implementing toggle */
    }
    /* .navbar a:first-child { display: block; } */ /* Show home/logo? */

    .skills-grid { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 15px; }
    .skill-card { max-width: 130px; padding: 20px 10px; }
    .skill-icon { width: 40px; height: 40px; }
    .stack-group { padding: 20px; }

    .projects-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; } /* Ensure cards fit */
    .project-card { height: 260px; }
    .card-content h3 { font-size: 1.3rem;}
    .card-content p { font-size: 0.9rem;}

    .experience-grid { grid-template-columns: 1fr; gap: 20px; }
    .experience-card { padding: 25px; }
    .experience-role { font-size: 1.4rem; }

    .contact-grid { gap: 25px; }
    .contact-info, .contact-form { padding: 25px; }

    .footer-links { justify-content: center; gap: 8px 15px; }
    .footer-links a { font-size: 0.8rem; }
}

@media (max-width: 576px) {
    :root {
        --sectionPaddingY: 50px;
    }
    h1 { font-size: 2rem; }
    .logo-title h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }

    .filter-btn { padding: 8px 18px; font-size: 0.85rem; }
    .projects-grid { grid-template-columns: 1fr; } /* Single column projects */

    .navbar a { padding: 6px 8px; font-size: 0.8rem; margin: 0 1px; } /* Further shrink navbar items */
}