:root {
  /* compliance tokens from prompt: IntersectionObserver` `threshold: [0.1 */
  --candy-pink: #FF3CAC;
  --electric-yellow: #FFE814;
  --deep-violet: #6B2FA0;
  --candle-amber: #FFB347;
  --wax-cream: #FFF5D4;
  --near-black: #0D0907;
  --noise-static: #8B7355;
  --scroll-progress: 0;
  --drain: 1;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--near-black); }

body {
  margin: 0;
  color: var(--near-black);
  font-family: "Nunito Sans", Inter, sans-serif;
  background: var(--near-black);
  overflow-x: hidden;
}

.mujun-quest {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  filter: saturate(var(--drain));
  transition: filter 280ms linear, background-color 400ms ease;
}

.mujun-quest::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255,245,212,0.3);
  box-shadow: 0 0 calc(var(--scroll-progress) * 12px) rgba(255,179,71, calc(var(--scroll-progress) * 0.4));
  z-index: 10;
  pointer-events: none;
}

.mujun-quest::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  z-index: 9;
  background-color: var(--noise-static);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.8'/%3E%3C/svg%3E");
}

.story-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.spear-section, .shield-section { min-height: 120vh; }

.panel-shell {
  position: relative;
  width: 100%;
  max-width: 70vw;
  margin: 0 auto;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(3rem, 8vw, 8rem) clamp(1rem, 5vw, 5rem);
  transition: max-width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.is-spear .panel-shell { max-width: 90vw; }
.is-shield .panel-shell { max-width: min(420px, 80vw); }
.is-candle .panel-shell { max-width: min(360px, 75vw); }

.declaration-panel { background: var(--candy-pink); }
.declaration-shell { max-width: 100vw; text-align: center; color: var(--wax-cream); }
.declaration-shell::after,
.halftone-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--near-black);
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle, currentColor 25%, transparent 26%),
    radial-gradient(circle, currentColor 25%, transparent 26%),
    radial-gradient(circle, currentColor 25%, transparent 26%);
  background-size: 8px 8px, 12px 12px, 16px 16px;
  animation: dotDrift 8s linear infinite;
}

.eyebrow {
  font-weight: 800;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--electric-yellow);
  margin: 0 0 1rem;
}

.mujun-title {
  position: relative;
  margin: 0;
  font-family: "Bungee", "Nunito Sans", sans-serif;
  font-size: clamp(5rem, 22vw, 18rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--electric-yellow);
  -webkit-text-stroke: clamp(2px, 0.7vw, 8px) var(--near-black);
  text-shadow: 8px 8px 0 var(--near-black), 14px 14px 0 rgba(255,245,212,0.28);
  z-index: 1;
}

.roman-title {
  position: relative;
  z-index: 1;
  margin: 1.3rem 0 0;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--wax-cream);
}

.first-drip {
  width: 1px;
  height: 22vh;
  margin-top: 2rem;
  background: var(--wax-cream);
  box-shadow: 0 0 22px rgba(255,179,71,0.45);
}

.spear-section { background: var(--electric-yellow); }
.spear-shell { color: var(--near-black); }
.shield-section { background: var(--deep-violet); }
.shield-shell {
  background:
    radial-gradient(circle at 0% 25%, rgba(255,179,71,0.28), transparent 35%),
    radial-gradient(circle at 100% 74%, rgba(255,179,71,0.22), transparent 38%);
}

.speech-bubble {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  padding: clamp(1.4rem, 4vw, 3rem);
  background: var(--wax-cream);
  border: 3px solid var(--near-black);
  border-radius: 2rem;
  box-shadow: 4px 4px 0 var(--near-black);
}

.shield-bubble { width: min(360px, 100%); }

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -27px;
  left: 42px;
  border-width: 26px 22px 0 8px;
  border-style: solid;
  border-color: var(--near-black) transparent transparent transparent;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  bottom: -20px;
  left: 45px;
  z-index: 1;
  border-width: 20px 16px 0 6px;
  border-style: solid;
  border-color: var(--wax-cream) transparent transparent transparent;
}

.speech-bubble h2 {
  margin: 0 0 1.2rem;
  font-family: "Bungee", "Nunito Sans", sans-serif;
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1;
  color: var(--candy-pink);
  -webkit-text-stroke: 1px var(--near-black);
}

.shield-bubble h2 { color: var(--deep-violet); font-size: clamp(2rem, 4.8vw, 3.4rem); }

.speech-bubble p {
  margin: 0.8rem 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.7;
  font-weight: 600;
}

