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

html {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

body {
  background: #000;
  overflow-x: hidden;
  max-width: 720px;
  margin: 0 auto;
}

/* === NAVIGATION DOTS === */
.nav-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0;
  position: relative;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.2);
}

.dot.active {
  background: #9eff00;
  border-color: #9eff00;
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(158, 255, 0, 0.4);
}

/* Tooltip on dots */
.dot::after {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(5px);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.dot:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* === SPREAD SECTIONS === */
.spread {
  width: 100%;
  scroll-snap-align: start;
  background: #000;
  display: flex;
}

/* === SPREAD HALVES === */
.spread-half {
  width: 50%;
  position: relative;
}

.spread-half img {
  width: 100%;
  height: auto;
  display: block;
}

.spread-half img.bg-img {
  position: relative;
  z-index: 1;
}

.spread-half img.layer-img {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  /* Fade effect — starts invisible */
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* When section is visible, fade in layers */
.spread.visible .layer-img {
  opacity: 1;
}

/* === STATIC SPREAD (Lista de Termas) === */
.spread-static {
  background: #9eff00;
  align-items: center;
  justify-content: center;
  position: relative;
}

.termas-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.scroll-indicator.hidden {
  opacity: 0;
}

.scroll-indicator span {
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-indicator .arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  transform: rotate(45deg);
  animation: scrollBounce 1.8s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 1; }
}

/* === PROGRESS BAR === */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #9eff00, #7fff00);
  z-index: 200;
  width: 0%;
  transition: width 0.4s ease;
}

/* === LIGHTBOX POPUP === */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img,
.lightbox-page {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  border-radius: 2px;
}

.lightbox-page img {
  max-width: 100%;
  max-height: 90vh;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 28px;
  cursor: pointer;
  padding: 5px 10px;
  transition: color 0.3s ease;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.lightbox-close:hover {
  color: #9eff00;
}

/* Make spread-halves clickable */
.spread-half {
  cursor: zoom-in;
}

/* === PUZZLE MODE === */
.puzzle-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 25px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.puzzle-toggle:hover {
  background: #9eff00;
  color: #000;
  border-color: #9eff00;
}

/* Puzzle grid overlay */
.puzzle-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 400;
  display: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.puzzle-overlay.active {
  display: block;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 60px 20px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.puzzle-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.5s ease,
              opacity 0.4s ease;
  user-select: none;
  -webkit-user-select: none;
}

.puzzle-card:active {
  cursor: grabbing;
}

.puzzle-card img,
.puzzle-card > div {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.puzzle-card.dragging {
  z-index: 10;
  box-shadow: 0 12px 40px rgba(158, 255, 0, 0.25);
  opacity: 0.92;
  transition: box-shadow 0.4s ease, opacity 0.3s ease;
}

.puzzle-card.drop-target {
  box-shadow: 0 0 0 3px #9eff00, 0 0 20px rgba(158, 255, 0, 0.3);
  transform: scale(0.95);
}

.puzzle-close {
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 450;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.puzzle-close:hover {
  background: #9eff00;
  color: #000;
  border-color: #9eff00;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-dots {
    right: 10px;
    gap: 6px;
  }

  .dot {
    width: 7px;
    height: 7px;
  }

  .dot::after {
    display: none;
  }

  .scroll-indicator span {
    font-size: 9px;
  }

  .puzzle-toggle {
    font-size: 9px;
    padding: 6px 12px;
  }

  .puzzle-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 50px 10px 10px;
  }
}
