/* Layout concept: a bookstore face-out wall. Covers stand on a shelf line; everything else stays quiet. */
:root {
  --paper: #fdfbf4;
  --ink: #1b1f2e;
  --muted: #5d6375;
  --rule: #e4ddcb;
  --accent: #2b3a8c;        /* night-ink blue for links */
  --lantern: #c98a1b;       /* lantern gold for stars and badges */
  --name-green: #2f6e44;    /* wordmark green */
  --lantern-bg: #f7e8c8;
  --shadow: 0 1px 2px rgba(27, 31, 46, .12), 0 8px 20px -8px rgba(27, 31, 46, .28);

  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.4rem;
  --wrap: 72rem;
}
:root[data-theme="dark"] {
  --paper: #12151f; --ink: #e8e9ef; --muted: #9ba1b3; --rule: #2a2f3e;
  --accent: #a9b8ff; --lantern: #f0bd5a; --lantern-bg: #3a2f17;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 24px -10px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 700px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

/* Announcement bar */
.announce {
  background: var(--ink);
  color: var(--paper);
  font-size: var(--step--1);
  text-align: center;
}
.announce a {
  display: block;
  color: inherit;
  text-decoration: none;
  padding-block: .6rem;
}
.announce strong {
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-right: .6em;
  color: var(--lantern-bg);
}
.announce a:hover span { text-decoration: underline; }

/* Header */
.site-head .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding-block: 2rem 1.5rem;
}
.wordmark {
  display: block;
  width: 100%;
  font-family: var(--display);
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 1;
  color: var(--name-green);
  text-decoration: none;
  letter-spacing: -.01em;
}
.wordmark small {
  display: block;
  font-family: var(--body);
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .55rem;
}
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.5rem; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding-block: .25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

main { padding-block: 1.5rem 4rem; }

/* Cover wall */
.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3.5rem 2rem;
}
@media (min-width: 640px) { .shelf { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .shelf { grid-template-columns: repeat(4, 1fr); gap: 5rem 3rem; } }
.shelf a { display: block; color: inherit; text-decoration: none; }
.cover {
  position: relative;
  height: 230px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform .25s ease;
}
@media (min-width: 600px) { .cover { height: 270px; } }
@media (min-width: 1100px) { .cover { height: 320px; } }
.shelf a:hover .cover { transform: translateY(-4px); }
.cover img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  box-shadow: var(--shadow);
  border-radius: 2px 4px 4px 2px;
  display: block;
}
.shelf-meta { margin-top: .9rem; min-height: 2.8em; }
.shelf-title {
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.25;
  text-wrap: balance;
}
.shelf-sub { font-size: var(--step--1); color: var(--muted); margin-top: .2rem; }
.forth-shelf .badge { display: none; }

.badge {
  position: absolute;
  top: .5rem;
  left: .5rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--lantern-bg);
  color: var(--ink);
  padding: .25rem .5rem;
  border-radius: 2px;
}

/* Typeset stand-in when a cover image is missing */
.fallback {
  display: none;
  aspect-ratio: 4 / 5;
  max-width: 100%;
  padding: 1.1rem 1rem;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 2px 4px 4px 2px;
  box-shadow: var(--shadow);
  background: hsl(var(--h) 38% 30%);
  color: hsl(var(--h) 60% 94%);
}
.fallback b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; line-height: 1.2; text-wrap: balance; }
.fallback span { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.nocover img { display: none; }
.nocover .fallback { display: flex; }
.book-cover .fallback b { font-size: 1.8rem; }

/* Section headings */
.section-label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.prose.forthcoming { max-width: 56rem; }
.further-away {
  margin: 4rem 0 1.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--step-1);
  color: var(--muted);
}
.forthcoming ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3 16rem;
  column-gap: 2.5rem;
}
.forthcoming li { break-inside: avoid; padding-block: .45rem; border-bottom: 1px dotted var(--rule); }
.forthcoming li.has-cover { display: flex; align-items: center; gap: .9rem; padding-block: .6rem; }
.forth-cover { width: 3.2rem; height: 4rem; object-fit: cover; border-radius: 2px 3px 3px 2px; box-shadow: var(--shadow); flex-shrink: 0; }
.forthcoming li b { font-family: var(--display); font-weight: 400; }
.forthcoming li span { display: block; font-size: var(--step--1); color: var(--muted); }
.forthcoming li span a { color: var(--muted); text-decoration-color: var(--rule); }
.forthcoming li span a:hover { color: var(--accent); }

