/* Independent planes: composition, pointer depth and entrance each own a wrapper. */
.layered-stage {
  isolation: isolate;
  transform: none !important;
  perspective: 1000px;
}
.stage-layer {
  position: absolute;
  pointer-events: none;
}
.stage-in-view .stage-layer {
  will-change: transform;
}
.layer-reveal {
  width: 100%;
  height: 100%;
  position: relative;
}
.stage-environment {
  inset: -8% -8% 2% -5%;
  z-index: 0;
  overflow: hidden;
}
.stage-environment .layer-reveal {
  background: url("assets/spring.webp") 3% 65% / 280% auto;
  mask-image: radial-gradient(ellipse at 58% 50%, black 25%, transparent 72%);
  opacity: 0.6;
}
.story-backdrop:first-child {
  object-position: 0 50%;
  width: 260%;
  max-width: none;
}
.stage-orbit {
  width: 88%;
  aspect-ratio: 1;
  right: 1%;
  top: -17%;
  z-index: 1;
  color: #e5d09b;
  opacity: 0.55;
}
.stage-orbit .layer-reveal {
  border: 1px solid #dfd6b65c;
  border-radius: 50%;
}
.stage-orbit i {
  position: absolute;
  inset: 8%;
  border: 1px dashed #dfd6b659;
  border-radius: 50%;
}
.stage-orbit b {
  position: absolute;
  top: 13%;
  left: 13%;
  font: 26px Georgia;
}
.stage-orbit span {
  position: absolute;
  top: 47%;
  left: -7%;
  font: 8px Georgia;
  letter-spacing: 0.25em;
  writing-mode: vertical-rl;
}
.stage-word {
  left: -4%;
  top: 22%;
  z-index: 1;
  color: #ebddba;
  opacity: 0.23;
  font:
    italic clamp(85px, 10.5vw, 155px) / 1 Georgia,
    serif;
  letter-spacing: -0.065em;
}
.stage-subject {
  z-index: 4;
  width: 84%;
  right: 1%;
  top: 1%;
}
.subject-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 575 / 484;
}
.stage-subject img {
  position: absolute;
  display: block;
  width: 290.7826%;
  max-width: none;
  height: auto;
  left: -93.2174%;
  top: -56.8182%;
  pointer-events: none;
  filter: drop-shadow(0 15px 13px #10221e48);
}
.stage-near {
  z-index: 6;
  inset: 8% -13% -6% -12%;
  color: #152f30;
}
.stage-botanical {
  width: 100%;
  height: 100%;
  stroke: #afbc9577;
  stroke-width: 1.3;
}
.stage-footnote {
  position: absolute;
  z-index: 7;
  right: 2%;
  bottom: -1%;
  font: 8px Georgia;
  letter-spacing: 0.2em;
  color: #e6d8b7;
}
.layered-stage .chapter-number {
  z-index: 0;
  top: -28%;
  opacity: 0.3;
}
.layered-stage .scene-main {
  z-index: 2;
  width: 49%;
  right: -5%;
  top: -10%;
  opacity: 0.8;
  transform: rotate(5deg);
  box-shadow: 0 15px 35px #0003;
}
.layered-stage .scene-main img,
.layered-stage .scene-main video {
  aspect-ratio: 16 / 9;
}
.layered-stage .scene-main:after {
  inset: -6px;
  border-color: #d3c8a650;
}
.layered-stage .scene-main figcaption {
  font-size: 6px;
  bottom: -20px;
  white-space: nowrap;
}
.layered-stage .scene-fragment {
  z-index: 5;
  width: 28%;
  bottom: 2%;
  left: -7%;
  border: 2px solid #d8dbc9;
  transform: rotate(-6deg);
}
.layered-stage .scene-fragment figcaption {
  font-size: 8px;
}
.layered-stage .scene-cross {
  display: none;
}
.layered-stage[data-stage="1"] .stage-environment {
  display: none;
}
.layered-stage[data-stage="1"] .scene-main {
  width: 99%;
  right: -5%;
  top: 2%;
  opacity: 1;
  transform: rotate(-3deg);
}
.layered-stage[data-stage="1"] .scene-main:after {
  inset: -10px;
}
.layered-stage[data-stage="1"] .stage-orbit {
  top: -12%;
  right: -2%;
  width: 100%;
}
.layered-stage[data-stage="1"] .stage-word {
  top: 62%;
  left: -8%;
  z-index: 3;
  color: #f1e6c9;
  opacity: 0.7;
  font-size: clamp(70px, 8vw, 128px);
}
.layered-stage[data-stage="1"] .stage-subject {
  width: 62%;
  right: -14%;
  top: -38%;
  overflow: hidden;
  rotate: 15deg;
}
.layered-stage[data-stage="1"] .subject-canvas {
  aspect-ratio: 1153 / 717;
}
.layered-stage[data-stage="1"] .stage-subject img {
  width: 145.01%;
  left: -45.01%;
  top: 0;
}
.layered-stage[data-stage="1"] .scene-fragment {
  left: -12%;
  bottom: -3%;
  width: 35%;
}
.wind-line {
  position: absolute;
  left: -6%;
  top: 30%;
  width: 108%;
  height: 20%;
  border-top: 1px solid #eee4c1aa;
  border-radius: 50%;
  transform: rotate(-18deg);
}
.wind-line:nth-child(2) {
  top: 60%;
  left: 5%;
  width: 90%;
  opacity: 0.4;
}
.wind-spark {
  position: absolute;
  top: 68%;
  left: 77%;
  font-size: 20px;
  color: #f5e5b1;
}
.layered-stage[data-stage="2"] .stage-environment .layer-reveal {
  background: radial-gradient(ellipse, #789d9860, transparent 65%);
  opacity: 1;
}
.layered-stage[data-stage="2"] .stage-subject {
  width: 122%;
  right: -14%;
  top: -7%;
  mask-image: linear-gradient(
    0deg,
    transparent,
    black 14%,
    black 94%,
    transparent
  );
}
.layered-stage[data-stage="2"] .subject-canvas {
  aspect-ratio: 1672 / 941;
}
.layered-stage[data-stage="2"] .stage-subject img {
  width: 100%;
  left: 0;
  top: 0;
  filter: drop-shadow(0 6px 20px #09172877);
}
.layered-stage[data-stage="2"] .scene-main {
  width: 94%;
  right: -5%;
  top: -7%;
  opacity: 0.54;
  transform: rotate(6deg);
}
.layered-stage[data-stage="2"] .stage-orbit {
  z-index: 3;
  width: 103%;
  right: -10%;
  top: -20%;
  color: #b6dccb;
}
.layered-stage[data-stage="2"] .stage-word {
  top: 67%;
  left: 0;
  font-size: clamp(60px, 7vw, 107px);
  opacity: 0.75;
  z-index: 5;
}
.layered-stage[data-stage="2"] .scene-fragment {
  width: 26%;
  bottom: 5%;
  left: -4%;
}
.spell-foreground {
  position: absolute;
  inset: 0;
  color: #bde1d0;
}
.spell-foreground i {
  position: absolute;
  width: 110%;
  height: 30%;
  top: 53%;
  left: -8%;
  border: 1px solid #bde1d078;
  border-radius: 50%;
  transform: rotate(-16deg);
}
.spell-foreground span {
  position: absolute;
  top: 12%;
  right: 7%;
  font: 45px Georgia;
}
.spell-foreground b {
  position: absolute;
  top: 90%;
  right: 0;
  font: 8px Georgia;
  letter-spacing: 0.35em;
}
.scene-replay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  color: #d9caa5;
  font: 20px Georgia;
  transition: color 0.3s;
}
.scene-replay small {
  font: 10px var(--serif);
}
.scene-replay:hover {
  color: #fff1c8;
}
.scene-replay:focus-visible {
  outline: 1px solid #e3cc95;
  outline-offset: 4px;
}
.story-turn-controls {
  gap: 14px;
}
.scene-replay span {
  display: inline-block;
  transition: rotate 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.scene-replay:hover span {
  rotate: -55deg;
}
.portrait-depth {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transform: translate3d(
    var(--character-depth-x, 0px),
    var(--character-depth-y, 0px),
    0
  );
}
.character-art .character-portrait {
  transform: none;
  transition: opacity 0.38s;
  height: 89%;
}
.character-art .character-portrait.is-active {
  transform: none;
}
.character-name-display {
  translate: calc(var(--character-depth-x, 0px) * -0.35) 0;
}
.character-front-word {
  position: absolute;
  z-index: 3;
  left: 30%;
  bottom: 11%;
  font:
    italic clamp(36px, 4.5vw, 70px) / 1 Georgia,
    serif;
  letter-spacing: -0.03em;
  color: #f8f2dc;
  mix-blend-mode: screen;
  text-shadow: 0 2px 24px #334c5b20;
  transform: translate3d(calc(var(--character-depth-x, 0px) * 1.45), 0, 0);
  pointer-events: none;
}
.character-art:after {
  content: "";
  position: absolute;
  z-index: 4;
  left: 4%;
  top: 16%;
  width: 87%;
  height: 76%;
  border: 1px solid #b8a87b66;
  clip-path: polygon(
    0 0,
    26% 0,
    26% 1%,
    0.2% 1%,
    0.2% 99%,
    99.8% 99%,
    99.8% 67%,
    100% 67%,
    100% 100%,
    0 100%
  );
  pointer-events: none;
}
@media (max-width: 1000px) and (min-width: 761px) {
  .stage-subject {
    top: 12%;
  }
  .stage-word {
    font-size: 90px;
  }
  .layered-stage[data-stage="2"] .stage-subject {
    top: 10%;
  }
}
@media (max-width: 760px) {
  .layered-stage {
    height: 44%;
    width: 86%;
    bottom: -1%;
    right: 0;
  }
  .stage-subject {
    width: 76%;
    right: 3%;
    top: -7%;
  }
  .stage-environment {
    inset: -18% -12% 7% -14%;
  }
  .stage-orbit {
    top: -32%;
    width: 89%;
  }
  .stage-word {
    font-size: 65px;
    left: -10%;
    top: 16%;
  }
  .stage-near {
    inset: 0 -13% -1% -15%;
  }
  .layered-stage .scene-main {
    width: 45%;
    right: -1%;
    top: -13%;
  }
  .layered-stage .scene-main figcaption {
    display: none;
  }
  .layered-stage .scene-fragment {
    width: 28%;
    left: -14%;
    bottom: 5%;
  }
  .layered-stage .scene-fragment figcaption {
    font-size: 6px;
  }
  .stage-footnote {
    bottom: 0;
    font-size: 6px;
    letter-spacing: 0.14em;
  }
  .layered-stage[data-stage="1"] .scene-main {
    width: 94%;
    right: 0;
  }
  .layered-stage[data-stage="1"] .stage-subject {
    width: 58%;
    right: -7%;
    top: -25%;
  }
  .layered-stage[data-stage="1"] .stage-word {
    font-size: 61px;
    top: 59%;
  }
  .layered-stage[data-stage="1"] .scene-fragment {
    width: 30%;
    bottom: 2%;
  }
  .layered-stage[data-stage="2"] .stage-subject {
    top: -8%;
    right: -5%;
    width: 121%;
  }
  .layered-stage[data-stage="2"] .scene-main {
    top: -7%;
    right: 0;
    width: 91%;
  }
  .layered-stage[data-stage="2"] .stage-word {
    font-size: 48px;
    top: 61%;
  }
  .layered-stage[data-stage="2"] .stage-orbit {
    top: -26%;
  }
  .layered-stage[data-stage="2"] .scene-fragment {
    width: 22%;
    left: -14%;
    bottom: 8%;
  }
  .spell-foreground b,
  .stage-orbit span {
    display: none;
  }
  .scene-replay {
    gap: 4px;
    order: 4;
  }
  .scene-replay small {
    display: none;
  }
  .story-turn-controls {
    gap: 10px;
  }
  .character-art .character-portrait {
    height: 106%;
  }
  .character-front-word {
    font-size: 41px;
    bottom: 10%;
    left: 26%;
  }
}
@media (max-height: 600px) {
  .compact-stage .layered-stage {
    position: absolute;
    width: 48%;
    height: 380px;
    top: 100px;
    bottom: auto;
    right: 0;
    margin: 0;
  }
  .compact-stage .stage-subject {
    width: 68%;
    right: 5%;
    top: 0;
  }
  .compact-stage .layered-stage[data-stage="2"] .stage-subject {
    width: 105%;
    right: -5%;
  }
  .compact-stage .layered-stage[data-stage="1"] .stage-subject {
    width: 50%;
  }
}
@media (max-height: 600px) and (max-width: 760px) {
  .compact-stage .layered-stage {
    width: 80%;
    height: 280px;
    top: 390px;
    right: 2%;
  }
}
.motion-paused .stage-layer,
.motion-paused .portrait-depth {
  will-change: auto;
}
@media (prefers-reduced-motion: reduce) {
  .stage-layer {
    will-change: auto;
  }
  .scene-replay span {
    transition: none;
  }
}
