:root {
  --paper: #faf8f4;
  --ink: #141414;
  --ink-soft: #5c5a55;
  --rule: #e4e0d8;
  --accent: #7a2e2a;
  --shadow: 0 1px 2px rgba(20, 20, 20, .08), 0 12px 32px -12px rgba(20, 20, 20, .28);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121212;
    --ink: #f1eee8;
    --ink-soft: #a29e96;
    --rule: #2a2826;
    --accent: #d9897f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -14px rgba(0, 0, 0, .8);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
main { flex: 1; }

/* ---------- Header ---------- */

.site-header { padding: 32px 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font: 500 13px/1 var(--sans);
  letter-spacing: .32em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark svg { width: 30px; height: 20px; flex: none; }

.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }

/* ---------- Intro ---------- */

.intro { padding-top: clamp(40px, 9vw, 112px); padding-bottom: clamp(40px, 7vw, 88px); }
.intro h1 {
  margin: 0;
  max-width: 14ch;
  font: 400 clamp(40px, 7vw, 84px)/1.02 var(--serif);
  letter-spacing: -.01em;
}
.intro h1 em { color: var(--accent); }
.intro p { margin: 24px 0 0; max-width: 44ch; color: var(--ink-soft); font-size: 17px; }

.eyebrow {
  margin: 0 0 16px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Shelf ---------- */

.shelf-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  margin-bottom: 40px;
}
.shelf-head h2 { margin: 0; font: 500 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }

.shelf {
  list-style: none;
  margin: 0 0 120px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 40vw), 1fr));
  gap: clamp(32px, 5vw, 64px) clamp(20px, 3vw, 36px);
}

.shelf__item { display: block; text-decoration: none; }
.shelf__item .cover { transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s; }
.shelf__item:hover .cover, .shelf__item:focus-visible .cover { transform: translateY(-6px); }
.shelf__title { display: block; margin-top: 18px; font: 500 21px/1.2 var(--serif); }
.shelf__meta { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-soft); }

/* ---------- Covers ---------- */

.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px;
  background: var(--rule);
  box-shadow: var(--shadow);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

