
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 140px; }
/* Base (mòbil primer) */
body { 
    margin: 0;
    background-color: #f2edeb;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

h1 {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: clamp(180px, 35vw, 720px);
    position: fixed;
    top: 65vh;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
    margin: 0;
    z-index: 20;
    text-align: center;
    line-height: 0.9;
}

.titol-imatge {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: min(90vw, 900px);
    height: clamp(200px, 35vw, 360px);
    object-fit: contain;
    z-index: 10;
}

.text {
    color: #000000;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    display: flex;
    justify-content: start;
    font-size: 15px;
    margin: 10px;
}

header {
    background-color: #f2edeb;
    padding: 28px;
    display: flex;
    align-items: center; /* alineació vertical coherent */
    justify-content: space-between;
    position: fixed;            /* fixat a dalt de tot */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;              /* per sobre de l'h1 fix */
    gap: 20px; 
    width: 100%;
}

/* el bloc de textos ocupa l'espai de l'esquerra */
header > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* enganxat a l'esquerra */
}
  
/* el logotip no s’estira */
header > a.logo {
    flex: 0;
    margin-left: 30px;
    margin-top: 10px;
    display: flex;
    align-items: center;
}

header > a.logo img {
    display: block;
    width: 127px;
    height: auto;
}

/* --- Navegació --- */
.menu { /* contenidor del menú */
    display: flex;
    align-items: center;
    gap: 12px; /* separació entre elements */
    position: relative; 
    margin-left: auto; /* empeny cap a la dreta */
    justify-content: flex-end;
    margin-right: 60px;
    margin-top: 10px;
}

/* Control del menú (checkbox ocult) */
.menu-control { 
    display: none;
}

/* Botó hamburguesa (mòbil) */
.hamburger { 
    box-sizing: border-box;
    width: 32px;  
    height: 32px; 
    display: grid; /* per centrar el caràcter */
    place-items: center; 
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #000000;
    user-select: none;
    border: none;       /* treu el contorn */
    background: none;   /* treu el fons */
}

/* Llista oculta per defecte en mòbil */
.menu-llista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none; /* Oculta per defecte */
    position: absolute;
    top: calc(100% + 4px);
    right: -12px;
    left: auto;
    background-color: #f2edeb;
    width: clamp(200px, 60vw, 320px);
    z-index: 10;
    margin-top: 0;
    text-align: right; /* text alineat a la dreta */
    padding-left: 8px;   /* menys aire a l'esquerra */
    padding-right: 0;    /* enganxat a la dreta */
}

/* Estil dels enllaços del menú */
.menu-llista a {
    display: block;
    padding: 12px 16px;
    color: #000000; /* color del text */
    text-decoration: none; /* treu la línia per defecte */
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 15px;
}

.menu-llista a:hover {
    background-color: #f2edeb; /* efecte hover suau */
    text-decoration: underline; /* només apareix al hover */
    color: #000000;
}

.menu-llista li {
    border: none; /* sense línies de separació */
}
  
/* Quan el menú té la classe "obert" (JS l'afegeix), es mostra */
.menu-llista.obert {
    display: flex;
    flex-direction: column; /* Els enllaços en columna */
}

/* --- Escriptori / pantalles grans --- */
@media (min-width: 768px) {
    .hamburger { /* amaguem l'hamburguesa en escriptori */
        display: none;
    }

    .menu-llista { /* mostrem el menú en línia */
        position: static;
        display: flex;
        gap: 20px;
        width: auto;
        box-shadow: none;
        background: transparent;
        text-align: right;
        padding-left: 0; /* netejem padding per escriptori */
    }

    .menu-llista li { 
        border: none;
    }

    .menu-llista a {
        padding: 8px 0;
    }

    .menu-llista a:hover { 
        text-decoration: underline;
        background: transparent;
    }
}

/* Botons de navegació destacats */
.enllacos-destacats {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 160px 24px 40px;
    align-items: center;
}

.enllacos-destacats .boto-destacat {
    margin: 0;
}

.enllacos-destacats .boto-destacat + .boto-destacat {
    margin-top: 72px;
}

