:root {
  --th-ochre: #C08A3F;
  --th-sepia: #704214;
  --th-dark-brown: #331f0a;
  --th-red: #8B0000;
  --th-petrol: #005f69;
  --text-light: #f5f5dc;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', serif;
  --font-script: 'La Belle Aurore', cursive;
}

body {
  margin: 0;
  padding: 0;
  background-color: #000;
  color: var(--text-light);
  font-family: var(--font-body);
  height: 100dvh;
  overflow: hidden; /* Gestito interamente da Swiper */
}

/* Fix SweetAlert Mobile Centering */
.swal2-container {
  height: 100dvh !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.swal-munaciello {
  width: 90% !important;
  max-width: 400px !important;
  margin: auto !important;
  font-size: 1rem !important;
}

/* SweetAlert2 Typography Override */
.swal2-title {
  font-family: var(--font-serif) !important;
}
.swal2-html-container {
  font-family: var(--font-body) !important;
}

.wip-slide {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Testo in basso */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.wip-slide::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Gradiente per leggere bene il testo */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
  pointer-events: none;
}

.wip-content {
  position: relative;
  z-index: 10;
  padding: 2rem;
  /* Animazione d'ingresso base (sarà gestita via JS/Intersection Observer per finezza, o puro CSS) */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.wip-slide.is-visible .wip-content {
  opacity: 1;
  transform: translateY(0);
}

.wip-title {
  font-size: 3rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--th-ochre);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 0.5rem;
}

.wip-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
  color: #fff;
}

.custom-btn {
  background-color: var(--th-petrol);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 0.75rem 2rem;
  font-size: 1.25rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s, transform 0.3s;
}

.custom-btn:hover {
  background-color: var(--th-ochre);
  color: var(--th-dark-brown);
  transform: translateY(-2px);
}

/* Freccia scorrimento giù */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.9);
  font-size: 2.5rem;
  animation: bounceNew 2.5s cubic-bezier(0.215, 0.610, 0.355, 1.000) infinite;
  z-index: 30;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.8));
}

@keyframes bounceNew {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }

  40% {
    transform: translateY(15px) translateX(-50%);
  }

  60% {
    transform: translateY(7px) translateX(-50%);
  }
}

/* ==========================================================
   HERO CAROUSEL SECTION
   ========================================================== */
#wip-hero {
  padding: 0;
}

#heroCarousel {
  width: 100%;
  height: 100%;
}

/* Fix per i layer: le custom caption coprono i controlli se non li alziamo */
.carousel-control-prev,
.carousel-control-next,
.carousel-indicators {
  z-index: 20;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================
   VIDEO IFRAME COVER FIX
   ========================================================== */
.cf-stream-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw !important;
  height: 56.25vw !important;
  min-height: 100vh !important;
  min-width: 177.78vh !important;
  pointer-events: none;
  border: none;
}

.hero-img {
  width: auto !important;
  height: 100dvh !important;
  min-width: 100vw !important;
  max-width: none !important;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.slide-content {
  background: rgba(0, 0, 0, 0);
  /* subtle overlay per testo */
  border-radius: 15px;
  padding: 2rem;
  max-width: 100%;
  margin: 0 auto;
}

/* ==========================================================
   HERO SECTION – plot narrativo (nessun overlay sull'immagine)
   ========================================================== */
.wip-hero-slide::before {
  display: none;
  /* overlay rimosso: la cisterna si vede in pieno */
}

.plot-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  font-style: italic;
  color: var(--th-ochre);
  text-shadow: 1px 1px 12px rgba(192, 138, 63, 0.6);
  line-height: 1.1;
}

.plot-desc {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 2.5vw, 1.2rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(245, 245, 220, 0.88);
  line-height: 1.8;
  max-width: 700px;
}

