/* === VARIABILI GLOBALI === */
:root {
  --brand-color: #a58d74; /* Colore principale (marrone chiaro) */
}

/* === RESET BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-snap-type: y mandatory; /* Snap verticale per le sezioni */
}

body {
  background-color: #111; /* Sfondo nero */
  font-family: 'Poppins', sans-serif;
  color: white;
  overflow-y: scroll;
}

/* === GALLERIA IMMAGINI: struttura scrollabile === */
.snap-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 0;
}

.snap-section {
  height: 100vh;
  width: 100%;
  scroll-snap-align: start;
}

/* Contenitore fisso per livelli immagine */
.viewport-fixed-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
}

/* Livelli immagine */
.image-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  will-change: clip-path, background-image;
}

#background-layer {
  z-index: 1;
}

#foreground-layer {
  z-index: 2;
}

/* === TESTO CENTRATO === */
.text-scroll-wrapper {
  position: fixed;
  top: 45%;
  left: 70%;
  transform: translate(-90%, -48%);
  z-index: 10;
  pointer-events: none;
}

.text-scroll-inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-out;
}

.text-block {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  text-align: center;
}

.text-block button {
  margin-left: 340px; /* Sposta a destra rispetto al titolo */
}

.text-block h2 {
  font-size: 4rem;
  margin-bottom: 5px;
  font-weight: 600;
}

.text-block button {
  background-color: var(--brand-color);
  border: 2px solid transparent;
  color: white;
  font-size: 1rem;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  padding: 10px 24px;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.text-block button:hover {
  border-color: white;
  box-shadow: 0 0 10px var(--brand-color);
}

/* === POPUP VIDEO === */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  display: none;
  place-items: center;
  z-index: 3000;
  backdrop-filter: blur(2px);
}

.video-overlay.active {
  display: grid;
}

.video-overlay iframe {
  width: 90%;
  max-width: 1280px;
  aspect-ratio: 16 / 9;
  border: none;
}

/* === 💻 MEDIA QUERY: similmywork – tablet e schermi medi === */
@media (max-width: 1256px) {
  .text-scroll-wrapper {
    left: 60%; /* Più centrato */
  }

  .text-block h2 {
    font-size: 2.7rem;
  }

  .text-block button {
    font-size: 0.95rem;
    padding: 9px 20px;
  }
}

/* === 📱 MEDIA QUERY: similmywork (pagina 1 lavoro) – smartphone === */
@media (max-width: 633px) {
  .text-scroll-wrapper {
    top: 50%;       /* 🔽 Portato verticalmente al centro reale */
    left: 50%;      /* 🔽 Completamente centrato */
    transform: translate(-50%, -50%);
  }

  .text-block h2 {
    font-size: 2.2rem;
    margin-bottom: 18px;
  }

  .text-block button {
    font-size: 0.85rem;
    padding: 8px 18px;
  }

  .video-overlay iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }
}