.cover--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12% 10%;
  text-align: center;
}
.cover--dark { color: #f5f1ea; }
.cover--light { color: #1a1a1a; }
.cover__title { font: 500 clamp(22px, 3vw, 34px)/1.05 var(--serif); }
.cover__author { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; opacity: .85; }

/* ---------- Book page ---------- */

.book {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 7vw, 96px);
  align-items: start;
  padding: clamp(24px, 5vw, 64px) 0 clamp(48px, 8vw, 96px);
}
.book__cover { position: sticky; top: 32px; }
.book__cover .cover__title { font-size: clamp(28px, 4vw, 48px); }
.book__title { margin: 0; font: 400 clamp(40px, 6vw, 72px)/1.02 var(--serif); letter-spacing: -.01em; }
.book__tagline { margin: 20px 0 0; font: italic 400 clamp(20px, 2.4vw, 26px)/1.35 var(--serif); color: var(--ink-soft); }
.book__synopsis { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--rule); max-width: 60ch; font-size: 17px; }
.book__synopsis p { margin: 0 0 1.1em; }
.book__note { margin: 8px 0 0; max-width: 60ch; font-size: 13px; color: var(--ink-soft); }
.book__credit { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.book__buy { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.book__sample {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 24px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
  font: italic 400 20px/1.2 var(--serif);
  text-decoration: none;
}
.book__sample:hover { color: var(--accent); border-color: var(--accent); }
.soon {
  margin: 0;
  display: inline-block;
  padding: 14px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font: 500 13px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.is-soon { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 500 13px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: end;
  border-top: 1px solid var(--rule);
  padding: 28px 0 96px;
}
.pager a { text-decoration: none; font: 500 20px/1.2 var(--serif); }
.pager a span { display: block; margin-bottom: 6px; font: 400 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.pager .pager__all { font: 400 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.pager .pager__all:hover { color: var(--ink); }
.pager__next { text-align: right; }

.empty { padding: 120px 0; text-align: center; }
.link { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 7vw, 96px);
  padding: clamp(24px, 5vw, 64px) 0 120px;
  align-items: start;
}
.portrait {
  aspect-ratio: 4 / 5;
  background: var(--rule);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait svg { width: 40%; color: var(--ink-soft); opacity: .5; }
.about h1 { margin: 0 0 32px; font: 400 clamp(40px, 6vw, 72px)/1.02 var(--serif); }
.about .lede { font: 400 clamp(22px, 2.6vw, 28px)/1.4 var(--serif); margin: 0 0 28px; }
.about__body { max-width: 60ch; font-size: 17px; }
.about__body p { margin: 0 0 1.1em; }
.about__contact { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--ink-soft); }
.about__contact a { color: var(--ink); }

/* ---------- Reader (first chapters) ---------- */

.reader { max-width: 36em; margin: 0 auto; padding: clamp(24px, 5vw, 56px) 0 96px; }
.reader__title { text-align: center; margin-bottom: clamp(48px, 8vw, 88px); }
.reader__title h1 { margin: 0; font: 400 clamp(40px, 7vw, 68px)/1.05 var(--serif); }
.reader__by { margin: 16px 0 0; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.reader__by a { color: var(--ink-soft); }
.reader__note { margin: 20px auto 0; }
.reader__part {
  margin: 0 0 56px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.reader__part span { display: block; margin-top: 10px; font: italic 400 26px/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); }
.reader__section + .reader__section { margin-top: 96px; }
.reader__chapter { text-align: center; margin-bottom: 40px; }
.reader__num { margin: 0; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; }
.reader__chapter h2 { margin: 8px 0 0; font: italic 400 28px/1.2 var(--serif); }

.reader__text { font: 400 clamp(18px, 2.1vw, 20px)/1.65 "EB Garamond", Georgia, serif; hyphens: auto; -webkit-hyphens: auto; }
.reader__body p { margin: 0; text-indent: 1.4em; }
.reader__body p:first-child, .reader__body h4 + p, .reader__body .reader__break + p, .reader__body .reader__voice + p { text-indent: 0; }
.reader__section--doc .reader__body p { text-indent: 0; margin-bottom: .8em; }
.reader__body h4 { margin: 1.6em 0 .4em; font: 500 13px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.reader__body blockquote { margin: 1em 1.4em; }
.reader__body .reader__break { margin: 1.1em 0; text-align: center; text-indent: 0; color: var(--ink-soft); }
.reader__body .reader__voice { margin-top: 1.4em; text-indent: 0; font-variant: small-caps; letter-spacing: .08em; }

.reader__end { margin-top: 96px; padding-top: 40px; border-top: 1px solid var(--rule); }
.reader__end-row { display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: center; }
.reader__end-cover img { width: 100%; box-shadow: var(--shadow); }
.reader__end-line { margin: 0; font: 400 22px/1.35 var(--serif); }
.reader__end .book__buy { margin-top: 20px; }
@media (max-width: 520px) {
  .reader__end-row { grid-template-columns: 88px 1fr; gap: 20px; align-items: start; }
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 7vw, 96px);
  padding: clamp(24px, 5vw, 64px) 0 120px;
  align-items: start;
}
.contact h1 { margin: 0 0 24px; font: 400 clamp(40px, 6vw, 72px)/1.02 var(--serif); }
.contact .lede { margin: 0; max-width: 28ch; font: 400 clamp(20px, 2.4vw, 24px)/1.4 var(--serif); color: var(--ink-soft); }

.form { max-width: 560px; }
.field { margin-bottom: 28px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 6px center, right 1px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field select option { color: #141414; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.form__trap { position: absolute; left: -9999px; }
.form__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 8px; }
.form__foot .btn { cursor: pointer; }
.form__foot .btn:disabled { opacity: .5; cursor: default; }
.form__status { margin: 0; font-size: 14px; color: var(--ink-soft); }
.form__status.is-ok { color: var(--ink); }
.form__status.is-error { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 28px 0 40px; font-size: 13px; color: var(--ink-soft); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .site-header { padding: 20px 0; }
  .nav { gap: 16px; }
  .nav a { font-size: 12px; letter-spacing: .06em; }
  .wordmark { gap: 10px; letter-spacing: .22em; }
  .wordmark svg { width: 26px; }
  .book, .about, .contact { grid-template-columns: 1fr; }
  .book__cover { position: static; max-width: 300px; }
  .portrait { max-width: 320px; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .pager__all { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
