/* 직지관: 로비와 같은 먹빛 공간에 호두나무 서가. 책은 표지가 앞을 보고 서 있는 입체 책(책등·뒷면은 표지 색) */
:root {
  --night: #12110F; --ink-on: #EFEBE4; --dim: #A29C91; --hair: rgba(239, 235, 228, .14); --seal: #D2271D; --paper: #E9E4DA; --gold: #D8BF8A;
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --serif: "EB Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --kserif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  --gut: clamp(20px, 3.4vw, 52px);
  /* 나뭇결: 세로결(벽)과 가로결(선반). 어두운 결과 밝은 결 두 겹 */
  --grain-v: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04 0.002' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .03 0 0 0 0 .015 2.4 0 0 0 -.95'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.13 0.004' numOctaves='3' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .43 0 0 0 0 .27 1.6 0 0 0 -.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='.3'/%3E%3C/svg%3E");
  --grain-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2400' height='120'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0018 0.09' numOctaves='4' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .03 0 0 0 0 .015 2.4 0 0 0 -.95'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.25' numOctaves='3' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .7 0 0 0 0 .5 0 0 0 0 .32 1.6 0 0 0 -.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='.3'/%3E%3C/svg%3E");
  /* 종이 결: 내지 옆면(세로 결)과 위·아래(가로 결) */
  --pg-v: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='1200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9 0.006' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .33 0 0 0 0 .2 1.4 0 0 0 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  --pg-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006 0.9' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .33 0 0 0 0 .2 1.4 0 0 0 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; background: var(--night); }
body { margin: 0; background: var(--night); color: var(--ink-on); font-family: var(--sans); font-weight: 300; line-height: 1.7;
  word-break: keep-all; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--ink-on); outline-offset: 3px; }

/* 위 막대 */
.bar { position: fixed; z-index: 40; inset: 0 0 auto 0; display: flex; align-items: center; gap: 28px; padding: 22px var(--gut); font-size: 13px; letter-spacing: .08em;
  background: linear-gradient(180deg, rgba(18, 17, 15, .92), rgba(18, 17, 15, 0)); }
.bar__brand { display: flex; align-items: center; gap: 12px; letter-spacing: .3em; font-weight: 400; }
.bar__brand img { width: 22px; height: 22px; }
.bar__nav { display: flex; gap: 26px; margin-left: auto; }
.bar__nav a { position: relative; color: var(--dim); transition: color .25s; }
.bar__nav a[aria-current="page"], .bar__nav a:hover { color: var(--ink-on); }
.bar__nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .4s ease; }
.bar__nav a:hover::after, .bar__nav a[aria-current="page"]::after { transform: none; }
.bar__lang { display: flex; gap: 4px; }
.bar__lang button { font: inherit; letter-spacing: .1em; background: none; border: 0; color: var(--dim); cursor: pointer; padding: 6px 6px; }
.bar__lang button[aria-pressed="true"] { color: var(--ink-on); }

/* 도서관 머리: 관 이름과 찾기 */
.lib { padding: clamp(104px, 10vw, 128px) 0 150px; }
.lib__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px; padding: 0 var(--gut); }
.lib__id { display: grid; gap: 4px; }
.lib__no { margin: 0; font-size: 12px; letter-spacing: .3em; color: var(--seal); }
.lib__name { margin: 0; font-weight: 200; font-size: clamp(44px, 6vw, 84px); line-height: 1.1; letter-spacing: .12em; }
html[lang="en"] .lib__name { font-family: var(--serif); font-weight: 400; letter-spacing: .02em; }
.lib__count { margin: 6px 0 0; font-size: 13px; letter-spacing: .08em; color: var(--dim); }
.search { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); height: 48px; padding: 0 16px; border: 1px solid rgba(239, 235, 228, .22); background: rgba(239, 235, 228, .03); transition: border-color .25s; cursor: text; }
.search:focus-within { border-color: rgba(239, 235, 228, .6); }
.search svg { flex: none; width: 17px; height: 17px; fill: none; stroke: var(--dim); stroke-width: 1.6; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink-on); font: inherit; font-size: 16px; letter-spacing: .02em; }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.sec__h { margin: 0 0 16px; font-weight: 300; font-size: 13px; letter-spacing: .24em; color: var(--dim); }