/* Book page */
.book {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .book { grid-template-columns: minmax(260px, 2fr) 3fr; gap: 4rem; align-items: start; }
  .book-cover { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1.5rem); }
}
.book-cover { max-width: 420px; }
.book-info { min-width: 0; max-width: 40rem; }
.book-info h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  margin: 0 0 .75rem;
  text-wrap: balance;
}
.credits { font-size: var(--step-1); margin: 0; }
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.status {
  display: inline-block;
  margin-top: 1.25rem;
  background: var(--lantern-bg);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  padding: .3rem .65rem;
  border-radius: 2px;
}
.description { font-size: 1.12rem; line-height: 1.65; margin: 1.75rem 0 0; }
.buy { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.15rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: transparent; color: var(--ink); }

.honors { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.honors li { padding-left: 1.5rem; position: relative; font-weight: 500; }
.honors li::before { content: "◆"; position: absolute; left: 0; top: .1em; font-size: .7rem; color: var(--lantern); }

.reviews { margin: 2.75rem 0 0; display: grid; gap: 1.5rem; }
.reviews figure { margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.reviews figure:first-child { padding-top: 0; border-top: none; }
.reviews blockquote {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--ink);
}
.reviews figcaption { margin-top: .6rem; font-size: var(--step--1); color: var(--muted); }
.reviews figcaption cite { font-style: italic; font-weight: 600; }
.star { color: var(--lantern); margin-right: .4em; font-style: normal; }
.extra-links { margin-top: 2rem; font-size: .95rem; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: .95rem;
}
.pager a { text-decoration: none; color: var(--ink); max-width: 45%; }
.pager a span { display: block; font-size: var(--step--1); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.pager a b { font-family: var(--display); font-weight: 400; }
.pager .next { text-align: right; margin-left: auto; }

/* Prose pages */
.prose { max-width: 38rem; }
.prose h1 { font-family: var(--display); font-weight: 400; font-size: var(--step-3); line-height: 1.1; margin: 0 0 1.5rem; }
.prose p { font-size: 1.1rem; line-height: 1.7; margin: 0 0 1.1rem; }
.about-grid { display: grid; gap: 2.5rem; justify-items: center; max-width: 46rem; margin-inline: auto; }
.about-photo { width: 100%; max-width: 36rem; }
.about-photo img { box-shadow: var(--shadow); border-radius: 3px; width: 100%; }
.about-photo.multi { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.about-photo.multi img { aspect-ratio: 4 / 5; object-fit: cover; }
.about-grid .prose { max-width: 38rem; }

.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.list-plain li { padding-block: 1.1rem; border-bottom: 1px solid var(--rule); }
.list-plain li:first-child { border-top: 1px solid var(--rule); }
.list-plain a { font-family: var(--display); font-size: 1.25rem; text-decoration: none; color: var(--ink); }
.list-plain a:hover { color: var(--accent); }
.list-plain span { display: block; font-size: var(--step--1); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: .2rem; }

.contact dl { margin: 0; display: grid; gap: 1.5rem; }
.contact dt { font-size: var(--step--1); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact dd { margin: .25rem 0 0; font-size: 1.15rem; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); }
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem 2rem;
  padding-block: 1.75rem 2.25rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.site-foot nav { display: flex; align-items: center; gap: 1.25rem; }
.site-foot a { color: var(--muted); }
.site-foot nav a { display: flex; align-items: center; transition: color .15s ease; }
.site-foot nav a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .cover, .shelf a:hover .cover { transition: none; transform: none; }
}
