/* ========================================
   VARIABLES
======================================== */

:root {
    --color-primary: #115A8A;
    --color-secondary: #F39C12;
    --color-light: #AFD7EF;
    --color-white: #FFFFFF;
    --color-text: #1F2937;
    --color-border: #E5E7EB;

    --radius-sm: .5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;

    --shadow-sm: 0 4px 12px rgba(0,0,0,.08);
    --shadow-md: 0 10px 30px rgba(0,0,0,.10);

    --container-width: 1180px;

    --space-xs: .5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    --transition: .3s ease;
}


/* ========================================
   RESET
======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inria Sans', sans-serif;
    font-size: 16px;
    line-height: 1.5;

    background-color: var(--color-white);
    color: var(--color-text);

    overflow-x: hidden;
    /*width: 1180px;*/
    margin: auto;
}

img {
    display: block;
    max-width: 100%;
}

picture {
    display: block;
}

ul {
    list-style: none;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}


/* ========================================
   ACCESSIBILITY
======================================== */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;
    border: 0;
}

.hidden-field {
    display: none;
}


/* ========================================
   TYPOGRAPHY
======================================== */

h1,
h2,
h3,
h4 {
    color: var(--color-primary);
    line-height: 1.1;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 5rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.3rem, 3vw, 2rem);
}

p {
    color: var(--color-text);
}

.atma-semibold {
    font-family: 'Atma', system-ui;
    font-weight: 600;
}


/* ========================================
   LAYOUT
======================================== */

.container {
    width: 100%;
    max-width: 1180px;

    margin-inline: auto;
    padding-inline: 1rem;
}

.section {
    padding-block: 20px/*var(--space-xl)*/;
}


/* ========================================
   HEADER
======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background-color: rgba(255,255,255,.95);
    backdrop-filter: blur(10px);

    border-bottom: 1px solid var(--color-border);
}

.site-header__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 90px;
}
.logo2{
    display:flex;
    flex-direction:row;
    align-items: center;
    color: var(--color-primary);
    
}
.logo2 img{
    width: 170px;
    margin-left:10px;
}
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-primary);
}

.logo__title {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
}

.logo__subtitle {
    font-size: .95rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav a {
    position: relative;

    font-weight: 600;

    transition: color var(--transition);
}

.main-nav a::after {
    content: '';

    position: absolute;
    left: 0;
    bottom: -5px;

    width: 0;
    height: 2px;

    background-color: var(--color-secondary);

    transition: width var(--transition);
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
    width: 100%;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--color-secondary);
}

.social-links {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.social-links a {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-white);

    transition:
        transform var(--transition),
        background-color var(--transition);
}

.social-links a:hover {
    transform: translateY(-3px);
    background-color: var(--color-secondary);
}
.language-switcher{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    position:relative;
    top:-40px;
    z-index: 1000;

   
}
.mobile-menu-btn {
    display: none;

    flex-direction: column;
    justify-content: center;

    gap: 5px;

    width: 48px;
    height: 48px;

    background: transparent;
    border: none;
}

.mobile-menu-btn span {
    width: 28px;
    height: 3px;

    background-color: var(--color-primary);

    border-radius: 10px;
}

.mobile-menu {
    display: none;
}


/* ========================================
   HERO
======================================== */

