/* Menalcus Lankford — "literary edition" styles. Paper, ink, oxblood bookcloth. Mobile first. */

:root {
  --paper: #f4eee2;
  --paper-2: #ebe2cf;
  --paper-3: #e0d4ba;
  --sheet: #fbf8f1;
  --ink: #1d1a16;
  --ink-soft: #463e34;
  --muted: #6b5f50;
  --oxblood: #7b2d26;
  --oxblood-dark: #5c201b;
  --foil: #d9b56e;
  --foil-dim: rgba(217, 181, 110, 0.45);
  --rule: rgba(29, 26, 22, 0.16);
  --rule-strong: rgba(29, 26, 22, 0.35);

  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --text: "EB Garamond", "Iowan Old Style", Georgia, serif;

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 18px 40px -22px rgba(40, 28, 16, 0.45);
  --shadow-book: 0 26px 30px -18px rgba(40, 28, 16, 0.5);
  --header-h: 78px;

  /* Fine paper grain, generated rather than downloaded. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  background: var(--paper) var(--grain);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.25rem;
  line-height: 1.65;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 900px) { body { font-size: 1.3125rem; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--oxblood-dark); }
:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.05; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
cite { font-style: italic; }
::selection { background: rgba(123, 45, 38, 0.18); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }
.icon { width: 1.05em; height: 1.05em; flex: none; }

.smallcaps, .kicker, .chip, .btn, .site-nav a, .book-card__no, .entry__meta, .blurb__source, .crumbs, .toc-row__type, .site-footer__title {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
}
.kicker { display: block; font-size: 1.3rem; font-weight: 500; color: var(--oxblood); margin-bottom: 0.6rem; }
.kicker--foil { color: var(--foil); }
.kicker--center { text-align: center; font-family: var(--text); }

/* ---------- ornaments ---------- */

.fleuron { display: block; width: 150px; height: 18px; margin: 18px auto; color: var(--oxblood); overflow: visible; }
.fleuron path { fill: none; stroke: currentColor; stroke-width: 1.2; }
.fleuron circle { fill: currentColor; }
.fleuron--wide { width: 220px; }
.fleuron--left { margin-left: 0; }
.fleuron--foil { color: var(--foil); }
.fleuron g { transform-box: fill-box; transition: transform 1.1s var(--ease), opacity 0.8s; transition-delay: var(--d, 0ms); }
.js .fleuron[data-reveal] { opacity: 1; transform: none; }
.js .fleuron .fleuron__l { transform: scaleX(0); transform-origin: right center; }
.js .fleuron .fleuron__r { transform: scaleX(0); transform-origin: left center; }
.js .fleuron .fleuron__c { transform: rotate(-135deg) scale(0); transform-origin: center; opacity: 0; }
.js .fleuron.is-in g { transform: none; opacity: 1; }
.js .fleuron.is-in .fleuron__l, .js .fleuron.is-in .fleuron__r { transition-delay: 0.25s; }

/* ---------- buttons ---------- */

.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--ink); --fill: var(--ink); --fill-fg: var(--paper);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 10px 24px;
  font: 500 1.3rem/1.1 var(--text);
  color: var(--fg); background: var(--bg); border: 1px solid var(--bd); border-radius: 2px;
  text-decoration: none; cursor: pointer; transition: color 0.35s var(--ease), border-color 0.35s;
}
.btn::before { /* ink fill that sweeps in from the left */
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fill);
  transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease);
}
.btn:hover { color: var(--fill-fg); }
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn--ink { --bg: var(--ink); --fg: var(--paper); --fill: var(--oxblood); --fill-fg: #fff; }
.btn--ink:hover { border-color: var(--oxblood); }
.btn--line { --fill: var(--ink); }
.btn--line-light { --fg: var(--paper); --bd: var(--foil-dim); --fill: var(--paper); --fill-fg: var(--ink); }
.btn--foil { --bg: var(--foil); --fg: var(--ink); --bd: var(--foil); --fill: #f0d79c; --fill-fg: var(--ink); }
.btn--sm { min-height: 44px; padding: 8px 18px; font-size: 1.15rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 50%; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.icon-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-style: italic; font-size: 1.15rem; text-decoration: none; }
.link-arrow .icon { transition: transform 0.3s var(--ease); }
.link-arrow:hover .icon { transform: translateX(5px); }

/* ---------- header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  transition: background-color 0.35s, box-shadow 0.35s, transform 0.45s var(--ease);
}
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { position: relative; display: block; width: 88px; height: 42px; flex: none; z-index: 2; }
.brand__logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; transition: opacity 0.35s; }
.brand__logo--light { opacity: 0; }
.site-header.is-scrolled { background: rgba(244, 238, 226, 0.94); box-shadow: 0 1px 0 var(--rule), 0 3px 0 -2px var(--rule); }
@supports (backdrop-filter: blur(8px)) { .site-header.is-scrolled { background: rgba(244, 238, 226, 0.82); backdrop-filter: blur(10px); } }
.site-header.is-hidden { transform: translateY(-100%); }

.site-nav ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a { position: relative; display: block; padding: 10px 12px; color: var(--ink); text-decoration: none; font-size: 1.4rem; }
.site-nav__no { color: var(--oxblood); font-size: 0.85em; }
.site-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 1px; background: var(--oxblood);
  transform: scaleX(0); transform-origin: right; transition: transform 0.4s var(--ease);
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-toggle { display: none; }

@media (max-width: 899px) {
  :root { --header-h: 66px; }
  .nav-toggle {
    display: grid; place-items: center; position: relative; z-index: 2;
    width: 48px; height: 48px; margin-right: -8px; border: 0; background: transparent; color: var(--ink); cursor: pointer;
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 26px; height: 1.5px; background: currentColor; transition: transform 0.35s var(--ease), background-color 0.2s;
  }
  .nav-toggle__bars { position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -8px; }
  .nav-toggle__bars::after { top: 8px; }
  .nav-open .nav-toggle { color: var(--paper); }
  .nav-open .nav-toggle__bars { background: transparent; }
  .nav-open .nav-toggle__bars::before { transform: translateY(8px) rotate(45deg); }
  .nav-open .nav-toggle__bars::after { transform: translateY(-8px) rotate(-45deg); }

  .site-nav {
    position: fixed; inset: 0; z-index: 1; display: grid; place-items: center;
    background: var(--ink) var(--grain);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.6s var(--ease), visibility 0s linear 0.6s; visibility: hidden;
  }
  .nav-open .site-nav { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path 0.6s var(--ease); }
  .site-nav ol { flex-direction: column; align-items: center; gap: 2px; }
  .site-nav li { opacity: 0; transform: translateY(16px); transition: opacity 0.4s, transform 0.5s var(--ease); }
  .nav-open .site-nav li { opacity: 1; transform: none; transition-delay: calc(0.2s + var(--i) * 0.06s); }
  .site-nav a { color: var(--paper); font-family: var(--display); font-variant-caps: normal; letter-spacing: 0; font-size: 2.3rem; padding: 6px 18px; }
  .site-nav__no { color: var(--foil); font-size: 0.6em; vertical-align: middle; }
  .site-nav a::after { background: var(--foil); }
  .nav-open .site-header { background: transparent; box-shadow: none; backdrop-filter: none; transform: none; }
  .nav-open .brand__logo--light { opacity: 1; }
  .nav-open .brand__logo--dark { opacity: 0; }
  .nav-open { overflow: hidden; }
}

/* ---------- motion primitives ---------- */

.js [data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Words rise out of a mask. */
.split-heading .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.split-heading .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--wi) * 80ms + var(--d, 0ms)); }
.split-heading.is-in .w > span { transform: none; }

