:root {
  --paper: #eeeae0;
  --paper-deep: #e5e0d3;
  --paper-light: #f5f2ea;
  --ink: #203e4b;
  --ink-soft: #4a6470;
  --ink-faint: #53676d;
  --rule: rgba(32, 62, 75, 0.16);
  --serif: "Boska", "Iowan Old Style", Georgia, serif;
  --sans: "Satoshi", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; line-height: 1.08; text-wrap: balance; }
p { margin: 0 0 1.1em; text-wrap: pretty; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

/* Header */
header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem var(--gutter);
  background: rgba(238, 234, 224, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
}
.identity .imprint-logo { width: 34px; height: auto; }
nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); font-size: .84rem; letter-spacing: .02em; }
nav a { color: var(--ink-soft); transition: color .2s ease; padding: .3rem 0; }
nav a:hover { color: var(--ink); }
.edition-link { color: var(--ink); border-bottom: 1px solid var(--rule); }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) var(--gutter) 2.5rem;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
  min-height: calc(100vh - 70px);
}
.hero-copy h1 { font-size: clamp(3.2rem, 7.4vw, 6.4rem); line-height: .98; margin-bottom: 2rem; }
.hero-copy h1 span { font-style: italic; }
.intro { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.35; margin-bottom: 1.4rem; }
.hero-description { color: var(--ink-soft); font-size: .98rem; max-width: 34rem; margin-bottom: 2.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: center; }
.button {
  display: inline-flex; gap: .6rem; align-items: center;
  background: var(--ink); color: var(--paper);
  padding: .85rem 1.4rem; font-size: .88rem; letter-spacing: .02em;
  transition: background .2s ease;
}
.button:hover { background: #142c37; }
.text-link { font-size: .88rem; border-bottom: 1px solid var(--rule); padding-bottom: 2px; transition: border-color .2s ease; }
.text-link:hover { border-color: var(--ink); }

.cover-stage { margin: 0; display: flex; flex-direction: column; align-items: center; }
.book {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 8.5 / 11;
  background: var(--paper-light);
  box-shadow:
    1px 0 0 rgba(32,62,75,.06) inset,
    6px 0 10px -6px rgba(32,62,75,.18) inset,
    0 1px 2px rgba(32,62,75,.08),
    0 18px 40px -18px rgba(32,62,75,.35),
    0 40px 80px -40px rgba(32,62,75,.25);
  display: flex; flex-direction: column; align-items: center;
  padding-top: 37%;
  text-align: center;
}
.cover-title { font-family: var(--serif); font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.1; color: var(--ink); }
.cover-top { font-family: var(--serif); font-size: .74rem; color: var(--ink-soft); margin-top: .7rem; letter-spacing: .04em; }
.cover-subtitle { font-family: var(--serif); font-size: .56rem; color: var(--ink-soft); margin-top: 1.1rem; letter-spacing: .06em; }
.cover-bottom { position: absolute; bottom: 7%; left: 50%; transform: translateX(-50%); }
.cover-bottom img { width: 38px; opacity: .78; }
figcaption { margin-top: 1.6rem; display: flex; gap: 1.2rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

.hero-foot {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule); padding-top: 1.2rem; margin-top: 1rem;
  font-size: .72rem; letter-spacing: .18em; color: var(--ink-faint);
}
.hero-foot a { letter-spacing: .04em; color: var(--ink-soft); font-size: .82rem; }

/* Inside the volume */
.books-section { background: var(--paper-deep); }
.volume-introduction {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(5rem, 10vw, 8.5rem) var(--gutter);
  display: grid; grid-template-columns: 1fr 2.2fr; gap: clamp(2rem, 5vw, 5rem);
}
.volume-introduction h2 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin-bottom: 3rem; }
.volume-excerpt { margin: 0 0 3.5rem; max-width: 40rem; }
.volume-excerpt p { font-family: var(--serif); font-size: clamp(1.15rem, 1.7vw, 1.38rem); line-height: 1.6; }
cite { font-style: normal; font-size: .78rem; letter-spacing: .06em; color: var(--ink-faint); }
.contents { border-top: 1px solid var(--rule); padding-top: 1.6rem; max-width: 40rem; }
.contents ol { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.contents li {
  counter-increment: c;
  font-family: var(--serif); font-size: 1.12rem;
  padding: .85rem 0; border-bottom: 1px solid var(--rule);
  display: flex; gap: 1.4rem;
}
.contents li::before { content: counter(c, upper-roman); font-family: var(--sans); font-size: .72rem; letter-spacing: .1em; color: var(--ink-faint); min-width: 1.6rem; padding-top: .3rem; }

/* Interlude */
.interlude {
  padding: clamp(6rem, 13vw, 11rem) var(--gutter);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.interlude p { font-family: var(--serif); font-size: clamp(1.55rem, 3.2vw, 2.4rem); line-height: 1.45; margin: .4rem 0 2rem; }
.interlude-note { font-size: .76rem; letter-spacing: .06em; color: var(--ink-faint); }

/* Author note */
.author-note {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
  display: grid; grid-template-columns: 1fr 2.2fr; gap: clamp(2rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
}
.author-note h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); position: sticky; top: 6rem; }
.author-note-text { max-width: 38rem; }
.author-note-text p { font-family: var(--serif); font-size: clamp(1.08rem, 1.45vw, 1.22rem); line-height: 1.72; margin-bottom: 1.4em; }
.author-signature { font-style: italic; margin-top: 2rem; }

/* Edition */
.edition-section {
  background: var(--ink); color: var(--paper);
}
.edition-section > * { }
.edition-section {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start;
  padding: clamp(5rem, 10vw, 8rem) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.edition-section .eyebrow { color: rgba(238,234,224,.62); }
.edition-section h2 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); margin-bottom: 2rem; }
.edition-copy { font-family: var(--serif); font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.6; max-width: 32rem; color: rgba(238,234,224,.9); }
.small-note { font-size: .82rem; color: rgba(238,234,224,.58); margin-top: 1.6rem; }
.order-panel {
  background: var(--paper); color: var(--ink);
  padding: clamp(1.8rem, 3.5vw, 2.6rem);
}
.order-panel .eyebrow { color: var(--ink-soft); }
.order-panel h3 { font-size: 1.9rem; margin-bottom: .3rem; }
.order-panel h3 + p { color: var(--ink-soft); font-size: .92rem; }
dl { margin: 1.8rem 0; border-top: 1px solid var(--rule); }
dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); font-size: .88rem; }
dt { color: var(--ink-faint); }
dd { margin: 0; text-align: right; }
.availability { display: flex; align-items: center; gap: .7rem; font-size: .9rem; margin-bottom: .7rem; }
.availability span { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-soft); }
.order-note { font-size: .82rem; color: var(--ink-soft); margin: 0; }

