/*
 * INTRO OVERLAY STYLES
 * Gestione layout e animazioni della schermata introduttiva
 */

/* --- Layout Principale --- */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1000;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background-color: var(--color-bg-beige);
  cursor: pointer;

  transition: opacity 1s ease-in-out;
}

.content-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-gap);
  padding: var(--spacing-sm);
}

/* --- Tipografia Condivisa --- */
.intro-label,
.word-item {
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  user-select: none;
  text-align: center;
}

/* Label statico: "Clicca ovunque per iniziare" */
.intro-label {
  color: var(--color-brand-brown);
  font-weight: 500;
  font-size: 0.75rem;
}

/* Adattamento font-size per Desktop */
@media (min-width: 768px) {
  .intro-label,
  .word-item {
    font-size: 0.875rem;
  }
}

/* --- Gestione Parole Dinamiche --- */
.dynamic-word-container {
  height: 1.5rem;
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.word-item {
  position: absolute;
  color: var(--color-text-grey);
  font-weight: 700;
  font-size: 10.5px;
  opacity: 0; /* Stato iniziale nascosto */
}

/* --- Classi di Animazione (Trigger JS) --- */

/* Entrata standard con scorrimento verticale (dal basso) */
.animate-static-enter {
  animation: staticEnter 1.5s ease-out forwards;
  animation-delay: 0.5s;
}

/* Uscita standard con sfocatura */
.animate-static-exit,
.animate-static-second-exit {
  animation: staticExit 1.2s ease-out forwards;
  animation-delay: 0.5s;
}

/* Entrata secondaria con sfocatura (fade-in + deblur) */
.animate-static-second-enter,
.animate-static-third-enter {
  animation: staticSecondEnter 1.5s ease-out forwards;
  animation-delay: 0.5s;
}

/* Animazione singola parola: Entrata (dall'alto) */
.word-enter {
  animation: wordEnter 0.8s ease-in-out forwards;
}

/* Animazione singola parola: Uscita (verso il basso) */
.word-exit {
  animation: wordExit 0.8s ease-in-out forwards;
}

/* Utility per nascondere l'intro al termine del flusso */
.fade-out-intro {
  opacity: 0;
  pointer-events: none;
}

/* --- Definizioni Keyframes --- */

@keyframes staticEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes staticExit {
  from {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 0;
    filter: blur(15px);
  }
}

@keyframes staticSecondEnter {
  from {
    opacity: 0;
    filter: blur(15px);
  }
  to {
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes wordEnter {
  from {
    opacity: 0;
    transform: translateY(-20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

@keyframes wordExit {
  from {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
}