.btn-enter {
  background: linear-gradient(135deg, var(--th-petrol), #003f45);
  border: 1px solid rgba(192, 138, 63, 0.4);
  color: var(--th-ochre);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0.85rem 2.5rem;
  border-radius: 30px;
  box-shadow: 0 0 20px rgba(0, 95, 105, 0.5), 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.35s ease;
  cursor: pointer;
}

.btn-enter:hover,
.btn-enter:focus {
  background: linear-gradient(135deg, var(--th-ochre), #a07030);
  color: var(--th-dark-brown);
  box-shadow: 0 0 28px rgba(192, 138, 63, 0.6), 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px) scale(1.02);
}

/* ==========================================================
   CHARACTER SLIDES – fullscreen per personaggio (Giro-Panorama)
   Ogni .char-slide è un wip-slide indipendente nello scroll snap
   ========================================================== */

/* Slide personaggio: aggiunge overflow:hidden al .wip-slide base */
.char-slide {
  overflow: hidden;
  background-color: #1a0f05;
  cursor: none;
  /* il cursore è nascosto durante il pan */
  user-select: none;
  -webkit-user-select: none;
}

.char-img {
  height: 80dvh;
  width: auto;
  max-width: none;
  pointer-events: none;
}

/* Overlay gradiente: solo in basso, per leggere nome e spark */
.char-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.82) 0%,
      rgba(0, 0, 0, 0.22) 40%,
      transparent 65%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 2.5rem;
  transition: background 0.4s ease;
}

/* Sul desktop, al hover il gradiente si intensifica leggermente */
@media (hover: hover) {
  .char-slide:hover .char-card-overlay {
    background: linear-gradient(to top,
        rgba(10, 5, 0, 0.92) 0%,
        rgba(30, 10, 5, 0.35) 45%,
        transparent 70%);
  }
}

.char-card-era {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--th-ochre);
  opacity: 0.85;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.char-card-name {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  font-style: italic;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 0.5rem;
  text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.7);
}

.char-card-spark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  color: rgba(245, 245, 220, 0.75);
  line-height: 1.5;
  max-width: 600px;
}

/* Indicatore "← esplora →" nell'angolo superiore destro */
.char-card-hint {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 3;
  color: rgba(192, 138, 63, 0.55);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-serif);
  transition: opacity 0.3s;
}

/* Nascosto su touch: si usa il giroscopio */
@media (pointer: coarse) {
  .char-card-hint {
    display: none;
  }

  .char-slide {
    cursor: default;
  }
}

/* ==========================================================
   RESPONSIVE – smartphone stretto (≤576px)
   ========================================================== */
@media (max-width: 576px) {
  .wip-title {
    font-size: 2rem;
  }

  .plot-title {
    font-size: 1.75rem;
  }

  .plot-desc {
    font-size: 0.9rem;
  }

  .char-card-overlay {
    padding: 1.5rem 1.25rem;
  }
}

/* ==========================================================
   GYRO HINT – icona telefono animata (solo mobile)
   Suggerisce di muovere il telefono per il pan panoramico
   ========================================================== */
.gyro-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  pointer-events: auto;
  animation: gyroHintPulse 3s ease-in-out infinite;
  /* visibile solo su touchscreen – nascosto su desktop tramite @media sotto */
  transition: opacity 0.5s ease;
}

.gyro-hint-inner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Telefono SVG oscillante */
.gyro-hint-phone {
  width: 38px;
  height: 38px;
  color: var(--th-ochre);
  filter: drop-shadow(0 0 8px rgba(192, 138, 63, 0.55));
  animation: phoneRock 1.6s ease-in-out infinite;
  transform-origin: center bottom;
}

/* Frecce direzionali */
.gyro-hint-arrow {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.55);
  font-style: normal;
  line-height: 1;
}

/* Etichetta sotto l'icona */
.gyro-hint-label {
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

/* Animazioni */
@keyframes phoneRock {
  0% {
    transform: rotate(-20deg);
  }

  50% {
    transform: rotate(20deg);
  }

  100% {
    transform: rotate(-20deg);
  }
}

@keyframes gyroHintPulse {

  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

/* Nascosto dal JS solo in specifiche condizioni */
.gyro-hint.hide-hint {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Desktop (mouse preciso): mai mostrato */
@media (hover: hover) and (pointer: fine) {
  .gyro-hint {
    display: none !important;
  }
}