@font-face { font-family: "Oxanium"; src: url("fonts/Oxanium-VF.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
:root { --bg: #000; --ui: #8c8c88; --ui-hi: #e8e8e4; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ui); overflow: hidden;
  font: 500 10px/1 "Oxanium", "Helvetica Neue", Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:hover, a:hover { color: var(--ui-hi); }
button:focus-visible, a:focus-visible { outline: 1px solid var(--ui-hi); outline-offset: 6px; }
button:disabled { opacity: .25; cursor: default; }
a { color: inherit; text-decoration: none; }

header { height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 28px; }
header .title { color: var(--ui-hi); letter-spacing: .3em; }
#counter { justify-self: end; min-width: 120px; text-align: right; }

main { position: relative; height: calc(100dvh - 122px); display: flex; align-items: center; justify-content: center; padding: 12px 72px 20px; }
.stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#book { transition: transform .85s cubic-bezier(.2, .65, .2, 1); }
#book.closed { transform: translateX(-25%); }
#book.back { transform: translateX(25%); }

.page { background: #fff; overflow: hidden; }
.page img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
/* gutter shading so a spread reads as a bound book */
.page.--left::after, .page.--right::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.page.--left::after { background: linear-gradient(90deg, transparent 90%, rgba(0,0,0,.05) 95%, rgba(0,0,0,.22) 100%); }
.page.--right::after { background: linear-gradient(90deg, rgba(0,0,0,.2), transparent 9%); }

.cover { background: #0d0d0d; color: #e8e8e4; box-shadow: inset 0 0 0 1px #222; }
.cover .t, .cover .a { position: absolute; left: 11%; }
.cover .t { top: 10%; }
.cover .a { bottom: 9%; }
.cover .t { font-weight: 300; font-size: clamp(18px, 3.4vw, 42px); letter-spacing: .14em; }
.cover .a { font-size: clamp(7px, .8vw, 10px); letter-spacing: .3em; color: #9a9a96; }
.endpaper { background: #161616; }

.arrow { position: absolute; top: 50%; transform: translateY(-50%); padding: 16px; z-index: 5; display: flex; }
.arrow svg { width: 14px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1; }
.prev { left: 14px; } .next { right: 14px; }

footer { height: 58px; display: flex; align-items: center; justify-content: center; position: relative; font-size: 9px; }
#zoom { position: absolute; right: 28px; font-size: 9px; padding: 10px 0; }

dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 56px 18px 18px; border: 0; background: #000; color: var(--ui); }
dialog::backdrop { background: #000; }
.tools { position: absolute; top: 20px; left: 24px; display: flex; gap: 16px; align-items: center; }
.tools .tip { margin-left: 12px; font-size: 9px; }
#zoom-level { min-width: 42px; text-align: center; }
#dismiss { position: absolute; top: 20px; right: 24px; }
#enlarged { position: relative; width: 100%; height: 100%; overflow: hidden; cursor: grab; touch-action: none; }
#enlarged.dragging { cursor: grabbing; }
#canvas { position: absolute; left: 50%; top: 50%; display: flex; transform-origin: 0 0; }
#canvas img { display: block; height: 100%; width: auto; user-select: none; -webkit-user-drag: none; }

@media (max-width: 700px) {
  header { padding: 0 16px; font-size: 8px; } #counter { min-width: 70px; }
  main { padding: 10px 34px 14px; }
  .prev { left: 0; } .next { right: 0; } .arrow { padding: 10px; }
  #book.closed, #book.back { transform: none; }
  footer { justify-content: flex-start; padding-left: 16px; font-size: 7px; }
  #zoom { right: 16px; font-size: 8px; }
  .tools .tip { display: none; }
}
@media (prefers-reduced-motion: reduce) { #book { transition: none; } }
.cover.art { padding: 0; box-shadow: inset 0 0 0 1px #1a1a1a; }
.cover.art img { object-fit: cover; }
