/* Globestar Docs (docs.globestarsolutions.eu) — premium private library. Self-hosted fonts only. */
:root {
  --navy: #0b1a33;
  --navy-2: #12243f;
  --cream: #f4efe4;
  --ivory: #fbf7ef;
  --ink: #1c140c;
  --muted: #5c5146;
  --gold: #c9a24a;
  --gold-hi: #f0dc9a;
  --gold-lo: #8a6a28;
  --star: #d4ff3a;
  --accent: #3b82f6;
  --paper: #f7f1e6;
  --shelf: #c4a574;
  --shelf-dark: #6b4a2a;
  --wood-hi: #e2c899;
  --wood-lo: #8a5a2c;
  --wall: #d8cbb6;
  --shadow: rgba(28, 16, 6, .55);
  --header-h: 4.25rem;
  --font-ui: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Times New Roman", serif;
  --font-display: "Cormorant Garamond", "Palatino Linotype", serif;
  --font-foil: "Cinzel", "Palatino Linotype", serif;
  color-scheme: light;
}
html.dark {
  --cream: #141820;
  --ivory: #0e1218;
  --ink: #f3eee4;
  --muted: #b7ab9a;
  --paper: #1a1612;
  --shelf: #3a2a1c;
  --shelf-dark: #1a110c;
  --wood-hi: #6a4a2c;
  --wood-lo: #2a1a10;
  --wall: #0b1220;
  --shadow: rgba(0, 0, 0, .72);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--wall); }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(240, 220, 154, .18), transparent 60%),
    radial-gradient(900px 500px at 80% 110%, rgba(11, 26, 51, .18), transparent 55%),
    var(--wall);
  min-height: 100vh;
  min-height: 100dvh;
}
html.dark body {
  background:
    radial-gradient(1000px 500px at 20% -10%, rgba(59, 130, 246, .12), transparent 55%),
    radial-gradient(800px 400px at 80% 0%, rgba(201, 162, 74, .08), transparent 50%),
    linear-gradient(180deg, #0b1a33 0%, #0a1018 100%);
}
img { max-width: 100%; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
  padding: .6rem 1.4rem;
  padding-top: max(.6rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--ivory) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.brand-mark { display: flex; flex-direction: column; line-height: 1.05; }
.brand-kicker {
  font-family: var(--font-foil); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-lo); font-weight: 600;
}
html.dark .brand-kicker { color: var(--gold-hi); }
.brand-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: .01em;
}
.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  appearance: none; border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  background: color-mix(in srgb, var(--ivory) 70%, white);
  border-radius: 999px; width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset;
}
html.dark .icon-btn { background: color-mix(in srgb, var(--navy) 70%, black); border-color: rgba(255,255,255,.1); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hint {
  font-size: .92rem; color: var(--muted); max-width: 40rem; margin: 0 auto;
  text-align: center; padding: 1.15rem 1.25rem .25rem;
  font-family: var(--font-display); font-size: 1.25rem; font-style: italic;
}

/* Hall + bookcase */
.hall {
  perspective: 1800px;
  padding: .5rem 1rem 3rem;
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}
.case {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.15rem 1.15rem 1.4rem;
  border-radius: 6px 6px 10px 10px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.22), transparent 8%, transparent 92%, rgba(0,0,0,.22)),
    linear-gradient(180deg, #2a1a10 0%, #3a2414 6%, #4a2e18 100%);
  box-shadow:
    0 40px 80px -30px var(--shadow),
    0 0 0 1px rgba(0,0,0,.35),
    inset 0 2px 0 rgba(255,220,160,.18),
    inset 0 0 40px rgba(0,0,0,.25);
  transform: rotateX(4deg);
  transform-style: preserve-3d;
}
html.dark .case {
  background:
    linear-gradient(90deg, rgba(0,0,0,.4), transparent 10%, transparent 90%, rgba(0,0,0,.4)),
    linear-gradient(180deg, #1a1008 0%, #2a1a10 8%, #1a120c 100%);
}
.case-top {
  height: 14px; margin: -1.15rem -1.15rem 0.85rem;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--wood-hi), var(--wood-lo));
  box-shadow: inset 0 1px 0 rgba(255,240,200,.35), 0 6px 10px rgba(0,0,0,.25);
}
.shelf {
  position: relative;
  height: 280px;
  margin: 0 0 1.15rem;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 1rem 0;
  transform-style: preserve-3d;
}
.shelf:last-of-type { margin-bottom: 0; }
.shelf-back {
  position: absolute; inset: 0 0 18px 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 230, 180, .09), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.18) 40%, rgba(0,0,0,.5));
  box-shadow: inset 0 18px 30px rgba(0,0,0,.35);
  pointer-events: none;
}
.shelf-plank {
  position: absolute; left: -4px; right: -4px; bottom: 0; height: 18px;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(80,40,10,.08) 19px),
    linear-gradient(180deg, var(--wood-hi), var(--wood-lo) 55%, #5a3818);
  box-shadow:
    0 10px 18px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,230,180,.35),
    inset 0 -2px 0 rgba(0,0,0,.25);
  z-index: 3;
  pointer-events: none;
}
.shelf-shadow {
  position: absolute; left: 6%; right: 6%; bottom: 16px; height: 16px;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.45), transparent 70%);
  filter: blur(3px);
  z-index: 2;
  pointer-events: none;
}
.books {
  position: relative; z-index: 4;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 5px;
  height: calc(100% - 18px);
  width: 100%;
  transform-style: preserve-3d;
}

