/* story.css
 * Page-specific overrides for story page.
 * (Scaffold ready; migrate .story-page blocks here in next pass if needed.)
 */

/* migrated from common.css: story page */

.story-page .story-text {
  width: min(100%, 1280px);
  background: #000;
  border-radius: 0;
  margin: 0 auto;
  padding: 64px 24px;
  color: #fff;
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 2.35;
  letter-spacing: 0.03em;
  font-weight: 700;
  text-shadow:
    0 0 3px rgba(120, 210, 255, 0.9),
    0 0 8px rgba(70, 170, 255, 0.65),
    0 0 14px rgba(40, 140, 255, 0.45);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.story-page .story-text::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../image/story/story_bg.jpg");
  background-repeat: no-repeat;
  background-position: center 12%;
  background-size: cover;
  opacity: 0;
  animation: storyBgFadeMove 9.8s ease 0.2s forwards;
  z-index: 0;
  pointer-events: none;
}

.story-page .story-text > * {
  position: relative;
  z-index: 1;
}

.story-page .story-text .story-line {
  display: block;
}

/* paragraph-by-paragraph with pauses */
.story-page .story-text p {
  width: min(100%, 980px);
  margin: 0 auto 4.2em;
  text-align: left;
  opacity: 0;
  transform: translateY(14px);
  animation: storyLineFadeIn 1.35s ease forwards;
}

.story-page .story-text p:nth-of-type(1) { animation-delay: 0.5s; }
.story-page .story-text p:nth-of-type(2) { animation-delay: 2.5s; }
.story-page .story-text p:nth-of-type(3) { animation-delay: 4.5s; }
.story-page .story-text p:nth-of-type(4) { animation-delay: 7.5s; }

@keyframes storyLineFadeIn {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-page .story-text p {
    animation: none;
    opacity: 1;
  }
}

.story-page .story-text .kw-pink {
  color: inherit;
  text-shadow:
    0 0 3px rgba(120, 210, 255, 0.9),
    0 0 8px rgba(70, 170, 255, 0.65),
    0 0 14px rgba(40, 140, 255, 0.45);
  animation: kwBlueToPink 0.9s ease forwards;
}

/* start pink transition after each paragraph has fully faded in (+small pause) */
.story-page .story-text p:nth-of-type(1) .kw-pink { animation-delay: 2.1s; }
.story-page .story-text p:nth-of-type(2) .kw-pink { animation-delay: 4.1s; }
.story-page .story-text p:nth-of-type(3) .kw-pink { animation-delay: 6.1s; }
.story-page .story-text p:nth-of-type(4) .kw-pink { animation-delay: 9.1s; }

.story-page .story-text p:last-child {
  margin-bottom: 0;
}

@keyframes kwBlueToPink {
  0% {
    color: inherit;
    text-shadow:
      0 0 3px rgba(120, 210, 255, 0.9),
      0 0 8px rgba(70, 170, 255, 0.65),
      0 0 14px rgba(40, 140, 255, 0.45);
  }
  100% {
    color: #ffd6f4;
    text-shadow:
      0 0 3px rgba(255, 145, 230, 0.95),
      0 0 8px rgba(255, 95, 210, 0.85),
      0 0 16px rgba(255, 55, 190, 0.65);
  }
}

@keyframes storyBgFadeMove {
  0% {
    opacity: 0;
    background-position: center 4%;
  }
  100% {
    opacity: 0.36;
    background-position: center 40%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-page .story-text::before {
    animation: none;
    opacity: 0.36;
  }
}