/* 지금 읽는 책 */
.now { margin: clamp(36px, 4vw, 52px) var(--gut) 0; }
.now__card { display: flex; align-items: center; gap: clamp(22px, 3vw, 36px); max-width: 640px; padding: 22px 28px 22px 26px; border: 1px solid var(--hair); background: rgba(239, 235, 228, .025); transition: border-color .3s; }
.now__card:hover { border-color: rgba(239, 235, 228, .4); }
.now__text { display: grid; gap: 4px; min-width: 0; flex: 1; }
.now__title { font-size: 20px; font-weight: 400; line-height: 1.35; }
html[lang="en"] .now__title { font-family: var(--serif); font-size: 23px; }
.now__meta { font-size: 13px; color: var(--dim); }
.now__bar { display: block; height: 2px; margin: 10px 0 4px; background: rgba(239, 235, 228, .12); }
.now__bar i { display: block; height: 100%; background: var(--seal); }
.now__go { margin-top: 8px; font-size: 13px; letter-spacing: .08em; }

/* 서가: 짙은 호두나무 벽과 선반. 책은 표지를 앞으로 하고 반듯이 서 있다가 마우스를 올리면 돌아서 책등·책장이 보인다 */
.case { margin-top: clamp(40px, 5vw, 64px); }
.shelf { position: relative; --bw: clamp(124px, 13.5vw, 212px); --room: clamp(40px, 4vw, 64px); --lip: 26px; --top: 14px;
  --base: calc(var(--room) + var(--bw) * 1.5); }
.shelf__wall { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--base) + 2px);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 54px),
    radial-gradient(ellipse 70% 120% at 30% 0%, rgba(255, 206, 150, .10), rgba(255, 206, 150, 0) 70%),
    linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 12%, rgba(0, 0, 0, 0) 88%, rgba(0, 0, 0, .35)),
    var(--grain-v), #2B1C13; }
.shelf__board { position: absolute; left: 0; right: 0; top: var(--base); height: calc(var(--top) + var(--lip)); }
/* 선반 윗면(책이 서 있는 면)과 앞판 */
.shelf__board::before { content: ""; position: absolute; left: 0; right: 0; top: calc(-1 * var(--top) / 2); height: var(--top);
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0)), var(--grain-h), #5A3B26; }
.shelf__board::after { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--top) / 2); height: var(--lip);
  background: linear-gradient(180deg, rgba(255, 220, 180, .16), rgba(255, 220, 180, 0) 2px, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .3)), var(--grain-h), #3E2818;
  box-shadow: 0 16px 28px -6px rgba(0, 0, 0, .7); }