/* Book */
.book {
  position: relative;
  height: calc(var(--bh, .9) * 230px);
  width: var(--bt, 36px);
  flex: 0 0 var(--bt, 36px);
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .45s ease;
  cursor: pointer;
  border: 0; padding: 0; background: none;
  color: inherit;
}
.book:hover, .book:focus-visible {
  transform: translateY(-6px) translateZ(22px);
  z-index: 8;
  filter: drop-shadow(0 14px 10px rgba(0,0,0,.35));
}
.book.is-pulled {
  z-index: 12;
  transform: translateY(-28px) translateZ(80px) rotateY(-18deg) translateX(8px);
  filter: drop-shadow(0 28px 18px rgba(0,0,0,.45));
  width: auto;
  flex-basis: auto;
}
.book-3d {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  width: var(--bt, 36px);
  height: 100%;
}
.book.is-pulled .book-3d { width: var(--bt, 36px); }

.spine, .cover, .back, .pages, .top-edge {
  position: absolute; top: 0; left: 0;
  background-color: var(--bc);
}
.spine {
  width: 100%; height: 100%;
  transform: translateZ(calc(var(--bt, 36px) / 2));
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 10px 0 12px;
  overflow: hidden;
  box-shadow:
    inset 6px 0 10px rgba(255,255,255,.1),
    inset -8px 0 12px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(0,0,0,.25);
}
.cover, .back {
  width: 168px; height: 100%;
  left: 0;
}
.cover {
  transform-origin: left center;
  transform: rotateY(-90deg) translateZ(0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset -12px 0 16px rgba(0,0,0,.25);
}
.book.is-pulled .cover {
  transform: rotateY(-18deg) translateZ(calc(var(--bt, 36px) / 2));
}
.back {
  transform: rotateY(90deg) translateZ(var(--bt, 36px));
  box-shadow: inset 8px 0 16px rgba(0,0,0,.4);
}
.pages {
  width: calc(var(--bt, 36px) - 4px); height: calc(100% - 6px);
  top: 3px; left: 2px;
  background:
    repeating-linear-gradient(90deg, #f3ead6 0 1px, #e8dcc0 1px 2px, #f7f0e2 2px 3px);
  transform: rotateY(90deg) translateZ(calc(var(--bt, 36px) / 2));
  box-shadow: inset 0 0 6px rgba(0,0,0,.15);
}
.top-edge {
  width: 168px; height: var(--bt, 36px);
  background: linear-gradient(#f3ead6, #e4d6b6);
  transform: rotateX(90deg) translateZ(calc(var(--bt, 36px) / 2));
  transform-origin: top left;
}

/* Materials */
.mat-cloth .spine, .mat-cloth .cover, .mat-cloth .back,
.mat-linen .spine, .mat-linen .cover, .mat-linen .back,
.mat-leather .spine, .mat-leather .cover, .mat-leather .back {
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 18%, transparent 70%, rgba(0,0,0,.28)),
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 30%, rgba(0,0,0,.2));
  background-color: var(--bc);
}
.mat-cloth .spine, .mat-cloth .cover, .mat-cloth .back {
  background-image:
    url("/img/cloth-twill.png"),
    linear-gradient(90deg, rgba(255,255,255,.1), transparent 16%, transparent 72%, rgba(0,0,0,.3)),
    linear-gradient(var(--bc), var(--bc2, var(--bc)));
  background-size: 80px 80px, auto, auto;
}
.mat-linen .spine, .mat-linen .cover, .mat-linen .back {
  background-image:
    url("/img/linen-weave.png"),
    linear-gradient(90deg, rgba(255,255,255,.12), transparent 20%, transparent 75%, rgba(0,0,0,.22)),
    linear-gradient(var(--bc), var(--bc2, var(--bc)));
  background-size: 90px 90px, auto, auto;
}
.mat-leather .spine, .mat-leather .cover, .mat-leather .back {
  background-image:
    url("/img/leather-grain.png"),
    linear-gradient(90deg, rgba(255,255,255,.07), transparent 14%, transparent 70%, rgba(0,0,0,.38)),
    linear-gradient(var(--bc), var(--bc2, var(--bc)));
  background-size: 160px 160px, auto, auto;
}
.book.ink-dark .spine-title, .book.ink-dark .spine-vol { color: #2a1a10; text-shadow: 0 1px 0 rgba(255,255,255,.25); }

/* Spine typography + ribs + headband */
.headband {
  position: absolute; top: 0; left: 8%; right: 8%; height: 7px; z-index: 2;
  background: repeating-linear-gradient(90deg, var(--hb1) 0 3px, var(--hb2) 3px 6px);
  box-shadow: 0 1px 0 rgba(0,0,0,.35);
  border-radius: 0 0 1px 1px;
}
.ribs { position: absolute; left: 0; right: 0; top: 18%; bottom: 16%; pointer-events: none; }
.rib {
  position: absolute; left: 0; right: 0; height: 5px;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(0,0,0,.35) 45%, rgba(255,255,255,.05));
  box-shadow: 0 1px 1px rgba(0,0,0,.4);
}
.spine-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-foil);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--foil);
  text-shadow: 0 0 1px color-mix(in srgb, var(--foil) 40%, black), 0 1px 0 rgba(0,0,0,.45);
  margin: 8px 0;
  max-height: 70%;
  overflow: hidden;
}
.foil-gold { --foil: #e8c56b; }
.foil-silver { --foil: #e4e8ee; }
.foil-copper { --foil: #e0a066; }
.foil-burgundy { --foil: #6a1c28; }
.spine-vol {
  font-family: var(--font-foil); font-size: .58rem; letter-spacing: .12em;
  color: var(--foil); opacity: .9;
}
.gold-rule {
  width: 55%; height: 1px; margin: 4px 0;
  background: linear-gradient(90deg, transparent, var(--foil), transparent);
  opacity: .75;
}

/* Unique front covers */
.cover-art {
  position: absolute; inset: 0;
  padding: 14px 14px 16px;
  display: flex; flex-direction: column; align-items: center;
  color: var(--foil);
}
.cover-frame {
  position: absolute; inset: 10px;
  border: 1px solid color-mix(in srgb, var(--foil) 70%, transparent);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--bc) 80%, black), inset 0 0 0 5px color-mix(in srgb, var(--foil) 45%, transparent);
  pointer-events: none;
}
.cover-frame::before, .cover-frame::after {
  content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid var(--foil); opacity: .8;
}
.cover-frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.cover-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.cover-ornament { width: 72px; height: 72px; margin-top: 22px; }
.cover-ornament svg { width: 100%; height: 100%; filter: drop-shadow(0 0 2px color-mix(in srgb, var(--foil) 40%, transparent)); }
.cover-title {
  margin-top: auto; text-align: center;
  font-family: var(--font-foil); font-weight: 600;
  font-size: 1.05rem; letter-spacing: .16em; text-transform: uppercase;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}
.cover-sub {
  margin-top: .35rem; text-align: center;
  font-family: var(--font-display); font-style: italic; font-size: .78rem;
  letter-spacing: .02em; opacity: .9; max-width: 90%;
  color: color-mix(in srgb, var(--foil) 80%, white);
}
.cover-imprint {
  margin-top: auto; font-family: var(--font-foil); font-size: .42rem;
  letter-spacing: .14em; text-transform: uppercase; opacity: .75; text-align: center;
}

/* Pulled-out stage (front cover hero) */
.pull-stage {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 10, 16, .55);
  backdrop-filter: blur(8px);
  padding: 2rem 1rem;
}
.pull-stage.is-on { display: flex; }
.pull-card {
  position: relative;
  width: min(360px, 86vw);
  aspect-ratio: 63 / 88;
  transform: translateY(8px) rotateZ(-2deg);
  animation: rise .55s cubic-bezier(.2,.8,.2,1) both;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.5));
}
@keyframes rise { from { opacity: 0; transform: translateY(40px) rotateZ(-8deg) scale(.92);} to { opacity: 1; transform: translateY(8px) rotateZ(-2deg) scale(1);} }
.pull-cover {
  position: absolute; inset: 0; border-radius: 2px 6px 6px 2px; overflow: hidden;
  background: var(--bc);
  box-shadow: inset -16px 0 24px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.08);
}
.pull-pages {
  position: absolute; right: -10px; top: 4px; bottom: 4px; width: 10px;
  background: repeating-linear-gradient(#f4ead6, #e8d9b8 2px, #f7f1e4 3px);
  border-radius: 0 2px 2px 0;
  box-shadow: 2px 0 0 rgba(0,0,0,.15);
}
.pull-actions {
  position: absolute; left: 50%; bottom: -4.2rem; transform: translateX(-50%);
  display: flex; gap: .6rem; white-space: nowrap;
}
.btn {
  appearance: none; border: 0; border-radius: 999px;
  padding: .65rem 1.2rem; font-weight: 600; letter-spacing: .02em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #2a1a08; box-shadow: 0 8px 18px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn.secondary {
  background: color-mix(in srgb, var(--ivory) 80%, transparent);
  color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
}

/* Reader */
.reader {
  position: fixed; inset: 0; z-index: 60;
  display: none; background: var(--ivory);
}
.reader.is-on { display: grid; grid-template-rows: auto 1fr; }
.reader-bar {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem 1rem;
  padding-top: max(.55rem, env(safe-area-inset-top));
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  background: color-mix(in srgb, var(--ivory) 90%, var(--paper));
}
.reader-bar .book-meta { display: flex; flex-direction: column; min-width: 0; }
.reader-bar strong { font-family: var(--font-foil); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.reader-bar span { color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-body {
  display: grid; grid-template-columns: minmax(200px, 260px) 1fr;
  min-height: 0;
}
.toc {
  border-right: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  padding: 1.25rem 1rem 2rem;
  overflow: auto;
  background: color-mix(in srgb, var(--paper) 70%, var(--ivory));
}
.toc h2 { margin: 0 0 .8rem; font-family: var(--font-foil); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.toc a {
  display: block; padding: .45rem .5rem; border-radius: 6px; text-decoration: none;
  font-family: var(--font-display); font-size: 1.12rem;
}
.toc a:hover, .toc a[aria-current="page"] { background: color-mix(in srgb, var(--gold) 18%, transparent); }
.page {
  overflow: auto;
  background:
    url("/img/paper-grain.png"),
    linear-gradient(90deg, #efe6d4, var(--paper) 6%, var(--paper) 94%, #efe6d4);
  background-blend-mode: multiply, normal;
}
html.dark .page {
  background:
    url("/img/paper-grain.png"),
    linear-gradient(90deg, #16110c, #1c1610 8%, #1c1610 92%, #16110c);
}
.page-inner {
  max-width: 42rem; margin: 0 auto;
  padding: 3.2rem 1.6rem 5rem;
}
.page-inner h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; margin: 0 0 .3rem;
  letter-spacing: -.01em;
}
.kicker { font-family: var(--font-foil); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-lo); margin: 0 0 1rem; }
html.dark .kicker { color: var(--gold-hi); }
.page-inner h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.7rem;
  margin: 2.2rem 0 .8rem; letter-spacing: -.01em;
}
.page-inner p, .page-inner li {
  font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.75;
  margin: 0 0 1rem;
}
.page-inner p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 600; float: left;
  font-size: 4.1rem; line-height: .75; padding: .12em .12em 0 0;
  color: var(--gold-lo);
}
html.dark .page-inner p:first-of-type::first-letter { color: var(--gold-hi); }
.page-inner ul { margin: 0 0 1rem 1.1rem; padding: 0; }
.footnote { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); color: var(--muted); font-size: .92rem; }

/* Footer */
.site-footer {
  max-width: 1180px; margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted); font-size: .88rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: center;
}
.site-footer a { color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.site-footer a:hover { color: var(--ink); }

/* Search */
.search-wrap { position: relative; }
.search-wrap input {
  appearance: none; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background: color-mix(in srgb, var(--ivory) 80%, white);
  border-radius: 999px; padding: .45rem .9rem .45rem 2.1rem;
  width: min(240px, 36vw); color: var(--ink);
}
html.dark .search-wrap input { background: color-mix(in srgb, var(--navy) 70%, black); border-color: rgba(255,255,255,.1); }
.search-wrap svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; opacity: .55; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* Reduced motion + mobile */
@media (prefers-reduced-motion: reduce) {
  .book, .book:hover, .book.is-pulled, .pull-card { transition: none; animation: none; transform: none; }
  .book:hover { outline: 2px solid var(--gold); }
}
@media (max-width: 860px) {
  .reader-body { grid-template-columns: 1fr; }
  .toc { border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); display: flex; gap: .4rem; overflow-x: auto; padding: .7rem; }
  .toc h2 { display: none; }
  .toc a { white-space: nowrap; }
  .shelf { height: 230px; overflow-x: auto; overflow-y: hidden; justify-content: flex-start; scrollbar-width: thin; }
  .books { justify-content: flex-start; padding: 0 .4rem; width: max-content; min-width: 100%; }
  .book { height: calc(var(--bh, .9) * 190px); }
  .case { transform: none; padding: .8rem; }
  .hint { font-size: 1.05rem; }
  .search-wrap input { width: 42vw; min-width: 8rem; }
}
@media (max-width: 560px) {
  .brand-title { font-size: 1.15rem; }
  .hint { display: none; }
}