/* About */
.about-section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(5rem, 10vw, 8rem) var(--gutter);
  display: grid; grid-template-columns: 1fr 2.2fr; gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
.press-identity img { width: 120px; margin-top: .4rem; }
.about-section h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 2rem; }
.about-section p { max-width: 36rem; color: var(--ink-soft); font-size: 1.02rem; }

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.8rem var(--gutter);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: .8rem; color: var(--ink-soft);
}
footer a:first-child { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
footer a:first-child span { font-family: var(--sans); font-size: .78rem; color: var(--ink-faint); margin-left: .4rem; }
footer > span { font-size: .68rem; letter-spacing: .18em; color: var(--ink-faint); }

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .book { width: min(64%, 260px); }
  .cover-stage { margin-top: 1rem; }
  .volume-introduction, .author-note, .about-section, .edition-section { grid-template-columns: 1fr; }
  .author-note h2 { position: static; }
  .hero-foot span { display: none; }
}
@media (max-width: 520px) {
  nav a:not(.edition-link) { display: none; }
  footer { flex-direction: column; align-items: flex-start; }
  .contents li { font-size: 1rem; }
}

/* Praise */
.praise-section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--gutter);
  display: grid; grid-template-columns: 1fr 2.2fr; gap: clamp(2rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
}
.praise-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); position: sticky; top: 6rem; }
.praise-head h2 span { font-style: italic; }
.praise-list { max-width: 40rem; }
.praise { margin: 0; padding: 0 0 2.6rem; }
.praise + .praise { border-top: 1px solid var(--rule); padding-top: 2.6rem; }
.praise blockquote { margin: 0; }
.praise blockquote p { font-family: var(--serif); font-size: clamp(1.12rem, 1.6vw, 1.3rem); line-height: 1.6; margin-bottom: .9em; }
.praise figcaption { margin-top: 1.3rem; display: block; text-transform: none; letter-spacing: 0; }
.praise-name { display: block; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: .3rem; }
.praise-role { display: block; font-size: .86rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 860px) {
  .praise-section { grid-template-columns: 1fr; }
  .praise-head h2 { position: static; }
}

/* Reader's overview */
.overview-section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--gutter);
  display: grid; grid-template-columns: 1fr 2.2fr; gap: clamp(2rem, 5vw, 5rem);
  border-top: 1px solid var(--rule);
}
.overview-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); position: sticky; top: 6rem; }
.overview-head h2 span { font-style: italic; }
.overview-body { max-width: 40rem; }
.overview-lede { font-family: var(--serif); font-size: clamp(1.2rem, 1.9vw, 1.45rem); line-height: 1.5; margin-bottom: 3rem; }
.overview-part { border-top: 1px solid var(--rule); padding: 2.2rem 0 1rem; }
.part-label { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .8rem; }
.part-label span { color: var(--ink-soft); margin-left: .8rem; }
.overview-part h3 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); font-style: italic; margin-bottom: 1.1rem; }
.overview-part p:not(.part-label), .overview-echoes p:not(.part-label) { font-size: 1.02rem; line-height: 1.75; color: var(--ink); }
.overview-body a { border-bottom: 1px solid var(--rule); transition: border-color .2s ease; }
.overview-body a:hover { border-color: var(--ink); }
.further-reading { border-top: 1px solid var(--rule); padding-top: 2.2rem; margin-top: 1rem; }
.further-reading ul { list-style: none; margin: 0; padding: 0; }
.further-reading li { padding: .7rem 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .92rem; }
.further-reading li a { border: 0; font-family: var(--serif); font-size: 1.05rem; }
.further-reading li span { color: var(--ink-faint); font-size: .82rem; }
@media (max-width: 860px) {
  .overview-section { grid-template-columns: 1fr; }
  .overview-head h2 { position: static; }
}
.interlude p { max-width: 46rem; }

