:root {
  --bg: #080c11;
  --surface: rgba(10, 14, 20, 0.72);
  --surface-strong: rgba(7, 11, 17, 0.88);
  --text: #f3ead8;
  --text-strong: #fff4da;
  --text-soft: rgba(255, 237, 204, 0.72);
  --line: rgba(255, 237, 204, 0.12);
  --line-strong: rgba(255, 239, 208, 0.26);
  --shadow: rgba(0, 0, 0, 0.42);
  --shadow-elevated: rgba(0, 0, 0, 0.58);
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Baskerville, Georgia, serif;
  --font-body: "Baskerville Old Face", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --radius-lg: 1.35rem;
  --radius-xl: 1.95rem;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(248, 218, 158, 0.08), transparent 26%),
    linear-gradient(180deg, #0b1017 0%, #07090e 100%);
  color: var(--text);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.16), transparent 20%),
    radial-gradient(circle at 82% 10%, rgba(255, 217, 150, 0.08), transparent 18%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 11px
    );
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 218, 156, 0.05), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.34), transparent 56%);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  position: relative;
  overflow-x: clip;
}

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  justify-items: center;
  align-items: start;
  padding: clamp(0.8rem, 2.2vw, 1.2rem);
  background: var(--bg);
  overflow: clip;
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero::before {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 233, 189, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(6, 10, 16, 0.48) 0%, rgba(6, 10, 16, 0.18) 24%, rgba(6, 10, 16, 0.36) 100%);
  z-index: 1;
}

.hero::after {
  inset: clamp(0.8rem, 2.2vw, 1.2rem);
  border-radius: calc(var(--radius-xl) + 0.45rem);
  border: 1px solid rgba(255, 242, 215, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2.4rem 5rem rgba(0, 0, 0, 0.28);
  z-index: 1;
}

.dragon-grid {
  position: absolute;
  inset: clamp(0.8rem, 2.2vw, 1.2rem);
  display: flex;
  border-radius: calc(var(--radius-xl) + 0.45rem);
  overflow: hidden;
  border: 1px solid rgba(255, 241, 214, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2.2rem 4rem rgba(0, 0, 0, 0.3);
}

.dragon-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 15%),
    linear-gradient(0deg, rgba(3, 5, 9, 0.48), transparent 18%);
}

.dragon-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dragon-link {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: inherit;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 360ms var(--ease-smooth),
    filter 260ms ease,
    opacity 260ms ease,
    box-shadow 360ms ease;
}

.dragon-link + .dragon-link {
  box-shadow: inset 1px 0 0 rgba(255, 244, 221, 0.08);
}

.dragon-link::before,
.dragon-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.dragon-link::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.04)),
    var(--panel-image) var(--panel-position, center center) / cover no-repeat;
  transform: scale(1.02);
  transition:
    transform 780ms var(--ease-smooth),
    filter 360ms ease;
}

.dragon-link::after {
  background:
    linear-gradient(180deg, rgba(4, 6, 10, 0.12), rgba(4, 6, 10, 0.76)),
    linear-gradient(180deg, transparent 0%, rgba(4, 6, 10, 0.12) 42%, rgba(4, 6, 10, 0.78) 100%),
    radial-gradient(circle at 50% 100%, rgba(255, 246, 228, 0.18), transparent 32%);
  transition:
    opacity 360ms ease,
    background 360ms ease;
}

.dragon-link:hover,
.dragon-link:focus-visible,
.dragon-link.is-active {
  z-index: 2;
}

.dragon-link:focus-visible {
  outline: 2px solid rgba(255, 231, 190, 0.86);
  outline-offset: -4px;
}

.dragon-link:hover::before,
.dragon-link:focus-visible::before,
.dragon-link.is-active::before {
  transform: scale(1.08);
}

.dragon-link:hover::after,
.dragon-link:focus-visible::after,
.dragon-link.is-active::after {
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.08), rgba(4, 6, 10, 0.66)),
    linear-gradient(180deg, transparent 0%, rgba(4, 6, 10, 0.06) 40%, rgba(4, 6, 10, 0.8) 100%),
    radial-gradient(circle at 50% 100%, rgba(255, 248, 233, 0.24), transparent 34%);
}

.dragon-grid:hover .dragon-link {
  filter: saturate(0.58) brightness(0.66) blur(0.7px);
}