/* Letters settle like wet ink. */
[data-split="chars"] .word { display: inline-block; white-space: nowrap; }
[data-split="chars"] .c {
  display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(0.12em) scale(1.06);
  transition: opacity 1.1s var(--ease), filter 1.3s var(--ease), transform 1.3s var(--ease);
  transition-delay: calc(var(--ci) * 55ms + 150ms);
}
[data-split="chars"].is-in .c { opacity: 1; filter: none; transform: none; }

/* ---------- sections ---------- */

.section { position: relative; padding-block: clamp(72px, 10vw, 130px); }
.section--tight { padding-block: clamp(48px, 7vw, 84px); }
.section--flush { padding-top: 0; }
.section--deckle { --section-bg: var(--paper-2); background: var(--paper-2) var(--grain); }
.section--deckle::before, .section--deckle::after { /* scalloped, deckle-like paper edges */
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background: radial-gradient(circle at 7px 0, transparent 6px, var(--paper-2) 6.5px) repeat-x;
  background-size: 14px 10px;
}
.section--deckle::before { top: -9px; transform: scaleY(-1); }
.section--deckle::after { bottom: -9px; }

.chapter-head { text-align: center; max-width: 760px; margin: 0 auto clamp(40px, 6vw, 68px); }
.chapter-head__num { font-size: 1.35rem; margin-bottom: 0.4rem; color: var(--oxblood); font-variant-caps: all-small-caps; letter-spacing: 0.22em; }
.chapter-head__title { font-size: clamp(2.6rem, 6.5vw, 4.4rem); font-weight: 500; margin-bottom: 0; }
.chapter-head .fleuron { margin-block: 20px 18px; }
.chapter-head__lede { font-style: italic; color: var(--ink-soft); font-size: 1.15em; margin: 0; }

/* ---------- title page (home hero) ---------- */