.shelf__tag { position: absolute; z-index: 2; left: var(--gut); top: calc(var(--top) / 2 + 3px); height: calc(var(--lip) - 6px); display: flex; align-items: center; gap: 8px; padding: 0 10px;
  font-size: 11.5px; letter-spacing: .14em; line-height: 1; color: #2A211A; background: linear-gradient(180deg, #EFE6D2, #DCD0B6);
  box-shadow: inset 0 0 0 1px rgba(120, 96, 60, .5), 0 0 0 2px #8D7550, 0 0 0 3px rgba(0, 0, 0, .35); }
.shelf__tag small { font-size: 11.5px; color: #6B5A45; }
.shelf__scroll { position: relative; z-index: 1; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.shelf__scroll::-webkit-scrollbar { display: none; }
.shelf__row { list-style: none; display: flex; gap: clamp(28px, 4vw, 64px); margin: 0; padding: var(--room) var(--gut) 0 calc(var(--gut) + 8px); width: max-content; min-width: 100%; }
.bk { flex: none; width: var(--bw); scroll-snap-align: start; scroll-margin-left: var(--gut); }
.bk__link { display: block; }
.bk__book { display: block; height: calc(var(--bw) * 1.5); }
.bk__text { display: grid; gap: 2px; padding-top: calc(var(--top) / 2 + var(--lip) + 16px); }
.bk__title { font-size: 15px; font-weight: 400; line-height: 1.4; }
html[lang="en"] .bk__title { font-family: var(--serif); font-size: 17px; }
.bk__meta { font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.bk__meta.is-reading { color: var(--ink-on); }
.bk__meta.is-reading::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; vertical-align: 2px; background: var(--seal); }
.none { margin: 28px var(--gut) 0; font-size: 14px; color: var(--dim); }
/* 표지 출처: 서가 아래 한 줄 */
.lib__credit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: clamp(44px, 5vw, 64px) var(--gut) 0; font-size: 12.5px; letter-spacing: .02em; color: var(--dim); }
.lib__lic { color: var(--ink-on); border-bottom: 1px solid var(--hair); }
.lib__lic:hover { border-color: var(--ink-on); }

/* 입체 책(양장본): 판지 두께(--bt)와 판지가 내지보다 나온 만큼(--sq). 면마다 밝기(--lf 앞, --lk 뒤, --ls 책등, --lp 옆, --lt 위)는 돌아간 각도에 따라 스크립트가 정한다 */
.b3 { --d: calc(var(--w) * var(--t, .14)); --h: calc(var(--w) * 1.5); --bt: calc(var(--w) * .022); --sq: calc(var(--w) * .014);
  --edge: color-mix(in srgb, var(--bg) 82%, #000); --endpaper: #8E1C15;
  position: relative; display: block; width: var(--w); height: var(--h); perspective: 1700px; perspective-origin: 50% 40%; }
.b3--shelf { --w: var(--bw, 160px); }
.b3--now { --w: 84px; perspective: 1100px; }
.b3--large { --w: clamp(220px, 26vw, 330px); perspective: 2100px; }
.b3[data-drag] { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.b3.is-drag { cursor: grabbing; }
.b3 img { -webkit-user-drag: none; }
.b3__body { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rest-x, 0deg)) rotateY(var(--rest, 0deg)); }
.b3.is-tilt .b3__body, .b3.is-back .b3__body, .b3.is-drag .b3__body { will-change: transform; }
/* 면 가장자리 계단 막기: 1px 투명 테두리를 두르고 그림은 그 안쪽(padding-box)에만 칠해, 기울어진 가장자리가 그림 안에서 부드럽게 걸러지게 한다 */
.b3__face { position: absolute; left: 50%; top: 50%; display: block; width: calc(var(--fw) + 2px); height: calc(var(--fh) + 2px); margin: calc((var(--fh) + 2px) / -2) 0 0 calc((var(--fw) + 2px) / -2);
  border: 1px solid transparent; background-clip: padding-box; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
/* 앞·뒤 판지 바깥 */
.b3__front, .b3__back { --fw: var(--w); --fh: var(--h); overflow: hidden; background: var(--bg); }
.b3__front { transform: translateZ(calc(var(--d) / 2)); filter: brightness(var(--lf, 1)); }
.b3__back { transform: translateZ(calc(var(--d) / -2)) rotateY(180deg); color: var(--fg); filter: brightness(var(--lk, 1)); }
.b3__front .cover__img { width: 100%; height: 100%; object-fit: cover; }
/* 양장본 홈: 책등 쪽에 눌린 줄과 얕은 그늘 */
.b3__front::after, .b3__back::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .26), rgba(0, 0, 0, .06) 1.6%, rgba(255, 255, 255, .10) 2.6%, rgba(0, 0, 0, .14) 4%, rgba(255, 255, 255, .04) 5%, rgba(0, 0, 0, 0) 7.5%); }
.b3__back::after { transform: scaleX(-1); }
/* 책등 */
.b3__spine { --fw: var(--d); --fh: var(--h); transform: translateX(calc(var(--w) / -2)) rotateY(-90deg); filter: brightness(var(--ls, .8));
  display: flex; flex-direction: column; align-items: center; padding: calc(var(--h) * .07) 0 calc(var(--h) * .045); overflow: hidden; color: var(--fg);
  background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .06) 9%, rgba(255, 255, 255, .08) 40%, rgba(0, 0, 0, .02) 70%, rgba(0, 0, 0, .06) 91%, rgba(0, 0, 0, .34)), var(--bg); }
