@supports (overflow: clip) {
  body:not(.overlay-open) { overflow-x: clip; }
}

.story {
  --story-header: 3.5rem;
  --story-gutter: clamp(1.25rem, 5vw, 4.5rem);
  --story-shade: linear-gradient(90deg, rgb(19 16 15 / 88%), rgb(19 16 15 / 77%) 42%, rgb(19 16 15 / 50%) 65%, rgb(19 16 15 / 8%)),
    linear-gradient(0deg, rgb(19 16 15 / 40%), transparent 45%);
}
.story-intro {
  width: min(100%, 80rem);
  margin-inline: auto;
  padding: clamp(3.75rem, 9vw, 8rem) var(--story-gutter) clamp(2.25rem, 5vw, 4rem);
}
.story-intro h2 {
  font: 500 clamp(2rem, 4.4vw, 3.65rem)/1.2 "Noto Serif SC", "Songti SC", serif;
}
.story-intro p { margin-top: .75rem; max-width: 34ch; line-height: 1.65; }

.story-sequence {
  background: #201b1d;
  color: #fff8eb;
}
.story-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-block-size: clamp(25rem, 70svh, 43rem);
  display: grid;
  align-items: center;
  padding: clamp(3.25rem, 9vw, 8rem) max(var(--story-gutter), calc((100% - 80rem) / 2 + var(--story-gutter)));
}
.story-copy { position: relative; z-index: 1; max-width: 30rem; }
.story-kicker { color: #f6d6bd; letter-spacing: .14em; font: 500 .85rem/1.5 system-ui, sans-serif; }
.story-ice .story-kicker { color: #c2e6e9; }
.story-dialogue .story-kicker { color: #f5cbd7; }
.story-copy h3 {
  margin: .33em 0 .4em;
  font: 500 clamp(2.15rem, 5.15vw, 4.8rem)/1.15 "Noto Serif SC", "Songti SC", serif;
  text-wrap: balance;
}
.story-description {
  max-width: 24em;
  color: #f7ebdc;
  font-size: clamp(.97rem, 1.5vw, 1.13rem);
  line-height: 1.76;
  text-wrap: pretty;
}
.story-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: .5em;
  margin-top: 1.1rem;
  font: 500 .91rem/1.5 system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: .35rem;
}
.story-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.story-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  margin: 0;
  pointer-events: none;
}
.story-visual { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-stone { background: #736858; }
.story-stone img { object-position: 60% 45%; }
.story-water { background: #253c46; }
.story-water img { object-position: 51% 48%; }
.story-voices {
  background: radial-gradient(ellipse at 76% 27%, #765461, #4a3344 46%, #251e28 90%);
}
.story-voice-mark {
  display: grid;
  grid-auto-flow: column;
  place-content: center end;
  padding-inline-end: clamp(3rem, 15vw, 17rem);
  gap: .05em;
  color: #e9b6c7;
  font: 400 clamp(8rem, 18vw, 20rem)/.65 Georgia, serif;
}
.story-voice-mark span:first-child { transform: translateY(.1em); color: #f7d9bf; }
.story-voice-mark span:last-child { transform: translateY(.35em); }
.story-panel::after, .story-window::after {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--story-shade);
  pointer-events: none;
}

.story-canvas[hidden] { display: none; }
.story-enhanced .story-sequence {
  display: grid;
  align-items: start;
  isolation: isolate;
}
.story-enhanced .story-canvas, .story-enhanced .story-chapters { grid-area: 1 / 1; }
.story-enhanced .story-canvas {
  position: sticky;
  top: var(--story-header);
  height: calc(100svh - var(--story-header));
  pointer-events: none;
}
.story-enhanced .story-chapters {
  z-index: 1;
  display: grid;
  grid-auto-rows: 1fr;
}
.story-enhanced .story-scene { min-block-size: clamp(27rem, 78svh, 49rem); }
.story-enhanced .story-panel { height: 100%; min-block-size: 0; background: transparent; }
.story-enhanced .story-panel::after { display: none; }
.story-window { position: relative; height: 100%; overflow: hidden; isolation: isolate; }
.story-window .story-art { inset-block: -9%; }

@media (max-width: 759px) {
  .story {
    --story-shade: linear-gradient(0deg, rgb(19 16 15 / 94%), rgb(19 16 15 / 77%) 38%, rgb(19 16 15 / 45%) 75%, rgb(19 16 15 / 36%));
  }
  .story-panel {
    align-items: end;
    min-block-size: clamp(23rem, 75svh, 36rem);
    padding: 3rem var(--story-gutter) clamp(3.5rem, 11svh, 7rem);
  }
  .story-enhanced .story-scene { min-block-size: clamp(26rem, 77svh, 42rem); }
  .story-copy { isolation: isolate; }
  .story-copy::before {
    content: "";
    position: absolute;
    inset: -3.75rem -6rem;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at 33% 50%, rgb(19 16 15 / 74%) 17%,
      rgb(19 16 15 / 66%) 56%, rgb(19 16 15 / 42%) 76%, transparent 100%);
  }
  .story-copy h3 { font-size: clamp(2rem, 8.5vw, 3.3rem); }
  .story-link { min-height: 48px; }
  .story-description { line-height: 1.65; }
  .story-stone img { object-position: 67% 47%; }
  .story-water img { object-position: 51% center; }
  .story-voice-mark {
    place-content: start center;
    padding: 33% 0 0;
    font-size: clamp(8rem, 37vw, 14rem);
  }
  body[data-page="home"] .glass-nav {
    background: #f8f5ee;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .dark body[data-page="home"] .glass-nav { background: #181713; }
}
