/* BOOK_SCROLL — the site as a book (static/book.js builds the leaves; nothing here applies until it has). */
.bk-on .bk-leaf {
  position: relative;
  z-index: calc(40 - var(--i));
  pointer-events: none;
}
/* lead + page + turn. The heights follow the content, so a scene that grows a page is allowed for at once. The room
   is real content (a sticky box may only travel inside its container's content, never into padding): after the hold
   for the lead, after the page for the turn. */
.bk-on .bk-leaf::after { content: ""; display: block; height: var(--tin); }
.bk-on .bk-hold::after { content: ""; display: block; height: var(--tout); }
.bk-on .bk-leaf + .bk-leaf {
  /* each leaf starts underneath the last screen of the one before it */
  margin-top: calc(-1 * (var(--bk-lvh) + var(--tin)));
}
.bk-on .bk-hold {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
}
/* the page's own styles may say position: relative; the book's layout has to win */
html.bk-on .bk-page {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: calc(var(--bk-lvh) - var(--h)) !important;
  bottom: auto !important;
  min-height: var(--bk-lvh);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: auto;
}
/* a text column gathered into pages: each sheet is the full width of the screen, its column inside */
.bk-on .bk-sheet {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.bk-on .bk-sheet.bk-first { justify-content: flex-start; }
.bk-on .bk-sheet > * { flex: 0 0 auto; width: 100%; min-height: 0; }
.bk-canvas {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 45;
  display: none;
  width: 100%;
  height: var(--bk-lvh, 100vh);
  pointer-events: none;
}
/* the turn is the browser's own scrolling: no snapping, no smooth-scroll fighting the settle */
html.bk-on { scroll-snap-type: none !important; scroll-behavior: auto !important; }

/* ---------- Stocgle's home page ---------- */
/* every sheet is opaque paper in the page's own ink, so the sheet underneath never shows through */
.bk-spread { background: var(--ink); }
/* the first sheet is the hero and the tape together: exactly one screen */
.bk-want .ticker { height: 60px; }
.bk-want .hero { height: calc(100vh - 60px); min-height: 620px; }
/* the story's sheet ends on the two lines alone, filling the screen, before it lifts */
.bk-on .bridge { min-height: var(--bk-lvh); display: flex; flex-direction: column; justify-content: center; }