/* Pulled-out front cover uses the same materials as the bound book. */
.pull-cover.mat-cloth, .pull-cover.mat-linen, .pull-cover.mat-leather {
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 16%, transparent 78%, rgba(0,0,0,.28)),
    linear-gradient(var(--bc, #123), var(--bc2, var(--bc, #123)));
}
.pull-cover.mat-cloth { background-image: url("/img/cloth-twill.png"), linear-gradient(90deg, rgba(255,255,255,.1), transparent 16%, transparent 78%, rgba(0,0,0,.3)), linear-gradient(var(--bc), var(--bc2, var(--bc))); background-size: 80px 80px, auto, auto; }
.pull-cover.mat-linen { background-image: url("/img/linen-weave.png"), linear-gradient(90deg, rgba(255,255,255,.12), transparent 20%, transparent 75%, rgba(0,0,0,.22)), linear-gradient(var(--bc), var(--bc2, var(--bc))); background-size: 90px 90px, auto, auto; }
.pull-cover.mat-leather { background-image: url("/img/leather-grain.png"), linear-gradient(90deg, rgba(255,255,255,.07), transparent 14%, transparent 70%, rgba(0,0,0,.38)), linear-gradient(var(--bc), var(--bc2, var(--bc))); background-size: 160px 160px, auto, auto; }
.pull-card .cover-art { color: var(--foil, #e8c56b); }
.pull-card.foil-gold { --foil: #e8c56b; }
.pull-card.foil-silver { --foil: #e4e8ee; }
.pull-card.foil-copper { --foil: #e0a066; }
.pull-card.foil-burgundy { --foil: #6a1c28; }
.pull-card.ink-dark { --foil: #2a1a10; }
.pull-card.ink-dark.foil-burgundy { --foil: #6a1c28; }

.case, .shelf { overflow: visible; }

/* Hide the bound book's sides unless it is pulled out — otherwise perspective
   leaves ghost pages/covers sticking out past the last spine. */
.book:not(.is-pulled) .cover,
.book:not(.is-pulled) .back,
.book:not(.is-pulled) .pages,
.book:not(.is-pulled) .top-edge { display: none; }
.book:not(.is-pulled) { overflow: hidden; border-radius: 1px 1px 0 0; }

/* Bookends hold the row so the case does not look empty. */
.bookend {
  flex: 0 0 28px;
  height: 210px;
  position: relative;
  align-self: flex-end;
  pointer-events: none;
  z-index: 5;
}
.bookend::before, .bookend::after { content: ""; position: absolute; bottom: 0; }
.bookend::before {
  left: 0; right: 0; height: 100%;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35), transparent 40%, rgba(255,220,160,.2) 50%, rgba(0,0,0,.3)),
    linear-gradient(180deg, #c9a24a 0 12px, #8a5a28 12px, #6b3f16 100%);
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 4px 0 10px rgba(0,0,0,.25);
  border-radius: 2px 2px 0 0;
}
.bookend--right::before {
  clip-path: polygon(0 0, 100% 18%, 100% 100%, 0 100%);
  box-shadow: -4px 0 10px rgba(0,0,0,.25);
}
.bookend::after {
  left: 15%; right: 15%; height: 10px; bottom: 40%;
  background: linear-gradient(180deg, #f0dc9a, #c9a24a);
  border-radius: 1px;
  opacity: .85;
}

.shelf-back {
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 220, 160, .16), transparent 58%),
    linear-gradient(180deg, rgba(40,24,12,.55), rgba(20,12,6,.25) 45%, rgba(0,0,0,.45));
}

/* Tighter, slightly taller spines; long titles still fit. */
.spine-title { font-size: .68rem; letter-spacing: .1em; max-height: 74%; }
.book { height: calc(var(--bh, .9) * 242px); }

/* Reader: drop cap only on the first body paragraph, not the kicker. */
.page-inner p:first-of-type::first-letter { font-size: inherit; float: none; padding: 0; line-height: inherit; color: inherit; font-family: inherit; font-weight: inherit; }
.page-inner .prose > p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 600; float: left;
  font-size: 4.1rem; line-height: .75; padding: .12em .12em 0 0;
  color: var(--gold-lo);
}
html.dark .page-inner .prose > p:first-of-type::first-letter { color: var(--gold-hi); }

@media (max-width: 860px) {
  .case { transform: none; }
  .book { height: calc(var(--bh, .9) * 200px); overflow: hidden; }
  .bookend { display: none; }
  .books { gap: 4px; }
  .hall { perspective: none; }
}
