/* Chapter I: the knight's campfire. Title card and fire animation. */

.scene--dark-fantasy {
  --scene-bg: #2a1f6e;
  --accent: #e7b45a;
}

.scene--dark-fantasy .scene__backdrop::before {
  background-image: url("../../assets/dark-fantasy/cielo-s.webp");
}

.title-plate {
  position: relative;
  isolation: isolate;
  max-width: 34rem;
  padding-top: clamp(1rem, 6svh, 4rem);
  text-shadow:
    0 2px 2px rgb(0 0 0 / 0.6),
    0 0 24px rgb(10 6 40 / 0.9);
}

/* A soft pool of night behind the text, so contrast holds wherever the art is
   bright, including while the stage pans behind it on phones. */
.title-plate::before {
  content: "";
  position: absolute;
  inset: -2rem -4rem -3rem -6rem;
  z-index: -1;
  background: radial-gradient(
    ellipse closest-side,
    rgb(10 6 40 / 0.7),
    rgb(10 6 40 / 0.45) 60%,
    transparent
  );
  pointer-events: none;
}

.title-plate__name {
  margin-block: var(--space-1) var(--space-1);
  font-size: clamp(2.5rem, 1.6rem + 6vw, 6.5rem);
  letter-spacing: 0.04em;
  color: #fff6e4;
}

.title-plate__surname {
  display: block;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.title-plate__role {
  font-family: var(--font-hand);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  font-style: italic;
  color: var(--accent);
}

.title-plate__intro {
  margin-top: var(--space-3);
  max-width: 26rem;
}

/* Two fire frames shown alternately: the second runs half a cycle behind the first,
   so exactly one of them is visible at any moment. */
.layer[data-role="fire"] {
  animation: fire-flicker 0.7s steps(1, end) infinite;
}

.layer[data-role="fire"] + .layer[data-role="fire"] {
  animation-delay: -0.35s;
}

@keyframes fire-flicker {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .layer[data-role="fire"] + .layer[data-role="fire"] {
    opacity: 0;
  }
}

/* Warm light pulsing from the campfire. */
.scene--dark-fantasy .stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: radial-gradient(
    circle at 51% 86%,
    rgb(255 150 60 / 0.22),
    transparent 22%
  );
  mix-blend-mode: screen;
  animation: fire-glow 2.3s ease-in-out infinite alternate;
}

@keyframes fire-glow {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

@media (max-aspect-ratio: 1 / 1) {
  .scene--dark-fantasy {
    --focus-x: 44%;
  }
}
