/* books.inspairedstudio.com — the library: a walnut card catalog, a bookcase under picture lights, a typed catalog card */

/* ---------------------------------------------------------------- hero */
.lib-hero { padding: clamp(28px, 3.6vw, 54px) 0 clamp(50px, 6vw, 90px); }
.lib-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 40px clamp(30px, 5vw, 80px); align-items: center; }
.lib-copy h1 { font-size: clamp(2.5rem, 4.8vw, 4.8rem); margin-bottom: 26px; }
html[lang="de"] .lib-copy h1 { font-size: clamp(2.3rem, 4.1vw, 4.1rem); }
.lib-copy .lead { margin-bottom: 30px; }

/* the card catalog: walnut, brass, index cards behind every drawer */
.cabinet { justify-self: center; width: min(100%, 470px); }
.cab-body { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px 18px 22px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 220, 170, .14), rgba(0, 0, 0, .3)), url('/assets/art/walnut-back.webp') center / cover, #3b2312;
  box-shadow: inset 0 2px 0 rgba(255, 220, 170, .3), inset 0 0 0 1px rgba(30, 14, 4, .8), 0 50px 80px -30px #000, 0 22px 30px -18px rgba(0, 0, 0, .9); }
.cab-body::before { content: ""; position: absolute; left: -10px; right: -10px; top: -14px; height: 16px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #8a5a32, #4a2a13); box-shadow: inset 0 1px 0 rgba(255, 220, 170, .45), 0 6px 12px rgba(0, 0, 0, .5); }
.cab-body::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -16px; height: 16px; background: linear-gradient(180deg, #2a170a, #120802); border-radius: 0 0 4px 4px; }
.drawer { position: relative; display: block; aspect-ratio: 1.22; text-decoration: none; color: inherit; perspective: 600px; }
.dr-front { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; border-radius: 5px;
  background: linear-gradient(180deg, rgba(255, 220, 170, .2), rgba(0, 0, 0, .25)), url('/assets/art/walnut-board.webp') 30% 50% / 520% 100%, #5a3519;
  box-shadow: inset 0 1px 0 rgba(255, 225, 180, .5), inset 0 -2px 4px rgba(0, 0, 0, .5), 0 3px 0 #1d0f05, 0 8px 14px -6px rgba(0, 0, 0, .9);
  transition: transform .55s var(--spring), box-shadow .55s var(--ease); }
.plate { display: grid; gap: 3px; min-width: 70%; padding: 8px 10px 9px; text-align: center; border-radius: 3px;
  background: linear-gradient(180deg, #fff6e0, #efe2c2); box-shadow: 0 0 0 3px #b98a3e, 0 0 0 4px #6d4b17, inset 0 1px 2px rgba(0, 0, 0, .2), 0 3px 4px 3px rgba(0, 0, 0, .35); }
.plate b { font: 700 .8rem/1 var(--typewriter); color: #2a2318; letter-spacing: .04em; }
.plate span { font: 600 .74rem/1.15 var(--sans); color: #4a3e2c; }
.pull { width: 44px; height: 13px; border-radius: 0 0 22px 22px; background: linear-gradient(180deg, #f3d48a, #b98a3e 55%, #6d4b17); box-shadow: 0 3px 4px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .5); }
.dr-front em { position: absolute; right: 9px; bottom: 8px; font: italic 400 .8rem/1 var(--display); letter-spacing: -.01em; color: rgba(255, 228, 190, .75); }
.dr-cards { position: absolute; left: 9%; right: 9%; top: 6%; height: 40%; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; transition: transform .55s var(--spring); }
.dr-cards i { display: block; height: 8px; margin-top: -3px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #fbf3df, #e8dcc0); box-shadow: 0 -1px 0 rgba(0, 0, 0, .15); }
.dr-cards i:nth-child(2) { margin-left: 30%; width: 22%; } .dr-cards i:nth-child(4) { margin-left: 62%; width: 24%; }
.drawer:hover .dr-front, .drawer:focus-visible .dr-front { transform: translateY(14px) translateZ(24px); box-shadow: inset 0 1px 0 rgba(255, 225, 180, .6), inset 0 -2px 4px rgba(0, 0, 0, .5), 0 3px 0 #1d0f05, 0 26px 30px -10px rgba(0, 0, 0, .95); }
.drawer:hover .dr-cards, .drawer:focus-visible .dr-cards { transform: translateY(-26px); }
.drawer:focus-visible { outline: none; }
.drawer:focus-visible .plate { box-shadow: 0 0 0 3px var(--rose), 0 0 0 5px #6d4b17; }
.cab-cap { margin: 34px 0 0; text-align: center; font: italic 400 .98rem/1.4 var(--display); letter-spacing: -.01em; color: var(--ink-3); }
@media (max-width: 900px) { .lib-grid { grid-template-columns: minmax(0, 1fr); } .cabinet { margin-top: 10px; } }

/* ---------------------------------------------------------------- the bookcase */
.library { padding: clamp(40px, 5vw, 80px) 0 var(--sec); }
.bookcase { position: relative; padding: 26px 26px 0; border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .1) 8%, rgba(0, 0, 0, .1) 92%, rgba(0, 0, 0, .55)), url('/assets/art/walnut-back.webp') center / 900px auto, #2a170b;
  box-shadow: 0 0 0 14px #3a2110, 0 0 0 15px rgba(255, 210, 150, .15), 0 60px 100px -30px #000; }
.bookcase::before, .bookcase::after { content: ""; position: absolute; top: -14px; bottom: -14px; width: 26px; z-index: 3;
  background: url('/assets/art/walnut-side.webp') center / cover, #4a2a14; box-shadow: inset -2px 0 3px rgba(0, 0, 0, .5), inset 2px 0 0 rgba(255, 220, 170, .2); }
.bookcase::before { left: -14px; border-radius: 4px 0 0 4px; } .bookcase::after { right: -14px; border-radius: 0 4px 4px 0; }
.case-row { position: relative; }
.case-row.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.case-row.split .shelf + .shelf { border-left: 18px solid transparent; border-image: url('/assets/art/walnut-side.webp') 0 30 stretch; }
.shelf { position: relative; isolation: isolate; padding: 58px 18px 0; }
.shelf.flash .lamp-light { animation: flicker 1.3s steps(1) both; }
@keyframes flicker { 0% { opacity: 0; } 10% { opacity: 1; } 16% { opacity: .2; } 24% { opacity: 1; } 30% { opacity: .5; } 40%, 100% { opacity: 1; } }
/* picture light: a brass bar with its warm cone of light over the books */
.lamp { position: absolute; left: 50%; top: 0; z-index: 4; width: min(46%, 300px); height: 14px; translate: -50% 0; border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #f6dc9b, #c08f41 45%, #7a531c); box-shadow: 0 4px 8px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6); }
.lamp i { position: absolute; left: 10%; right: 10%; bottom: -2px; height: 3px; border-radius: 3px; background: #fff2cf; box-shadow: 0 0 14px 4px rgba(255, 214, 150, .9); opacity: .25; transition: opacity .6s; }
.lamp::before { content: ""; position: absolute; left: 50%; top: -14px; width: 8px; height: 16px; translate: -50% 0; background: linear-gradient(90deg, #7a531c, #e9c87a, #7a531c); border-radius: 2px; }
.lamp-light { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease); mix-blend-mode: screen;
  background: radial-gradient(30% 34% at 50% 0%, rgba(255, 226, 180, .42), transparent 80%), radial-gradient(56% 86% at 50% 0%, rgba(255, 206, 140, .3), rgba(255, 180, 110, .1) 48%, transparent 76%); }
.shelf.lit-on .lamp-light { opacity: 1; }
.shelf.lit-on .lamp i { opacity: 1; }
.shelf-sign { position: absolute; left: 22px; top: 22px; z-index: 5; display: flex; align-items: baseline; gap: 10px; max-width: calc(100% - 44px); }
.call { flex: 0 0 auto; padding: 4px 8px 3px; border-radius: 2px; font: 700 .74rem/1 var(--typewriter); letter-spacing: .04em; color: #2a2318;
  background: linear-gradient(180deg, #fff6e0, #efe2c2); box-shadow: 0 0 0 2px #b98a3e, 0 2px 4px 2px rgba(0, 0, 0, .4); }
.shelf-sign h3 { font: 700 clamp(1.08rem, 1.45vw, 1.3rem)/1.1 var(--display); letter-spacing: -.025em; color: #fff2dd; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); white-space: nowrap; }
.case-row.split .shelf { padding-top: 76px; }
.case-row.split .shelf-sign { flex-wrap: wrap; row-gap: 4px; }
.case-row.split .shelf-sign p { flex-basis: 100%; white-space: normal; }
.shelf-sign p { margin: 0; font: italic 400 .9rem/1.2 var(--display); letter-spacing: -.01em; color: rgba(255, 228, 196, .7); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.books-row { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: clamp(14px, 2.2vw, 30px); padding: 18px 10px 0; min-height: 250px; }
.slot { position: relative; flex: 0 0 auto; width: clamp(110px, 12.5vw, 172px); scroll-margin: 120px; }
.bk { position: relative; display: block; perspective: 900px; outline: none; }
.bk-3d { position: relative; display: block; transform-style: preserve-3d; transform-origin: 50% 100%; transform: rotateX(-4deg) rotateY(var(--lean, 0deg)); transition: transform .7s var(--spring); }
.slot:nth-child(3n + 1) { --lean: 7deg; } .slot:nth-child(3n + 2) { --lean: -4deg; } .slot:nth-child(3n) { --lean: 11deg; }
.bk-face { position: relative; display: block; border-radius: 1px 4px 4px 1px; overflow: hidden;
  box-shadow: inset 4px 0 6px -2px rgba(0, 0, 0, .45), 0 18px 18px -12px rgba(0, 0, 0, .9), 8px 4px 14px -6px rgba(0, 0, 0, .7); }
.bk-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .14) 3%, transparent 7%), linear-gradient(180deg, rgba(255, 230, 190, .18), transparent 30%); }
.bk-face img { display: block; width: 100%; height: auto; }
.bk-pages { position: absolute; top: 2px; right: 0; bottom: 2px; width: 16px; transform-origin: 100% 50%; transform: rotateY(-90deg) translateZ(0);
  background: repeating-linear-gradient(90deg, #f3ead6 0 1px, #d9cdb2 1px 2px), #efe6d2; box-shadow: inset 0 0 6px rgba(0, 0, 0, .35); }
.bk-glint { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; border-radius: 1px 4px 4px 1px;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .38) 46%, transparent 56%) var(--gx, 0%) 0 / 260% 100% no-repeat; mix-blend-mode: screen; }
.bk:hover .bk-3d, .bk:focus-visible .bk-3d, .bk.open .bk-3d { transform: translateY(-14px) translateZ(46px) rotateY(22deg) rotateX(2deg); }
.bk:hover .bk-glint, .bk:focus-visible .bk-glint { opacity: 1; }
.bk:focus-visible .bk-face { outline: 2px solid var(--rose); outline-offset: 3px; }
.slot .tag { position: absolute; left: 50%; bottom: -34px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% + 10px); padding: 4px 8px 4px; translate: -50% 0; white-space: nowrap;
  border-radius: 2px; font: 700 .7rem/1 var(--typewriter); color: #2a2318; background: linear-gradient(180deg, #fff6e0, #ecdfbe); box-shadow: 0 0 0 1px #b98a3e, 0 3px 5px rgba(0, 0, 0, .45); }
.slot .tag b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.slot .tag i { flex: 0 0 auto; font-style: normal; color: #b23a74; }
.board { position: relative; z-index: 3; height: 34px; margin: 0 -18px; border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 220, 170, .32), rgba(255, 220, 170, 0) 18%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .45)), url('/assets/art/walnut-board.webp') center / 1600px 100%, #5a3519;
  box-shadow: 0 10px 18px -6px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 230, 190, .5); }
.case-row:last-child .board { margin-bottom: 0; height: 44px; }
.board::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; transition: opacity 1.2s var(--ease); mix-blend-mode: screen;
  background: radial-gradient(40% 140% at 50% 0%, rgba(255, 214, 160, .38), transparent 70%); }
.shelf.lit-on .board::after { opacity: 1; }
.shelf .books-row { padding-bottom: 34px; }

@media (max-width: 760px) {
  .bookcase { padding: 18px 12px 0; box-shadow: 0 0 0 8px #3a2110, 0 0 0 9px rgba(255, 210, 150, .15), 0 40px 70px -30px #000; }
  .bookcase::before, .bookcase::after { width: 14px; }
  .bookcase::before { left: -8px; } .bookcase::after { right: -8px; }
  .case-row.split { grid-template-columns: minmax(0, 1fr); }
  .case-row.split .shelf + .shelf { border-left: 0; }
  .books-row { overflow-x: auto; overflow-y: visible; gap: 16px; padding: 30px 6px 40px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; min-height: 0; }
  .slot { width: 128px; scroll-snap-align: start; }
  .shelf { padding: 64px 8px 0; }
  .shelf-sign { left: 10px; top: 18px; flex-wrap: wrap; row-gap: 4px; }
  .shelf-sign p { flex-basis: 100%; white-space: normal; }
  .shelf .books-row { padding-bottom: 46px; }
  .board { margin: 0 -8px; }
}

/* ---------------------------------------------------------------- the catalog card */
.card-dlg { width: min(1040px, 94vw); max-height: calc(100dvh - 24px); padding: 64px clamp(12px, 2vw, 26px) 22px; border: 0; background: transparent; color: var(--ink);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.card-dlg::backdrop { background: rgba(10, 10, 10, .74); -webkit-backdrop-filter: blur(10px) saturate(.8); backdrop-filter: blur(10px) saturate(.8); }
.card-dlg[open] { animation: dlgIn .5s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.cc { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 3.4vw, 46px); align-items: center; }
.cc-cover { perspective: 1200px; }
.cc-cover img { width: 100%; max-width: 380px; margin-left: auto; border-radius: 2px 6px 6px 2px; transform: rotateY(14deg) rotateX(3deg); transform-origin: 70% 50%; animation: coverIn .9s var(--ease);
  box-shadow: inset 4px 0 6px -2px rgba(0, 0, 0, .4), -30px 40px 70px -20px rgba(0, 0, 0, .95), -4px 0 0 rgba(255, 255, 255, .25); }
@keyframes coverIn { from { transform: rotateY(60deg) rotateX(6deg) translateX(-30px); opacity: 0; } }
.cc-card { position: relative; padding: 30px clamp(20px, 3vw, 38px) 34px; border-radius: 4px; color: #26201a; font: 400 .98rem/1.6 var(--typewriter);
  background:
    linear-gradient(180deg, transparent 0 66px, #d9465f 66px 68px, transparent 68px),
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(70, 120, 200, .28) 27px 28px) 0 68px / 100% calc(100% - 68px) no-repeat,
    url('/assets/art/card-paper.webp') center / cover, #f6efdc;
  box-shadow: 0 50px 80px -30px rgba(0, 0, 0, .95), 0 2px 0 rgba(255, 255, 255, .5) inset, 0 0 0 1px rgba(80, 60, 30, .25); transform: rotate(-.6deg); animation: cardIn .7s var(--spring); }
@keyframes cardIn { from { transform: rotate(-4deg) translateY(30px); opacity: 0; } }
.cc-card::after { content: ""; position: absolute; left: 50%; bottom: 14px; width: 16px; height: 16px; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle, #121212 55%, rgba(0, 0, 0, .25) 70%, transparent 72%); }
.cc-call { position: absolute; left: clamp(20px, 3vw, 38px); top: 26px; font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; }
.cc-shelf { position: absolute; right: clamp(20px, 3vw, 38px); top: 31px; font: italic 400 .92rem/1 var(--display); color: #6b5a40; }
.cc-author { margin: 52px 0 2px; }
.cc-title { margin: 0; font: 700 1.5rem/1.2 var(--typewriter); letter-spacing: -.01em; color: #1b1712; text-wrap: pretty; }
.cc-sub, .cc-line { margin: 0; }
.cc-facts { margin: 0; padding: 0; }
.cc-facts li::before { content: "– "; }
.cc-text { margin: 4px 0 0; font-family: var(--display); font-style: italic; font-size: 1rem; line-height: 1.58; letter-spacing: -.01em; }
.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cc-actions .btn { min-height: 46px; font-family: var(--sans); }
.cc-actions .btn-quiet { color: #26201a; border-color: rgba(38, 32, 26, .35); background: rgba(255, 255, 255, .35); }
.cc-stamp { position: absolute; right: clamp(16px, 3vw, 34px); top: 78px; padding: 6px 12px 5px; border: 3px solid currentColor; border-radius: 6px; color: rgba(190, 40, 92, .82);
  font: 900 1.08rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; transform: rotate(-8deg); opacity: 0; mix-blend-mode: multiply;
  -webkit-mask: url('/assets/art/card-paper.webp') center / 300% 300%; mask: url('/assets/art/card-paper.webp') center / 300% 300%; }
.cc-stamp.down { animation: stamp .42s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-16deg) scale(2.4); } 60% { opacity: .95; transform: rotate(-7deg) scale(.94); } 100% { opacity: .9; transform: rotate(-8deg) scale(1); } }
.cc-card.thud { animation: thud .3s ease-out; }
@keyframes thud { 0% { transform: rotate(-.6deg); } 40% { transform: rotate(-.6deg) translateY(3px) scale(.995); } 100% { transform: rotate(-.6deg); } }
.cc-close { position: absolute; right: clamp(12px, 2vw, 26px); top: 6px; z-index: 3; }
.cc-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.cc-count { min-width: 4em; text-align: center; font: 700 1.12rem/1 var(--display); letter-spacing: -.02em; color: var(--ink-2); }
@media (max-height: 760px) and (min-width: 761px) {
  .cc-cover img { max-height: 58vh; width: auto; }
  .cc-card { padding-top: 24px; padding-bottom: 26px; }
}
@media (max-width: 760px) {
  .card-dlg { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; margin: 0; padding: 70px 14px 24px; overflow-y: auto; }
  .card-dlg[open] { display: block; }
  .cc { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cc-cover img { max-width: 180px; margin: 0 auto; transform: rotateY(10deg); }
  .cc-close { position: fixed; right: 14px; top: 14px; z-index: 5; }
  .cc-title { font-size: 1.25rem; }
  .cc-stamp { top: 60px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-3d, .dr-front, .dr-cards { transition: none; }
  .lamp-light { transition: none; }
}