.title-page { position: relative; padding: calc(var(--header-h) + clamp(28px, 6vw, 70px)) 0 clamp(90px, 10vw, 120px); min-height: 100svh; display: flex; align-items: center; }
.title-page::before { /* hairline frame like a printed title page */
  content: ""; position: absolute; inset: calc(var(--header-h) + 6px) var(--gutter) 18px;
  border: 1px solid var(--rule); outline: 1px solid var(--rule); outline-offset: 5px; pointer-events: none;
}
.title-page__grid { display: grid; gap: 56px; align-items: center; }
.title-page__text { text-align: center; padding-inline: clamp(0px, 3vw, 24px); }
.title-page__name { font-size: clamp(3.4rem, 13vw, 7.4rem); font-weight: 500; line-height: 0.92; letter-spacing: -0.01em; margin: 0.1em 0 0; }
.title-page__name .word { display: block; }
.title-page__roles { font-variant-caps: all-small-caps; letter-spacing: 0.3em; font-size: 1.4rem; color: var(--ink-soft); margin-bottom: 1.6em; }
.title-page__roles span { color: var(--oxblood); margin-inline: 0.2em; }
@media (max-width: 480px) { .title-page__roles { letter-spacing: 0.14em; font-size: 1.25rem; } }
.epigraph { max-width: 30em; margin: 0 auto 2em; font-style: italic; font-size: 1.12rem; color: var(--ink-soft); }
.epigraph p { margin-bottom: 0.4em; }
.epigraph cite { font-style: normal; font-variant-caps: all-small-caps; letter-spacing: 0.12em; }
.title-page__ctas { justify-content: center; }
.frontispiece { position: relative; justify-self: center; display: grid; justify-items: center; width: min(78vw, 360px); padding: 36px 34px 0; text-decoration: none; color: var(--ink); }
.frontispiece__arch {
  position: absolute; inset: 0 0 64px; border-radius: 999px 999px 0 0;
  background: var(--paper-2) var(--grain); border: 1px solid var(--rule-strong);
  box-shadow: inset 0 0 0 7px var(--paper-2), inset 0 0 0 8px var(--rule);
}
.frontispiece img { position: relative; z-index: 1; width: 100%; filter: drop-shadow(0 26px 22px rgba(40, 28, 16, 0.42)); transition: transform 0.4s var(--ease); }
.frontispiece__ribbon {
  position: absolute; z-index: 2; top: 30px; right: 26%; width: 18px; height: 110px;
  background: linear-gradient(90deg, var(--oxblood-dark), var(--oxblood) 40%, var(--oxblood-dark));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  transform-origin: top center; animation: sway 5s ease-in-out infinite;
}
@keyframes sway { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(-3deg); } }
.frontispiece__caption { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule-strong); min-width: 70%; text-align: center; }
.frontispiece__caption .smallcaps { color: var(--oxblood); font-size: 1rem; }
.frontispiece__caption cite { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.frontispiece:hover cite { color: var(--oxblood); }
.turn-page { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: none; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-style: italic; font-size: 1.05rem; }
.turn-page .icon { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
@media (min-width: 900px) {
  .title-page__grid { grid-template-columns: 1.25fr 1fr; gap: 40px; }
  .turn-page { display: inline-flex; }
}

/* ---------- about ---------- */

.about__grid { display: grid; gap: clamp(40px, 6vw, 80px); align-items: start; }
.portrait { margin: 0; max-width: 400px; justify-self: center; }
.portrait__frame { padding: 14px; background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--shadow); transform: rotate(-1.2deg); transition: transform 0.6s var(--ease); }
.portrait:hover .portrait__frame { transform: rotate(0); }
.portrait__frame img { width: 100%; filter: sepia(0.12) contrast(1.02); }
.portrait figcaption { margin-top: 28px; font-size: 1.02rem; font-style: italic; color: var(--ink-soft); text-align: center; line-height: 1.55; }
.portrait figcaption strong { font-style: normal; font-weight: 500; font-variant-caps: all-small-caps; letter-spacing: 0.08em; }
@media (min-width: 900px) {
  .about__grid { grid-template-columns: 5fr 7fr; }
  .portrait { position: sticky; top: calc(var(--header-h) + 30px); }
}

.prose { max-width: 66ch; }
.prose p:last-child { margin-bottom: 0; }
.prose--centered { margin-inline: auto; }
.prose--light { color: rgba(244, 238, 226, 0.88); }
.prose h2 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); font-weight: 500; margin-top: 1.6em; }
.prose blockquote { margin: 1.6em 0; padding-left: 20px; border-left: 2px solid var(--oxblood); font-style: italic; }
.prose--dropcap > p:first-of-type::first-letter {
  float: left; font-family: var(--display); font-weight: 600; font-size: 4.6em; line-height: 0.78;
  padding: 0.07em 0.09em 0 0; color: var(--oxblood);
}
.tally { margin: 28px 0 0; padding: 18px 0; border-block: 1px solid var(--rule); font-family: var(--display); font-style: italic; font-size: 1.55rem; line-height: 1.3; text-align: center; color: var(--ink); }
.trades { margin-top: 36px; padding: 28px clamp(20px, 4vw, 36px); background: var(--sheet); border: 1px solid var(--rule); box-shadow: inset 0 0 0 6px var(--sheet), inset 0 0 0 7px var(--rule); }
.trades__title { font-size: 1.6rem; font-weight: 500; text-align: center; margin-bottom: 18px; }
.trades__list { margin: 0; padding-left: 2.6em; columns: 1; column-gap: 40px; list-style: upper-roman; font-style: italic; font-size: 1.08rem; line-height: 1.5; }
.trades__list li { break-inside: avoid; padding: 3px 0 3px 6px; }
.trades__list li::marker { color: var(--oxblood); font-style: normal; font-size: 0.85em; }
.js .trades__list li { opacity: 0; transform: translateX(-8px); transition: opacity 0.6s, transform 0.6s var(--ease); transition-delay: calc(var(--i) * 60ms + 300ms); }
.js .trades.is-in li { opacity: 1; transform: none; }
@media (min-width: 600px) { .trades__list { columns: 2; } }

