/*
  The author's little dragon, under the links on Book 1's right-hand page (r8). Book 2 does not have it. Pairs with dragon.js.

  The drawing is ink on nothing: one ink colour whose transparency is the pencil's darkness (the same way
  the eye drawing is made), so the page's own paper shows between the marks. No box, no edge.
  Without script, and under reduced motion, it is a still image. With script, dragon.js lays a canvas
  over the image and now and then bends the drawing's own tail and neck a little (see dragon.js).
  Sizes follow the page's width (container units), as the words above it do.
*/
.dragon {
  position: relative;
  width: 74cqi;
  aspect-ratio: 800 / 582;
}
/* Shown as drawn: head on the left, looking up and to the right, at the links above it. */
.dragon picture,
.dragon img {
  display: block;
  width: 100%;
  height: 100%;
}
.dragon__fx {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* While the canvas shows the drawing, the image stays in the page (and keeps its alt text) but is not painted. */
.dragon--live img { opacity: 0; }

/* Narrow pages (a short or small window): a little smaller, so it never crowds the links. */
@container (max-width: 320px) {
  .dragon { width: 66cqi; }
}
/* Phones: the page grows to fit, so the dragon can be larger. */
@media (max-width: 719.98px) {
  .dragon { width: 78cqi; }
}

/* The sequence: the dragon is the last thing drawn on the right page, and is done before the eye wakes. */
.bk-seq.w-on .words > :nth-child(9) { animation-delay: 0.9s; }

@media (prefers-reduced-motion: reduce) {
  .dragon__fx { display: none; }
  .dragon--live img { opacity: 1; }
}