.b3__st { writing-mode: vertical-rl; white-space: nowrap; line-height: 1; font-family: var(--serif); font-size: calc(var(--d) * .42); letter-spacing: .08em; text-transform: uppercase; }
.b3__sa { margin-top: calc(var(--d) * .5); writing-mode: vertical-rl; white-space: nowrap; line-height: 1; font-family: var(--serif); font-size: calc(var(--d) * .26); letter-spacing: .1em; opacity: .8; }
.b3__spine.is-ko .b3__st, .b3__spine.is-ko .b3__sa { text-orientation: upright; text-transform: none; }
.b3__spine.is-ko .b3__st { font-size: calc(var(--d) * .5); letter-spacing: .06em; }
.b3__spine.is-ko .b3__sa { font-size: calc(var(--d) * .3); letter-spacing: .02em; }
.b3__spine--serif.is-ko .b3__st { font-family: var(--kserif); font-weight: 900; }
.b3__spine--serif.is-ko .b3__sa { font-family: var(--kserif); font-weight: 500; }
.b3__spine--sans .b3__st { font-family: var(--sans); font-weight: 700; }
.b3__spine--sans .b3__sa { font-family: var(--sans); font-weight: 400; }
.b3__spine img { width: calc(var(--d) * .46); height: auto; margin-top: auto; }
/* 판지 옆면: 표지 천이 감싼 두께 */
.b3__edge { background: linear-gradient(90deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .18)), var(--edge); }
.b3__edge--ff, .b3__edge--bf { --fw: var(--bt); --fh: var(--h); filter: brightness(var(--lp, .6)); }
.b3__edge--ff { transform: translate3d(calc(var(--w) / 2), 0, calc(var(--d) / 2 - var(--bt) / 2)) rotateY(90deg); }
.b3__edge--bf { transform: translate3d(calc(var(--w) / 2), 0, calc(var(--bt) / 2 - var(--d) / 2)) rotateY(90deg); }
.b3__edge--top, .b3__edge--bot { --fw: var(--w); --fh: var(--bt); }
.b3__edge--top { filter: brightness(var(--lt, .8)); }
.b3__edge--bot { filter: brightness(.5); }
.b3__edge--ft { transform: translate3d(0, calc(var(--h) / -2), calc(var(--d) / 2 - var(--bt) / 2)) rotateX(90deg); }
.b3__edge--bt { transform: translate3d(0, calc(var(--h) / -2), calc(var(--bt) / 2 - var(--d) / 2)) rotateX(90deg); }
.b3__edge--fb { transform: translate3d(0, calc(var(--h) / 2), calc(var(--d) / 2 - var(--bt) / 2)) rotateX(-90deg); }
.b3__edge--bb { transform: translate3d(0, calc(var(--h) / 2), calc(var(--bt) / 2 - var(--d) / 2)) rotateX(-90deg); }
/* 판지 안쪽 면지: 인주색. 옆에서 보면 판지와 내지 사이로 가늘게 보인다 */
/* 책등 쪽은 3px 안으로 들여(책등 옆에 붉은 줄이 비치지 않게), 앞쪽 끝은 판지 끝까지 */
.b3__inner { --fw: calc(var(--w) - 3px); --fh: calc(var(--h) - 1px); background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .12)), var(--endpaper); }
.b3__inner--f { transform: translate3d(1.5px, 0, calc(var(--d) / 2 - var(--bt))) rotateY(180deg); filter: brightness(calc(var(--lk, .6) * .72)); }
.b3__inner--b { transform: translate3d(1.5px, 0, calc(var(--bt) - var(--d) / 2)); filter: brightness(calc(var(--lf, 1) * .72)); }
/* 내지 묶음: 한 장 한 장 겹친 종이 결, 판지 가까이는 그늘. 판지 안쪽 면과 1px 띄움(면이 맞닿아 겹치면 그 줄이 톱니처럼 깨져 보임) */
.b3__pages { background-color: #EFE7D6; }
.b3__pages--fore { --fw: calc(var(--d) - var(--bt) * 2 - 2px); --fh: calc(var(--h) - var(--sq) * 2); transform: translateX(calc(var(--w) / 2 - var(--sq))) rotateY(90deg); filter: brightness(var(--lp, .6));
  background-image:
    linear-gradient(90deg, rgba(70, 50, 25, .34), rgba(70, 50, 25, .06) 10%, rgba(70, 50, 25, 0) 22%, rgba(70, 50, 25, 0) 78%, rgba(70, 50, 25, .06) 90%, rgba(70, 50, 25, .34)),
    linear-gradient(180deg, rgba(70, 50, 25, .14), rgba(70, 50, 25, 0) 4%, rgba(70, 50, 25, 0) 96%, rgba(70, 50, 25, .14)),
    var(--pg-v),
    repeating-linear-gradient(90deg, rgba(120, 98, 66, .16) 0 1px, rgba(0, 0, 0, 0) 1px 2px, rgba(120, 98, 66, .08) 2px 3px, rgba(0, 0, 0, 0) 3px 5px); }
/* 위·아래 면은 비스듬히 보이므로 종이 줄을 경계 없이 번지게 그림(날카로운 1px 줄은 계단처럼 깨져 보임) */
.b3__pages--top, .b3__pages--bottom { --fw: calc(var(--w) - var(--sq) - var(--bt)); --fh: calc(var(--d) - var(--bt) * 2 - 2px);
  background-image:
    linear-gradient(90deg, rgba(70, 50, 25, .3), rgba(70, 50, 25, 0) 8%),
    linear-gradient(180deg, rgba(70, 50, 25, .3), rgba(70, 50, 25, .05) 10%, rgba(70, 50, 25, 0) 22%, rgba(70, 50, 25, 0) 78%, rgba(70, 50, 25, .05) 90%, rgba(70, 50, 25, .3)),
    var(--pg-h),
    repeating-linear-gradient(180deg, rgba(120, 98, 66, .09), rgba(120, 98, 66, 0) 1.5px, rgba(120, 98, 66, .05) 3px, rgba(120, 98, 66, 0) 4.5px); }
.b3__pages--top { transform: translate3d(calc((var(--bt) - var(--sq)) / 2), calc(var(--h) / -2 + var(--sq)), 0) rotateX(90deg); filter: brightness(var(--lt, .8)); }
.b3__pages--bottom { transform: translate3d(calc((var(--bt) - var(--sq)) / 2), calc(var(--h) / 2 - var(--sq)), 0) rotateX(-90deg); filter: brightness(.5); }
/* 그림자: 벽에 지는 그림자와 바닥에 닿는 그림자. 기울기 반대쪽으로 움직인다 */
.b3__shadow { position: absolute; left: 4%; right: 6%; top: 3%; bottom: 0; background: rgba(0, 0, 0, .62); filter: blur(var(--sb, 12px));
  transform: translate(var(--sx, 5px), var(--sy, 4px)); opacity: calc(.75 - var(--lit, 0) * .15); }
.b3::after { content: ""; position: absolute; left: 4%; right: 2%; bottom: -5px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .7); filter: blur(5px); opacity: calc(1 - var(--lit, 0) * .7); }
.b3--large::after, .b3--now::after { display: none; }
/* 빛: 빛 받는 쪽이 살짝 밝고 반대쪽이 살짝 어둡다(soft-light) + 좁고 흐린 하이라이트 + 비치는 사선 띠 */
.b3__glare { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; overflow: hidden; transition: opacity .6s ease; }
.b3.is-tilt .b3__glare { opacity: 1; }
.b3__glare::before { content: ""; position: absolute; inset: -25%; mix-blend-mode: soft-light; opacity: .34;
  background: radial-gradient(farthest-corner circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, .25) 28%, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, .3) 100%); }
