.story-page {
  --story-bg: #17352d;
  --story-ink: #fff9ec;
  --story-panel: rgba(11, 35, 29, 0.82);
  --story-accent: #ccd02e;
  background: var(--story-bg);
  color: var(--story-ink);
  transition: background-color 900ms ease, color 700ms ease;
}

.story-page[data-story-phase="fire"] {
  --story-bg: #5c1712;
  --story-ink: #fff5e5;
  --story-panel: rgba(68, 12, 10, 0.84);
  --story-accent: #ffb234;
}

.story-page[data-story-phase="ash"] {
  --story-bg: #cec8bc;
  --story-ink: #351b19;
  --story-panel: rgba(250, 246, 238, 0.84);
  --story-accent: #8e2d24;
}

.story-page[data-story-phase="growth"] {
  --story-bg: #dfe8cf;
  --story-ink: #173c2b;
  --story-panel: rgba(248, 250, 237, 0.86);
  --story-accent: #397030;
}

.story-page[data-story-phase="bloom"] {
  --story-bg: #fbf7ef;
  --story-ink: #3d1212;
  --story-panel: rgba(255, 255, 255, 0.88);
  --story-accent: #c91c21;
}

.story-page .site-header {
  color: var(--deep-ember);
}

.story-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.story-atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 20%, color-mix(in srgb, var(--story-accent) 35%, transparent), transparent 25%),
    linear-gradient(145deg, transparent 20%, color-mix(in srgb, var(--story-bg) 68%, #000) 100%);
  transition: background 900ms ease;
}

.story-landscape {
  position: absolute;
  right: -18vw;
  bottom: -10vh;
  width: min(880px, 78vw);
  height: min(880px, 88vh);
  overflow: visible;
}

.story-ground {
  fill: color-mix(in srgb, var(--story-bg) 70%, #0e211b);
  transition: fill 900ms ease;
}

.story-sun {
  fill: var(--story-accent);
  opacity: 0.15;
  transform-origin: 620px 150px;
  transition: fill 900ms ease, opacity 900ms ease, transform 1200ms ease;
}

.story-forest {
  fill: #0b241d;
  opacity: 0.95;
  transform-origin: center bottom;
  transition: opacity 1100ms ease, transform 1300ms ease;
}

.story-fire {
  fill: #f04a22;
  opacity: 0;
  transform: translateY(70px) scaleY(0.4);
  transform-origin: center bottom;
  transition: opacity 700ms ease, transform 1000ms cubic-bezier(.2, .8, .2, 1);
}

.story-ash {
  fill: #f5eee0;
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 900ms ease, transform 1500ms ease;
}

.story-seed {
  fill: #3d1212;
  opacity: 0;
  transform: translateY(50px);
  transform-origin: 410px 650px;
  transition: opacity 900ms ease, transform 1300ms cubic-bezier(.2, .8, .2, 1);
}

.story-stem {
  fill: none;
  stroke: #3c6d34;
  stroke-linecap: round;
  stroke-width: 12;
}

.story-needles {
  fill: none;
  stroke: #569742;
  stroke-linecap: round;
  stroke-width: 5;
}

.story-bloom {
  opacity: 0;
  transform: translateX(-16px) scale(0.92);
  transform-origin: 278px 525px;
  transition: opacity 1100ms ease, transform 1100ms cubic-bezier(.2, .8, .2, 1);
}

.story-bloom-disc {
  fill: #fbf7ef;
  stroke: #e82325;
  stroke-width: 4;
}

.story-page[data-story-phase="fire"] .story-fire {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

.story-page[data-story-phase="fire"] .story-forest {
  opacity: 0.55;
  transform: translateY(12px) scaleY(0.96);
}

.story-page[data-story-phase="ash"] .story-forest {
  opacity: 0.18;
  transform: translateY(35px) scaleY(0.82);
}

.story-page[data-story-phase="ash"] .story-ash {
  opacity: 0.7;
  transform: translateY(-30px);
}

.story-page[data-story-phase="ash"] .story-sun {
  opacity: 0.5;
  transform: scale(1.18);
}

.story-page[data-story-phase="growth"] .story-forest {
  opacity: 0.08;
}

.story-page[data-story-phase="growth"] .story-seed {
  opacity: 1;
  transform: translateY(0);
}

.story-page[data-story-phase="growth"] .story-sun,
.story-page[data-story-phase="bloom"] .story-sun {
  opacity: 0.75;
  transform: scale(1.28);
}

.story-page[data-story-phase="bloom"] .story-forest {
  opacity: 0.04;
}

.story-page[data-story-phase="bloom"] .story-seed {
  opacity: 0.82;
  transform: translateY(0);
}

.story-page[data-story-phase="bloom"] .story-bloom {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.story-grain {
  position: absolute;
  inset: -50%;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  transform: rotate(8deg);
}

.story-main,
.story-footer {
  position: relative;
  z-index: 1;
}

.story-chapter {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: 110px 20px 90px;
}

.story-copy {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: clamp(26px, 6vw, 52px);
  background: var(--story-panel);
  border: 1px solid color-mix(in srgb, var(--story-ink) 20%, transparent);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  transition: background 700ms ease, border-color 700ms ease, opacity 600ms ease, transform 700ms ease;
}

.story-ready .story-copy {
  opacity: 0.48;
  transform: translateY(30px);
}

.story-ready .story-chapter.is-active .story-copy {
  opacity: 1;
  transform: translateY(0);
}

.story-copy h1,
.story-copy h2 {
  max-width: 620px;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

.story-copy h1 {
  font-size: clamp(2.7rem, 8vw, 5rem);
}

.story-copy h2 {
  font-size: clamp(2.25rem, 8vw, 5rem);
}

.story-heading-line {
  display: block;
  white-space: nowrap;
}

.story-copy p {
  max-width: 58ch;
  margin: 20px 0 0;
  font-size: clamp(1rem, 2.2vw, 1.22rem);
}

.story-kicker {
  margin-top: 0 !important;
  color: var(--story-accent);
  font-size: 0.82rem !important;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 700ms ease;
}

.story-kicker + h1,
.story-kicker + h2 {
  margin-top: clamp(18px, 3vw, 28px);
}

.story-lede {
  font-size: clamp(1.08rem, 2.5vw, 1.35rem) !important;
}

.story-scroll {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 32px;
  color: var(--story-accent);
  font-weight: 900;
  text-decoration: none;
}

.story-scroll span {
  font-size: 1.5rem;
}

.story-final-line {
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--story-ink) 24%, transparent);
  font-family: "Liquid Unflow", Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 1.8rem) !important;
  line-height: 1.25;
}

.story-progress {
  position: fixed;
  top: 50%;
  right: 24px;
  z-index: 8;
  display: none;
  gap: 9px;
  transform: translateY(-50%);
}

.story-progress a {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--story-ink);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  opacity: 0.72;
  transition: color 700ms ease, opacity 300ms ease, transform 300ms ease;
}

.story-progress a[aria-current="step"] {
  opacity: 1;
  transform: translateX(-8px);
}

.story-progress span {
  color: var(--story-accent);
  transition: color 700ms ease;
}

.story-progress em {
  font-style: normal;
}

.story-footer {
  background: rgba(61, 18, 18, 0.96);
}

@media (min-width: 760px) {
  .story-landscape {
    right: -8vw;
    width: min(850px, 62vw);
  }

  .story-chapter {
    padding-right: 16vw;
    padding-left: 8vw;
  }

  .story-copy {
    width: min(100%, 720px);
    margin-left: 0;
  }

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

@media (min-width: 1100px) {
  .story-progress {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .story-page,
  .story-atmosphere *,
  .story-copy,
  .story-progress a {
    scroll-behavior: auto;
    transition-duration: 0.01ms !important;
  }

  .story-ready .story-copy {
    opacity: 1;
    transform: none;
  }
}

@supports not (color: color-mix(in srgb, white, black)) {
  .story-atmosphere::before {
    background: radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.15), transparent 25%);
  }

  .story-ground {
    fill: #23483c;
  }
}
