@font-face {
  font-family: Manrope;
  src: url('./fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Amiko;
  src: url('./fonts/amiko.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  background: #fff;
  color: #222;
  font-family: Manrope, sans-serif;
  letter-spacing: -.1px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid #6e5d4f; outline-offset: 4px; }

.site-header { max-width: 1320px; margin: auto; padding: 26px clamp(20px, 4vw, 52px); display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.site-header a { color: inherit; text-decoration: none; }
.site-header a:hover, .site-header [aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.site-name { font-family: Amiko, Manrope, sans-serif; font-size: 1.2rem; letter-spacing: -.5px; white-space: nowrap; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .65rem 1.25rem; font-size: .9rem; }
.table { max-width: 1320px; padding: clamp(28px, 5vw, 72px) clamp(20px, 4vw, 52px) 80px; margin: auto; }
.table-heading h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 400; line-height: 1.15; margin: 0 0 clamp(32px, 5vw, 56px); }
.reading-heading { margin-bottom: clamp(40px, 6vw, 76px); text-align: center; }
.reading-heading h2 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 400; margin: 0 0 .55rem; }
.reading-heading p { font-size: .9rem; line-height: 1.55; color: #5b5752; margin: 0; }
.books { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; column-gap: clamp(24px, 3vw, 36px); row-gap: clamp(50px, 6vw, 84px); container-type: inline-size; }
.book { --cm: min(11px, calc((100cqw - 73px) / 101)); width: calc(var(--open-width) * var(--cm)); min-width: 0; }
.book h3 { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 400; line-height: 1.25; margin: 0; }
.book-detail, .book-specification { color: #5b5752; font-size: .82rem; line-height: 1.5; margin: .4rem 0 0; }

.reader { width: 100%; }
.book-slot { min-height: 0; }
.stage { position: relative; isolation: isolate; aspect-ratio: var(--spread-ratio); touch-action: pan-y; cursor: grab; user-select: none; }
.stage:active { cursor: grabbing; }
.stage.pointer-focus:focus { outline: none; }
.stage img, .stage canvas { display: block; position: absolute; width: 100%; pointer-events: none; }
.stage img { inset: 0; height: 100%; object-fit: contain; }
.stage[data-kind="cover"] img { left: var(--cover-inset); width: calc(100% - var(--cover-inset) * 2); }
.stage:not([data-kind="cover"]) img { box-shadow: 0 2px 6px #30271b25; }
.stage canvas { inset: -24% 0 auto; height: 124%; z-index: 3; }
.stage.is-turning img, .stage.is-turning .gutter { visibility: hidden; }
.gutter { position: absolute; z-index: 1; inset: 0 48% 0; pointer-events: none; background: linear-gradient(90deg, transparent, #30271b29 48%, #30271b15 55%, transparent); }
.stage[data-kind="cover"] .gutter { display: none; }
[data-binding="saddle"] .gutter { inset-inline: 49.5%; opacity: .55; }
.binding, .page-block { position: absolute; pointer-events: none; z-index: -1; }
.binding { left: calc(50% - var(--spine-width) / 2); top: 100%; width: var(--spine-width); height: clamp(2px, .65vw, 7px); border-radius: 0 0 40% 40%; background: linear-gradient(90deg,#0004,transparent 54%,#0002), var(--spine-paint, var(--binding-color,#c9bca5)); box-shadow: 0 2px 4px #30271b22; }
.stage[data-kind="cover"] .binding { top: 0; left: calc(var(--cover-inset) - var(--spine-width)); height: 100%; border-radius: 2px 0 0 2px; clip-path: polygon(0 1.1%,100% 0,100% 100%,0 98.9%); background: linear-gradient(90deg,#0006,transparent 70%,#0003), var(--spine-paint, var(--binding-color,#c9bca5)); }
.stage[data-kind="cover"][data-back] .binding { left: calc(100% - var(--cover-inset)); border-radius: 0 2px 2px 0; clip-path: polygon(0 0,100% 1.1%,100% 98.9%,0 100%); }
.stage[data-turning-cover] .binding { left: calc(var(--hinge) - var(--spine-width) * var(--hinge-bias)); top: 0; height: 100%; transform-origin: var(--binding-origin) 50%; transform: scaleX(var(--binding-scale)); opacity: var(--binding-opacity); border-radius: 2px; clip-path: polygon(0 .7%,100% 0,100% 100%,0 99.3%); }
[data-binding="saddle"] .binding { display: none; }
.page-block { inset: auto 0 -2px; height: 3px; background: #c8c2b5; box-shadow: 0 2px 4px #30271b24; }
.stage[data-kind="cover"] .page-block { inset-inline: var(--cover-inset); }
[data-binding="hardcover"] .page-block { height: 5px; bottom: -4px; background: linear-gradient(#dbd3c1 0 70%,#3b3b52 70%); }
[data-binding="saddle"] .page-block { height: 1px; bottom: -1px; box-shadow: none; }
[data-edge="graduated"] .page-block { --edge-tone: color-mix(in srgb,#373532 calc(var(--progress, 0) * 70%),#ece9e2); height: 5px; bottom: -4px; background: linear-gradient(90deg,#e9e6de,var(--edge-tone) 85%,#4a4640); }
[data-edge="graduated"] .stage[data-kind="cover"] .page-block { height: 7px; bottom: -5px; }
.stage[data-turning-cover] .page-block { visibility: hidden; }
.controls { display: flex; justify-content: flex-end; margin: .1rem 0 .2rem; }
.expand { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; color: #524b41; background: transparent; cursor: pointer; }
.expand:hover { background: #524b4110; }
.expand svg { width: 22px; height: 22px; }
.collapse-icon, .reading-room .expand-icon { display: none; }
.reading-room .collapse-icon { display: inline; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.reading-room { max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; border: 0; padding: 12px 22px; background: #faf9f6; }
.reading-room[open] { display: grid; place-items: center; }
.reading-room::backdrop { background: #faf9f6; }
body:has(.reading-room[open]) { overflow: hidden; }
.embedded .site-header, .embedded .table-heading { display: none; }
.embedded .table { padding: 0 clamp(16px, 2vw, 32px) 32px; }
.embedded .reading-heading { margin-top: 8px; }
.reading-slot { width: 100%; }
.reading-room .reader { width: min(100%, 1200px, calc((100dvh - 105px) * var(--spread-ratio) * .80)); margin: auto; padding-top: min(9vh, 84px); }

@media (max-width: 850px) { .book { width: min(100%, max(260px, calc(var(--open-width) * 8px))); } }
@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: 12px; }
  .books { gap: 56px; }
  .book { width: min(100%, 500px); }
  .reading-room { padding-inline: 12px; }
}