.dragon-grid:hover .dragon-link:hover,
.dragon-grid:hover .dragon-link:focus-visible,
.dragon-grid:hover .dragon-link.is-active {
  filter: saturate(1) brightness(1) blur(0);
}

.dragon-meta {
  position: absolute;
  inset: auto 0 clamp(1.4rem, 3vw, 2.2rem);
  z-index: 2;
  display: grid;
  gap: 0.42rem;
  justify-items: center;
  padding-inline: clamp(0.65rem, 1.4vw, 1rem);
  text-align: center;
  transition: transform 300ms var(--ease-smooth);
}

.dragon-meta::after {
  content: "";
  width: 2.6rem;
  height: 1px;
  margin-top: 0.05rem;
  background: linear-gradient(90deg, rgba(255, 245, 222, 0), rgba(255, 245, 222, 0.85), rgba(255, 245, 222, 0));
  opacity: 0.62;
  transition:
    width 300ms var(--ease-smooth),
    opacity 300ms ease,
    transform 300ms var(--ease-smooth);
}

.dragon-link:hover .dragon-meta,
.dragon-link:focus-visible .dragon-meta,
.dragon-link.is-active .dragon-meta {
  transform: translateY(-0.38rem);
}

.dragon-link:hover .dragon-meta::after,
.dragon-link:focus-visible .dragon-meta::after,
.dragon-link.is-active .dragon-meta::after {
  width: 3.5rem;
  opacity: 1;
  transform: translateY(0.08rem);
}

.dragon-label,
.dragon-subtitle,
.dragon-chapter,
.hero-byline,
.stage-world,
.stage-kicker,
.stage-panel__status {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.dragon-label {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.8vw, 1.72rem);
  font-weight: 700;
  color: rgba(255, 247, 232, 0.98);
  text-shadow: 0 0.24rem 1rem rgba(0, 0, 0, 0.38);
}

.dragon-subtitle {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: rgba(255, 241, 214, 0.76);
}

.dragon-chapter {
  margin-top: 0.16rem;
  padding: 0.46rem 0.84rem;
  border: 1px solid rgba(255, 236, 198, 0.22);
  border-radius: 999px;
  background: rgba(255, 246, 224, 0.08);
  backdrop-filter: blur(10px);
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: rgba(255, 247, 231, 0.88);
}

.hero-copy {
  position: relative;
  z-index: 5;
  align-self: start;
  width: min(38rem, calc(100% - 2rem));
  margin-top: clamp(1.6rem, 5vh, 3.2rem);
  padding: 0.4rem 1rem 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
  text-align: center;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: -1.4rem -2rem -1.6rem;
  z-index: -1;
  background:
    radial-gradient(circle at center, rgba(4, 7, 12, 0.88), transparent 64%),
    linear-gradient(180deg, rgba(4, 7, 12, 0.3), transparent 72%);
  filter: blur(22px);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 0.96;
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.9rem);
  color: var(--text-strong);
  text-shadow:
    0 0.4rem 1.6rem rgba(0, 0, 0, 0.48),
    0 0 1.8rem rgba(5, 10, 17, 0.34);
}

.hero-byline {
  margin: 0.82rem 0 0;
  font-family: var(--font-ui);
  font-size: clamp(0.78rem, 0.9vw, 0.92rem);
  color: rgba(255, 238, 207, 0.86);
  text-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.34);
}

.story-hub {
  position: relative;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 235, 196, 0.04), transparent 28%),
    linear-gradient(180deg, #04070b 0%, #05070a 100%);
  border-top: 1px solid var(--line);
}

.story-hub::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 248, 231, 0.04), transparent);
}

.story-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: stretch;
  gap: clamp(1rem, 2vw, 1.8rem);
  min-height: 100svh;
  width: 100%;
  padding: clamp(1rem, 4vw, 3rem);
  background-color: #0b1118;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  overflow: hidden;
  isolation: isolate;
  transition:
    background-image 420ms ease,
    background-color 420ms ease;
}

.story-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--overlay-left, rgba(6, 8, 12, 0.84)) 0%, var(--overlay-mid, rgba(6, 8, 12, 0.48)) 48%, var(--overlay-right, rgba(6, 8, 12, 0.72)) 100%);
  transition:
    opacity 360ms ease,
    transform 520ms ease;
  z-index: 0;
}

.story-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 14px
    );
  pointer-events: none;
  z-index: 0;
}