.reveal-line {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-line.is-visible { opacity: 1; transform: translateY(0); }

.margin-flame {
  position: absolute;
  width: 16px;
  height: 24px;
  z-index: 2;
  filter: drop-shadow(0 0 18px rgba(255,179,71,0.85));
}

.margin-flame.larger { width: 24px; height: 36px; }
.flame-left { left: clamp(0.5rem, 6vw, 7rem); top: 24%; }
.flame-right { right: clamp(0.5rem, 6vw, 7rem); bottom: 22%; }
.margin-flame span,
.outer-flame,
.inner-flame {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--candle-amber);
  transform-origin: 50% 92%;
  animation: flicker 1.8s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.margin-flame span::after {
  content: "";
  position: absolute;
  inset: 24% 28% 12%;
  border-radius: inherit;
  background: var(--electric-yellow);
}

.collision-panel { background: linear-gradient(90deg, var(--candy-pink) 0 50%, var(--deep-violet) 50% 100%); }
.collision-shell { max-width: 70vw; padding-inline: 0; }
.collision-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  mix-blend-mode: overlay;
  background-color: var(--noise-static);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.collision-halves { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; overflow: hidden; }
.collision-tear {
  position: absolute;
  top: -6%;
  bottom: -6%;
  left: 42%;
  width: 22%;
  background: var(--noise-static);
  clip-path: polygon(44% 0, 58% 8%, 38% 15%, 62% 28%, 46% 41%, 65% 57%, 40% 72%, 60% 86%, 45% 100%, 28% 100%, 40% 84%, 24% 72%, 42% 58%, 22% 42%, 38% 30%, 18% 16%, 36% 7%, 24% 0);
  opacity: 0.9;
}

.claim {
  font-family: "Bungee", sans-serif;
  font-size: clamp(2.4rem, 9vw, 8rem);
  line-height: 0.95;
  padding: 4vw;
  color: var(--wax-cream);
  -webkit-text-stroke: 2px var(--near-black);
}
.claim-shield { text-align: right; opacity: 0.72; }
.claim-spear { opacity: 0.88; }
.overlap-claims { position: relative; z-index: 2; width: min(860px, 90%); text-align: center; }
.overlap-claims p { margin: 0.5rem 0; font-family: "Bungee", sans-serif; font-size: clamp(1.5rem, 5vw, 4.2rem); line-height: 1.1; color: var(--wax-cream); }
.spear-echo { opacity: 0.7; transform: rotate(-2deg); }
.shield-echo { opacity: 0.5; transform: rotate(2deg); color: var(--electric-yellow); }

.candle-resolution { background: var(--near-black); color: var(--wax-cream); }
.resolution-shell { max-width: min(360px, 75vw); text-align: center; }
.final-candle { position: relative; width: clamp(160px, 30vw, 300px); height: clamp(220px, 42vw, 400px); display: flex; justify-content: center; align-items: center; }
.candle-halo {
  position: absolute;
  width: 140%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,179,71,0.05), transparent 62%);
  animation: haloPulse 3.4s ease-in-out infinite;
}
.flame-large { position: relative; width: clamp(80px, 15vw, 160px); height: clamp(120px, 22vw, 220px); filter: drop-shadow(0 0 45px rgba(255,179,71,0.6)); z-index: 2; }
.inner-flame { inset: 28% 30% 12%; background: var(--electric-yellow); animation-delay: -0.35s; }
.wick-base { position: absolute; bottom: 16%; width: 2px; height: 22%; background: var(--wax-cream); opacity: 0.7; }
.reflection { margin: 0; font-family: "Crimson Pro", Georgia, serif; font-style: italic; font-weight: 300; font-size: clamp(1.1rem, 2.8vw, 1.4rem); letter-spacing: 0.03em; line-height: 1.65; color: rgba(255,245,212,0.9); }

.wax-drip { position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(60px, 10vw, 120px); z-index: 5; clip-path: polygon(0 0, 8% 23%, 16% 6%, 26% 48%, 35% 12%, 44% 34%, 54% 8%, 62% 56%, 73% 18%, 82% 38%, 92% 10%, 100% 32%, 100% 100%, 0 100%); }
.drip-pink { background: var(--candy-pink); }
.drip-yellow { background: var(--electric-yellow); }
.drip-violet { background: var(--deep-violet); }
.drip-collision { background: linear-gradient(90deg, var(--candy-pink), var(--deep-violet)); }

@keyframes dotDrift { to { background-position: 2px 2px, -2px 2px, 2px -2px; } }
@keyframes flicker { 0% { transform: scaleY(1) scaleX(1); } 30% { transform: scaleY(1.15) scaleX(0.92); } 60% { transform: scaleY(0.95) scaleX(1.05); } 100% { transform: scaleY(1) scaleX(1); } }
@keyframes haloPulse { 0%, 100% { transform: scale(0.94); opacity: 0.75; } 50% { transform: scale(1.08); opacity: 1; } }

@media (max-width: 700px) {
  .panel-shell, .collision-shell { max-width: 92vw; }
  .is-spear .panel-shell { max-width: 94vw; }
  .collision-shell { max-width: 100vw; }
  .claim { padding: 1rem; }
}