.b3__glare::after { content: ""; position: absolute; inset: -35%; mix-blend-mode: screen; filter: blur(16px); opacity: .85;
  background:
    radial-gradient(ellipse 26% 18% at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 72%),
    linear-gradient(calc(104deg + var(--ry, 0deg) * 1.5), rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .02) 46%, rgba(255, 255, 255, .055) 50%, rgba(255, 255, 255, .02) 54%, rgba(255, 255, 255, 0) 60%);
  background-size: 100% 100%, 240% 240%;
  background-position: 0 0, calc(var(--gx, 50%) * 1.3 - 15%) calc(var(--gy, 50%) * 1.3 - 15%); }

/* 뒷표지 */
.bb { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 13% 12% 9%; container-type: inline-size; }
.bb__label { font-size: max(11px, 3.6cqw); letter-spacing: .2em; opacity: .7; }
.bb__quote { margin-top: 5cqw; font-family: var(--serif); font-size: max(14px, 7cqw); line-height: 1.38; }
.bb__quote::before { content: "\201C"; }
.bb__quote::after { content: "\201D"; }
.bb__rule { display: block; width: 12cqw; height: 1px; margin: 9cqw 0 6cqw; background: currentColor; opacity: .5; }
.bb__title { font-size: max(13px, 6.4cqw); font-weight: 500; line-height: 1.3; }
.bb__author { margin-top: 1cqw; font-size: max(12px, 4.4cqw); opacity: .8; }
.bb__foot { display: flex; align-items: center; gap: 2.6cqw; margin-top: auto; font-size: max(11px, 3.6cqw); letter-spacing: .12em; opacity: .85; }
.bb__foot img { width: 7cqw; height: 7cqw; }

