:root {
  --colore-principale: #5fae5f;  /* Colore principale del sito */
}

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

body {
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #000;
  line-height: 1.4;
  overflow-x: hidden; /* Evita scrollbar orizzontale in caso di trasformazioni */
}

h1, h2, h3, .logo, nav, .big-text, .cta-button, .contact-button, .social-button, .copy-button, .contact-label, .marquee-title {
  font-family: 'Space Grotesk', sans-serif;
}

a {
  text-decoration: none;
  color: #000;
}

/* HEADER */
header {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 4px solid #000;
  background: #fff; /* sfondo fisso per il menu */
  z-index: 999;
  transition: transform 0.3s ease;
}
.logo {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.logo small {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--colore-principale);
}
nav a {
  margin-left: 2rem;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
}

/*******************************************************
  1) NUOVA HERO - con testo grande e deformazione
********************************************************/
.hero-intro {
  position: relative;
  width: 100%;
  height: 100vh; /* full screen */
  background: var(--colore-principale); 
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 2rem;
}

/* Logo nella hero */
.hero-logo {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 10;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
}

.hero-logo .logo-text {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.hero-logo small {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: white;
}

/* Scroll Down Indicator */
.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
  opacity: 0.8;
  transition: opacity 1s ease;
  cursor: pointer;
}

.scroll-down:hover {
  opacity: 1;
}

.scroll-down.fade-out {
  opacity: 0;
  pointer-events: none;
}

.scroll-down-text {
  margin-bottom: 10px;
}

.scroll-down-arrow {
  width: 20px;
  height: 30px;
  border: 2px solid white;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.scroll-down-arrow::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
  border-radius: 50%;
  animation: scrollDownAnimation 2s infinite;
}

@keyframes scrollDownAnimation {
  0% {
    opacity: 1;
    top: 8px;
  }
  30% {
    opacity: 1;
    top: 15px;
  }
  60% {
    opacity: 0;
    top: 15px;
  }
  100% {
    opacity: 0;
    top: 8px;
  }
}

.hero-intro .big-text {
  text-transform: uppercase;
  font-weight: 900;
  font-size: 12vw; /* dimensione in base alla larghezza viewport */
  color: #fff;
  line-height: 0.9;
  text-align: center;
  white-space: nowrap;
  transition: all 0.3s ease-out; /* più fluido */
  will-change: transform; /* ottimizzazione per l'animazione */
}
/* Vogliamo più righe? Usiamo un container con righe separate */
.hero-intro .text-lines {
  display: inline-block;
}
.hero-intro .text-line {
  display: block;
  transition: transform 0.3s ease-out;
  text-shadow: 20px 20px 40px rgba(0, 0, 0, 0.3);
}

/* Posizionamento iniziale disallineato delle righe */
#line-0 {
  opacity: 0.5;
  transform: translateX(-25vw);
}
#line-1 {
  opacity: 0.75;
  transform: translateX(-15vw);
}

#line-2 {
  transform: translateX(10vw);
}

#line-3 {
  opacity: 0.75;
  transform: translateX(-5vw);
}

#line-4 {
  opacity: 0.5;
  transform: translateX(20vw);
}

/*******************************************************
  2) VECCHIA HERO (BIANCA) - appare dopo lo scroll
********************************************************/
.hero-old {
  padding: 8rem 2rem 6rem; /* aumentata spaziatura verticale */
  background: #fff;
  position: relative;
  min-height: 100vh; /* in modo che riempia lo schermo */
  display: flex;
  justify-content: space-between; /* Spazia contenuto e immagine */
  align-items: center; /* Allinea verticalmente */
  gap: 3rem; /* Spazio tra testo e immagine */
}

/* Divisori sezioni */
.section-divider {
  width: 100%;
  height: 4px;
  background-color: #000;
  margin: 0;
  padding: 0;
}

