.reading-room {
  --room-paper: #f3f1e7; --room-ink: #112f4c;
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(ellipse at 53% 22%,#446780,#203e59 62%,#132e47);
}
.currents { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.shelf { display: flex; align-items: center; justify-content: center; perspective: 1200px;
  padding: clamp(55px,7vw,110px) 6%; gap: clamp(8px,2vw,34px); }
.volume {
  --angle: -7deg; --raise: 3%; --gather-x: 38%; --gather-angle: 11deg;
  width: 29%; max-width: 315px; aspect-ratio: 2/3; position: relative; isolation: isolate;
  cursor: pointer; text-align: left; color: var(--room-ink); padding: 0; border: 0;
  background: var(--room-paper); box-shadow: 3px 3px #c8cabe,5px 5px #808b90,0 20px 30px -13px #020e1deb;
  transform: translate(calc(var(--gather,0) * var(--gather-x)),calc(var(--raise) + var(--drift,0) * 9px)) rotate(calc(var(--angle) + var(--gather,0) * var(--gather-angle)));
  transition: transform .55s cubic-bezier(.16,.75,.22,1), box-shadow .45s;
}
.volume:nth-child(2) { --angle: 1deg; --raise: -4%; --gather-x: 0%; --gather-angle: -4deg; }
.volume:nth-child(3) { --angle: 7deg; --raise: 5%; --gather-x: -38%; --gather-angle: -12deg; }
.volume:is(:focus-visible,:hover) { --angle: 0deg; --raise: -8%; z-index: 2; }
.volume::after { content: ''; pointer-events: none; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(90deg,#10243766,transparent 2%,#f2f0df44 3%,transparent 5%);
  box-shadow: inset 0 0 0 1px #c9d4dd33; }
.volume-title { position: absolute; inset: 8% 7% auto 9%; font: 500 clamp(23px,3.55vw,65px)/.91 var(--serif);
  letter-spacing: -.068em; }
.open-volume { position: absolute; bottom: 7%; left: 9%; padding: .38em .65em; border-radius: 2em;
  color: #15324a; background: #f3f2e9; font: 550 .75rem/1.25 var(--grotesk); }
.cover-art { position: absolute; inset: 0; overflow: hidden; background-size: cover; background-position: center; }
[data-book=water] { background-color: #e6ebe2; }
[data-book=water] .cover-art { background-image: linear-gradient(#ebefe6 4%,#ebefe6ed 24%,transparent 63%),url("./swell.webp"); background-position: center,48% 58%; }
[data-book=watch] { color: #f0efe5; }
[data-book=watch] .cover-art { background-image: linear-gradient(#071d31bb,transparent 65%),url("../night-tide/coast.webp"); background-position: center,83% center; }
[data-book=light] .cover-art { background: linear-gradient(150deg,#dee5dc,#aac4cd 62%,#567e92); }
[data-book=light] .cover-art::before { content: ''; position: absolute; width: 150%; height: 99%; border-radius: 50%; left: -28%; bottom: -29%;
  background: repeating-radial-gradient(ellipse at 50% 49%,#183b56 0 1px,transparent 2px 5px); transform: rotate(-26deg); }
[data-book=light] .cover-art::after { content: ''; position: absolute; width: 27%; aspect-ratio: 1; top: 41%; right: 16%; border-radius: 50%;
  background: #f4f2dd; mix-blend-mode: screen; box-shadow: 0 0 32px #f6f2db66; }
.room-page { position: relative; margin: clamp(16px,3.4vw,54px); display: grid; grid-template-columns: .76fr 1.24fr;
  background: var(--room-paper); box-shadow: 0 18px 36px -18px #081b32bf; color: var(--room-ink); }
.frontispiece { position: relative; min-height: clamp(360px,34vw,550px); overflow: hidden; isolation: isolate; }
.frontispiece .cover-art { z-index: -1; }
.print-initial { position: absolute; inset: 12% 0 0; display: grid; place-content: center; font: italic 400 clamp(130px,24vw,365px)/1 var(--serif);
  color: #fff; mix-blend-mode: difference; opacity: .8; }
.room-text { padding: clamp(22px,3.1vw,50px); align-self: center; }
.room-text button { cursor: pointer; }
.to-shelf, .write-note, .keep-note { background: transparent; border: 0; color: var(--room-ink); padding: .55em 0; font: var(--control); }
.room-text h3 { font: 500 clamp(33px,3.6vw,66px)/.98 var(--serif); letter-spacing: -.045em; margin: .38em 0 .55em; }
.room-text h3:focus { outline: none; }
.room-text p:not(.room-hint), .pull-line { font: 400 clamp(19px,1.6vw,28px)/1.38 var(--serif); }
.pull-line { display: block; color: inherit; border: 0; background: none; text-align: left; padding: .45em 0;
  text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; text-decoration-color: #7991a6; }
.room-page.is-focused .pull-line { font-size: clamp(25px,2.3vw,40px); letter-spacing: -.03em; text-decoration-color: #184f7c; }
.room-page.is-focused :is(.opening-line,.closing-line) { color: #516573; }
.room-hint { font: var(--caption); color: #496078; margin: 1.1em 0 0; }
.line-tools { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 16px; }
.ink-switch { display: flex; border: 1px solid #42648077; border-radius: 30px; overflow: hidden; }
.ink-switch button { border: 0; color: inherit; padding: .55em .85em; background: transparent; font: var(--control); }
.ink-switch button[aria-pressed=true], .keep-note { color: var(--room-paper); background: var(--room-ink); }
.ink-switch button:focus-visible { outline-offset: -3px; }
.pencil { margin: 12px 0 0; padding-left: 15px; border-left: 2px solid #7998af; }
.pencil label { display: block; margin-bottom: .45em; font: var(--caption); }
.pencil textarea { display: block; width: 100%; resize: vertical; font: italic 1.12rem var(--serif); background: transparent; color: inherit; border: 1px solid #728794; padding: .45em; }
.keep-note { margin-top: .5em; padding: .5em .8em; border-radius: 1em; }
.capture-drawer { border-bottom: 1px solid #617c8e70; }
.capture-drawer > summary { cursor: pointer; padding: 1.25em 0; font: 500 1rem var(--grotesk); }
.capture-drawer[open] { padding-bottom: 1em; }
@media (max-width: 650px) {
  .shelf { flex-wrap: wrap; gap: 12px; padding: 29px 8% 38px; }
  .volume { width: 43%; }
  .volume:first-child { margin: 0 21%; width: 55%; --angle: -4deg; }
  .volume:nth-child(2) { --angle: -6deg; --raise: 0%; }
  .volume-title { font-size: clamp(22px,6vw,40px); }
  .room-page { grid-template-columns: 1fr; margin: 14px; }
  .frontispiece { min-height: 95px; height: clamp(95px,24vw,160px); }
  .frontispiece .cover-art { background-position: center 63%; }
  .print-initial { inset: -18% 0 0; font-size: 126px; }
}
@media (prefers-reduced-motion: reduce) { .volume { transition: none; } }
.motion-paused .volume { transition: none; }
.room-flight { position: absolute; z-index: 5; margin: 0; pointer-events: none; transform-origin: top left; overflow: hidden; }

@media (max-width: 650px) { .shelf .volume { --gather-x: 0%; } }
@media (prefers-reduced-motion: no-preference) {
  html:not(.motion-paused) .volume[data-book=water] .cover-art { background-position: center,48% calc(58% + var(--drift,0) * 12%); }
  html:not(.motion-paused) [data-book=light] .cover-art::after { transform: translateY(calc(var(--drift,0) * -18%)); }
}