/* ---------- bookcloth spotlight ---------- */

.bookcloth {
  position: relative; overflow: hidden; color: var(--paper);
  background-color: var(--oxblood-dark);
  background-image:
    radial-gradient(ellipse at 25% 15%, rgba(255, 255, 255, 0.09), transparent 55%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, var(--oxblood), var(--oxblood-dark));
  padding-block: clamp(80px, 11vw, 140px);
}
.bookcloth::before { /* blind-stamped border, as on a cloth binding */
  content: ""; position: absolute; inset: 18px; border: 1px solid var(--foil-dim); outline: 1px solid rgba(217, 181, 110, 0.2); outline-offset: -7px; pointer-events: none;
}
.bookcloth__grid { position: relative; display: grid; gap: 48px; align-items: center; }
.bookcloth__cover { justify-self: center; width: min(68vw, 330px); }
.bookcloth__cover img { filter: drop-shadow(0 30px 30px rgba(0, 0, 0, 0.55)); transition: transform 0.4s var(--ease); }
.bookcloth__title { font-size: clamp(3rem, 7vw, 4.8rem); font-weight: 600; margin-bottom: 0.1em; }
.bookcloth__subtitle { font-family: var(--display); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 1.9rem); color: var(--foil); margin: 0; }
.bookcloth .fleuron { margin-block: 22px; }
.bookcloth__quote { margin: 26px 0 30px; font-family: var(--display); font-style: italic; font-size: clamp(1.3rem, 2.2vw, 1.55rem); line-height: 1.45; }
.bookcloth__quote p { margin-bottom: 0.4em; }
.bookcloth__quote cite { font-family: var(--text); font-style: normal; font-size: 1rem; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--foil); }
@media (min-width: 900px) { .bookcloth__grid { grid-template-columns: 2fr 3fr; gap: 80px; } }

.foil {
  background: linear-gradient(100deg, #b38a3e 0%, #f5e0a4 30%, #c69a4a 50%, #f0d38d 70%, #b38a3e 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 9s linear infinite;
}
@keyframes foil { to { background-position: -250% 0; } }

/* ---------- library ---------- */

.library { position: relative; }
.library__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding-bottom: 18px; margin-bottom: clamp(32px, 5vw, 52px); border-bottom: 1px solid var(--rule); }
.filters { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.chip { position: relative; padding: 8px 12px; min-height: 44px; border: 0; background: none; color: var(--ink-soft); font: 500 1.35rem var(--text); cursor: pointer; transition: color 0.25s; }
.chip sup { font-size: 0.7em; color: var(--muted); margin-left: 2px; font-variant-numeric: lining-nums; }
.chip::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 1px; background: var(--oxblood); transform: scaleX(0); transition: transform 0.35s var(--ease); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--oxblood); }
.chip[aria-pressed="true"]::after { transform: scaleX(1); }
.view-toggle { display: inline-flex; border: 1px solid var(--rule-strong); }
.view-toggle button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 0; background: none; color: var(--ink-soft); font: italic 1.05rem var(--text); cursor: pointer; transition: background-color 0.25s, color 0.25s; }
.view-toggle button + button { border-left: 1px solid var(--rule-strong); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.library__empty { font-style: italic; color: var(--muted); text-align: center; }
.library [hidden] { display: none !important; }
[data-item].is-filtered { display: none !important; }
[data-item].is-entering { animation: item-in 0.6s var(--ease) both; animation-delay: var(--fd, 0ms); }
@keyframes item-in { from { opacity: 0; transform: translateY(16px); } }
.js [data-panel].is-switching { animation: panel-in 0.5s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } }

.shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 5vw, 56px) clamp(18px, 3vw, 40px); }
@media (min-width: 700px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1050px) { .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.book-card__link { display: block; height: 100%; color: inherit; text-decoration: none; text-align: center; }
.book-card__stage { position: relative; display: grid; place-items: end center; padding: 10px 8% 0; margin-bottom: 18px; }
.book-card__stage::after { /* the shelf plank */
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 8px;
  background: linear-gradient(var(--paper-3), #cdbd9c); box-shadow: 0 8px 12px -6px rgba(40, 28, 16, 0.4);
}
.book-card__stage img { position: relative; z-index: 1; width: 100%; max-width: 220px; aspect-ratio: 410 / 620; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(40, 28, 16, 0.28)); transition: transform 0.55s var(--ease), filter 0.55s var(--ease); }
.book-card__link:hover .book-card__stage img { transform: translateY(-12px); filter: drop-shadow(0 26px 18px rgba(40, 28, 16, 0.32)); }
.book-card__no { margin: 0 0 4px; font-size: 1.15rem; color: var(--oxblood); }
.book-card__title { font-size: clamp(1.35rem, 2.3vw, 1.7rem); font-weight: 600; margin: 0 0 0.2em; }
.book-card__title { background: linear-gradient(var(--oxblood), var(--oxblood)) no-repeat 50% 100% / 0 1px; transition: background-size 0.45s var(--ease), color 0.3s; display: inline; }
.book-card__link:hover .book-card__title { background-size: 100% 1px; color: var(--oxblood); }
.book-card__subtitle { font-style: italic; font-size: 1.02rem; line-height: 1.35; color: var(--ink-soft); margin: 6px 0 0; }
.shelf--compact .book-card__subtitle { display: none; }

.bookmark {
  position: absolute; z-index: 2; top: 0; right: 10%;
  padding: 10px 7px 18px; background: var(--oxblood); color: #fff;
  writing-mode: vertical-rl; font-size: 0.82rem; font-variant-caps: all-small-caps; letter-spacing: 0.14em; line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 9px), 0 100%);
  box-shadow: var(--shadow);
}

