/* digital library bookshelf (digital-library.html) */
.lib, .lib-overlay { --paper: #f4f2ed; --wood: #ddd8ce; --wood-dark: #bdb6a8; --shadow: 42, 36, 20; --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }
.lib-locked { overflow: hidden; }

/* hero */
.lib-hero { text-align: center; margin-bottom: 1.5rem; }
.lib-kicker { font-size: 0.72rem; letter-spacing: 0.3em; color: var(--accent); margin-bottom: 0.9rem; }
.lib-heading {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.3rem, 6.5vw, 3.9rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  max-width: 18em;
  margin: 0 auto;
  display: grid;
}
.lib-heading > span { grid-area: 1 / 1; }
.lib-ghost { visibility: hidden; }
.lib-keep { text-transform: none; }
.lib-typed::after { content: ""; display: inline-block; width: 2px; height: 0.9em; margin-left: 4px; background: var(--accent); vertical-align: -0.08em; animation: lib-caret 1s steps(1) infinite; }
.lib-heading--small { font-size: clamp(1.4rem, 3.5vw, 1.9rem); min-height: 0; }
.lib-heading--small::after { display: none; }
@keyframes lib-caret { 50% { opacity: 0; } }
.lib-count { margin-top: 0.9rem; font-size: 0.72rem; letter-spacing: 0.3em; color: var(--accent); }
.lib-btn {
  display: inline-block;
  background: none;
  font-family: inherit;
  text-transform: lowercase;
  cursor: pointer;
  margin-top: 1.1rem;
  padding: 0.45rem 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.lib-btn:hover { color: var(--accent); border-color: var(--accent); }
.lib-btn[hidden] { display: none; }

/* top bar: name on the left, rec + about on the right */
.lib-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 2rem) 0; }
.lib-bar .lib-kicker { margin: 0; font-size: 0.9rem; letter-spacing: 0.06em; }
.lib-bar-btns { display: flex; gap: 0.5rem; }
.lib-bar .lib-btn { margin-top: 0; padding: 0.55rem 1.4rem; font-size: 0.88rem; }

