/* The three volumes as objects: a cloth cover set as the real one is, standing as a small 3D book, whose
   cloth gives way to stills from that volume's part of the story (js/covers.js).
   Used by the Grand Narrative page's trilogy band (grand-narrative.html, where it is loaded after
   css/page.css: these rules were in that file until 2026-11-21 and keep their place in the order) and by the
   home page's offer, where a volume's row opens under the pointer and its book stands at the right
   (css/site.css .gn__volumes, js/volumes.js). */

.vol--i { --cloth: var(--forest); --cloth-ink: var(--gold); }
.vol--ii { --cloth: var(--sage); --cloth-ink: var(--gold); }
.vol--iii { --cloth: var(--oat); --cloth-ink: var(--gold-deep, #9c7a46); } /* the foil reads deeper on the pale linen */
.vol__cover {
  /* set as the real cover is: the title in serif capitals at the upper left, a rule, the volume's
     name beneath, the mark at the foot; all in the foil's gold */
  position: relative;
  container-type: inline-size;
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  overflow: hidden;
  padding: 11% 9% 9%;
  background: var(--cloth);
  color: var(--cloth-ink);
  font-family: 'EB Garamond', Georgia, serif;
  text-align: left; /* whatever the text around the book does: in a centred column the title was centred too, which the real cover is not */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 50px rgba(40, 30, 10, 0.16);
  transition: color 0.5s ease;
}
.vol__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(../assets/img/gn/cloth.png) center / 420px repeat;
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.vol__face { position: relative; z-index: 1; display: block; }
.vol__title {
  display: block;
  font-weight: 500;
  font-size: 10.2cqw;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.12);
}
.vol__rule { display: block; width: 88%; height: 1px; margin: 5.5% 0 4.5%; background: currentColor; opacity: 0.85; }
.vol__sub { display: block; font-weight: 500; font-size: 4.2cqw; letter-spacing: 0.12em; text-transform: uppercase; }
.vol__mark {
  position: absolute;
  left: 9%;
  bottom: 4.5%; /* nearer the foot, as the foil sits on the real cover (user's note, 2026-11-08) */
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 1.8cqw;
  font-family: Jost, system-ui, sans-serif;
  font-size: 2.1cqw;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}
.vol__mark img { display: block; width: 11cqw; height: 11cqw; }
.vol__mark span { display: block; }
/* under the pointer the cloth gives way to stills from that volume's part of the story, one after
   another, the cover's lettering staying over them on a shade */
.vol__slides { position: absolute; inset: 0; z-index: 0; }
.vol__slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.vol__slides img.is-on { opacity: 1; }
.vol__slides::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(7, 17, 11, 0.62), rgba(7, 17, 11, 0) 58%),
    linear-gradient(to top, rgba(7, 17, 11, 0.55), rgba(7, 17, 11, 0) 34%);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.vol__cover.is-live { color: var(--gold); }
.vol__cover.is-live::before { opacity: 0; }
.vol__cover.is-live .vol__slides::after { opacity: 1; }
/* The covers as books (.vols--books on the list; 2026-11-11, after the closed book in the reader). Without
   that class everything here is inert and the covers are the flat cards they were: the wrappers
   (.vol__book, .vol__turn, .vol__obj) are plain blocks and the three extra faces are not shown.
   A book is a small 3D object (.vol__obj): the cover is its front board, brought forward by half the
   book's thickness; a spine stands at its left; its head, the top face, shows the two boards with the
   block of pages set back between them and the headband where the pages meet the spine; its
   shadow lies on the surface it stands on, behind it and to the right. It is turned so the spine
   shows and seen from a little above (.vol__turn's perspective-origin), as a book standing on a
   table is, which is what brings the pages into view: straight on, neither the head nor the foot
   of a standing book can be seen. Under the pointer it comes round a little toward the reader.
   Every length is taken from the cover's own width (cqw of .vol__book), so it holds at any size. */
.vol__shade, .vol__spine, .vol__head { display: none; }
/* the books are smaller than their columns (the user found them too big filling them), set to the
   left over their text; on a phone the cover has its own narrow column and fills that */