.hero {
    min-height: 60vh;
    /*min-height: 90vh;*/
    background-image: url('../img/hero.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size:auto;

    padding: 4rem 0;
}

.hero__container {
    /*min-height: 90vh;*/
    display: grid;
    align-items: center;
    justify-content: flex-end;
   /* margin:0px;*/
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.hero__text {
    max-width: 520px;

    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    text-align: left;
    grid-column: 2;
    margin-left: 100px;
}

.hero__text h1 {
    font-size: clamp(2rem, 7vw, 3.5rem);
    color: var(--color-primary);
    line-height: 1.3;
}

.hero__text p {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    /*margin-left: auto;*/
    max-width: 32ch;
}

/* ========================================
   BUTTONS
======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;

    padding: 1rem 1.5rem;

    border: none;
    border-radius: var(--radius-md);

    font-weight: 600;

    transition:
        transform var(--transition),
        background-color var(--transition),
        color var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--primary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.btn--primary:hover {
    background-color: var(--color-primary);
}

.btn--secondary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn--secondary:hover {
    background-color: var(--color-secondary);
}


/* ========================================
   PROJECTS
======================================== */

.projects {
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding-bottom: 20px/*var(--space-xl)*/;
}

.featured-card {
    display: flex;
    flex-direction: column;
    
    overflow: hidden;
    border-radius: var(--radius-lg);
    background-color: var(--color-white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.featured-card__image {
    aspect-ratio: 1 / 1;

    background-size: cover;
    background-position: center;

    transition: transform .5s ease;
    object-fit: cover;
    object-position: center;
    display: block;
}

.featured-card:hover .featured-card__image {
    transform: scale(1.03);
}

.featured-card__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    
    flex-grow: 1; 

    padding: 1.5rem;
}

.featured-card__content h2 {
    font-size: 1.5rem;
}
.featured-card__content .btn {
    margin-top: auto; 
}

/* ========================================
   ABOUT
======================================== */

.about {
    padding: var(--space-xl) 2rem;
    margin-bottom: 20px/*var(--space-xl)*/;
    text-align: center;
    border-radius: var(--radius-lg);
    background-color: var(--color-light);
}

.about__text {
    max-width: 800px;

    margin-inline: auto;
    margin-bottom: 2rem;

    font-size: clamp(1.2rem, 2vw, 2rem);
}


/* ========================================
   FOOTER
======================================== */

.site-footer {

    padding-top: 6rem;

    background-color: var(--color-primary);
    color: var(--color-white);
}
.site-footer h2,
.site-footer p,
.footer-brand h2,
.footer-brand p {

    color: var(--color-white);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    padding-bottom: 4rem;
}
.footer-logo {
    font-size: 3rem;
    margin-bottom: 2rem;
}
.footer-nav,
.footer-social,
.footer-contact {

    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.footer-nav h3,
.footer-social h3,
.footer-contact h3 {
    margin-bottom: .5rem;
    color: var(--color-secondary);
}

.footer-nav a, .footer-contact a {
    transition: opacity .3s ease;
}

.footer-nav a:hover, .footer-contact a:hover {
    opacity: .7;
}

.footer-social__links {
    display: flex;
    gap: 1rem;
}

.footer-social__links a {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background-color: rgba(255,255,255,.1);

    transition:
        transform .3s ease,
        background-color .3s ease;
}

.footer-social__links a:hover {
    transform: translateY(-3px);
    background-color: var(--color-secondary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 2rem;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .95rem;
}

.footer-legal {
    display: flex;
    gap: 1rem;
}


/* ========================================
   FORMULARI
======================================== */

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.contact-form input,
.contact-form textarea {
    /*width: 100%;*/
    padding: 1rem;

    border: none;
    border-radius: var(--radius-md);

    background-color: rgba(255,255,255,.95);
}

.contact-form textarea {
    resize: vertical;
    min-height: 180px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--color-secondary);
}

.form-response {
    min-height: 24px;

    font-size: .95rem;
}
label{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

/* ========================================
   FOOTER BOTTOM
======================================== */
.footer-form h3{
    color: var(--color-white);
    margin-bottom: 2rem;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
}

.footer-bottom__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding-block: 1.5rem;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-legal a {
    transition: color var(--transition);
}

.footer-legal a:hover {
    color: var(--color-secondary);
}

/* ========================================
   COOKIES BANNER (REAJUSTAT)
======================================== */

.cookies-banner {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    min-height: 120px;
    z-index: 2000;

    background-color: var(--color-primary); /* Canviat a blau corporatiu per a millor contrast visual */
    border-top: 3px solid var(--color-secondary);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
}

.cookies-banner p {
    color: var(--color-white);
    text-align: center;
    max-width: 800px;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.cookies-banner__link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.cookies-banner__link:hover {
    color: var(--color-white);
}

.cookies-banner__buttons {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
}

/* Forcem que els botons del banner no tinguin marges hereditaris estranys */
#acceptCookies,
#rejectCookies {
    margin: 0;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

/* Disseny adaptatiu per a pantalles petites */
@media (max-width: 768px) {
    .cookies-banner {
        padding: 1.2rem;
    }
    .cookies-banner__buttons {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    #acceptCookies,
    #rejectCookies {
        width: 100%;
    }
}

/* ========================================
   COOKIES
======================================== */

.cookies-banner {
    position: fixed;
    left: 0px;
    bottom: 0px;

    /*transform: translateX(-50%);*/

    width: 100%;
    height: 150px;
    z-index: 2000;

    background-color: #F39C12;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cookies-banner__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: .2rem;
    padding: 1.5rem;
    /*border-radius: var(--radius-lg);
    background-color: rgba(17,90,138,.96);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);*/
    color: var(--color-white);
}

.cookies-banner__content p {
    color: var(--color-white);
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

/*#acceptCookies{
    text-align: center ;
    margin-bottom: 30px;
}*/
.hidden {
    display: none;
}
.legal-content{
    margin-bottom: 40px;
}
.legal-content h1{
    font-size: 35px;
    margin-bottom: 10px;
    margin-top: 20px;
}
.legal-content h2{
    font-size: 25px;
    margin-bottom: 10px;
    margin-top: 0px;
}
.legal-content p{
    font-weight: lighter;
    margin-bottom: 10px;

}
.legal-content ul{
    font-weight: lighter;
    margin-bottom: 10px;
}
/* ========================================
   PROJECT IMAGES
======================================== */

.portada01 {
    background-image: url('../img/Projectes/capen1cub_01.webp');
}

.portada02 {
    background-image: url('../img/Projectes/formes_02.webp');
}

.portada03 {
    background-image: url('../img/Projectes/babou_03.webp');
}

/* ========================================
   PORFOLIO 
======================================== */

/*.portfolio-grid{
    display: grid;
    grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: var(--space-xl);

}
.project-card{
    aspect-ratio:1/1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
}
.obra h2{
    font-size: 40px;
    text-align: center;
}
.referencia{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
}*/

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.project-card {
    overflow: hidden;
    border-radius: 1.5rem;
}
.project-card__image {
    position: relative;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;

    /*border-radius: 1.5rem;*/
}

.project-card__overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 2rem;

    background:linear-gradient(to top,rgba(0,0,0,.7),transparent );
}

.project-card__title {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.project-card__tags span {
    padding: .4rem .8rem;
    border-radius: 999px;
    background-color: rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
    color: white;
    font-size: .85rem;
}


/* ========================================
   FITXA PROJECTE
======================================== */

.project-page {
    /*opacity: .6;*/
    margin-top:20px;
    margin-bottom:20px;
}

.project-description {
    max-width: 1180px;

    display: flex;
    flex-direction: column;
    /*gap: 1.5rem;*/

    font-size: 1.1rem;
    font-weight: lighter;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.project-description span {
    font-weight: 600;
}


/* 1. EL CONTENIDOR GRID */
.cas-estudi-brief {
    display: grid;
    /* Crea 2 columnes idèntiques. Si la pantalla és petita, passa a 1 columna automàticament */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px; /* Espaiat generós entre Repte i Solució. Respira elegància. */
    margin: 40px 0; /* Marge per separar-ho de les imatges o títols */
}

/* 2. LA TIPOGRAFIA DEL PARÀGRAF */
.brief-text {
    font-size: 1.1rem; /* Una mica més gran que el text normal, és una intro */
    line-height: 1.6; /* Interlineat obert per facilitar la lectura */
    color: #4a4a4a; /* Un gris fosc (no negre pur) redueix la fatiga visual */
    margin: 0;
}

/* 3. EL TRACTAMENT DE L'ETIQUETA STRONG (El secret) */
.brief-text strong {
    display: block; /* Trenca la línia. Força que el text normal vagi a sota */
    font-size: 1rem; /* Més petit per fer contrast de jerarquia */
    text-transform: uppercase; /* Majúscules per donar-li caràcter de "Label" */
    letter-spacing: 0.08em; /* Les majúscules sempre necessiten aire entre lletres */
    color: #111111; /* Aquest sí, gairebé negre pur */
    margin-bottom: 12px; /* Separa el títol del text base */
    border-bottom: 1px solid #e5e5e5; /* Línia subtil que subratlla el concepte */
    padding-bottom: 8px;
}


/*.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-gallery__item {
    overflow: hidden;
    border-radius: 1.5rem;
}

.project-gallery img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .6s ease;
}
*/

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
.project-gallery.single-image {
    grid-template-columns: 1fr;
    justify-items: center;
}
.project-gallery.single-image .project-gallery__item {
    max-width: 70%;
}
.project-gallery.single-image .project-gallery__item {
    max-width: 900px;
    width: 100%;
}
.project-gallery img {
    width: 100%;
    display: block;

    border-radius: 1.5rem;
}
.project-gallery__item:hover img {
    transform: scale(1.03);
}
.project-navigation{
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.project-navigation__link{
    color: #115A8A;
}
.project-navigation__link:hover{
    color: #F39C12;
}
.project-title {
    /* Mínim de 40px en mòbil, creixement ràpid de 5vw, topall de 72px en pantalles grans */
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    
    /* Afegim el color corporatiu i l'interlineat correcte per a títols grans */
    color: var(--color-primary);
    line-height: 1.1;
    font-weight: 700;
    
    /* Ajustem l'espaiat per donar-li aire respecte al menú i la imatge */
    margin-top: 30px;
    margin-bottom: 30px;
}

/* ========================================
   CURRICULUM
======================================== */
.cv-page {
    display: flex;
    flex-direction: column;
    gap: 6rem;

    padding-block: 6rem;
}

.cv-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;

    padding-bottom: .5rem;

    border-bottom: 1px solid rgba(255,255,255,.1);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;

    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 1rem 2rem;

    border: 1px solid currentColor;
    border-radius: 999px;

    text-decoration: none;
}

.cv-summary {
    max-width: 1180px;
    padding: 60px 40px;
    background-color: #AFD7EF;
    border-radius: 1rem;
}

.cv-summary h1 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: .95;

    margin-bottom: 2rem;
}

.cv-summary p {
    font-size: 1.2rem;
    line-height: 1.8;
}

.cv-section {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 1rem;

    font-size: 2rem;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.experience-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;

    padding-bottom: 1rem;

    border-bottom: 1px solid rgba(255,255,255,.08);
}

.experience-date {
    font-size: .9rem;
    opacity: .7;
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    border-left:1px solid #115A8A;
    padding-left: 1rem;
    font-weight: lighter;

}

.education-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .8rem;
}

.education-item {
    padding: 1rem;

    border: 1px solid rgba(255,255,255,.08);
    /*border:1px solid black;*/
    border-radius: 1rem;
    background-color:#AFD7EF;
}
.education-item h3{
    font-size: clamp(1rem, 2vw, 1.3rem);
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.skill-group {
    padding: 2rem;
    border-radius: 1.5rem;
    background: rgba(255,255,255,.03);
}

.skill-group ul {
    display: flex;
    flex-direction: column;
    gap: .75rem;

    margin-top: 1.5rem;

    font-weight: lighter;
}

/* ========================================
   RESPONSIVE (Tauletes i Mòbils)
======================================== */

/* ----------------------------------------
   PANTALLES MITJANES / TAULETES (Fins a 991px)
---------------------------------------- */
@media (max-width: 991px) {
    /* --- HEADER I MENÚ MÒBIL --- */
    .main-nav,
    .social-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Neutralitzem el hack de posicionament perquè no es desquadri al mòbil */
    .language-switcher {
        top: 0; 
        margin-right: 1rem;
    }

    .mobile-menu {
        position: fixed;
        top: 90px; /* Comença just a sota de la teva capçalera */
        left: 0;
        width: 100%; /* Ocupa tota l'amplada */
        
        /* LA MÀGIA: S'adapta al contingut, però mai supera l'alçada de la pantalla */
        max-height: calc(100vh - 90px); 
        overflow-y: auto; /* Si els enllaços no hi caben, crea un petit scroll intern només per al menú */
        
        display: none;
        padding: 2rem;
        background-color: var(--color-white);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1); /* Li afegim una mica d'ombra perquè separi visualment la web del menú */
    }

    .mobile-menu.is-open {
        display: block;
    }

    .mobile-menu__nav {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    /* --- HERO --- */
    .hero {
        text-align: center;
        background-size: cover; /* Evita fons tallats en pantalles verticals */
        background-position: right;
    }

    .hero__container {
        justify-content: center;
    }

    .hero__text {
        align-items: center;
    }

    /* --- GRAELLES (Adaptació intermèdia a 2 columnes) --- */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* Passem de 3 a 2 columnes */
    }

    .education-grid {
        grid-template-columns: repeat(2, 1fr); /* Passem de 4 a 2 columnes */
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr); /* Passem de 3 a 2 columnes */
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}


/* ----------------------------------------
   MÒBILS GRANS (Fins a 768px)
---------------------------------------- */
@media (max-width: 768px) {
    .logo2 img{
        display: none;
    
    }
    /* --- CV I TEXTOS --- */

    .cv-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .cv-summary {
        padding: 30px 20px; /* Reduïm l'excés de coixí per aprofitar espai de pantalla */
    }

    .experience-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .experience-list {
        border-left: none;
        border-top: 1px solid var(--color-primary);
        padding-left: 0;
        padding-top: 1rem;
    }

    /* --- PROJECTE INTERIOR --- */
    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-navigation {
        /* 1. Forcem la línia horitzontal */
        flex-direction: row; 
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
    }

    .project-navigation__link {
        /* 2. Evitem que un text llarg empenyi l'altre fora de la pantalla */
        max-width: 48%; 
        font-size: 0.95rem; /* Lletra un pèl més petita pel mòbil */
        line-height: 1.3;
    }

    /* 3. Assegurem que l'enllaç de la dreta ("Següent") quedi alineat al marge dret */
    .project-navigation__link:last-child {
        text-align: right;
    }
}


/* ----------------------------------------
   MÒBILS PETITS (Fins a 640px)
---------------------------------------- */
@media (max-width: 640px) {
    
    /* --- COL·LAPSE TOTAL DE GRAELLES --- */
    .portfolio-grid,
    .education-grid,
    .skills-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* --- FOOTER I COOKIES --- */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-legal {
        justify-content: center;
    }

    .cookies-banner {
        padding: 1rem;
    }

    .cookies-banner__buttons {
        width: 100%;
        flex-direction: column;
    }

    #acceptCookies,
    #rejectCookies {
        width: 100%;
    }
}


/* ========================================
   RESPONSIVE
======================================== 
@media (max-width: 768px) {
    .project-gallery { grid-template-columns: 1fr; }
    .project-navigation { flex-direction: column; align-items: flex-start; }
    .cv-hero { flex-direction: column; align-items: flex-start;}
    .experience-item { grid-template-columns: 1fr; }
    .education-grid, .skills-grid { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
    .main-nav, .social-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-menu { position: fixed; inset: 90px 0 0 0; display: none; padding: 2rem; background-color: var(--color-white); }
    .mobile-menu.is-open { display: block; }
    .mobile-menu__nav { display: flex; flex-direction: column; gap: 1.5rem; }
    .mobile-menu__nav a { font-size: 1.25rem; font-weight: 600; }
    .hero { text-align: center; }
    .hero__content { align-items: center; }
    .hero__title { max-width: 100%; }
    .footer-bottom__wrapper { flex-direction: column; text-align: center; }
    .cookies-banner__content { flex-direction: column; text-align: center; }
    .footer-grid { grid-template-columns: 1fr 1fr;}
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (min-width: 992px) {
    .hero { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr;}
}*/