/* 기본 표지(그림이 없을 때): 천을 씌운 양장본, 책 색 천 위에 금박 글자로 제목·저자·기본 정보 */
.dc { position: relative; display: block; width: 100%; height: 100%; color: var(--gold); container-type: inline-size; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, rgba(255, 255, 255, 0) 1px 3px),
    radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 60%),
    var(--book); }
.dc--dots { background-image: radial-gradient(rgba(0, 0, 0, .16) 1px, rgba(0, 0, 0, 0) 1.6px),
  repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, rgba(0, 0, 0, 0) 1px 3px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, rgba(255, 255, 255, 0) 1px 3px),
  radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 60%); background-size: 9px 9px, auto, auto, auto; }
.dc--lines { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .12) 0 1px, rgba(0, 0, 0, 0) 1px 7px),
  repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, rgba(0, 0, 0, 0) 1px 3px), radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 60%); }
.dc--waves { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='12'%3E%3Cpath d='M0 9 Q7 3 14 9 T28 9' fill='none' stroke='%23000' stroke-opacity='.16' stroke-width='1'/%3E%3C/svg%3E"),
  repeating-linear-gradient(0deg, rgba(0, 0, 0, .07) 0 1px, rgba(0, 0, 0, 0) 1px 3px), radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 60%); background-size: 28px 12px, auto, auto; }
.dc__frame { position: absolute; inset: 6%; display: flex; flex-direction: column; padding: 9% 8% 8%; border: 1px solid rgba(216, 191, 138, .55); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0), inset 0 0 0 4px rgba(216, 191, 138, .3);
  background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .1)); }
.dc__hall { font-size: max(11px, 4.2cqw); letter-spacing: .12em; line-height: 1.4; opacity: .8; }
.dc__title { margin-top: 12cqw; font-family: var(--serif); font-size: 12cqw; line-height: 1.04; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.dc__sub { display: block; margin-top: 3cqw; font-family: var(--serif); font-size: max(12px, 5.4cqw); font-style: italic; line-height: 1.25; opacity: .85; }
.dc__rule { display: block; width: 14cqw; height: 1px; margin: 7cqw 0 0; background: currentColor; opacity: .6; }
.dc__author { margin-top: auto; font-family: var(--serif); font-size: max(14px, 6.4cqw); line-height: 1.3; }
.dc__life { display: block; font-size: max(11px, 4.2cqw); letter-spacing: .1em; opacity: .75; }
.dc__facts { margin-top: 3cqw; font-size: max(11px, 3.8cqw); letter-spacing: .04em; opacity: .75; }
.dc__seal { position: absolute; right: 8%; bottom: 8%; width: 4cqw; height: 4cqw; background: var(--seal); }
.dc--small { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; height: auto; }
.dc__init { font-family: var(--serif); font-size: 46cqw; line-height: 1; }
.dc--small .dc__seal { width: 7cqw; height: 7cqw; right: 12%; bottom: 9%; }
.cover__img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }

/* 관장 명함 단추: 연락이 필요한 곳에 둔다(정정 요청 등) */
.card-link { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; height: 36px; padding: 0 14px 0 12px; border: 1px solid rgba(239, 235, 228, .42); background: none;
  color: var(--ink-on); font: inherit; font-size: 12.5px; letter-spacing: .1em; white-space: nowrap; cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
dd .card-link { display: flex; width: max-content; }
.card-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card-link::after { content: ""; width: 6px; height: 6px; margin-left: 2px; background: var(--seal); }
.card-link:hover, .card-link:focus-visible { background: var(--ink-on); color: var(--night); border-color: var(--ink-on); }
/* 명함 창: 명함 쪽과 같은 바탕색으로 덮고, 다 받으면 명함이 떠오른다(로비와 같음) */
.cardbox { position: fixed; inset: 0; z-index: 90; background: #24231F; opacity: 0; transition: opacity .4s ease; }
.cardbox.is-open { opacity: 1; }
.cardbox__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transform: scale(.985); transition: opacity .5s ease .05s, transform .6s cubic-bezier(.2, .7, .1, 1) .05s; }
.cardbox.is-loaded.is-open .cardbox__frame { opacity: 1; transform: none; }
.cardbox__close { position: absolute; z-index: 1; top: calc(16px + env(safe-area-inset-top)); right: var(--gut); display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px;
  border: 1px solid rgba(239, 235, 228, .3); background: rgba(18, 17, 15, .45); color: var(--ink-on); font: inherit; font-size: 12.5px; letter-spacing: .12em; cursor: pointer; transition: background .25s, color .25s; }
.cardbox__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.cardbox__close:hover, .cardbox__close:focus-visible { background: var(--ink-on); color: var(--night); }
html.is-card { overflow: hidden; }

/* 아래 독(로비와 같은 모양) */
.dock { position: fixed; z-index: 44; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: stretch; height: 44px; padding: 0 6px; background: rgba(18, 17, 15, .62); border: 1px solid rgba(239, 235, 228, .14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: .9; transition: opacity .5s ease, transform .5s ease; }
.dock.is-moving { opacity: .45; }
.dock.is-away { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.dock:hover, .dock:focus-within { opacity: 1; }
.dock__item { position: relative; display: flex; align-items: center; gap: 9px; padding: 0 16px; color: var(--dim); font-size: 12.5px; letter-spacing: .08em; line-height: 1; white-space: nowrap; transition: color .25s ease; }
.dock__item::before { content: ""; position: absolute; left: 16px; right: 16px; bottom: 8px; height: 1px; background: var(--ink-on); transform: scaleX(0); transition: transform .3s ease; }
a.dock__item:hover, a.dock__item:focus-visible { color: var(--ink-on); }
a.dock__item:hover::before, a.dock__item:focus-visible::before { transform: scaleX(1); }
.dock__item.is-here { color: var(--ink-on); }
.dock__item.is-here::before { background: var(--seal); transform: scaleX(1); }
.dock__item[aria-disabled] { color: rgba(162, 156, 145, .55); cursor: default; }
.dock__glyph svg { display: block; width: 15px; height: 15px; }
.dock__kind { opacity: .7; }  /* 관 이름 옆 갈래(로비와 같음), 휴대폰은 이름만 */
.dock__sep { width: 1px; margin: 12px 4px; background: rgba(239, 235, 228, .14); }
.dock__tip { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%); display: none; padding: 6px 10px; white-space: nowrap;
  font-size: 11.5px; letter-spacing: .06em; line-height: 1.3; color: var(--ink-on); background: rgba(18, 17, 15, .92); border: 1px solid rgba(239, 235, 228, .14); pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .dock__item:hover .dock__tip, .dock__item:focus-visible .dock__tip { display: block; } }

/* 맨 위로 */
.totop { position: fixed; z-index: 44; right: var(--gut); bottom: calc(16px + env(safe-area-inset-bottom)); height: 44px; display: flex; align-items: center; gap: 7px; padding: 0 14px;
  font: inherit; font-size: 11.5px; letter-spacing: .14em; color: var(--dim); background: rgba(18, 17, 15, .62); border: 1px solid rgba(239, 235, 228, .14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .4s ease, visibility .4s, transform .4s ease, color .25s ease; }
.totop svg { display: block; width: 14px; height: 14px; }
.totop.is-on { opacity: .9; visibility: visible; transform: none; }
.totop:hover, .totop:focus-visible { color: var(--ink-on); opacity: 1; }

/* 휴대폰 */
@media (max-width: 760px) {
  .bar { padding: 16px 18px; gap: 14px; }
  .bar__brand span { display: none; }
  .bar__brand { min-width: 44px; min-height: 44px; }
  .bar__nav { gap: 18px; }
  .lib { padding-top: 92px; padding-bottom: 130px; }
  .lib__head { padding: 0 18px; gap: 20px; }
  .search { width: 100%; }
  .now { margin: 30px 18px 0; }
  .now__card { padding: 18px 18px 18px 16px; gap: 18px; }
  .b3--now { --w: 68px; }
  .shelf { --bw: 112px; --room: 36px; --lip: 20px; }
  .shelf__row { gap: 26px; padding-left: 26px; padding-right: 18px; }
  .shelf__tag { left: 18px; }
  .bk__title { font-size: 14px; }
  .dock { height: 54px; padding: 0 4px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .dock__item { flex-direction: column; justify-content: center; gap: 6px; min-width: 60px; padding: 0 10px; font-size: 11px; letter-spacing: .04em; }
  .dock__item::before { left: 50%; right: auto; width: 14px; margin-left: -7px; bottom: 5px; }
  .dock__glyph svg { width: 17px; height: 17px; }
  .dock__kind { display: none; }
  .dock__sep { margin: 14px 2px; }
  .totop { right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 40px; height: 40px; padding: 0; justify-content: center; }
  .totop span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dock, .totop, .b3__glare, .cardbox, .cardbox__frame { transition: none; } }