/* Contents view */
.toc { list-style: none; margin: 0 auto; padding: 0; max-width: 940px; counter-reset: none; }
.toc-row { border-bottom: 1px solid var(--rule); }
.toc-row__link { display: flex; align-items: baseline; gap: 14px; padding: 18px 10px; color: var(--ink); text-decoration: none; transition: background-color 0.3s, padding 0.4s var(--ease); }
.toc-row__link:hover { background: rgba(123, 45, 38, 0.05); padding-left: 20px; }
.toc-row__no { flex: none; width: 3.2em; color: var(--oxblood); font-family: var(--display); font-size: 1.3rem; text-align: right; }
.toc-row__thumb { display: none; }
.toc-row__title { display: flex; flex-direction: column; min-width: 0; }
.toc-row__title cite { font-family: var(--display); font-style: normal; font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 1.85rem); line-height: 1.1; transition: color 0.3s; }
.toc-row__title em { color: var(--ink-soft); font-size: 1.02rem; }
.toc-row__link:hover cite { color: var(--oxblood); }
.toc-row__leader { flex: 1; min-width: 30px; border-bottom: 2px dotted var(--rule-strong); transform: translateY(-6px); }
.toc-row__type { flex: none; color: var(--muted); font-size: 1.05rem; }
.toc-preview {
  position: fixed; left: 0; top: 0; z-index: 50; width: 170px; pointer-events: none;
  opacity: 0; transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(-4deg) scale(0.9);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toc-preview.is-on { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(-4deg) scale(1); }
.toc-preview img { filter: drop-shadow(0 20px 20px rgba(40, 28, 16, 0.45)); }
@media (max-width: 699px), (hover: none) {
  .toc-row__link { align-items: center; gap: 12px; padding-inline: 4px; }
  .toc-row__no { width: auto; min-width: 1.8em; font-size: 1.1rem; }
  .toc-row__thumb { display: block; width: 52px; flex: none; filter: drop-shadow(0 6px 6px rgba(40, 28, 16, 0.3)); }
  .toc-row__leader { display: none; }
  .toc-row__type { display: none; }
  .toc-preview { display: none; }
}

/* ---------- book page ---------- */

.book-title { position: relative; overflow: hidden; padding: calc(var(--header-h) + clamp(30px, 6vw, 70px)) 0 clamp(50px, 7vw, 90px); border-bottom: 1px solid var(--rule); }
.book-title__initial {
  position: absolute; right: -0.06em; top: 50%; transform: translateY(-50%);
  font-family: var(--display); font-weight: 700; font-size: clamp(24rem, 55vw, 46rem); line-height: 0.8;
  color: var(--oxblood); opacity: 0.05; pointer-events: none; user-select: none;
}
.book-title__grid { position: relative; display: grid; gap: 44px; align-items: center; }
.book-title__cover { justify-self: center; width: min(66vw, 340px); }
.cover-zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cover-zoom img { width: 100%; filter: drop-shadow(0 28px 24px rgba(40, 28, 16, 0.45)); transition: transform 0.4s var(--ease); }
.cover-zoom__hint { position: absolute; z-index: 3; right: 14%; bottom: 8%; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); opacity: 0; transform: scale(0.8); transition: opacity 0.3s, transform 0.3s var(--ease); }
.cover-zoom:hover .cover-zoom__hint, .cover-zoom:focus-visible .cover-zoom__hint { opacity: 1; transform: none; }
.book-title__h { font-size: clamp(3rem, 8vw, 5.6rem); font-weight: 500; margin-bottom: 0.12em; }
.book-title__subtitle { font-family: var(--display); font-style: italic; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.2; color: var(--oxblood); margin-bottom: 0.5em; }
.book-title__by { font-style: italic; color: var(--ink-soft); margin: 0; }
.book-title .fleuron { margin-block: 22px 26px; }
@media (min-width: 900px) { .book-title__grid { grid-template-columns: 2fr 3fr; gap: 72px; } .book-title__cover { width: 100%; max-width: 360px; } }
.crumbs { font-size: 1rem; margin-bottom: 18px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- blurbs & carousel ---------- */

.blurb { margin: 0 auto; max-width: 780px; text-align: center; }
.quote-glyph { display: block; height: 0.5em; font-family: var(--display); font-size: 7rem; line-height: 1; color: var(--oxblood); opacity: 0.85; }
.blurb__quote { margin: 0; font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(1.4rem, 2.8vw, 1.85rem); line-height: 1.45; }
.blurb__quote p { margin-bottom: 0.7em; }
.blurb__quote p:last-child { margin-bottom: 0; }
.blurb__quote[data-clamp] { position: relative; max-height: 12.5em; overflow: hidden; transition: max-height 0.8s var(--ease); text-align: left; }
.blurb__quote[data-clamp]::after { content: ""; position: absolute; inset: auto 0 0; height: 5em; background: linear-gradient(transparent, var(--section-bg, var(--paper))); transition: opacity 0.4s; }
.blurb.is-expanded .blurb__quote[data-clamp]::after { opacity: 0; }
.blurb__more { margin-top: 14px; padding: 6px 0; border: 0; background: none; font: italic 1.1rem var(--text); color: var(--oxblood); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.blurb__takeaway { margin: 22px auto 0; font-style: italic; max-width: 36em; }
.blurb__takeaway .smallcaps { font-style: normal; color: var(--oxblood); }
.blurb__by { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.blurb__source { font-size: 1.15rem; }
.blurb__source::before { content: "— "; }
.blurb__book { font-style: italic; color: var(--muted); }
.blurb-stack { display: grid; gap: clamp(48px, 7vw, 80px); }

.carousel__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 24px; align-items: start;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  scrollbar-width: none; padding: 8px 2px 24px;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track.is-resizing { transition: height 0.4s var(--ease); }
.carousel__slide { scroll-snap-align: center; transition: opacity 0.6s var(--ease); }
.carousel__slide:not(.is-active) { opacity: 0.25; }
.carousel__controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.carousel__dots { display: flex; gap: 2px; }
.carousel__dots button { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.carousel__dots button::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--oxblood); transition: background-color 0.3s, transform 0.4s var(--ease); }
.carousel__dots button[aria-current="true"]::before { background: var(--oxblood); transform: rotate(45deg) scale(1.3); }

/* ---------- commonplace ---------- */

.commonplace__grid { display: grid; gap: 56px; align-items: center; }
.commonplace__arches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; max-width: 520px; width: 100%; justify-self: center; }
.commonplace__arches img {
  width: 100%; aspect-ratio: 3 / 5; object-fit: cover; border-radius: 999px 999px 4px 4px;
  border: 1px solid var(--rule-strong); padding: 5px; background: var(--sheet);
  filter: sepia(0.55) saturate(0.7) contrast(0.95); transition: filter 0.8s var(--ease);
}
.commonplace__arches img:nth-child(2) { aspect-ratio: 3 / 6; }
.commonplace__arches:hover img { filter: none; }
.commonplace__title { font-size: clamp(2.2rem, 4.6vw, 3.2rem); font-weight: 500; }
.commonplace__body { font-style: italic; font-size: 1.15em; color: var(--ink-soft); max-width: 34em; margin-bottom: 28px; }
@media (min-width: 900px) { .commonplace__grid { grid-template-columns: 1fr 1fr; gap: 80px; } }

/* ---------- notes & essays ---------- */

.entries { display: grid; border-top: 1px solid var(--rule-strong); }
.entry { border-bottom: 1px solid var(--rule); }
.entry__link { display: grid; gap: 20px; padding-block: 30px; color: inherit; text-decoration: none; }
.entry__meta { margin: 0 0 6px; font-size: 1.2rem; color: var(--oxblood); }
.entry__title { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 600; margin-bottom: 0.3em; transition: color 0.3s; }
.entry__link:hover .entry__title { color: var(--oxblood); }
.entry__excerpt { color: var(--ink-soft); margin-bottom: 0.6em; max-width: 46em; }
.entry__more { display: inline-flex; align-items: center; gap: 8px; font-style: italic; color: var(--oxblood); }
.entry__more .icon { transition: transform 0.3s var(--ease); }
.entry__link:hover .entry__more .icon { transform: translateX(5px); }
.entry__plate { order: -1; overflow: hidden; border: 1px solid var(--rule); padding: 6px; background: var(--sheet); }
.entry__plate img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; filter: sepia(0.4) saturate(0.75); transition: filter 0.7s var(--ease), transform 0.9s var(--ease); }
.entry__link:hover .entry__plate img { filter: none; transform: scale(1.03); }
@media (min-width: 760px) {
  .entry__link { grid-template-columns: 1fr 280px; gap: 40px; align-items: center; }
  .entry__plate { order: 0; }
}
.journal__all { margin: 32px 0 0; text-align: center; }

