body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  background: #fffceb;
  scroll-behavior: smooth;
}

/* NAVBAR BASE */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #ffc625;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  z-index: 1000; /* Assicura che la navbar sia sopra gli altri elementi */
}

.logo img {
  height: 40px;
}

/* Nasconde l'hamburger su desktop */
.menu-toggle {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: #000;
}

.nav-links { /* Questo è l'elemento `ul` */
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  margin-left: auto; /* Spinge a destra */
  margin-right: 4rem; /* Aggiunge spazio sulla destra, spostandolo a sinistra dal bordo */
}

.nav-links li a {
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-size: 1rem;
}

/* === MOBILE MENU (Media Query) === */
@media (max-width: 768px) {
  .menu-toggle {
    display: block !important; /* Mostra l'hamburger su mobile */
  }

  .nav-links {
    display: none; /* Nasconde i link di default */
    flex-direction: column;
    background-color: #ffc625; /* Colore giallo coerente */
    position: absolute;
    top: 70px; /* Posiziona sotto la navbar */
    right: 20px; /* Posiziona a destra su mobile */
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999; /* Assicura che il menu sia sopra il contenuto ma sotto la navbar */
  }

  .nav-links.show {
    display: flex; /* Mostra i link quando la classe 'show' è presente */
  }

  .nav-links li a {
    color: #000;
    font-weight: 600;
    padding: 0.7rem 0; /* Aggiunge padding per facilitare il tocco */
  }

  .logo img {
    height: 36px; /* Riduci la dimensione del logo su mobile */
  }
}

/* HERO SECTION */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  color: white;
  text-align: center;
}

.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Assicura che il video copra l'area */
  z-index: 0;
  opacity: 0.8;
}

.hero-button-wrapper {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* Per desktop: abbassa il tasto */
@media (min-width: 769px) {
  .hero-button-wrapper {
    top: 75%;
  }
}

/* Adatta la posizione del pulsante su mobile */
@media (max-width: 768px) {
  .hero-button-wrapper {
    top: 70%;
  }
}

.hero-button {
  background-color: #ffc85c;
  padding: 12px 24px;
  border-radius: 999px;
  color: #000;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.hero-button:hover {
  background-color: #f5b800;
}

/* SEZIONI GENERALI */
.section {
  padding: 6rem 2rem;
  text-align: center;
  background-color: white;
}

.section .intro {
  max-width: 700px;
  margin: 0 auto 3rem auto;
  font-size: 1.5rem;
  line-height: 1.7;
  color: #333;
}

.section:nth-child(even) {
  background-color: #fdf6d7;
}

/* FEATURE BOXES */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.feature {
  background-color: #fff9e1;
  padding: 2rem;
  border-radius: 12px;
  width: 280px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer; /* Manteniamo il cursore per coerenza */
  overflow: hidden;
  position: relative;
  min-height: 150px; /* Aggiungi un'altezza minima se necessario */
}

.feature p {
  opacity: 1; /* Mostra sempre il testo su mobile e desktop */
  transition: opacity 0.3s ease;
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* Rimuovi gli effetti hover/active per il paragrafo, dato che vogliamo che sia sempre visibile */
.feature:hover p,
.feature.active p {
  opacity: 1;
}

/* Mantieni gli effetti visivi sull'hover del box per desktop */
@media (min-width: 769px) {
  .feature:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  }

  .feature p {
    opacity: 0; /* Nascondi il testo su desktop per l'effetto hover */
  }

  .feature:hover p,
  .feature.active p {
    opacity: 1; /* Mostra il testo solo all'hover su desktop */
  }

  .feature.active {
    height: auto;
    transform: scale(1.08);
    background-color: #fff3bf;
  }
}

/* VIDEO DEMO */
.video-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

.video-wrapper iframe {
  width: 100%;
  height: 400px; /* Altezza di default per desktop */
  border-radius: 12px;
}

@media (max-width: 768px) {
  .video-wrapper iframe {
    height: 180px; /* Riduci l'altezza del video su mobile */
  }
}

/* FORM SECTION */
.letter-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.envelope {
  position: relative;
  background: #ffe47a;
  border: 3px solid #2b200f;
  border-radius: 16px;
  padding: 2.5rem 1rem 1.5rem;
  width: 300px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: #ffe78a;
  border-bottom: 3px solid #3c2c14;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  transform-origin: top center;
  transition: transform 0.3s ease;
  z-index: 2;
}

.envelope.open .envelope-flap {
  transform: rotateX(70deg);
}

.email-input {
  margin-top: 10px;
  border: none;
  background: #fff9e3;
  padding: 0.8rem 1rem;
  width: 85%;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  outline: none;
  z-index: 1;
  position: relative;
}

.face {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 10px;
}

.eye {
  width: 12px;
  height: 12px;
  background: #3c2c14;
  border-radius: 50%;
}

.mouth {
  width: 14px;
  height: 14px;
  background: #2b200f;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.mouth.smile {
  width: 30px;
  height: 15px;
  background: transparent;
  border-bottom: 4px solid #2b200f;
  border-radius: 0 0 30px 30px;
}

.stamp-button {
  background: #ffc85c;
  border: 3px dashed #3c2c14;
  border-radius: 12px;
  font-size: 1.2rem;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.stamp-button:hover {
  background: #ffdd85;
  transform: scale(1.05);
}

#form.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: transparent; /* O #fffceb per uniformarlo al body */
}

.confetti {
  position: absolute;
  width: 6px;
  height: 6px;
  background: red;
  animation: fall 0.4s ease-out forwards;
  border-radius: 50%;
  opacity: 0.8;
  z-index: 10;
}

@keyframes fall {
  to {
    transform: translateY(60px) rotate(360deg);
    opacity: 0;
  }
}

/* General Mobile Adjustments */
@media screen and (max-width: 768px) {
  .intro {
    font-size: 1.2rem; /* Leggermente più piccolo su mobile */
    padding: 0 1rem;
  }

  h2 {
    font-size: 1.8rem; /* Titoli leggermente più piccoli */
  }

  .stamp-button {
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
  }

  .features {
    flex-direction: column; /* Stack le feature verticalmente */
    align-items: center;
  }

  .feature {
    width: 90%; /* Occupa quasi tutta la larghezza */
    max-width: 350px; /* Limita la larghezza massima per schermi più grandi di un certo punto */
    text-align: center;
  }
}