/* Slide 8 — Pheras & Varmala (group reveal + synced text) */

.slide[data-slide="8"] {
  overflow: hidden;
}

.slide[data-slide="8"] .s8-bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.slide[data-slide="8"] .s8-bg {
  transform-origin: 50% 42%;
  opacity: 0.75;
  transform: scale(1.04);
  filter: brightness(0.95);
}

.slide[data-slide="8"] .s8-scene-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transform: translateY(160px);
  will-change: transform, opacity;
  pointer-events: none;
}

.slide[data-slide="8"] .s8-design {
  z-index: 3;
}

.slide[data-slide="8"] .s8-frame {
  z-index: 4;
}

.slide[data-slide="8"] .s8-couple-wrap,
.slide[data-slide="8"] .s8-light-wrap,
.slide[data-slide="8"] .s8-pot-wrap,
.slide[data-slide="8"] .s8-pheras-wrap {
  position: absolute;
}

.slide[data-slide="8"] .s8-couple-wrap {
  z-index: 5;
  transform-origin: 50% 85%;
}

.slide[data-slide="8"] .s8-light-wrap {
  z-index: 4;
  transform: scaleX(-1);
  transform-origin: 50% 50%;
}

.slide[data-slide="8"] .s8-pot-wrap {
  z-index: 4;
  transform-origin: 50% 80%;
}

.slide[data-slide="8"] .s8-pheras-wrap {
  z-index: 7;
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  -webkit-clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}

.slide[data-slide="8"] .s8-couple,
.slide[data-slide="8"] .s8-pheras,
.slide[data-slide="8"] .s8-light,
.slide[data-slide="8"] .s8-pot {
  display: block;
  width: 100%;
  height: 100%;
}

.slide[data-slide="8"] .s8-copy {
  position: absolute;
  z-index: 8;
  left: 329px;
  top: 1309px;
  width: 422px;
  pointer-events: none;
}

.slide[data-slide="8"] .s8-content-reveal {
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  -webkit-clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}

.slide[data-slide="8"] .s8-content-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

/* ── Keyframes ── */

@keyframes s8GroupSlideIn {
  from {
    opacity: 0;
    transform: translateY(160px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes s8BgBreathe {
  0%,
  100% {
    opacity: 0.88;
    transform: scale(1.04);
    filter: brightness(0.98) saturate(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
    filter: brightness(1.06) saturate(1.05);
  }
}

@keyframes s8RevealDown {
  to {
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
  }
}

@keyframes s8LightGlow {
  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 8px rgba(255, 215, 120, 0.3));
  }

  50% {
    filter: brightness(1.12) drop-shadow(0 0 22px rgba(255, 215, 120, 0.9))
      drop-shadow(0 0 44px rgba(255, 190, 80, 0.45));
  }
}

@keyframes s8PherasFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-7px) rotate(1.5deg);
  }
}

@keyframes s8PotFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
}

/* ── Play state ── */

.slide[data-slide="8"].s8-play .s8-bg {
  animation: s8BgBreathe 10s ease-in-out infinite;
}

.slide[data-slide="8"].s8-play .s8-scene-wrap {
  animation: s8GroupSlideIn 1.1s ease-out 0.35s forwards;
}

.slide[data-slide="8"].s8-play .s8-pheras-wrap,
.slide[data-slide="8"].s8-play .s8-content-reveal {
  animation: s8RevealDown 1.1s ease-out 0.35s forwards;
}

.slide[data-slide="8"].s8-play .s8-pheras-wrap {
  animation:
    s8RevealDown 1.1s ease-out 0.35s forwards,
    s8PherasFloat 2.4s ease-in-out infinite;
  animation-delay: 0.35s, 2.1s;
}

.slide[data-slide="8"].s8-play .s8-light-wrap {
  animation: s8LightGlow 2s ease-in-out infinite;
  animation-delay: 2.1s;
}

.slide[data-slide="8"].s8-play .s8-pot-wrap {
  animation: s8PotFloat 2.2s ease-in-out infinite;
  animation-delay: 2.2s;
}

@media (prefers-reduced-motion: reduce) {
  .slide[data-slide="8"] .s8-scene-wrap {
    opacity: 1 !important;
    transform: none !important;
  }

  .slide[data-slide="8"] .s8-pheras-wrap,
  .slide[data-slide="8"] .s8-content-reveal {
    clip-path: none !important;
    -webkit-clip-path: none !important;
  }

  .slide[data-slide="8"].s8-play .s8-bg,
  .slide[data-slide="8"].s8-play .s8-scene-wrap,
  .slide[data-slide="8"].s8-play .s8-pheras-wrap,
  .slide[data-slide="8"].s8-play .s8-content-reveal,
  .slide[data-slide="8"].s8-play .s8-light-wrap,
  .slide[data-slide="8"].s8-play .s8-pot-wrap {
    animation: none !important;
    opacity: 1;
    transform: none;
    clip-path: none;
    -webkit-clip-path: none;
    filter: none;
  }
}