.story-stage.is-changing::before {
  opacity: 0.92;
  transform: scale(1.03);
}

.story-stage.is-changing .stage-panel {
  opacity: 0.08;
  transform: translateY(36px) scale(0.97);
  filter: blur(12px);
}

.story-stage.is-revealing .stage-panel {
  animation: panel-in 780ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.story-stage.is-revealing::before {
  animation: overlay-settle 860ms ease both;
}

.stage-backdrop {
  display: none;
}

.stage-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.stage-fx::before,
.stage-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
}

.stage-fx .fx-particle {
  position: absolute;
  left: var(--left, 50%);
  top: var(--top, 0%);
  width: var(--size, 0.6rem);
  height: var(--size, 0.6rem);
  opacity: 0;
}

.stage-panel {
  position: relative;
  z-index: 2;
  width: min(76rem, 100%);
  max-height: calc(100svh - clamp(5.5rem, 10vw, 8rem));
  display: flex;
  justify-self: center;
  align-self: center;
  overflow: hidden;
  margin: 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 241, 214, 0.16);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(180deg, rgba(8, 12, 19, 0.62), rgba(8, 12, 19, 0.86));
  box-shadow:
    0 2rem 4rem var(--shadow-elevated),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(120%);
  transition:
    opacity 280ms ease,
    transform 280ms ease,
    filter 280ms ease;
}

.stage-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.75rem, 3vw, 2.8rem) clamp(1.12rem, 2.5vw, 2.05rem) clamp(1.75rem, 3vw, 2.8rem) clamp(1.3rem, 2.8vw, 2.55rem);
}

.stage-panel::before,
.stage-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-panel::before {
  border-radius: inherit;
  background:
    radial-gradient(circle at top right, rgba(255, 249, 239, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%);
}

.stage-panel::after {
  inset: 1rem;
  border-radius: calc(2rem - 1rem);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.story-stage--panel-hidden .stage-panel {
  opacity: 0 !important;
  transform: translateY(2rem) scale(0.98);
  filter: blur(16px);
  pointer-events: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.story-stage--panel-hidden .stage-panel::before,
.story-stage--panel-hidden .stage-panel::after {
  opacity: 0;
}

.stage-scroll::-webkit-scrollbar {
  width: 0.42rem;
}

.stage-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border: 0.06rem solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.stage-scroll::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(244, 248, 255, 0.4), rgba(181, 205, 235, 0.18));
  border: 0.04rem solid transparent;
  background-clip: content-box;
  border-radius: 999px;
  min-height: 3.5rem;
}

.stage-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 229, 247, 0.36) rgba(255, 255, 255, 0.035);
}

.stage-panel__header,
.stage-scroll > h3,
.stage-scroll > .stage-body,
.story-credit {
  width: min(56rem, 100%);
  margin-inline: auto;
}

.stage-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid rgba(255, 241, 214, 0.12);
}

.stage-panel__meta {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.stage-panel__status {
  margin: 0;
  padding: 0.48rem 0.82rem;
  border: 1px solid rgba(255, 241, 214, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 239, 0.05);
  color: rgba(255, 239, 208, 0.72);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  white-space: nowrap;
}

.stage-world {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: rgba(255, 240, 212, 0.74);
}

.stage-kicker {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: rgba(255, 239, 209, 0.82);
}

h3 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 5vw, 5rem);
  color: #fff3d6;
  margin-bottom: 1.2rem;
  letter-spacing: 0.01em;
  text-align: left;
}

.stage-world:empty,
.stage-kicker:empty,
.stage-scroll > h3:empty {
  display: none;
}

.stage-panel p:not(.stage-world):not(.stage-kicker):not(.stage-panel__status) {
  margin: 0;
  max-width: none;
  font-size: clamp(1.02rem, 1.16vw, 1.16rem);
  line-height: 1.88;
  color: rgba(245, 236, 220, 0.88);
}

.stage-body p + p {
  margin-top: 0.92rem;
}

.stage-body {
  display: grid;
  row-gap: 1.1rem;
  white-space: normal;
  justify-items: stretch;
}

.stage-body > * {
  margin: 0 !important;
}

.stage-body h4 {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-top: 1.65rem;
  border-top: 1px solid rgba(255, 239, 208, 0.12);
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1.36vw, 1.24rem);
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 240, 212, 0.9);
  letter-spacing: 0.04em;
  text-transform: none;
  text-wrap: balance;
}