/* Media query per aggiungere margini orizzontali su schermi grandi */
@media (min-width: 1700px) {
  section.hero-old, 
  section.lavori, 
  section.contattami {
    padding-left: 10% !important;
    padding-right: 10% !important;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  
  /* Fa sporgere il marquee a tutta larghezza */
  .contattami .marquee-container {
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    position: relative;
    margin-left: 0;
    margin-right: 0;
  }
}

.hero-content {
  flex-basis: 60%; /* Lascia spazio per l'immagine */
  max-width: 650px; /* Limita larghezza testo */
}

.hero-old h1 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 1.5rem; 
  line-height: 1;
}
.hero-old h1.red {
  color: var(--colore-principale);
}
.hero-old p {
  margin-top: 3rem; /* aumentato spazio dopo i titoli */
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.cta-button {
  display: inline-block;
  margin-top: 3rem; /* aumentato spazio prima del bottone */
  padding: 1rem 2rem;
  border: 3px solid #000;
  font-weight: bold;
  text-transform: uppercase;
  background: #fff;
  transition: background 0.3s ease, color 0.3s ease;
}
.cta-button:hover {
  background: #000;
  color: #fff;
}

.hero-profile-svg {
  display: block; /* Rimuove spazio extra sotto l'immagine */
  max-width: 30%; /* Limita la larghezza dell'SVG */
  height: auto; /* Mantiene le proporzioni */
  /* Aggiungere eventuali altri stili come filtri, bordi etc. se necessario */
}

/*******************************************************
  3) ALTRE SEZIONI (LAVORI, CONTATTAMI)
********************************************************/
.lavori, .contattami {
  padding: 3rem 2rem;
}
.lavori h2, .contattami h2 {
  font-size: 3rem;
  font-weight: 900;
  color: var(--colore-principale);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.lavori p, .contattami p {
  font-size: 1.2rem;
  max-width: 1200px;
  margin-bottom: 2rem;
}
.progetto {
  margin: 2rem 0;
  border-bottom: 2px solid #000;
  padding-bottom: 1rem;
}
.progetto h3 {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.progetto p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
/* Container per i tag delle skills */
.skills-list {
margin-top: 1rem;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}

/* Stile per ogni singolo tag */
.skill-tag {
padding: 0.3rem 0.8rem;
border: 2px solid #000;
font-size: 0.8rem;
font-weight: bold;
text-transform: uppercase;
background: #fff;
transition: background 0.3s ease, color 0.3s ease;
}

/* Effetto hover per i tag */
.skill-tag:hover {
background: #000;
color: #fff;
}

.contact-button {
  display: inline-block;
  padding: 1rem 2rem;
  border: 3px solid #000;
  font-weight: bold;
  text-transform: uppercase;
  background: #fff;
  transition: background 0.3s ease, color 0.3s ease;
  font-size: 1rem;
}
.contact-button:hover {
  background: #000;
  color: #fff;
}


/*******************************************************
  SOCIAL BUTTONS E COPY EMAIL
********************************************************/
.social-buttons {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
  max-width: 700px;
}

.contact-section {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-bottom: 0.5rem;
}

.contact-divider {
  width: 100%;
  max-width: 200px;
  height: 3px;
  background-color: #000;
  margin: 0.5rem 0 0.5rem;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  border: 3px solid #000;
  font-weight: bold;
  text-transform: uppercase;
  background: #fff;
  transition: all 0.3s ease;
  width: 100%;
}

.social-button:hover {
  background: #000;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.copy-button {
  cursor: pointer;
  display: inline-block;
  padding: 1rem 2rem;
  border: 3px solid #000;
  font-weight: bold;
  text-transform: uppercase;
  background: #fff;
  transition: background 0.3s ease, color 0.3s ease;
  font-size: 1rem;
}

.copy-button:hover {
  background: #000;
  color: #fff;
}

.copy-feedback {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}

.copy-feedback.show {
  opacity: 1;
}

@media (max-width: 768px) {
  .social-buttons {
    grid-template-columns: 1fr;
  }
  
  .contact-options {
    flex-direction: column;
  }
  
  .copy-button {
    margin-left: 0;
  }
  
  /* Nascondi la voce "Chi sono" nel menu su mobile */
  nav a[href="#hero-old"] {
    display: none;
  }
}

/*******************************************************
  4) EFFETTI FADE-IN SU SCROLL (Intersection Observer)
********************************************************/
.fade-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-section.in-view {
  opacity: 1;
  transform: translateY(0);
}

/*******************************************************
  FOOTER
********************************************************/
footer {
  padding: 2rem;
  border-top: 1px solid #000;
  text-align: center;
  font-size: 0.9rem;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.piva {
  color: #666;
  font-size: 0.8rem;
}

/*******************************************************
  5) RESPONSIVE
********************************************************/
@media (max-width: 992px) { /* Breakpoint per tablet/schermi medi */
  .hero-old {
    flex-direction: column; /* Impila su schermi medi */
    align-items: flex-start; /* Allinea gli elementi all'inizio (sinistra) */
    padding-top: 6rem;
    padding-bottom: 4rem;
    min-height: auto;
    justify-content: flex-start;
    gap: 0; /* Rimuove lo spazio tra gli elementi */
  }
  .hero-content {
    max-width: 100%;
    order: 0; /* Ordine standard, dopo l'immagine */
    text-align: left; /* Allinea il testo a sinistra */
    margin-top: 0; /* Rimosso spazio sopra il testo */
  }
  .hero-profile-svg {
    max-width: 30%; /* Immagine più piccola */
    order: -1; /* Posiziona l'immagine prima del testo */
    margin-bottom: 0; /* Rimosso spazio sotto l'immagine */
  }
  .hero-old h1:first-child {
    margin-top: 0; /* Eliminiamo anche questo spazio */ 
  }
  .hero-old h1 {
    font-size: 3rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 768px) {
  .text-line{
    margin-bottom: 1rem;
  }
  /* Nascondi l'header inizialmente su mobile */
  header {
    transform: translateY(-100%);
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* Mostra l'header quando ha la classe 'visible' */
  header.visible {
    transform: translateY(0);
  }
  nav {
    margin-top: 1rem;
  }
  nav a {
    margin-left: 0rem;
    margin-right: 1rem;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    padding-left: 0.5rem;
    border-left: 1px solid #000;
  }
  .hero-old h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
  .hero-old p {
    margin-top: 2rem;
  }
  .lavori h2, .contattami h2 {
    font-size: 2rem;
  }
  /* Nascondi la voce "Chi sono" nel menu su mobile */
  nav a[href="#hero-old"] {
    display: none;
  }
  
  /* Modifica per la hero-intro su mobile */
  .hero-intro {
    height: auto;
    min-height: 100vh;
    padding: 6rem 1rem 4rem;
  }
  
  /* Rendi il testo della hero responsive su mobile */
  .hero-intro .big-text {
    font-size: 15vw;
  }
  
  /* Riduci lo spostamento orizzontale delle righe su mobile */
  #line-0 { transform: translateX(-15vw); }
  #line-1 { transform: translateX(-10vw); }
  #line-2 { transform: translateX(5vw); }
  #line-3 { transform: translateX(-3vw); }
  #line-4 { transform: translateX(10vw); }
}

/* Tooltip Container */
.tooltip-container {
  position: relative;
  display: inline-block; /* Assicura che il contenitore non occupi tutta la larghezza */
}

/* Tooltip Text */
.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  text-transform: none;
  
  /* Positioning */
  position: fixed;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s ease-out;
  pointer-events: none; /* Assicura che il tooltip non blocchi gli eventi del mouse */
  
  /* Per seguire il mouse */
  transform: translate(-50%, 20px); /* Inizialmente sotto il cursore */
}

/* Show the tooltip text when hovering over the tooltip container */
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Sezione contattami */
.contattami {
  padding: 8rem 2rem;
  position: relative;
  overflow: hidden; /* Nasconde i contenuti che escono dal contenitore */
}

/* Effetto marquee migliorato per la sezione contattami */
.marquee-container {
  position: relative;
  width: 100vw; /* Larghezza viewport completa */
  left: 50%;
  transform: translateX(-50%); /* Centra il container rispetto alla sezione */
  margin-left: 0;
  margin-right: 0;
  height: 120px; /* Altezza del titolo */
  overflow: hidden;
  margin-bottom: 3rem;
}

/* Track scorrevole */
.marquee-track {
  position: absolute;
  display: flex;
  white-space: nowrap;
  will-change: transform, opacity;
  animation: marqueeScroll 40s linear infinite;
}

/* Titoli all'interno del marquee */
.marquee-title {
  font-size: 100px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.1; /* Opacità base bassa */
  padding-right: 2rem; /* Spazio tra le copie */
  will-change: opacity;
  color: var(--colore-principale);
  transition: opacity 0.15s ease-out;
}

/* Maschera per l'effetto highlight - Più smooth */
.marquee-highlight {
  display: none; /* Nascosto perché ora usiamo JavaScript per un effetto più fluido */
}

/* Animazione di scorrimento orizzontale - Rallentata per maggiore fluidità */
@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* Scorre indietro fino a metà, poi si ripete */
  }
}

/* Nuovi stili per i contatti */
.contatti-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3rem;
}

.contatti-item {
  flex: 1;
  min-width: 300px;
}

.contatti-item h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.email-container, .phone-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-link {
  font-size: 1.1rem;
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: var(--colore-principale);
}

#email-display, #phone-display {
  font-size: 1.1rem;
}

#copy-button, #copy-phone-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 3px solid #000;
  font-weight: bold;
  text-transform: uppercase;
  background: #fff;
  transition: background 0.3s ease, color 0.3s ease;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
}

#copy-button:hover, #copy-phone-button:hover {
  background: #000;
  color: #fff;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 3px solid #000;
  font-weight: bold;
  text-transform: uppercase;
  background: #fff;
  transition: background 0.3s ease, color 0.3s ease;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
}

.social-link:hover {
  background: #000;
  color: #fff;
}

/* Toast di conferma per copia email */
.copy-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #000;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.copy-toast.show {
  opacity: 1;
  visibility: visible;
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
  .marquee-title {
    font-size: 60px; /* Titolo più piccolo su mobile */
  }
  
  .marquee-container {
    height: 80px; /* Altezza ridotta */
  }
  
  .marquee-highlight {
    width: 250px; /* Zona di highlight più stretta */
  }
}

/* Classi di utilità per il colore principale */
.colore-principale {
  color: var(--colore-principale);
}

.bg-principale {
  background-color: var(--colore-principale);
}

.bordo-principale {
  border-bottom: 2px solid var(--colore-principale);
}

/* Pulsante floating per tornare su */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--colore-principale);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top::before {
  content: '';
  width: 12px;
  height: 12px;
  border-left: 3px solid white;
  border-top: 3px solid white;
  transform: rotate(45deg) translate(2px, 2px);
} 