.story-page--task {
  background:
    radial-gradient(circle at 88% 12%, rgba(244,162,97,.18), transparent 27rem),
    radial-gradient(circle at 8% 62%, rgba(203,226,216,.25), transparent 32rem),
    linear-gradient(180deg, #fffaf4 0%, #f8fbfa 56%, #f4f7fb 100%);
}

.story-page--message {
  background:
    radial-gradient(circle at 10% 18%, rgba(210,225,240,.34), transparent 29rem),
    radial-gradient(circle at 90% 58%, rgba(247,207,173,.24), transparent 31rem),
    linear-gradient(180deg, #fbfaf6 0%, #f6fafb 58%, #f5f7fb 100%);
}

.story-page--pile {
  background:
    radial-gradient(circle at 9% 14%, rgba(247,196,151,.25), transparent 27rem),
    radial-gradient(circle at 90% 44%, rgba(206,229,218,.3), transparent 34rem),
    linear-gradient(180deg, #fffaf4 0%, #f8faf7 54%, #f4f7fb 100%);
}

.story-beat--image-led {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.story-beat--copy-led {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.story-beat--panoramic {
  grid-template-columns: 1fr !important;
  gap: 1.75rem;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.story-beat--panoramic .story-copy,
.story-beat--panoramic .story-copy h2,
.story-beat--panoramic .story-copy p,
.story-beat--panoramic .story-pull {
  max-width: 42rem !important;
}

/* Keep each illustration shell at its SVG's native ratio. This prevents the
   white letterbox bands that appeared when the shared shell ratio changed by
   layout breakpoint. */
.story-scene-shell {
  aspect-ratio: 4 / 3;
}

.story-beat--panoramic .story-scene-shell {
  aspect-ratio: 25 / 11 !important;
}

article > figure.story-figure .story-scene-shell {
  aspect-ratio: 25 / 14;
}

.story-opening--left {
  margin-left: 0;
  margin-right: auto;
}

.story-opening--centre {
  margin-left: auto;
  margin-right: auto;
}

.story-break--narrow {
  max-width: 52rem;
}

:is(.story-page--task, .story-page--message, .story-page--pile) .story-main {
  padding-bottom: 2.25rem;
}

:is(.story-page--task, .story-page--message, .story-page--pile) .story-beat {
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: clamp(4rem, 7vw, 5rem);
}

:is(.story-page--task, .story-page--message, .story-page--pile) .story-break {
  margin-bottom: clamp(4rem, 7vw, 5rem);
}

:is(.story-page--task, .story-page--message, .story-page--pile) .story-final {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

:is(.story-page--task, .story-page--message, .story-page--pile) .story-final-copy {
  padding-bottom: 1.5rem;
}

:is(.story-page--task, .story-page--message, .story-page--pile) .story-reset-card {
  border: 1px solid rgba(255,255,255,.1);
}

:is(.story-page--task, .story-page--message, .story-page--pile) article > .story-figure:last-of-type {
  margin-bottom: 0 !important;
}

:is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--story-line);
  color: #667085;
  font-size: .82rem;
  line-height: 1.4;
}

:is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple > span {
  color: var(--story-ink);
  font-weight: 750;
  letter-spacing: -.01em;
}

:is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .95rem;
}

:is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: .2em;
}

:is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple a:hover,
:is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple a:focus-visible {
  color: var(--story-ink);
  text-decoration: underline;
}

@media (max-width: 980px) {
  .story-beat--image-led,
  .story-beat--copy-led,
  .story-beat--panoramic {
    grid-template-columns: 1fr !important;
  }

  .story-beat--panoramic .story-scene-shell {
    aspect-ratio: 25 / 11 !important;
  }
}

@media (max-width: 620px) {
  .story-beat--panoramic .story-scene-shell {
    aspect-ratio: 25 / 11 !important;
  }

  :is(.story-page--task, .story-page--message, .story-page--pile) .story-main {
    padding-bottom: 1.75rem;
  }

  :is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 1.5rem, 36rem);
    padding: 1.1rem 0 1.6rem;
  }

  :is(.story-page--task, .story-page--message, .story-page--pile) footer.footer-simple nav {
    justify-content: flex-start;
    gap: .75rem 1rem;
  }
}