.boto-destacat {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 0;
    color: #f2edeb;
    text-decoration: none;
    text-align: center;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    border-radius: 0;
    transition: transform 0.18s ease;
}

.boto-destacat:hover,
.boto-destacat:focus {
    transform: translateY(-2px);
}

.boto-destacat.boto-imatge:hover,
.boto-destacat.boto-imatge:focus {
    transform: translateY(-40px);
}

.boto-imatge {
    padding: 0;
    background: transparent;
    border-radius: 0;
    width: 100%;
    align-items: center;
    gap: 10px;
}

.boto-imatge img {
    display: block;
    width: min(45vw, 240px);
    height: auto;
}

.nom-carpetes {
    margin-top: 6px;
    color: #211F26;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.seccio-principal {
    padding: 30px 24px;
    max-width: 720px;
    margin: 50px auto 0;        /* manté el marge superior + centra horitzontalment */
    text-align: center;
    padding-bottom: 200px;       /* perquè el contingut no quedi tapat per elements fixos */
}

@media (min-width: 768px) {
    .enllacos-destacats {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 0;
    }

    .boto-destacat {
        min-width: 0;
    }

    .boto-imatge {
        width: auto;
    }

    .enllacos-destacats .boto-destacat + .boto-destacat {
        margin-top: 0;
        margin-left: 72px;
    }
}


#inici {
    display: flex;
    justify-content: flex-start;    /* col·loca el contingut a la part superior */
    align-items: center;
    flex-direction: column;
    padding: clamp(32px, 8vh, 100px) 24px clamp(64px, 12vh, 160px); /* torna a separar de la zona de projectes */
    box-sizing: border-box;
    max-width: min(100%, 1080px);    /* permet que el paràgraf ocupi més amplada */
    margin-top: 140px;
  }

#inici h2 {
  margin: 0 0 16px;
}

#inici p {
  margin: 0;
  width: 100%;                    /* deixa que el text s'estiri fins al límit del contenidor */
}

#contacte {
    display: flex;
    justify-content: flex-start;  /* contingut a dalt */
    align-items: center;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
    gap: 16px; /* opcional, per una mica d'espai entre elements */
  }

#sobre-mi {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;  /* contingut a dalt */
    align-items: stretch;
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
    gap: 32px;
}

#sobre-mi h3 {
  align-self: center;
  text-align: center;
}

.sobre-mi-contingut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.sobre-mi-contingut img {
    width: clamp(200px, 35vw, 320px);
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 40px 20px rgba(242, 114, 174, 0.4); 
    border-radius: 30px;
  }

.sobre-mi-text {
  max-width: 520px;
  text-align: center;
}

.sobre-mi-text p {
  margin: 0;
  line-height: 1.8;
}

@media (min-width: 768px) {
  #sobre-mi {
    align-items: center;
    text-align: left;
  }

  .sobre-mi-contingut {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 48px;
  }

  .sobre-mi-contingut img {
    flex: 0 0 clamp(220px, 28vw, 340px);
    box-shadow: 0 0 40px 20px rgba(242, 114, 174, 0.4); /* mateix efecte en escriptori */
  }

  .sobre-mi-text {
    text-align: left;
    max-width: 560px;
  }
}

#projectes.seccio-principal {
    padding: 12px 24px 0;   /* redueix espai abans del llistat */
    
}
  
  
  .enllacos-destacats {
    padding-top: 12px;
    margin-top: 24px;
  }
  
  #projectes h3 {
    margin: 0 0 24px;
  }

  /* Icones contacte en línia */
.icones-contacte {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
  }
  
  .icones-contacte a {
    display: inline-flex;
    text-decoration: none;
  }
  
  .icones-contacte img {
    display: block;
    width: clamp(32px, 6vw, 56px);
    height: auto;
  }

  .icones-contacte img { transition: opacity 0.2s ease; }
.icones-contacte a:hover img { opacity: 0.75; }

.site-footer {
    background-color: #211f26;
    color: #f2edeb;
    text-align: center;
    font-size: 12px;
    padding: 12px 16px;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}