.vols--books .vol__book { container-type: inline-size; width: 68%; }
.vols--books .vol__turn { perspective: 430cqw; perspective-origin: 50% -38%; }
.vols--books .vol__obj {
  --t: 12cqw; /* the book's thickness */
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(17deg);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.vols--books .vol__book:hover .vol__obj { transform: rotateY(9deg); }
/* on the Grand Narrative page a book is a button: a click opens See inside on that volume's chapter (js/gn-page.js) */
.vols .vol__book { cursor: pointer; }
.vols .vol__book:focus-visible { outline: 1px solid var(--gold-deep, #9c7a46); outline-offset: 8px; }
.vols--books .vol__cover {
  transform: translateZ(calc(var(--t) / 2));
  border-radius: 1px 2px 2px 1px; /* a board's corners are barely eased: a rounder one let the head show through it */
  /* the board's own edges: light along the top and the spine side, shade along the foot and the fore-edge */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 1px 0 0 rgba(255, 255, 255, 0.05), inset -1px 0 0 rgba(0, 0, 0, 0.26), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}
.vols--books .vol__cover::before { opacity: 0.62; } /* the weave, a little more present on an object */
/* on the cloth: the joint (the groove beside the spine that the board hinges on), the cloth rolling over
   into the spine, light falling across the board from the upper left and thinning toward the foot;
   over the stills too, so the book keeps its form */
.vols--books .vol__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0) 3.2%, rgba(0, 0, 0, 0.34) 4.3%, rgba(0, 0, 0, 0.14) 5.1%, rgba(255, 255, 255, 0.12) 5.9%, rgba(255, 255, 255, 0) 7.6%),
    linear-gradient(to right, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.06) 1.6%, rgba(0, 0, 0, 0) 3.2%),
    radial-gradient(ellipse 90% 60% at 22% 8%, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0) 70%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.14)),
    linear-gradient(to right, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.08));
}
/* the lettering is foil stamped into the cloth: a hair of shade above each stroke and of light beneath it */
.vols--books .vol__title,
.vols--books .vol__sub { text-shadow: 0 -0.5px 0 rgba(0, 0, 0, 0.32), 0 0.6px 0 rgba(255, 255, 255, 0.14); }
.vols--books .vol__rule { box-shadow: 0 -0.5px 0 rgba(0, 0, 0, 0.3), 0 0.6px 0 rgba(255, 255, 255, 0.12); }
.vols--books .vol__spine,
.vols--books .vol__head,
.vols--books .vol__shade { display: block; position: absolute; pointer-events: none; }
.vols--books .vol__spine {
  left: 0;
  top: 0;
  height: 100%;
  width: var(--t);
  transform-origin: left center;
  transform: translateZ(calc(var(--t) / -2)) rotateY(-90deg);
  border-radius: 1px;
  /* across it from the back board (left) to the front (right): rounded, so it is lit toward the front and
     shaded behind, with the shoulder of each joint a thin line of shade at either edge; darker toward the foot */
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.16)),
    linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3) 7%, rgba(0, 0, 0, 0.16) 40%, rgba(255, 255, 255, 0.13) 76%, rgba(255, 255, 255, 0.04) 92%, rgba(0, 0, 0, 0.22)),
    var(--cloth) url(../assets/img/gn/cloth.png) 0 0 / 256px repeat;
}
.vols--books .vol__head {
  left: 0;
  bottom: 100%;
  width: 100%;
  height: var(--t);
  transform-origin: bottom center;
  transform: translateZ(calc(var(--t) / 2)) rotateX(90deg);
  /* seen from above, from the front board (its lower edge) to the back: board; the pages, a little in the
     boards' shadow since they sit lower than the boards do; board. The pages run almost to the fore-edge
     (a sliver of shaded cloth beyond them, not the dark block it was) and round into the spine behind the
     headband, the small striped band sewn across the top of the spine. */
  background:
    linear-gradient(to top, var(--cloth) 0 7%, rgba(0, 0, 0, 0) 7% 93%, var(--cloth) 93%),
    linear-gradient(to top, rgba(0, 0, 0, 0) 0 7%, rgba(0, 0, 0, 0.42) 7%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.2) 93%, rgba(0, 0, 0, 0) 93%),
    linear-gradient(to right, var(--cloth) 0 2.6%, rgba(0, 0, 0, 0) 2.6% 98.6%, var(--cloth) 98.6%),
    linear-gradient(to right, rgba(0, 0, 0, 0) 97.4%, rgba(0, 0, 0, 0.3) 98.6%, rgba(0, 0, 0, 0.3)),
    repeating-linear-gradient(to top, #c9a86c 0 1.5px, #f0e4c8 1.5px 3px) 2.7% 50% / 2.6% 84% no-repeat,
    linear-gradient(to right, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0.22) 5.4%, rgba(0, 0, 0, 0) 11%),
    linear-gradient(to right, rgba(120, 96, 50, 0.1), rgba(120, 96, 50, 0) 30%, rgba(120, 96, 50, 0.06)),
    repeating-linear-gradient(to top, #f6f1e6 0 1px, #ddd5c2 1px 2px, #ece5d4 2px 3px);
}
/* the shadow lies on the surface the book stands on: a plane at its foot running back from the front
   board, wider than the book so it reaches out to the right (the light is from the upper left, in front),
   leaned that way, deepest against the book and gone within a book's thickness or two */
.vols--books .vol__shade {
  left: -3%;
  top: 100%;
  width: 190%;
  height: calc(var(--t) * 3.4);
  transform-origin: 0 0;
  transform: translateZ(calc(var(--t) / 2)) rotateX(-90deg) skewX(34deg);
  background: linear-gradient(to right, rgba(28, 22, 10, 0) 0, rgba(28, 22, 10, 0.5) 4%, rgba(28, 22, 10, 0.44) 46%, rgba(28, 22, 10, 0.2) 62%, rgba(28, 22, 10, 0) 86%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.75) 30%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, 0.75) 30%, rgba(0, 0, 0, 0) 100%);
  filter: blur(1.6cqw);
}
@media (prefers-reduced-motion: reduce) { .vols--books .vol__obj { transition: none; } }
@media (max-width: 900px) {
  .vols--books .vol__book { width: auto; }
  /* the text stands close beside the cover here: the shadow is kept short of it */
  .vols--books .vol__shade { width: 118%; height: calc(var(--t) * 2.2); transform: translateZ(calc(var(--t) / 2)) rotateX(-90deg) skewX(20deg); }
}
