 header{
     top: 0;
    left: 0;
}
.container{
  background-image: url(img/sfondo-header.jpg);
  width: 100%;
  height:100%;
  display: flex;
 
  z-index: -44;
 
}
.back{
  background-color: #222222;
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

}
.m{
  margin-left: 15%;
  margin-right: 15%;
}
.text-h{
  
    color: #ffffff;
    text-align:left;
    margin: 0 auto;
   
   padding-left: 100px;

    text-transform: uppercase;
   
    
    
}
.f-c{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-content: center;
 
    
}
.g{
  font-size: 28px;
  
  font-weight:400;
  
  text-transform: uppercase;
  color: #ffffff;
}
.text, a{
    color: #ffffff;
    text-align: center;
    margin: 0 auto;
    font-family: "Raleway", sans-serif;
     display: flex;
        z-index: 300;
        font-style: normal;
        align-items: center;
        font-size: 25px;
        text-decoration: none;
}
.progetti{
  width: 50%;
  text-align: center;
  margin: 0 auto;
  padding-top: 100px;
 width: 70%;
 height: 20%;

  text-transform: uppercase;
  padding-bottom: 100px;
  align-items: center;
  
}
h1{
  font-family: "Raleway", sans-serif;
    font-weight:300;
    font-style: normal;
    font-size: 60px;
}
.flex{
  justify-content: center;
  align-items: center;
  align-content: center;
  flex-direction:row;
    display: flex;
   
}
h2, h3{
    font-size: 20px;
    font-family: "Raleway", sans-serif;
    font-weight:200;
    text-transform: uppercase;
}
.img-1{
    background-image: url(img/s-e.png);
    background-size: cover;
    background-repeat: no-repeat;
}
.img-2{
    background-image: url(img/screen-p.png);
    background-size: cover;
    background-repeat: no-repeat;
}
.img-3{
    background-image: url(img/sc-r.png);
    background-size: cover;
    background-repeat: no-repeat;
}
.img-4{
    background-image: url(img/scr-b.png);
    background-size: cover;
    background-repeat: no-repeat;
}
.img-5{
    background-image: url(img/sceen-regg.jpg);
    background-size: cover;
    background-repeat: no-repeat;
}
body {
    margin: 0;
    padding: 0;
    height: 100vh;
  
    place-items: center;
    background:#2e2e2e;
  }
  .gallery {
    display: grid;
   padding-top: 50px;
  z-index: 44;
    display: grid;
    
    gap: .6rem;
    grid-template-columns: repeat(6, 100px);
    grid-template-rows: repeat(3, 100px);
    .img {
      max-width: 200px;
      aspect-ratio: 1;
      display: grid;
      grid-column: span 2;
      object-fit: cover;
      clip-path: path('M 80 20 C 100 0 100 0 120 20 C 140 40 160 60 180 80 C 200 100 200 100 180 120 C 160 140 140 160 120 180 C 100 200 100 200 80 180 C 60 160 40 140 20 120 C 0 100 0 100 20 80 Z');
      transition: transform .3s ease, filter .3s ease, clip-path .3s ease;
      filter: blur(1px) saturate(138%) contrast(175%) invert(13%);
      &:nth-of-type(4) {
        grid-column: 2 / span 2;
      }
      
      &:hover {
        clip-path: path('M 0 0 C 100 0 100 0 200 0 C 200 50 200 50 200 80 C 200 100 200 100 200 120 C 200 150 200 150 200 200 C 100 200 100 200 0 200 C 0 150 0 150 0 120 C 0 100 0 100 0 80 Z');
        filter: blur(0) saturate(100%) contrast(100%) invert(0);
        transform: scale(1.1);
        z-index: 3;
      }
      &:not(:hover) {
        animation: Index .2s ease;
      }
    }
  }
  
  @keyframes Index {
    0%, 100% {
      z-index: 1;
    }
  }

 /* ==========================================
   SOLO MODIFICHE RESPONSIVE (MEDIA QUERIES)
   ========================================== */

/* --- TABLET (Sotto i 1024px) --- */
@media (max-width: 1024px) {
  h1 {
    font-size: 45px; /* Riduce leggermente il titolo principale */
  }
  
  .text-h {
    padding-left: 40px; /* Riduce lo spazio a sinistra */
  }
}

/* --- SMARTPHONE (Sotto i 768px) --- */
@media (max-width: 768px) {
  /* Trasforma il layout da due colonne affiancate a una colonna verticale */
  .container.flex {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  /* La sezione del titolo occupa ora tutta la larghezza */
  .back {
    width: 100%;
    height: auto;
    padding: 60px 0;
  }

  /* Centra il testo sui dispositivi mobili per eliminare il padding fisso */
  .text-h {
    padding-left: 0;
    text-align: center;
  }

  h1 {
    font-size: 38px; /* Adatta il titolo agli schermi piccoli */
  }

  /* La sezione progetti si adatta a tutta la larghezza */
  .progetti {
    width: 100%;
    height: auto;
    padding-top: 40px;
    padding-bottom: 60px;
  }

  /* Riorganizza la griglia a rombi in un'unica colonna verticale 
     per evitare che i clip-path escano dallo schermo o si sovrappongano */
  .gallery {
    grid-template-columns: repeat(2, 100px); /* Stringe la griglia */
    justify-content: center;
    gap: 1.5rem;
  }

  /* Resetta il posizionamento specifico del quarto elemento per la vista mobile */
  .gallery .img:nth-of-type(4) {
    grid-column: span 2;
  }
}

/* --- SMARTPHONE PICCOLI (Sotto i 480px) --- */
@media (max-width: 480px) {
  h1 {
    font-size: 32px;
  }
  
  h2 {
    font-size: 16px;
  }
}