.stage-body h4:first-child {
  margin-top: 0 !important;
  padding-top: 0;
  border-top: 0;
}

.stage-body h4::before {
  content: "";
  flex: 0 0 2.2rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 241, 214, 0.78), transparent);
}

.stage-body p {
  margin: 0;
  width: 100%;
  max-width: none;
  font-size: clamp(1.03rem, 1.18vw, 1.18rem);
  line-height: 1.92;
  color: rgba(245, 236, 220, 0.9);
  text-align: left;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-shadow: 0 0.08rem 0.6rem rgba(0, 0, 0, 0.22);
  text-wrap: pretty;
}

.story-credit {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  padding: 0 0 0.3rem;
  font-family: var(--font-ui);
  font-size: clamp(0.78rem, 0.88vw, 0.94rem);
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: rgba(255, 239, 209, 0.72);
  text-align: center;
  text-shadow: 0 0.35rem 1.2rem rgba(0, 0, 0, 0.38);
  text-wrap: balance;
}

.story-credit::before {
  content: "";
  display: block;
  width: min(7rem, 38%);
  height: 1px;
  margin: 0 auto 0.85rem;
  background: linear-gradient(90deg, transparent, rgba(255, 241, 214, 0.76), transparent);
}

.stage-fx.is-active.stage-fx--winter::before {
  background:
    radial-gradient(circle at 50% 0%, rgba(221, 240, 255, 0.24), transparent 26%),
    linear-gradient(180deg, rgba(200, 230, 255, 0.2), transparent 48%);
  animation: wash-in 1600ms ease-out forwards;
}

.stage-fx.is-active.stage-fx--winter .fx-particle {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  animation: snow-fall var(--dur, 2200ms) linear forwards;
  animation-delay: var(--delay, 0ms);
}

.stage-fx.is-active.stage-fx--spring::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(181, 232, 150, 0.3), transparent 38%),
    radial-gradient(circle at 20% 100%, rgba(244, 191, 216, 0.16), transparent 22%),
    radial-gradient(circle at 80% 100%, rgba(244, 191, 216, 0.16), transparent 22%);
  animation: bloom-wash 1650ms ease-out forwards;
}

.stage-fx.is-active.stage-fx--spring .fx-particle {
  border-radius: 70% 35% 70% 35%;
  background:
    radial-gradient(circle at 35% 35%, #fffafb 0 24%, #ffdce8 25% 62%, #f3aec6 63% 100%);
  animation: petal-rise var(--dur, 1850ms) ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

.stage-fx.is-active.stage-fx--summer::before {
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 170, 86, 0.34), transparent 32%),
    linear-gradient(180deg, transparent 52%, rgba(255, 148, 72, 0.22) 100%);
  animation: ember-flash 1650ms ease-out forwards;
}

.stage-fx.is-active.stage-fx--summer::after {
  background:
    linear-gradient(110deg, transparent 0 30%, rgba(255, 214, 152, 0.2) 38%, rgba(48, 12, 4, 0.48) 54%, transparent 72%),
    radial-gradient(circle at 20% 100%, rgba(255, 185, 108, 0.2), transparent 28%),
    radial-gradient(circle at 80% 100%, rgba(255, 113, 52, 0.18), transparent 24%);
  clip-path: polygon(0 0, 0 100%, 36% 100%, 43% 0);
  transform-origin: left center;
  animation: burn-wipe 1500ms ease-out forwards;
}

