: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: 200%; 
  max-width: none;
  height: auto;
  margin-top: 10rem; 
  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; 
  line-height: 1; 
  display: inline-block;
  transition: color 0.3s ease; /* Transizione colore fluida */
}

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

.logo-description {
  font-size: 1rem;
  margin-top: 2rem;
}

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

/* --- SHOWREEL --- */
.showreel {
  margin-top: 5rem;
  margin-bottom: 2rem;
  width: 100%;
  position: relative;
  overflow: hidden;
  cursor: none;
  border-radius: 1rem;
}

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

.showreel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1; 
  pointer-events: unset;
}

.showreel-text-container {
  position: absolute;
  width: 100px;
  height: 100px;
  background-color: #CCFF00;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0; 
  transition: opacity 0.2s ease-out, transform 0s; 
}

.showreel-text-container span {
  color: #1D1D1D;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
}

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

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

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

/* --- GRID WORKS --- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: var(--grid-gap);
  margin-bottom: 2rem;
}

/* Item Container */
a.item {
  text-decoration: none;
  color: inherit; 
  display: block; 
  position: relative; 
  overflow: hidden; 
  border-radius: 0; 
}

a.item:hover {
  border-radius: 0; 
}

/* Immagine */
.image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
}

.image-wrapper img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
}

.item:hover .image-wrapper img {
  border-radius: 0;
  transition: all 0.6s ease;
}


/* --- LABEL & TITOLI --- */

/* Label Gialla  */
.label {
  position: absolute;
  border-radius: 1rem;
  bottom: 1rem;
  left: 1rem;
  background-color: #ffffff; 
  color: black;
  padding: 0.3rem 0.6rem;
  font-size: 1rem;
  display: block; 
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.3s ease;
}

/* Titolo Progetto  */
.item p {
  position: absolute;
  left: 1rem;
  bottom: 1rem; 
  background-color: #d6ff00; 
  color: #1D1D1D; 
  padding: 0.3rem 0.6rem;
  border-radius: 1rem;
  font-size: 1rem;
  margin: 0;
  pointer-events: none; 
  z-index: 5; 
  transition: bottom 0.3s ease;
}

/* HOVER DESKTOP */
.item:hover .label {
  opacity: 1; 
}

.item:hover p {
  bottom: 4rem; 
}


/* --- 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%; 
}


/* --- MOBILE RESPONSIVE STYLE --- */
@media (max-width: 768px) {
  
  header {
    flex-wrap: nowrap; 
    padding: 1rem;
    gap: 1rem;
    align-items: flex-start;
  }

  .logo-block {
    flex: 1; 
  }

  #logo {
    transition: all 0.3s ease;
  }

  nav {
    flex: 1;
    width: auto;
    margin-top: 0;
  }
  
  .nav-links {
    justify-content: flex-end; 
    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: 2rem;
  }

  .showreel {
    aspect-ratio: 9 / 16; 
    height: auto;
    margin-top: 2rem; 
  }
  
  .showreel video, 
  .showreel .placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  #who {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

  .label {
    opacity: 1 !important;
  }
  
  .item p {
    bottom: 4rem !important;
  }
  
  a.item {
    border-radius: 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;
  }
}