/* ---------- page / post titles ---------- */

.page-title { padding: calc(var(--header-h) + clamp(50px, 9vw, 110px)) 0 clamp(50px, 7vw, 80px); text-align: center; }
.page-title__inner { max-width: 900px; }
.page-title__h { font-size: clamp(3rem, 8vw, 5.4rem); font-weight: 500; margin: 0; }
.page-title__lede { font-style: italic; font-size: 1.2em; color: var(--ink-soft); max-width: 36em; margin: 0 auto; }

.post-head { padding-top: calc(var(--header-h) + clamp(40px, 7vw, 90px)); text-align: center; max-width: 960px; }
.post-head__title { font-size: clamp(2.4rem, 6.4vw, 4.4rem); font-weight: 500; margin-bottom: 0.3em; }
.post-head__meta { font-style: italic; color: var(--muted); margin: 0; }
.plate { max-width: 1000px; margin-top: 16px; }
.plate img { width: 100%; max-height: 560px; object-fit: cover; padding: 8px; background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.prose--article { margin-inline: auto; }
.prose--article .byline { color: var(--muted); text-align: center; }
.prose--excerpt { font-size: 1.12em; line-height: 1.7; }
.prose--excerpt p { margin: 0; text-indent: 1.5em; }
.prose--excerpt p:first-child { text-indent: 0; }
.prose--excerpt p:first-child::first-letter { float: left; font-family: var(--display); font-weight: 600; font-size: 4.9em; line-height: 0.78; padding: 0.06em 0.09em 0 0; color: var(--oxblood); }
.finis { text-align: center; color: var(--oxblood); font-size: 1.8rem; margin: 40px 0 0; }

.bookplate {
  display: grid; grid-template-columns: 110px 1fr; gap: 26px; align-items: center;
  max-width: 66ch; margin: 48px auto 0; padding: 28px;
  background: var(--sheet); border: 3px double var(--oxblood);
}
.bookplate__cover img { width: 100%; filter: drop-shadow(0 12px 12px rgba(40, 28, 16, 0.3)); }
.bookplate__title { font-size: 1.9rem; margin-bottom: 0.1em; }
.bookplate__title a { color: var(--ink); text-decoration: none; }
.bookplate__title a:hover { color: var(--oxblood); }
.bookplate__subtitle { font-style: italic; color: var(--oxblood); margin-bottom: 0.6em; }
.bookplate p:not(.kicker):not(.bookplate__subtitle) { font-size: 1.05rem; color: var(--ink-soft); }
@media (max-width: 599px) { .bookplate { grid-template-columns: 1fr; } .bookplate__cover { width: 120px; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-block: 36px; border-top: 1px solid var(--rule); }
.pager__link { display: flex; align-items: center; gap: 16px; padding: 14px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.15; transition: background-color 0.3s; }
.pager__link cite { font-style: normal; }
.pager__link:hover { background: rgba(123, 45, 38, 0.05); color: var(--ink); }
.pager__link small { display: flex; align-items: center; gap: 6px; font-family: var(--text); font-weight: 400; font-size: 1rem; font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--oxblood); margin-bottom: 4px; }
.pager__link img { width: 54px; flex: none; transition: transform 0.4s var(--ease); }
.pager__link:hover img { transform: rotate(-4deg) translateY(-3px); }
.pager__link--next { justify-content: flex-end; text-align: right; }
.pager__link--next small { justify-content: flex-end; }
@media (max-width: 599px) { .pager__link img { display: none; } .pager__link { padding: 8px; } }

/* ---------- correspondence ---------- */

.letter {
  position: relative; max-width: 760px; margin: 0 auto; padding: clamp(28px, 6vw, 60px) clamp(22px, 6vw, 64px);
  background: var(--sheet) var(--grain); border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 30px 50px -30px rgba(40, 28, 16, 0.5), 6px 6px 0 -1px var(--paper-2), 6px 6px 0 0 var(--rule);
  transform: rotate(-0.6deg); transition: transform 0.6s var(--ease), box-shadow 0.6s;
}
.letter:focus-within { transform: none; }
.letter__date { text-align: right; font-style: italic; color: var(--muted); margin-bottom: 1.4em; min-height: 1.65em; }
.letter__salutation { font-family: var(--display); font-style: italic; font-size: 2.1rem; line-height: 1.1; margin-bottom: 0.8em; }
.letter__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.letter__line label { font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--oxblood); font-size: 1.3rem; flex: none; }
.letter__line input, .letter__body {
  font: italic 1.2rem/1.6 var(--text); color: var(--ink); background: transparent; border: 0; border-radius: 0;
}
.letter__line input { flex: 1; min-width: 200px; padding: 6px 2px; border-bottom: 1px dotted var(--rule-strong); transition: border-color 0.3s; }
.letter__line input:focus, .letter__body:focus { outline: none; border-color: var(--oxblood); }
.letter__line input:focus { border-bottom-style: solid; }
.letter__line input:user-invalid { border-bottom-color: #a12b1b; }
.letter input::placeholder, .letter textarea::placeholder { color: var(--muted); opacity: 0.7; }
.letter__body {
  display: block; width: 100%; min-height: 15em; margin: 10px 0 20px; padding: 0 2px; resize: vertical;
  line-height: 2.1em; background-image: linear-gradient(transparent calc(2.1em - 1px), var(--rule) 1px);
  background-size: 100% 2.1em; background-attachment: local;
}
.letter__closing { font-style: italic; margin-bottom: 10px; }
.letter__sign { display: grid; gap: 4px 28px; }
@media (min-width: 640px) { .letter__sign { grid-template-columns: 1fr 1fr; } }
.letter__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; }
.seal-btn { display: inline-flex; align-items: center; gap: 14px; padding: 0; border: 0; background: none; cursor: pointer; font: italic 1.25rem var(--text); color: var(--ink); }
.seal {
  display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 50%;
  font: 600 1.45rem/1 var(--display); color: rgba(255, 235, 225, 0.85); letter-spacing: 0.02em;
  background: radial-gradient(circle at 35% 30%, #a3443a, var(--oxblood) 45%, var(--oxblood-dark) 100%);
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.12), inset 0 0 0 6px rgba(255, 255, 255, 0.08), 0 6px 12px -4px rgba(60, 20, 15, 0.6);
  transition: transform 0.45s var(--ease);
}
.seal-btn:hover .seal { transform: rotate(-12deg) scale(1.06); }
.seal-btn:hover [data-submit-label] { color: var(--oxblood); }
.seal-btn.is-loading { pointer-events: none; }
.seal-btn.is-loading .seal { animation: seal-pulse 1s ease-in-out infinite; }
@keyframes seal-pulse { 50% { transform: scale(0.92); } }
.seal-btn.is-sealed .seal { animation: stamp 0.6s var(--ease); }
@keyframes stamp { 0% { transform: scale(1.6) rotate(-25deg); opacity: 0; } 60% { transform: scale(0.92); opacity: 1; } 100% { transform: none; } }
.form-status { margin: 0; font-style: italic; }
.form-status.is-ok { color: #2d5a35; }
.form-status.is-err { color: #8a1f12; }

/* ---------- footer ---------- */

.site-footer { background: var(--ink) var(--grain); color: rgba(244, 238, 226, 0.78); padding-top: clamp(56px, 8vw, 90px); font-size: 1.08rem; }
.site-footer__mark { text-align: center; }
.site-footer__mark img { width: 120px; margin: 0 auto 10px; }
.site-footer__mark p { font-style: italic; margin: 0; }
.site-footer__grid { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); padding-block: 36px 44px; border-top: 1px solid rgba(244, 238, 226, 0.12); margin-top: 28px; }
.site-footer__title { font-family: var(--text); font-weight: 500; font-size: 1.1rem; color: var(--foil); margin-bottom: 12px; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { color: rgba(244, 238, 226, 0.88); text-decoration: none; }
.site-footer a:hover { color: var(--foil); text-decoration: underline; }
.site-footer__colophon { padding-block: 22px 32px; border-top: 1px solid rgba(244, 238, 226, 0.12); font-size: 0.98rem; text-align: center; }
.site-footer__colophon p { margin: 0; }
.to-top { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-style: italic; }
.to-top .icon { transition: transform 0.3s var(--ease); }
.to-top:hover .icon { transform: translateY(-3px); }

/* ---------- lightbox & progress ---------- */

.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: rgba(29, 26, 22, 0.9); opacity: 0; transition: opacity 0.3s; cursor: zoom-out; }
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; width: auto; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6)); transform: scale(0.92); transition: transform 0.4s var(--ease); }
.lightbox.is-open img { transform: none; }
.lightbox__close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(244, 238, 226, 0.12); color: var(--paper); cursor: pointer; }
.lightbox__close .icon { width: 26px; height: 26px; }

.progress { position: fixed; inset: 0 0 auto; z-index: 101; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--oxblood); transform-origin: left; transform: scaleX(0); }

[data-tilt] { will-change: transform; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0ms !important; }
  .js [data-reveal], .js .trades__list li { opacity: 1; transform: none; }
  .split-heading .w > span, [data-split="chars"] .c, .js .fleuron g { transform: none; opacity: 1; filter: none; }
  .foil { animation: none; }
}

@media print {
  .site-header, .site-footer, .progress, .correspondence, .turn-page, .view-toggle, .carousel__controls { display: none !important; }
  body { background: #fff; }
}