.stage-fx.is-active.stage-fx--summer .fx-particle {
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(180deg, #fff2bf 0%, #ffb357 55%, #ff6b2a 100%);
  filter: blur(0.2px);
  animation: ember-rise var(--dur, 1450ms) ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

.stage-fx.is-active.stage-fx--fall::before {
  background:
    linear-gradient(180deg, rgba(255, 182, 111, 0.16), transparent 42%),
    radial-gradient(circle at 50% 0%, rgba(255, 214, 135, 0.14), transparent 22%);
  animation: wash-in 1500ms ease-out forwards;
}

.stage-fx.is-active.stage-fx--fall .fx-particle {
  border-radius: 70% 10% 70% 10%;
  background: linear-gradient(180deg, #ffdb84 0%, #e58a41 58%, #b94e26 100%);
  animation: leaf-fall var(--dur, 1900ms) ease-in forwards;
  animation-delay: var(--delay, 0ms);
}

.stage-fx.is-active.stage-fx--death::before {
  background: rgba(3, 5, 9, 0.9);
  animation: death-fade 1700ms ease-out forwards;
}

.stage-fx.is-active.stage-fx--death::after {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 20%);
  animation: death-core 1500ms ease-out forwards;
}

.winter {
  --panel-image: url("./assets/winter-dragon.jpeg?v=20260324-2");
  --panel-position: center 28%;
}

.spring {
  --panel-image: url("./assets/spring-dragon.jpeg?v=20260323-5");
  --panel-position: center 30%;
}

.summer {
  --panel-image: url("./assets/summer-dragon.jpeg?v=20260324-1");
  --panel-position: center 28%;
}

.fall {
  --panel-image: url("./assets/fall-dragon.jpeg?v=20260323-5");
  --panel-position: center 28%;
}

.death {
  --panel-image: url("./assets/death-dragon.jpeg?v=20260323-5");
  --panel-position: center 30%;
}

.story-stage[data-dragon="winter"] {
  background-image: url("./assets/winter.jpeg?v=20260323-5");
  --overlay-left: rgba(7, 17, 28, 0.82);
  --overlay-mid: rgba(7, 17, 28, 0.42);
  --overlay-right: rgba(7, 17, 28, 0.64);
}

.story-stage[data-dragon="winter"] .stage-panel {
  border-color: rgba(205, 228, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(230, 242, 255, 0.14), transparent 18%),
    linear-gradient(180deg, rgba(12, 22, 36, 0.7), rgba(8, 14, 24, 0.88));
  box-shadow:
    0 2rem 4rem rgba(2, 10, 20, 0.52),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.story-stage[data-dragon="winter"] .stage-panel__header {
  border-bottom-color: rgba(205, 228, 255, 0.16);
}

.story-stage[data-dragon="winter"] .stage-panel__status {
  border-color: rgba(205, 228, 255, 0.2);
  background: rgba(225, 240, 255, 0.08);
  color: rgba(228, 242, 255, 0.76);
}

.story-stage[data-dragon="winter"] .stage-world,
.story-stage[data-dragon="winter"] .stage-kicker {
  color: rgba(221, 239, 255, 0.78);
}

.story-stage[data-dragon="winter"] h3,
.story-stage[data-dragon="winter"] .stage-body h4 {
  color: #f3fbff;
}

.story-stage[data-dragon="winter"] .stage-body h4 {
  color: rgba(235, 245, 255, 0.84);
  border-top-color: rgba(221, 239, 255, 0.14);
}

.story-stage[data-dragon="winter"] .stage-body h4::before {
  background: linear-gradient(90deg, rgba(221, 239, 255, 0.82), transparent);
}

.story-stage[data-dragon="winter"] .stage-body p {
  color: rgba(239, 246, 255, 0.94);
}

.story-stage[data-dragon="spring"] {
  background-image: url("./assets/spring.jpeg?v=20260323-5");
  --overlay-left: rgba(10, 21, 12, 0.82);
  --overlay-mid: rgba(10, 21, 12, 0.4);
  --overlay-right: rgba(10, 21, 12, 0.62);
}

.story-stage[data-dragon="summer"] {
  background-image: url("./assets/summer.jpeg?v=20260323-5");
  --overlay-left: rgba(23, 13, 5, 0.82);
  --overlay-mid: rgba(23, 13, 5, 0.38);
  --overlay-right: rgba(23, 13, 5, 0.62);
}

.story-stage[data-dragon="fall"] {
  background-image: url("./assets/fall.jpeg?v=20260323-5");
  --overlay-left: rgba(22, 10, 6, 0.82);
  --overlay-mid: rgba(22, 10, 6, 0.4);
  --overlay-right: rgba(22, 10, 6, 0.62);
}

.story-stage[data-dragon="death"] {
  background-image: linear-gradient(180deg, #020304 0%, #0a0d13 100%);
  --overlay-left: rgba(3, 5, 8, 0.88);
  --overlay-mid: rgba(3, 5, 8, 0.7);
  --overlay-right: rgba(3, 5, 8, 0.88);
}

@keyframes wash-in {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes bloom-wash {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  35% {
    opacity: 1;
    transform: scale(1.06);
  }

  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes snow-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -12%, 0) scale(var(--scale, 1));
  }

  15% {
    opacity: 0.94;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 20px), 140%, 0) scale(var(--scale, 1));
  }
}

@keyframes petal-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 54px, 0) rotate(0deg) scale(0.4);
  }

  28% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 18px), -100px, 0) rotate(var(--rotate, 180deg)) scale(1.2);
  }
}