/* fixed room for up to 3 lines, so hovering never nudges the shelf */
.lib-now {
  text-align: center; font-size: 0.9rem; font-style: italic; color: var(--accent);
  line-height: 1.5; height: 4.5em; margin: 1.2rem auto 0.4rem; max-width: 40em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* ---------- the photographed room ----------
   photo/room.jpg is one photo of an empty oak shelf on the wall, lit from the upper left.
   everything on the shelf is sized in real centimetres (--cm) to match the photo's scale, and stands
   on the shelf's top, which is 25.1% of the photo's width up from its bottom edge. */
.lib-top { position: relative; z-index: 1; padding-bottom: 0; }
.lib-rest { padding-top: 0; }
/* with nothing on the to-read pile, drop the empty padding so the page doesn't scroll for nothing */
.lib-rest:not(:has(> :not([hidden]))) { display: none; }
/* the room fills the window and ends where its blurred bottom would be, but never crops above the shelf's front edge */
body:has(> main.lib) { height: 100dvh; display: flex; flex-direction: column; }
body:has(> main.lib) > .lib-bar { flex: none; }
main.lib { flex: 1 1 0; display: flex; flex-direction: column; }
main.lib > .lib-top, main.lib > .lib-rest { flex: none; }
/* the wall carries on above the photo (room-sky.jpg) so the heading sits on it */
#scene {
  --sky: calc(max(100vw, 760px) * 420 / 1536);
  flex: 1 1 0; min-height: calc(max(46.5vw, 354px) + var(--sky));
  margin-top: calc(-15vw + 7.4rem - var(--sky));
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5rem), transparent);
}
.scene { position: relative; margin-top: calc(-15vw + 7.4rem); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.scene::-webkit-scrollbar { display: none; }
/* phones only have room for the shelf at its smaller size */
@media (max-width: 700px) {
  .scene .scene-track { --cm: 0.78cqw; }
  #scene .lib-shelf { left: 11.5%; }
  #scene .board { left: 14%; }
}
.scene-track {
  --cm: 0.9cqw;
  container-type: inline-size;
  position: relative;
  width: max(100%, 760px);
  aspect-ratio: 1536 / 1024;
}
.scene-sky {
  width: max(100%, 760px);
  aspect-ratio: 1536 / 484;
  /* its bottom strip runs under the photo, which fades in over it */
  margin-bottom: calc(max(100%, 760px) * -64 / 1536);
  background: url("photo/room-sky.jpg") center / 100% 100% no-repeat;
}
/* the photo (and its fade) sits on a layer of its own so the hung board isn't faded with it */
.scene-track::before {
  content: ""; position: absolute; inset: 0;
  background: url("photo/room.jpg") center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6.25%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 6.25%, #000 88%, transparent);
}
/* wind.js: the curtain and clover, redrawn over the photo while the wind moves them */
/* leaves swinging past the photo's right edge shouldn't make the shelf scroll sideways */
.scene-track { overflow-x: clip; }
.wind { position: absolute; left: 0; top: 0; pointer-events: none; }
.wind-curtain, .wind-light {
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6.25%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 6.25%, #000 88%, transparent);
}
.wind-shade {
  isolation: isolate;
  overflow: hidden;
  -webkit-mask: url("photo/wind/shade-mask.png") 0 0 / 100% 100%;
  mask: url("photo/wind/shade-mask.png") 0 0 / 100% 100%;
}
.wind-shade-lit { position: absolute; inset: 0; background: url("photo/wind/shade-base.jpg") 0 0 / 100% 100%; }
.wind-shade-shadows { position: absolute; background: url("photo/wind/shade.jpg") 0 0 / 100% 100%; mix-blend-mode: multiply; will-change: transform; }
.wind-light { width: 100%; opacity: 0; background: radial-gradient(55% 75% at 0% 42%, rgba(255, 250, 238, 0.5), transparent 70%); }
.lib-shelf {
  position: absolute; left: 15%; right: 20.5%; bottom: 25.1cqw;
  display: flex; align-items: flex-end; justify-content: center; gap: calc(0.3 * var(--cm));
}
.lib-shelf[hidden], .lib-shelf > [hidden] { display: none; }
/* the to-read shelf is a shorter crop of the same photo */
.scene--queue { margin: 1.5rem 0 0; }
.scene--queue .scene-track { aspect-ratio: 1536 / 420; }
.scene--queue .scene-track::before { background-size: 100% auto; background-position: 50% 55%; -webkit-mask-image: none; mask-image: none; border-radius: 6px; }
.scene--queue .lib-shelf { bottom: 7.3cqw; left: 6%; right: 22%; }

/* everything on the shelf: a soft shadow thrown up and to the right onto the wall,
   and a dark crease where it meets the oak */
.bk, .cd {
  position: relative; flex: none; padding: 0; border: 0; background: none; font: inherit; color: inherit;
  transform-origin: 50% 100%;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bk { transform: rotate(var(--lean, 0deg)); }
.bk::before, .cd::before {
  pointer-events: none;
  content: ""; position: absolute; z-index: -1; left: 14%; right: -16%; top: 6%; bottom: 0;
  background: rgba(58, 40, 18, 0.38); filter: blur(calc(0.8 * var(--cm))); border-radius: 3px;
  transform: skewX(-16deg); transform-origin: 0 100%;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s;
}
.bk::after, .cd::after {
  content: ""; position: absolute; z-index: 2; left: -2%; right: -2%; bottom: calc(-0.2 * var(--cm)); height: calc(0.45 * var(--cm));
  background: radial-gradient(closest-side, rgba(36, 22, 8, 0.5), transparent); pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s;
}
.bk:hover, .bk:focus-visible { transform: translateY(calc(-1.4 * var(--cm))) rotate(var(--lean, 0deg)); z-index: 3; }
.bk:hover::before, .bk:focus-visible::before,
.cd:hover::before, .cd:focus-visible::before { transform: translate(calc(0.5 * var(--cm)), calc(1.4 * var(--cm))) skewX(-16deg); opacity: 0.75; }
.bk:hover::after, .bk:focus-visible::after,
.cd:hover::after, .cd:focus-visible::after { transform: translateY(calc(1.4 * var(--cm))) scaleX(0.8); opacity: 0.45; }
.bk:focus-visible, .cd:focus-visible, .board:focus-visible { outline: none; }
.bk:focus-visible .bk-body, .cd:focus-visible .cd-body, .board:focus-visible .bb { outline: 2px solid #eef2e4; outline-offset: 3px; }
/* the photos were taken in flat studio light; this warms them into the room's light */
.bk-body, .cd-body, .bb, .cal { filter: sepia(0.14) saturate(0.9) brightness(0.94); }

/* books: a photo of the spine (spine: in shelf.js), or a cloth spine in their colour if there isn't one */
.bk { width: calc(var(--w) * var(--cm)); height: calc(var(--h) * var(--cm)); }
.bk-body { position: absolute; inset: 0; overflow: hidden; border-radius: 2px 2px 1px 1px; pointer-events: none; }
.bk-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.bk-cloth {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(1.8 * var(--cm)) 0 calc(1.3 * var(--cm));
  background: url("photo/cloth.jpg") center / calc(12 * var(--cm)) auto, var(--c); background-blend-mode: overlay;
  color: #e9dcbc; font-family: "Cormorant Garamond", Georgia, serif;
}
.bk-cloth::before, .bk-cloth::after { content: ""; position: absolute; left: 12%; right: 12%; height: 1px; background: currentColor; opacity: 0.55; }
.bk-cloth::before { top: calc(1 * var(--cm)); }
.bk-cloth::after { bottom: calc(3.6 * var(--cm)); }
.bk-title { writing-mode: vertical-rl; font-size: calc(1.25 * var(--cm)); font-weight: 600; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 72%; }
.bk-author { font-size: calc(0.85 * var(--cm)); letter-spacing: 0.08em; writing-mode: vertical-rl; max-height: 18%; overflow: hidden; white-space: nowrap; }
.bk.has-photo .bk-cloth { display: none; }
/* the round of the spine: lit on the left, falling into shadow on the right */
.bk-body::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255, 246, 226, 0.16), transparent 30%, transparent 62%, rgba(28, 16, 4, 0.34)),
    linear-gradient(to bottom, transparent 60%, rgba(28, 16, 4, 0.14));
}
.bk-ribbon { position: absolute; z-index: -1; right: 28%; top: calc(-1.3 * var(--cm)); width: calc(0.5 * var(--cm)); height: calc(2.4 * var(--cm)); background: #4d6a2f; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }

/* cds stand spine-out: a jewel case (a bit thicker than real so the names read), its printed spine behind clear plastic */
.cd { width: calc(var(--cw, 1.6) * var(--cm)); height: calc(12.4 * var(--cm)); transform: rotate(var(--lean, 0deg)); }
.cd:hover, .cd:focus-visible { transform: translateY(calc(-1.4 * var(--cm))) rotate(var(--lean, 0deg)); z-index: 3; }
.cd-body { position: absolute; inset: 0; border-radius: 1px; overflow: hidden; pointer-events: none; background: var(--c); color: #f3eee4; transition: background-color 0.4s; }
.cd--light .cd-body { color: #1f1d18; }
.cd-name {
  position: absolute; inset: 5% 0; display: block; text-align: center; line-height: calc(1.6 * var(--cm));
  writing-mode: vertical-rl; font-family: "Cormorant Garamond", Georgia, serif; font-size: calc(1.1 * var(--cm) * var(--fit, 1)); font-weight: 600; letter-spacing: 0.06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* the plastic: bright hinge edges, a gloss streak, and the clear rails at the top and bottom */
.cd-body::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1) 16%, transparent 32%, rgba(255, 255, 255, 0.18) 52%, transparent 66%, rgba(0, 0, 0, 0.28) 86%, rgba(255, 255, 255, 0.4)),
    linear-gradient(to bottom, rgba(225, 228, 230, 0.75), rgba(160, 165, 168, 0.55) 3%, transparent 3.4%, transparent 96.6%, rgba(160, 165, 168, 0.55) 97%, rgba(225, 228, 230, 0.75));
}
.cd .art { display: none; }
/* a cd with a spine photo (spine: in shelf.js) uses it instead of the printed name and drawn plastic */
.cd-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.cd.has-photo .cd-name, .cd.has-photo .cd-body::after { display: none; }

/* the bulletin board hangs on the wall to the left, above the calendar */
.board {
  position: absolute; z-index: 1; left: 11.5%; bottom: calc(24.9cqw + 3.5 * var(--cm));
  width: calc(18 * var(--cm)); aspect-ratio: 433 / 620; padding: 0; border: 0; background: none;
  transform: rotate(-0.8deg); transform-origin: 50% 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.board::before {
  pointer-events: none;
  content: ""; position: absolute; z-index: -1; inset: 2% -3% -4% 3%;
  background: rgba(58, 40, 18, 0.42); filter: blur(calc(1 * var(--cm)));
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.45s;
}
.bb { position: absolute; inset: 0; pointer-events: none; box-shadow: 0 calc(0.1 * var(--cm)) calc(0.25 * var(--cm)) rgba(40, 26, 10, 0.35); }

/* the standing calendar (a photo with its page blanked, straightened to face the front; the month is laid onto the page) and its
   shadow on the shelf, which hangs just below the shelf line. Sizes inside .cal-page are photo pixels. */
.cal {
  position: relative; flex: none; width: calc(10.73 * var(--cm)); aspect-ratio: 750 / 858;
  margin: 0 calc(1.6 * var(--cm)) calc(-0.30 * var(--cm)) 0; filter: sepia(0.14) saturate(0.9) brightness(0.94);
}
.cal { display: block; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; color: inherit; text-decoration: none; transition: filter 0.4s ease; }
/* hovering doesn't move it: the page catches a little more light and the pen circle around today is drawn again */
.cal:hover, .cal:focus-visible { filter: sepia(0.14) saturate(0.9) brightness(1); }
.cal:focus-visible { outline: 2px solid #eef2e4; outline-offset: 3px; }
.cal img { width: 100%; height: 100%; display: block; }
.cal-page {
  position: absolute; left: 0; top: 0; width: 673px; height: 664px; transform-origin: 0 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #9a9a97; line-height: 1; text-transform: none;
}
.cal-num { position: absolute; left: 64px; top: 112px; font-size: 90px; font-weight: 300; }
.cal-year { position: absolute; right: 60px; top: 154px; font-size: 40px; }
.cal-days, .cal-grid { position: absolute; left: 49px; width: 574px; display: grid; grid-template-columns: repeat(7, 1fr); font-size: 35px; }
.cal-days { top: 218px; grid-auto-rows: 57px; }
.cal-grid { top: 290px; grid-auto-rows: 57.2px; }
.cal-days > span, .cal-grid > span { display: grid; place-items: center; }
.cal .sun { font-weight: 700; color: #82827f; }
/* today gets a pen circle */
.cal-grid .today { position: relative; }
.cal-grid .today::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 66px; height: 58px; transform: translate(-50%, -52%) rotate(-8deg);
  border: 3px solid rgba(168, 52, 48, 0.85); border-radius: 50% 46% 52% 48%;
  -webkit-mask: conic-gradient(from -60deg, #000 var(--ink), transparent 0); mask: conic-gradient(from -60deg, #000 var(--ink), transparent 0);
}
@property --ink { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
@keyframes cal-ink { from { --ink: 0deg; } to { --ink: 360deg; } }
.cal:hover .today::after, .cal:focus-visible .today::after { animation: cal-ink 0.8s cubic-bezier(0.45, 0, 0.25, 1); }
.bb > img { width: 100%; height: 100%; display: block; }
/* things pinned to the cork; each pivots on its tack (or clip) and moves on its own when hovered */
.pin {
  position: absolute; pointer-events: auto; transform: rotate(var(--tilt));
  filter: drop-shadow(calc(0.1 * var(--cm)) calc(0.18 * var(--cm)) calc(0.28 * var(--cm)) rgba(45, 28, 12, 0.5));
  transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1), filter 0.4s ease;
}
.pin img { width: 100%; display: block; }
.pin:hover { z-index: 1; filter: drop-shadow(calc(0.2 * var(--cm)) calc(0.38 * var(--cm)) calc(0.45 * var(--cm)) rgba(45, 28, 12, 0.42)); }
.pin-rain:hover { transform: rotate(calc(var(--tilt) - 2.4deg)) scale(1.015); }
.pin-receipt:hover { animation: pin-flutter 0.9s ease-in-out; }
.pin-note:hover { transform: rotate(calc(var(--tilt) + 2deg)) scale(1.02); }
/* first-visit hint: a white outline around the note and a green hand-drawn arrow from the wall beside the board */
.board.hint .pin-note {
  filter: drop-shadow(0 0 calc(0.06 * var(--cm)) #fff) drop-shadow(0 0 calc(0.06 * var(--cm)) #fff) drop-shadow(0 0 calc(0.1 * var(--cm)) rgba(255, 255, 255, 0.9))
    drop-shadow(calc(0.1 * var(--cm)) calc(0.18 * var(--cm)) calc(0.28 * var(--cm)) rgba(45, 28, 12, 0.5));
}
.hint-call {
  position: absolute; left: 0; top: 0; width: 200%; height: 100%; overflow: visible; pointer-events: none;
  fill: none; stroke: #435a2b; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 calc(0.15 * var(--cm)) rgba(255, 252, 240, 0.85));
  animation: hint-bob 2.6s 1.8s ease-in-out infinite;
}
.hint-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hint-draw 0.9s 0.6s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
.hint-head, .hint-call text { opacity: 0; animation: hint-in 0.3s 1.4s ease forwards; }
.hint-call text {
  fill: #435a2b; stroke: none; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 600;
  font-size: 40px; letter-spacing: 0.02em; text-transform: none;
}
@keyframes hint-draw { to { stroke-dashoffset: 0; } }
@keyframes hint-in { to { opacity: 1; } }
@keyframes hint-bob { 50% { transform: translate(0.6%, -0.8%); } }
@keyframes pin-flutter {
  25% { transform: rotate(calc(var(--tilt) - 2.5deg)); }
  50% { transform: rotate(calc(var(--tilt) + 1.6deg)); }
  75% { transform: rotate(calc(var(--tilt) - 0.8deg)); }
}
.tack {
  position: absolute; z-index: 2; width: 3.926%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  background: url("photo/board/tack.png") center / 100% no-repeat;
  filter: drop-shadow(calc(0.06 * var(--cm)) calc(0.1 * var(--cm)) calc(0.1 * var(--cm)) rgba(45, 28, 12, 0.55));
}
.about-text p { line-height: 1.6; margin-bottom: 0.8rem; text-transform: none; }
.about-text p:last-child { margin-bottom: 0; }
.about-text a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.about-text a:hover { color: #435a2b; }
.about-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.2rem; }
.about-links .lib-btn { margin-top: 0; }

/* open cd: square case with the disc sliding out to the right */
.lib-art { position: relative; width: 100%; }
.lib-art .lib-cover { z-index: 1; }
.lib-disc { display: none; }
.lib-art--cd .lib-cover { aspect-ratio: 1; border-radius: 1px; }
.lib-art--cd .lib-disc {
  display: block; position: absolute; z-index: 0;
  top: 3%; right: 3%; width: 94%; aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(40, 28, 14, 0.28);
  -webkit-mask: radial-gradient(circle, transparent 0 6.5%, #000 7%);
  mask: radial-gradient(circle, transparent 0 6.5%, #000 7%);
  animation: lib-slide 0.75s cubic-bezier(0.25, 0.8, 0.25, 1) 0.3s both;
}
/* the printed silver face; it spins on its own layer so the slide keeps its transform */
.lib-disc::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(250, 250, 248, 0.92) 0 14%, rgba(150, 150, 156, 0.55) 14.5% 15.5%, transparent 16% 48.5%, rgba(255, 255, 255, 0.35) 49% 49.6%, transparent 50%),
    conic-gradient(from 20deg, #d9d9dc, #f4f4f2 8%, #c7d6dd 14%, #e9dfee 20%, #f6f0d8 26%, #cfcfd3 34%, #b9b9be 44%, #ecebe8 52%, #d4e1e6 58%, #ecdcea 64%, #f5efd5 70%, #c9c9cd 80%, #b4b4b9 90%, #d9d9dc);
  box-shadow: inset 0 0 0 1px rgba(120, 120, 126, 0.35);
}
.lib-art--playing .lib-disc::before { animation: lib-spin 6s linear 1.05s infinite; }
@keyframes lib-slide { from { transform: translateX(0); } to { transform: translateX(42%); } }
@keyframes lib-spin { to { transform: rotate(360deg); } }
@media (min-width: 701px) { .lib-open:has(.lib-art--cd) { gap: 8.5rem; } }

.lib-section { margin-top: 4rem; text-align: center; }
.lib-section .lib-shelf { margin-top: 1.5rem; text-align: left; }
.lib-empty { text-align: center; color: rgba(0, 0, 0, 0.5); padding: 3rem 0; }

/* open book */
.lib-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(235, 232, 226, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lib-fade 0.25s ease;
}
.lib-overlay[hidden] { display: none; }
@keyframes lib-fade { from { opacity: 0; } }
.lib-open {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 400px);
  gap: 4.5rem;
  align-items: center;
  max-height: 100%;
  animation: lib-rise 0.35s ease;
}
@keyframes lib-rise { from { transform: translateY(14px); opacity: 0; } }
/* closing is the opening played backwards */
.lib-overlay.lib-leaving { animation: lib-unfade 0.35s ease both; pointer-events: none; }
@keyframes lib-unfade { to { opacity: 0; } }
.lib-overlay.lib-leaving > * { animation: lib-sink 0.35s ease both; }
@keyframes lib-sink { to { transform: translateY(14px); opacity: 0; } }
.lib-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 1px 2px 2px 1px;
  overflow: hidden;
  background: var(--c, var(--accent));
  box-shadow: inset 6px 0 8px -4px rgba(0, 0, 0, 0.35), 0 30px 60px -25px rgba(0, 0, 0, 0.55);
}
.lib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: linear-gradient(to right, rgba(0, 0, 0, 0.25), transparent); }
.lib-cover-title { display: none; }
.lib-cover--plain .lib-cover-title { display: flex; position: absolute; inset: auto 1.2rem 1.4rem; color: #ffffff; font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.lib-card {
  position: relative;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 1.5rem 1.6rem 1.4rem;
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}
.lib-close { position: absolute; top: 0.9rem; right: 1rem; border: none; background: none; font: inherit; font-size: 0.8rem; text-transform: lowercase; color: rgba(0, 0, 0, 0.45); cursor: pointer; }
.lib-close:hover { color: var(--accent); }
.lib-head { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--accent); border-bottom: 1.5px solid var(--accent); padding-bottom: 0.5rem; margin-bottom: 0.9rem; }
.lib-title { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.lib-author { color: var(--accent); margin-bottom: 0.8rem; }
.lib-quote { font-style: italic; font-size: 0.95rem; color: rgba(0, 0, 0, 0.7); margin-bottom: 0.8rem; }
.lib-quote[hidden] { display: none; }
.lib-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px dashed rgba(0, 0, 0, 0.15); font-size: 0.9rem; }
.lib-row dt { color: rgba(0, 0, 0, 0.5); }
.lib-row dd { text-align: right; font-weight: 500; }
.lib-detail { margin-top: 1.1rem; border-top: 1.5px solid var(--accent); padding-top: 0.9rem; }
.lib-detail[hidden] { display: none; }
.lib-detail h4 { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.3rem; }
.lib-detail p { font-size: 0.92rem; color: rgba(0, 0, 0, 0.78); margin-bottom: 0.9rem; }
.lib-detail p:last-child { margin-bottom: 0; }
.lib-tracks { padding-left: 1.05rem; margin-bottom: 0.9rem; font-size: 0.92rem; color: rgba(0, 0, 0, 0.78); }
.lib-tracks:last-child { margin-bottom: 0; }
.lib-tracks li { line-height: 1.45; padding: 0.05rem 0; }
.lib-tracks li::marker { color: var(--accent); }
.lib-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; }
.lib-steps { display: flex; gap: 1.6rem; }
.lib-nav button { border: none; background: none; font: inherit; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: lowercase; color: var(--accent); cursor: pointer; }
.lib-steps button { color: rgba(0, 0, 0, 0.5); }
.lib-steps button:hover { color: var(--accent); }
.lib-shelve { color: var(--accent); }
.lib-nav button:disabled { visibility: hidden; }
.lib-nav button:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 700px) {
  .lib-bar .lib-btn { padding: 0.45rem 0.9rem; font-size: 0.8rem; letter-spacing: 0.12em; }
  .lib-overlay { align-items: flex-start; overflow-y: auto; }
  .lib-open { grid-template-columns: 1fr; gap: 1.2rem; justify-items: center; max-height: none; }
  .lib-art { width: 150px; }
  .lib-art--cd { margin-right: 64px; }
  .lib-card { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bk, .cd, .cd-body, .board, .cal, .cal .today::after, .pin, .bk::before, .cd::before, .board::before, .bk::after, .cd::after, .lib-overlay, .lib-open, .rec { transition: none; animation: none; }
  .lib-art--cd .lib-disc, .lib-disc::before { animation: none; }
  .lib-art--cd .lib-disc { transform: translateX(42%); }
  .lib-heading::after { display: none; }
  .hint-call, .hint-line, .hint-head, .hint-call text { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

/* recommend a book */
.rec {
  position: relative;
  width: min(100%, 34rem);
  max-height: 100%;
  overflow-y: auto;
  padding: 2rem clamp(1.2rem, 5vw, 2.2rem) 1.8rem;
  background: #f7f5f0;
  border-radius: 2px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
  text-align: left;
  animation: lib-rise 0.35s ease;
}
.rec [hidden] { display: none; }
.rec-heading { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 1.4rem; }
.rec-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.1rem;
  border: none;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.2);
  background: none;
  font: inherit;
  color: inherit;
  outline: none;
  resize: vertical;
}
.rec-input:focus { border-bottom-color: var(--accent); }
.rec-input::placeholder { color: rgba(0, 0, 0, 0.38); }
.rec-label { display: block; margin-top: 1.3rem; font-size: 0.72rem; letter-spacing: 0.2em; color: var(--accent); }
.rec-hint { min-height: 1.4em; margin-top: 0.6rem; font-size: 0.85rem; color: rgba(0, 0, 0, 0.5); }
.rec-results { list-style: none; max-height: 18rem; overflow-y: auto; margin: 0 -0.5rem; }
.rec-result {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 8px;
  background: none;
  font: inherit;
  text-transform: lowercase;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.rec-result:hover, .rec-result:focus-visible { background: rgba(44, 90, 136, 0.08); outline: none; }
.rec-result > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.rec-thumb {
  flex: none;
  display: block;
  width: 64px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg);
  box-shadow: inset 3px 0 4px -2px rgba(0, 0, 0, 0.3), 0 8px 16px -10px rgba(0, 0, 0, 0.5);
}
.rec-thumb--small { width: 34px; }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-book { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 0.4rem; }
.rec-book-text { flex: 1; min-width: 0; }
.rec-book-title { display: block; font-weight: 600; line-height: 1.3; }
.rec-book-by { display: block; font-size: 0.85rem; color: rgba(0, 0, 0, 0.55); }
.rec-why { min-height: 4.5rem; }
.rec-trap { position: absolute; left: -9999px; }
.rec-status { min-height: 1.4em; margin-top: 0.9rem; font-size: 0.85rem; color: var(--accent); }
.rec-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; }
.rec-link { border: none; background: none; padding: 0; margin-top: 0.8rem; font: inherit; font-size: 0.85rem; text-transform: lowercase; color: var(--accent); cursor: pointer; }
.rec-link:hover { text-decoration: underline; }
.rec-actions .rec-link, .rec-send { margin-top: 0; }
.rec-send { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.rec-send:hover { color: #ffffff; opacity: 0.88; }
.rec-send:disabled { opacity: 0.5; cursor: default; }
.rec-done { font-size: 1.1rem; font-weight: 600; color: var(--accent); }

/* the week that opens from the calendar: a paper week planner over the room */
.wk {
  --wk-ink: #2d2a22; --wk-muted: #9a9384; --wk-line: rgba(70, 55, 30, 0.1); --wk-accent: #435a2b;
  position: relative; display: flex; flex-direction: column; width: min(100%, 62rem); height: min(100%, 40rem);
  background: #f8f6f1; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 2px;
  box-shadow: 0 30px 60px -32px rgba(var(--shadow), 0.45);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--wk-ink);
  text-transform: lowercase; letter-spacing: normal; text-align: left;
  animation: lib-rise 0.35s ease;
}
.wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.6rem 0.8rem; }
.wk-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 2.3rem; font-weight: 500; line-height: 1; margin: 0; white-space: nowrap; }
.wk-title b { font-weight: 500; }
.wk-title span { color: var(--wk-muted); font-style: italic; font-weight: 400; }
.wk-shelf { font: inherit; font-size: 0.8rem; letter-spacing: 0.1em; color: var(--wk-accent); background: none; border: 0; padding: 0.2rem 0; cursor: pointer; }
.wk-shelf:hover { text-decoration: underline; text-underline-offset: 4px; }
.wk-week { flex: 1; display: grid; grid-template-columns: 3.6rem repeat(7, minmax(0, 1fr)); grid-template-rows: auto auto 1fr; min-height: 0; padding: 0 1.2rem 1rem 0.4rem; }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.2rem 0 0.6rem; white-space: nowrap; }
.wk-day > span:first-child { font-size: 0.66rem; letter-spacing: 0.22em; color: var(--wk-muted); }
.wk-num { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; line-height: 1.1; min-width: 2.2rem; text-align: center; }
.wk-day.wkend .wk-num { color: var(--wk-muted); }
.wk-day.today > span:first-child, .wk-day.today .wk-num { color: var(--wk-accent); }
.wk-day.today .wk-num { font-weight: 600; border-bottom: 1.5px solid var(--wk-accent); }
.wk-allday { border-top: 1.5px solid var(--wk-accent); height: 0.9rem; }
.wk-allday.label { font-size: 0; }
.wk-gutter, .wk-col { position: relative; }
.wk-col { border-left: 1px solid var(--wk-line); }
.wk-col.wkend { background: rgba(70, 55, 30, 0.018); }
.wk-hour { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--wk-line); }
.wk-gutter .wk-hour { border: 0; }
.wk-gutter .wk-hour span { position: absolute; right: 0.6rem; top: -0.45rem; font-size: 0.64rem; letter-spacing: 0.04em; color: var(--wk-muted); white-space: nowrap; }
.wk-gutter .wk-hour small { font-size: inherit; margin-left: 2px; }
.wk-ev {
  position: absolute; left: 3px; right: 4px; overflow: hidden; border-radius: 1px; padding: 0.3rem 0.45rem 0.3rem 0.6rem;
  background: color-mix(in srgb, var(--c) 12%, #fbfaf6); color: color-mix(in srgb, var(--c) 55%, #1e1a12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wk-ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--c); }
.wk-ev:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(var(--shadow), 0.4); }
.wk-ev b { display: block; font-size: 0.76rem; font-weight: 500; line-height: 1.25; }
.wk-ev time { display: block; font-size: 0.66rem; letter-spacing: 0.03em; opacity: 0.75; margin-top: 0.15rem; }
.wk-ev.past { opacity: 0.72; }
/* a time that does not fit under the title wraps into a hidden second column */
.wk-ev { display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; column-gap: 100px; overflow: hidden; }
.wk-ev > * { width: 100%; flex-shrink: 0; }
.wk-now { position: absolute; left: -1px; right: 0; height: 1.5px; background: var(--wk-accent); z-index: 3; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -3.5px; top: -3px; width: 7.5px; height: 7.5px; border-radius: 50%; background: var(--wk-accent); }
.wk-nowtime { position: absolute; right: 0.5rem; transform: translateY(-50%); font-size: 0.64rem; font-weight: 600; color: var(--wk-accent); background: #f8f6f1; padding: 0 0.15rem; z-index: 3; }
@media (max-width: 760px) {
  .lib-overlay:has(.wk) { padding: 0.6rem; align-items: center; }
  .wk { height: min(calc(100dvh - 1.2rem), 46rem); }
  .wk-head { padding: 0.9rem 0.8rem 0.5rem; }
  .wk-title { font-size: 1.9rem; }
  .wk-week { grid-template-columns: 2.1rem repeat(7, minmax(0, 1fr)); padding: 0 0.4rem 0.6rem 0; }
  .wk-day > span:first-child { font-size: 0.55rem; letter-spacing: 0.12em; }
  .wk-num { font-size: 1.3rem; min-width: 1.5rem; }
  .wk-gutter .wk-hour span { font-size: 0.56rem; right: 0.3rem; }
  .wk-gutter .wk-hour small { display: none; }
  .wk-ev { left: 1px; right: 2px; padding: 0.2rem 0.12rem 0.2rem 0.32rem; }
  .wk-ev b { font-size: 0.56rem; line-height: 1.15; hyphens: auto; -webkit-hyphens: auto; }
  .wk-ev time { display: none; }
  .wk-nowtime { font-size: 0.52rem; right: 0.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wk { animation: none; }
  .pin-receipt:hover { animation: none; }
}
