:root {
  --grid-gap: 1rem;
}

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

body {
  font-family: 'Satoshi', sans-serif;
  font-weight: 500;
  line-height: 1.5;
  background: #FAFAFA;
  color: #1D1D1D;
}

h2 {
  font-size: 2rem;
  font-weight: 500;
  padding-bottom: 2rem;
}

/* --- HEADER & NAV --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Allinea in cima */
  padding: 1rem 2rem 0 2rem;
  position: sticky; 
  top: 0;
  z-index: 10;
  gap: 2rem;
  background: transparent;
}

.logo-block {
  flex: 1; 
  transition: all 0.6s ease;
  line-height: 0;
  min-width: 0;
  margin-top: 0;
}

#logo {
  width: 100px;
  max-width: none;
  height: auto;
  margin-top: 0;
  transition: all 0.6s ease;
  display: block;
}

nav {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  margin-top: 0;
  padding-top: 0;
  min-width: 0;
} 

.nav-links {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 2rem; 
  text-align: right;
  width: 100%;
}

.nav-links a {
  text-decoration: none;
  color: #1D1D1D;
  font-size: 1rem;
  margin-left: 0;
  line-height: 1; /* Allineamento visivo */
  display: inline-block;
  transition: color 0.3s ease;
}

/* --- NUOVA REGOLA: Link Attivo --- */
.nav-links a.active {
  color: #d6ff00 !important;
}

main {
  padding: 1rem 2rem 0 2rem;
  margin-top: 2rem;
}

.project.title {
  display: flex;
  align-items: last baseline;
  gap: 2rem; 
  margin-bottom: 2rem;
}

.project.title h1 {
  font-size: 5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.project.title .label {
  background-color: #000000;
  color: #ffffff;
  padding: 0.3rem 1rem;
  font-size: 1rem;
  border-radius: 1rem;
}

.placeholder {
  display: block;
  margin-bottom: 1rem;
}

.placeholder.large {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.placeholder.large img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16/9;
}

.placeholder.large video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: left center;
  padding-bottom: 1rem;
  aspect-ratio: 5/4;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
  flex-wrap: wrap;
  justify-content: center;
}

.placeholder.square {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.placeholder.square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#about {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  margin-bottom: 2rem;
}

#about h2 {
  grid-column: 1 / 3;
}

#about p {
  grid-column: 3 / 5;
  font-size: 1rem;
}

/* --- NEXT / PREV PROJECT --- */
.projects-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

.project {
  position: relative; /* Necessario per posizionare il titolo */
}

.project h2 {
  font-size: 2rem;
  font-weight: 500;
  padding-top: 2rem;
  padding-bottom: 0;
}

/* Titolo "Previous / Next" trasformato in Label Bianca */
.project p {
  display: none !important;
  position: absolute;
  bottom: 4rem; 
  left: 1rem;
  background-color: #d6ff00;
  color: #1D1D1D;
  padding: 0.3rem 0.6rem;
  border-radius: 1rem;
  font-size: 1rem;
  margin: 0;
  z-index: 10;
  pointer-events: none;
  width: auto;
}

.project-link {
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.project.square {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  padding-bottom: 3rem;
}

.project.square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* NASCONDI LA LABEL GIALLA GLOBALE (Desktop e Mobile) */
.project.square .label {
  display: none !important;
}


/* --- FOOTER --- */
.contact {
  background: #d6ff00;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 3rem 2rem;
  height: 100%;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 100%;
}

.contact-title {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.contact-title h2 {
  font-size: 4rem;
  margin: 0;
  margin-bottom: 10rem;
}

.contact-links {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
}

.contact-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-links li {
  margin-bottom: 0.5rem;
}

.contact-links a {
  text-decoration: none;
  color: #1D1D1D;
  font-size: 1.5rem;
}

.logo-bottom {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: start;
  height: auto;
}
.logo-bottom img {
  display: block;
  margin-top: 0; 
  max-height: 70%; 
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- MOBILE RESPONSIVE STYLE (Projects) --- */
@media (max-width: 768px) {

  /* Header */
  header {
    flex-wrap: nowrap;
    padding: 1rem;
    gap: 1rem;
    align-items: flex-start;
  }

  .logo-block {
    flex: 1;
  }
  
  #logo {
    width: 80px; 
  }
  
  nav {
    flex: 1;
    margin-top: 0;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-end; 
    gap: 0.5rem;
  }
  
  .nav-links a {
    font-size: 1.1rem;
    line-height: 1;
  }
  
  main {
    padding: 1rem;
    margin-top: 5rem;
  }

  .project.title {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .project.title h1 {
    font-size: 3rem;
    line-height: 1.1;
  }

  .grid, 
  #about {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #about h2, 
  #about p {
    grid-column: auto;
  }

  /* 2 Colonne anche su mobile per Next/Prev */
  .projects-nav {
    grid-template-columns: 1fr 1fr; 
    gap: 1rem;
  }

  .project h2 {
    font-size: 1.5rem;
    font-weight: 500;
    padding-top: 2rem;
    padding-bottom: 0;
  }
  
  .contact-grid {
    display: flex;
    flex-direction: column;
    text-align: left;
    align-items: flex-start;
    gap: 2rem;
  }
  
  .contact-title, 
  .contact-links, 
  .logo-bottom {
    align-self: flex-start;
    justify-self: start;
    width: 100%;
  }

  .contact-title h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }

  .logo-bottom {
    margin-top: 2rem;
  }
}