@keyframes ember-flash {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes burn-wipe {
  0% {
    opacity: 0;
    transform: scaleX(0.1);
  }

  30% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform: scaleX(1.35);
  }
}

@keyframes ember-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 28px, 0) rotate(0deg) scale(0.5);
  }

  25% {
    opacity: 0.96;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 14px), -130px, 0) rotate(var(--rotate, 30deg)) scale(1.2);
  }
}

@keyframes leaf-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -10px, 0) rotate(0deg) scale(0.5);
  }

  20% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--drift, -20px), 145%, 0) rotate(var(--rotate, 200deg)) scale(1.1);
  }
}

@keyframes death-fade {
  0% {
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes death-core {
  0% {
    opacity: 0;
    transform: scale(1.8);
  }

  30% {
    opacity: 0.65;
  }

  100% {
    opacity: 0;
    transform: scale(0.7);
  }
}

@keyframes panel-in {
  0% {
    opacity: 0;
    transform: translateY(36px) scale(0.97);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes overlay-settle {
  0% {
    opacity: 0.92;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .hero-copy {
    width: min(34rem, calc(100% - 1.2rem));
    margin-top: 1.6rem;
  }

  .dragon-meta {
    inset: auto 0 1.6rem;
  }

  .dragon-label {
    font-size: 1rem;
  }

  .dragon-subtitle {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }

  .dragon-chapter {
    padding: 0.42rem 0.72rem;
    font-size: 0.58rem;
  }

  .stage-panel__header {
    gap: 0.8rem;
  }

  .stage-panel__status {
    font-size: 0.64rem;
  }

}

@media (max-width: 640px) {
  .hero {
    padding: 0.65rem;
  }

  .hero::after,
  .dragon-grid {
    inset: 0.65rem;
  }

  .hero-copy {
    width: calc(100% - 1rem);
    margin-top: 1.4rem;
    padding: 0.35rem 0.7rem 0;
  }

  .hero-copy::before {
    inset: -1rem -0.8rem -1.1rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .hero-byline {
    font-size: 0.72rem;
  }

  .dragon-link {
    flex-basis: 20%;
  }

  .dragon-meta {
    inset: auto 0 0.95rem;
    gap: 0.22rem;
  }

  .dragon-label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  .dragon-subtitle {
    display: none;
  }

  .dragon-chapter {
    padding: 0.34rem 0.5rem;
    font-size: 0.52rem;
  }

  .story-stage {
    gap: 0.8rem;
    padding: 0.85rem;
  }

  .stage-panel {
    width: 100%;
    max-height: calc(100svh - 5.25rem);
    margin-top: 0.2rem;
  }

  .stage-panel::after {
    inset: 0.72rem;
    border-radius: calc(2rem - 0.72rem);
  }

  .stage-scroll {
    padding: 1.25rem 0.95rem 1.35rem 1rem;
  }

  .stage-panel__header,
  .stage-scroll > h3,
  .stage-scroll > .stage-body,
  .story-credit {
    width: 100%;
  }

  .stage-panel__header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
  }

  .stage-panel__status {
    align-self: flex-start;
  }

  h3 {
    font-size: 2.25rem;
  }

  .stage-body h4 {
    gap: 0.75rem;
    padding-top: 1.35rem;
    font-size: 1rem;
    letter-spacing: 0.03em;
  }

  .stage-body h4::before {
    flex-basis: 1.7rem;
  }

  .stage-body p {
    font-size: 1rem;
    line-height: 1.8;
  }

  .story-credit {
    padding-bottom: 0.1rem;
    font-size: 0.78rem;
  }

}

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

  .dragon-link,
  .dragon-link::before,
  .dragon-meta,
  .story-stage,
  .stage-panel {
    transition: none;
  }

  .story-stage.is-revealing .stage-panel,
  .story-stage.is-revealing::before,
  .stage-fx,
  .stage-fx::before,
  .stage-fx::after,
  .stage-fx .fx-particle {
    animation: none !important;
  }
}
