/* Telling Tales in Nature only: the climb up through Lydia Hall's cover, and the reading below it.
   One accent sampled from the cover's foreground leaves. */
:root { --leaf: #99af5b; }

/* ---------- the four books: a cover-shaped window, the four covers brought up into it by the reader's scroll ---------- */
.dig { position: relative; height: 340vh; }
.dig .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; padding: 4.5rem var(--gutter) 1.2rem; }
.dig h1 { font-size: clamp(3rem, 12vw, 6.4rem); margin: 0 0 .9rem; color: var(--paper); }
/* the window: its size is set by js from the height actually left on the stage (this is the fallback); the pane
   clips the books, so each one rises in from under the window's foot. The frame (::before) gives way as the four
   are dealt out side by side (--frame, from js). */
.well { position: relative; aspect-ratio: 2 / 3; width: min(100% - 26px, calc((100svh - 330px) * .667)); background: var(--ground); }
.well::before { content: ''; position: absolute; inset: -1px; border: 1px solid var(--rule); pointer-events: none; opacity: var(--frame, 1); }
.well .pane { position: absolute; inset: 0; overflow: hidden; }
.book { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; will-change: transform; box-shadow: 0 0 22px rgba(0, 0, 0, .55); }
.book img { display: block; width: 100%; height: 100%; max-width: none; }
.book .shade { position: absolute; inset: 0; background: var(--ground); opacity: 0; will-change: opacity; }
/* the first frame before js draws: Underworld in the window, the other three waiting under its foot (js writes the same) */
html.js:not(.still) .book + .book { transform: translate3d(0, calc(100% + 30px), 0); }
/* the four tales in her order; in motion the lit one is the book in the window */
.tales { list-style: none; margin: .5rem 0 .9rem; padding: 0; }
.tales li { font-family: var(--cap); font-size: clamp(1.5rem, 6vw, 2rem); letter-spacing: .05em; line-height: 1.15; color: var(--leaf); will-change: opacity; }
@media (min-width: 700px) {
  .dig .stage { justify-content: center; padding: 2rem var(--gutter); }
  .dig .in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 4vw, 4rem); align-items: center; width: 100%; }
  .dig h1 { margin-bottom: 1.6rem; }
  .well { width: min(100%, calc(84svh * .667)); order: 2; justify-self: center; }
  .tales { margin: 0; }
  .tales li { font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.2; }
}
@media (min-width: 700px) and (max-width: 899px) {
  .dig h1 { font-size: clamp(3rem, 7.4vw, 4.4rem); }
}
/* reduced motion or no JavaScript: the four covers still, two by two, and the four tales written out */
html.still .dig, html:not(.js) .dig { height: auto; }
html.still .dig .stage, html:not(.js) .dig .stage { position: relative; height: auto; display: block; padding-top: clamp(3.5rem, 9vw, 7rem); padding-bottom: 2rem; }
html.still .well, html:not(.js) .well { width: min(460px, 100% - 26px); aspect-ratio: auto; background: none; }
html.still .well::before, html:not(.js) .well::before { content: none; }
html.still .well .pane, html:not(.js) .well .pane { position: static; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
html.still .book, html:not(.js) .book { position: relative; height: auto; transform: none !important; }
html.still .book img, html:not(.js) .book img { height: auto; }
html.still .book .shade, html:not(.js) .book .shade { display: none; }
html.still .tales, html:not(.js) .tales { margin: 1rem 0 1.4rem; }
html.still .tales li, html:not(.js) .tales li { opacity: 1 !important; font-size: 1.6rem; padding: .3rem 0; }
@media (min-width: 700px) {
  html.still .dig .in, html:not(.js) .dig .in { align-items: start; }
  html.still .well, html:not(.js) .well { order: 0; justify-self: start; width: min(460px, 100%); }
}

/* ---------- the reading below: her words on the hero title's left edge, the compendium's own cover beside them (still) ---------- */
.compendium .read { display: grid; grid-template-areas: "h" "c" "w"; justify-items: start; }
.compendium h2 { grid-area: h; }
.compendium .cover { grid-area: c; margin: .4rem 0 2.2rem; height: auto; }
.compendium .words { grid-area: w; }
@media (min-width: 860px) {
  .compendium .read { grid-template-columns: minmax(0, 38rem) auto; grid-template-areas: "h c" "w c"; grid-template-rows: auto 1fr; column-gap: clamp(3rem, 7vw, 7rem); align-items: start; justify-content: space-between; }
  .compendium .cover { margin: .6rem 0 0; }
}
.compendium h2 { color: var(--leaf); --reg-ink: var(--paper); } /* the register (site.js): "Four books in one" in leaf green, its second impression in paper, as the lettering on the cover is paper among leaves */
.classics { color: var(--soft); font-size: 1.05rem; margin-top: 1.6rem; }