/* Sales copy additions */
.volume-pitch { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.45; max-width: 40rem; margin: 0 0 2.6rem; }
.volume-excerpt p + p { margin-top: 1rem; }
.contents li { flex-wrap: wrap; }
.contents li .book-title { flex: 1 1 auto; }
.contents li .book-line { flex-basis: 100%; padding-left: 3rem; margin-top: .35rem; font-family: var(--sans); font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.edition-copy + .edition-copy { margin-top: 1rem; }

/* Distinguish the book quotation from the pitch */
.volume-excerpt { border-left: 1px solid var(--rule); padding-left: clamp(1.1rem, 2.4vw, 1.8rem); }
.volume-excerpt p { font-style: italic; color: var(--ink-soft); }
.volume-excerpt cite { display: block; margin-top: 1.2rem; }

/* Open the book */
button.book { border: 0; font: inherit; color: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s ease; transform-origin: left center; }
button.book > span { display: block; }
button.book:hover { transform: perspective(1400px) rotateY(-7deg); }
button.book:focus-visible, .look-inside:focus-visible, .reader button:focus-visible, .reader a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.look-inside { margin-top: 1rem; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 0 0 2px; font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer; transition: border-color .2s ease; }
.look-inside:hover { border-color: var(--ink); }

.reader { position: fixed; inset: 0; z-index: 100; background: var(--paper-deep); display: grid; grid-template-rows: auto 1fr auto; opacity: 0; transition: opacity .35s ease; }
.reader[hidden] { display: none; }
.reader.is-open { opacity: 1; }
body.reader-lock { overflow: hidden; }
.reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--gutter); border-bottom: 1px solid var(--rule); }
.reader-bar .eyebrow { margin: 0; }
.reader-jumps { display: flex; gap: 1.4rem; margin-left: auto; }
.reader-jumps button, .reader-close { background: none; border: 0; padding: 0 0 2px; font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer; border-bottom: 1px solid transparent; }
.reader-jumps button:hover, .reader-jumps button[aria-current="true"] { border-color: var(--ink); }
.reader-close { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.reader-close span { font-size: 1.1rem; letter-spacing: 0; margin-left: .3rem; }
.reader-stage { display: flex; align-items: center; justify-content: center; padding: clamp(.75rem, 2.5vw, 2rem) var(--gutter); min-height: 0; }
.flip-wrap { width: min(100%, calc((100vh - 190px) * 17 / 11), 1240px); width: min(100%, calc((100dvh - 190px) * 17 / 11), 1240px); margin: 0 auto; }
.flip-wrap.is-portrait { width: min(100%, calc((100vh - 200px) * 8.5 / 11), 520px); width: min(100%, calc((100dvh - 200px) * 8.5 / 11), 520px); }
.reader-stage { overflow: hidden; }
.page { background: #fff; overflow: hidden; }
.page img { width: 100%; height: 100%; object-fit: cover; }
.page-endpaper { background: var(--paper-light); }
.page-cover, .page-back { background: #ece7da; }
.page-back { display: flex; align-items: center; justify-content: center; }
.page-back img { width: 16%; height: auto; opacity: .7; margin: 0 auto; position: relative; top: 42%; }
.page-closing { background: var(--paper-light); }
.closing-inner { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; padding: 12%; text-align: center; }
.closing-line { font-family: var(--serif); font-size: clamp(1.1rem, 2.2vw, 1.6rem); line-height: 1.35; margin: 0; color: var(--ink); }
.reader-controls { display: flex; align-items: center; justify-content: center; gap: 1.6rem; padding: .9rem var(--gutter) 1.2rem; }
.reader-turn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper-light); color: var(--ink); font-size: 1.05rem; cursor: pointer; transition: border-color .2s ease, opacity .2s ease; }
.reader-turn:hover { border-color: var(--ink); }
.reader-turn:disabled { opacity: .35; cursor: default; }
.reader-count { margin: 0; min-width: 12rem; text-align: center; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
@media (max-width: 640px) {
  .reader-bar { flex-wrap: wrap; row-gap: .5rem; }
  .reader-bar .eyebrow { display: none; }
  .reader-jumps { margin-left: 0; }
  .reader-count { min-width: 9rem; }
}
