.illustrated-story-page {
  background:
    radial-gradient(circle at top left, rgba(255, 226, 167, 0.22), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(113, 168, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #18120f 0%, #211814 40%, #120d0b 100%);
  color: #f4ece4;
}

.storybook-shell {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.4fr) minmax(220px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(34, 25, 21, 0.92), rgba(17, 13, 11, 0.94));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.storybook-hero {
  grid-column: 1 / -1;
  padding: 1.4rem 1.5rem 1.2rem;
  overflow: hidden;
}

.storybook-hero::after {
  content: '';
  position: absolute;
  inset: auto -6rem -4rem auto;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(255, 207, 121, 0.26), transparent 60%);
  filter: blur(6px);
}

.storybook-hero h1,
.chapter-rail h2,
.illustration-panel h2,
.narration-panel h2,
.strip-panel h2 {
  margin: 0;
  color: #fff7ef;
  letter-spacing: 0.01em;
}

.storybook-hero p,
.narration-panel p,
.illustration-panel figcaption {
  max-width: 72ch;
  color: rgba(244, 236, 228, 0.86);
}

.storybook-hero h1 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.story-kicker,
.story-spotlight,
.story-counter,
.chapter-pill,
.scene-meta {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-kicker {
  margin: 0;
  font-size: 0.76rem;
  color: #e6b77a;
}

.chapter-rail,
.illustration-panel,
.narration-panel,
.strip-panel {
  padding: 1rem;
}

.rail-heading,
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.panel-header.compact {
  margin-bottom: 0.85rem;
  align-items: center;
}

.story-controls {
  display: flex;
  gap: 0.55rem;
}

.story-controls button,
.chapter-pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: #fff8f1;
  border-radius: 999px;
}

.story-controls button {
  width: 2.35rem;
  height: 2.35rem;
  cursor: pointer;
}

.story-controls button:hover,
.chapter-pill:hover {
  transform: translateY(-1px);
}

.chapter-tabs {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.chapter-pill {
  width: 100%;
  padding: 0.8rem 0.9rem;
  text-align: left;
  cursor: pointer;
}

.chapter-pill strong,
.scene-strip button strong {
  display: block;
  margin-bottom: 0.15rem;
  color: #fff;
}

.chapter-pill span,
.scene-strip button span {
  display: block;
  color: rgba(244, 236, 228, 0.74);
  font-size: 0.84rem;
  line-height: 1.35;
}

.chapter-pill.is-active,
.scene-strip button.is-active {
  border-color: rgba(255, 215, 157, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 157, 0.28);
  background: linear-gradient(180deg, rgba(121, 72, 31, 0.8), rgba(48, 27, 18, 0.92));
}

.story-meter {
  height: 0.6rem;
  margin-top: 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.story-meter-fill {
  height: 100%;
  width: 16.66%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0b469, #ffd99b);
  transition: width 220ms ease;
}

.illustration-panel {
  overflow: hidden;
}

.story-spotlight,
.story-counter {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe3bc;
  font-size: 0.74rem;
}

.illustration-frame {
  margin: 1rem 0 0;
}

.scene-art {
  position: relative;
  min-height: 28rem;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, var(--scene-sky, #24304c), var(--scene-earth, #17120f));
}

.scene-sky,
.scene-glow,
.scene-horizon,
.scene-path,
.scene-arch,
.scene-beacon,
.scene-figure,
.scene-dust {
  position: absolute;
}

.scene-sky {
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.22), transparent 18%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.14), transparent 20%),
    linear-gradient(180deg, var(--scene-sky-top, #344865), var(--scene-sky-bottom, #17202d));
}

.scene-glow {
  inset: 0;
  background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--scene-glow, #ffd28f) 26%, transparent), transparent 42%);
}

.scene-horizon {
  left: -8%;
  right: -8%;
  bottom: 0;
  height: 42%;
  background:
    radial-gradient(circle at 20% 100%, color-mix(in srgb, var(--scene-ground, #281d17) 84%, white), transparent 38%),
    radial-gradient(circle at 48% 92%, color-mix(in srgb, var(--scene-ground-2, #3d2a1f) 85%, white), transparent 44%),
    radial-gradient(circle at 78% 95%, color-mix(in srgb, var(--scene-ground-3, #251a13) 90%, white), transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--scene-ground, #281d17) 88%, white), var(--scene-earth, #17120f));
  clip-path: polygon(0 34%, 11% 28%, 22% 35%, 33% 22%, 47% 30%, 59% 16%, 71% 29%, 84% 21%, 100% 30%, 100% 100%, 0 100%);
}

.scene-path {
  left: 50%;
  bottom: -3%;
  width: 34%;
  height: 52%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--scene-path, #e7bb78) 52%, #4e3628));
  clip-path: polygon(48% 0, 58% 1%, 68% 10%, 77% 25%, 84% 43%, 89% 68%, 100% 100%, 0 100%, 11% 68%, 16% 43%, 23% 25%, 32% 10%, 42% 1%);
  filter: blur(0.2px);
}

.scene-arch {
  left: 50%;
  bottom: 20%;
  width: 18%;
  height: 46%;
  transform: translateX(-50%);
  border: 0.5rem solid color-mix(in srgb, var(--scene-arch, #b07e47) 84%, white);
  border-bottom: none;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 40px color-mix(in srgb, var(--scene-arch, #b07e47) 28%, transparent);
}

.scene-beacon {
  left: 50%;
  top: 18%;
  width: 0.8rem;
  height: 0.8rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--scene-beacon, #ffe7a4);
  box-shadow:
    0 0 20px 8px color-mix(in srgb, var(--scene-beacon, #ffe7a4) 42%, transparent),
    0 0 70px 28px color-mix(in srgb, var(--scene-beacon, #ffe7a4) 20%, transparent);
}

.scene-figure {
  left: 50%;
  bottom: 9%;
  width: 6rem;
  height: 11rem;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 10%, var(--scene-cloak, #201812) 0 12%, transparent 13%),
    linear-gradient(180deg, transparent 0 8%, var(--scene-cloak, #201812) 8% 44%, transparent 44%),
    radial-gradient(circle at 50% 32%, var(--scene-cloak, #201812) 0 52%, transparent 53%);
  clip-path: polygon(46% 0, 54% 0, 66% 18%, 76% 43%, 91% 100%, 73% 100%, 62% 60%, 56% 100%, 44% 100%, 38% 60%, 27% 100%, 9% 100%, 24% 43%, 34% 18%);
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.28));
}

.scene-dust {
  border-radius: 999px;
  background: color-mix(in srgb, var(--scene-dust, #f6d5a1) 55%, transparent);
  filter: blur(1px);
}

.scene-dust-a {
  left: 15%;
  top: 18%;
  width: 4rem;
  height: 4rem;
}

.scene-dust-b {
  right: 18%;
  top: 30%;
  width: 3rem;
  height: 3rem;
}

.scene-dust-c {
  left: 58%;
  top: 16%;
  width: 2rem;
  height: 2rem;
}

.narration-panel blockquote {
  margin: 1rem 0;
  padding: 1rem 1rem 1rem 1.1rem;
  border-left: 0.28rem solid #e8b16e;
  border-radius: 0 16px 16px 0;
  background: rgba(255, 255, 255, 0.04);
  color: #fff2e4;
  font-size: 1rem;
  line-height: 1.55;
}

.scene-notes {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.7rem;
}

.scene-notes li {
  color: rgba(244, 236, 228, 0.9);
  line-height: 1.45;
}

.scene-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.scene-strip button {
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.scene-strip button:hover {
  transform: translateY(-1px);
}

@media (max-width: 1120px) {
  .storybook-shell {
    grid-template-columns: 1fr;
  }

  .scene-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .chapter-rail,
  .illustration-panel,
  .narration-panel,
  .strip-panel {
    padding: 0.85rem;
  }

  .rail-heading,
  .panel-header {
    flex-direction: column;
  }

  .scene-art {
    min-height: 22rem;
  }

  .scene-strip {
    grid-template-columns: 1fr;
  }
}