/* 2009 · library — a dark reading room. A match strikes and the hearth catches; bookshelves slide in from the sides;
   a wreath drops onto the chimney breast; a sepia print of the lab develops on the mantel like a daguerreotype; the
   fire's draught flutters the pages of a book. Exit: the print sinks behind the mantel, the shelves part, the lights
   dim to the fire's glow and the gallery rises onto the same mantel. */
.in-library .rr{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.in-library .rr *{box-sizing:border-box}
.in-library .rr img{display:block}

/* the room: panelled wall, plank floor, the chimney breast (wide screens only) */
.in-library .rr-wall{position:absolute;inset:0;background:
  linear-gradient(180deg,rgba(0,0,0,.42),rgba(0,0,0,0) 28%,rgba(0,0,0,0) 72%,rgba(0,0,0,.3)),
  repeating-linear-gradient(90deg,#1c0f07 0 3px,#3d2415 3px 8px,#2c1a0e 8px 172px,#1c0f07 172px 176px)}
.in-library .rr-floor{position:absolute;left:0;right:0;bottom:0;background:
  repeating-linear-gradient(90deg,rgba(0,0,0,.4) 0 2px,rgba(0,0,0,0) 2px 84px),
  linear-gradient(180deg,#3c2211,#241409 60%,#150b05)}
.in-library .rr-vign{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 60%,rgba(0,0,0,0) 50%,rgba(0,0,0,.55) 100%)}
.in-library .rr-breast{position:absolute;background:linear-gradient(90deg,#24140b,#3e2516 10%,#3a2314 90%,#22130a);box-shadow:0 0 0 1px #150a04,0 0 44px rgba(0,0,0,.55)}
.in-library .rr-breast::before{content:"";position:absolute;left:6%;right:6%;top:4%;bottom:0;border:2px solid rgba(18,9,3,.8);border-bottom:0;box-shadow:inset 0 0 0 5px #4b2c19,inset 0 0 0 6px rgba(0,0,0,.45)}

/* bookshelves: a unit per side (frame + posts), rows of spines inside, each row its own sliding plane */
.in-library .rr-unit{position:absolute;will-change:transform;background:linear-gradient(180deg,#1a0d07,#110804)}
.in-library .rr-unit::before{content:"";position:absolute;top:-14px;bottom:0;width:16px;background:linear-gradient(90deg,#4d2f1a,#6d4526 40%,#3a2213);box-shadow:0 0 12px rgba(0,0,0,.6);z-index:2}
.in-library .rr-unit.l::before{right:0}
.in-library .rr-unit.r::before{left:0}
.in-library .rr-unit::after{content:"";position:absolute;left:0;right:0;top:-14px;height:16px;background:linear-gradient(180deg,#6d4526,#3a2213);box-shadow:0 6px 12px rgba(0,0,0,.5)}
.in-library .rr-row{position:absolute;left:0;right:0;overflow:hidden;will-change:transform}
.in-library .rr-books{position:absolute;left:0;right:0;top:9%;bottom:11px;display:flex;align-items:flex-end;gap:1px;padding:0 6px}
.in-library .rr-unit.l .rr-books{justify-content:flex-end;padding-right:22px}
.in-library .rr-unit.r .rr-books{padding-left:22px}
.in-library .rr-board{position:absolute;left:0;right:0;bottom:0;height:11px;background:linear-gradient(180deg,#5e3922,#3a2213 60%,#22130b);box-shadow:0 4px 10px rgba(0,0,0,.65)}
.in-library .rr-books b{position:relative;flex:none;border-radius:2px 2px 1px 1px;background-image:linear-gradient(90deg,rgba(255,255,255,.09),rgba(0,0,0,0) 35%,rgba(0,0,0,.3));box-shadow:inset 1px 0 0 rgba(255,255,255,.06),0 0 0 1px rgba(0,0,0,.3)}
.in-library .rr-books b.g::before,.in-library .rr-books b.g::after{content:"";position:absolute;left:2px;right:2px;height:2px;background:rgba(217,195,163,.6)}
.in-library .rr-books b.g::before{top:13%}
.in-library .rr-books b.g::after{bottom:15%}
.in-library .rr-books b.lean{transform-origin:0 100%;transform:skewX(9deg);margin-left:12px}
.in-library .rr-books b span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(90deg);white-space:nowrap;font:500 8px/1 var(--sans);letter-spacing:.14em;color:rgba(217,195,163,.8)}
/* the year: four fat volumes by the hearth carry 2 · 0 · 0 · 9 in gilt (width and digit size are set from the row height) */
.in-library .rr-books b.yr{width:30px;height:92%;background-color:#4a2620;box-shadow:inset 1px 0 0 rgba(255,255,255,.08),inset -2px 0 0 rgba(0,0,0,.4),0 0 0 1px rgba(0,0,0,.3)}
.in-library .rr-books b.yr::before,.in-library .rr-books b.yr::after{content:"";position:absolute;left:3px;right:3px;height:2px;background:rgba(217,195,163,.7)}
.in-library .rr-books b.yr::before{top:9%}
.in-library .rr-books b.yr::after{bottom:9%}
.in-library .rr-books b.yr span{top:26%;transform:translate(-50%,-50%);font:500 22px/1 var(--serif);letter-spacing:0;color:#e8d3ac;text-shadow:0 0 1px rgba(0,0,0,.4)}
.in-library .rr-bust{position:absolute;bottom:calc(100% + 13px);filter:sepia(.35) brightness(.92) drop-shadow(0 8px 8px rgba(0,0,0,.55))}
.in-library .rr-unit.l .rr-bust{right:26px}
.in-library .rr-unit.r .rr-bust{left:26px}
/* phones: the two units meet in the middle — one post, busts at the outer ends, clear of the caption */
.in-library .rr.nw .rr-unit.r::before{display:none}
.in-library .rr.nw .rr-unit.l .rr-books{padding-right:78px}   /* keeps the 2·0·0·9 volumes clear of the wreath */
.in-library .rr.nw .rr-unit.l .rr-bust{right:auto;left:16px}
.in-library .rr.nw .rr-unit.r .rr-bust{left:auto;right:16px}

/* the hearth: mantel board (the gallery's shelf lands exactly here), stone surround with the year's gilt plaque on the
   lintel, firebox with logs, hearth slab */
.in-library .rr-mantel{position:absolute;border-radius:2px;background:linear-gradient(180deg,#805230,#5a3620 45%,#3a2213);box-shadow:0 10px 26px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,230,190,.28)}
.in-library .rr-surround{position:absolute;background:linear-gradient(180deg,#4b3e35,#352c26);box-shadow:inset 0 0 0 2px rgba(0,0,0,.35),inset 0 -6px 12px rgba(0,0,0,.3)}
.in-library .rr-plaque{position:absolute;display:flex;align-items:center;justify-content:center;opacity:0;will-change:opacity;border-radius:2px;
  font-family:var(--serif);font-weight:600;line-height:1;letter-spacing:.22em;text-indent:.22em;color:#3b2410;
  background:linear-gradient(180deg,#e9d3a0,#bf9c60 55%,#dcbf88);box-shadow:0 1px 0 rgba(255,240,205,.35),0 2px 6px rgba(0,0,0,.55),inset 0 0 0 1px rgba(90,58,24,.55)}
.in-library .rr-box{position:absolute;overflow:hidden;background:radial-gradient(ellipse at 50% 100%,#33170a,#140805 55%,#060302)}
.in-library .rr-boxglow{position:absolute;inset:0;opacity:0;will-change:opacity;background:radial-gradient(ellipse at 50% 100%,rgba(255,210,150,.5),rgba(150,70,30,.22) 42%,transparent 75%)}
.in-library .rr-log{position:absolute;border-radius:40%/100%;background:linear-gradient(180deg,#3d2514,#1d1008 60%,#0c0603);box-shadow:inset 0 2px 0 rgba(255,255,255,.05),0 3px 6px rgba(0,0,0,.6)}
.in-library .rr-slab{position:absolute;background:linear-gradient(180deg,#4b3e35,#2a231e);box-shadow:0 5px 12px rgba(0,0,0,.55)}

/* the fire: a clip the size of the firebox, above the darkness. Each flame is a wrapper scaled by scroll holding two
   tongues — a soft outer one in gilt and amber and a thinner pale core — that flicker on their own */
.in-library .rr-fire{position:absolute;overflow:hidden}
.in-library .rr-fl{position:absolute;bottom:4%;transform-origin:50% 100%;opacity:0;will-change:transform,opacity}
.in-library .rr-fl i{position:absolute;left:0;right:0;bottom:0;height:100%;transform-origin:50% 100%;mix-blend-mode:screen;will-change:transform;
  border-radius:50% 50% 50% 50%/88% 88% 12% 12%;filter:blur(2.5px);
  background:radial-gradient(ellipse 75% 130% at 50% 96%,#fff3d6 0,#e8c98a 22%,#b8743a 55%,rgba(90,30,14,0) 92%);
  animation:rrflick 1.1s ease-in-out infinite alternate}
.in-library .rr-fl i.core{left:27%;right:27%;height:72%;border-radius:50% 50% 50% 50%/92% 92% 8% 8%;filter:blur(1.2px);
  background:radial-gradient(ellipse 80% 125% at 50% 98%,#fffaf0 0,#f6e6bc 28%,#d9a75f 60%,rgba(160,90,40,0) 94%);
  animation-name:rrflick2;animation-duration:.85s}
.in-library .rr-fl:nth-child(2) i{animation-duration:1.45s;animation-delay:-.5s}
.in-library .rr-fl:nth-child(3) i{animation-duration:.95s;animation-delay:-.2s}
.in-library .rr-fl:nth-child(4) i{animation-duration:1.3s;animation-delay:-.9s}
.in-library .rr-fl:nth-child(5) i{animation-duration:1.05s;animation-delay:-.35s}
.in-library .rr-fl:nth-child(6) i{animation-duration:1.25s;animation-delay:-.7s}
.in-library .rr-fl:nth-child(7) i{animation-duration:.9s;animation-delay:-.15s}
.in-library .rr-fl:nth-child(8) i{animation-duration:1.15s;animation-delay:-.6s}
.in-library .rr-fl:nth-child(2n) i.core{animation-duration:.7s}
@keyframes rrflick{0%{transform:scale(1,1) skewX(0)}50%{transform:scale(.94,1.08) skewX(-3deg)}100%{transform:scale(1.04,.96) skewX(3deg)}}
@keyframes rrflick2{0%{transform:scale(1,.96) skewX(2deg)}50%{transform:scale(.9,1.1) skewX(-2deg)}100%{transform:scale(1,1) skewX(1deg)}}
.in-library .rr-glow{position:absolute;opacity:0;will-change:opacity}
.in-library .rr-glow i{display:block;width:100%;height:100%;background:radial-gradient(ellipse at 50% 100%,rgba(255,206,140,.58),rgba(205,135,70,.26) 28%,rgba(120,55,25,.08) 58%,transparent 80%);animation:rrglow 1.7s ease-in-out infinite alternate}
@keyframes rrglow{from{opacity:.82}to{opacity:1}}
.in-library .rr-dark{position:absolute;inset:0;will-change:opacity}

/* the match: head at the top, stick below, rotated about the head */
.in-library .rr-match{position:absolute;transform-origin:50% 0;opacity:0;will-change:transform,opacity}
.in-library .rr-match .st{position:absolute;left:0;right:0;top:9%;bottom:0;border-radius:1px;background:linear-gradient(90deg,#d6c29a,#8b7250)}
.in-library .rr-match .hd{position:absolute;left:-45%;right:-45%;top:0;height:13%;border-radius:50%;background:radial-gradient(circle at 40% 40%,#8a2f26,#3a0f0c)}
.in-library .rr-match .mf{position:absolute;left:-170%;right:-170%;bottom:90%;height:70%;border-radius:50% 50% 50% 50%/72% 72% 28% 28%;opacity:0;will-change:opacity;filter:blur(1px);
  background:radial-gradient(ellipse at 50% 92%,#fff7d8,#ffdf95 30%,rgba(190,80,20,0) 90%)}
.in-library .rr-flare{position:absolute;border-radius:50%;opacity:0;will-change:opacity,transform;background:radial-gradient(circle,rgba(255,250,232,.95),rgba(255,222,150,.5) 22%,rgba(255,190,100,0) 70%)}

/* the wreath hangs from its bow */
.in-library .rr-wreath{position:absolute;transform-origin:50% 2%;will-change:transform;filter:drop-shadow(0 12px 14px rgba(0,0,0,.6))}

/* the print: a parchment mount standing on the mantel, inside a clip that runs from the chrome's bottom edge to the
   mantel's top — so the wreath emerges from behind the bar and the print can sink behind the board */
.in-library .rr-printclip{position:absolute;left:0;top:0;overflow:hidden;perspective:1400px}
.in-library .rr-print{position:absolute;transform-origin:50% 100%;will-change:transform;background:linear-gradient(160deg,#efe4cd,#dccaa8 60%,#cdb891);box-shadow:0 20px 44px -10px rgba(0,0,0,.75),inset 0 0 0 1px rgba(255,255,255,.35)}
.in-library .rr-print .rule{position:absolute;border:1px solid rgba(110,80,45,.5)}
.in-library .rr-print img{position:absolute;opacity:0;will-change:opacity,filter}
.in-library .rr-print .vig{position:absolute;opacity:0;will-change:opacity;background:radial-gradient(ellipse at 50% 55%,rgba(60,35,15,0) 42%,rgba(60,35,15,.6) 100%)}
.in-library .rr-print .imprint{position:absolute;left:0;right:0;text-align:right;font-family:var(--serif);font-style:italic;font-weight:500;color:#5b442e;letter-spacing:.05em;white-space:nowrap;opacity:0;will-change:opacity;line-height:1}
.in-library .rr-print .imprint b{font-style:normal;font-weight:600;font-size:1.4em;letter-spacing:.14em;color:#4a341f}

/* the book lies open at the mantel's left end; pages turn about the spine in 3-D */
.in-library .rr-book{position:absolute;perspective:520px;will-change:transform}
.in-library .rr-plane{position:absolute;inset:0;transform-style:preserve-3d;transform-origin:50% 100%;transform:rotateX(56deg)}
.in-library .rr-cover{position:absolute;left:-4%;right:-4%;top:-6%;bottom:-9%;border-radius:3px;background:linear-gradient(90deg,#4a2418,#6b3324 50%,#4a2418);box-shadow:0 8px 12px rgba(0,0,0,.55)}
.in-library .rr-leaf{position:absolute;top:0;bottom:0;width:50%;background:linear-gradient(90deg,#d9cba9,#efe4cc 22%,#e6d9bd);box-shadow:inset 0 0 6px rgba(0,0,0,.15)}
.in-library .rr-leaf.lf{left:0;border-radius:2px 0 0 2px;background:linear-gradient(270deg,#cbbc98,#efe4cc 25%,#e6d9bd)}
.in-library .rr-leaf.rt{right:0;border-radius:0 2px 2px 0}
.in-library .rr-leaf::before,.in-library .rr-page::before{content:"";position:absolute;left:15%;right:15%;top:18%;bottom:22%;background:repeating-linear-gradient(180deg,rgba(90,70,40,.38) 0 1px,transparent 1px 4px)}
.in-library .rr-page{position:absolute;left:50%;top:0;bottom:0;width:50%;transform-origin:0 50%;border-radius:0 2px 2px 0;backface-visibility:visible;will-change:transform;box-shadow:0 0 4px rgba(0,0,0,.18);background:linear-gradient(90deg,#d5c6a3,#efe4cc 25%,#e8dcc0)}

@media (prefers-reduced-motion:reduce){.in-library .rr-fl i,.in-library .rr-glow i{animation:none}}
