:root {
  --paper: #f4eee4;
  --paper-deep: #e8dfd0;
  --ink: #1c1612;
  --ink-soft: #4a4038;
  --ember: #9a3b14;
  --ember-hover: #6f280d;
  --rule: #c9b8a4;
  --card: #fffcf7;
  --focus: #0b5cab;
  --nav-ink: #f7f0e6;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --measure: 40rem;
  --wide: 68rem;
  --space: clamp(1rem, 4vw, 2.25rem);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .book-card,
  .buy-link {
    transition: none;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ember);
}

a:hover {
  color: var(--ember-hover);
}

a:focus-visible,
.site-nav a:focus-visible,
.buy-link:focus-visible,
.book-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: 0;
  z-index: 10;
  transform: translateY(-150%);
  background: var(--card);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0.5rem);
}

.site-header {
  position: relative;
  background: #1a1210;
}

.site-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
  padding: 0.9rem var(--space) 2.4rem;
  background: linear-gradient(to bottom, rgba(14, 8, 6, 0.78) 0%, rgba(14, 8, 6, 0.28) 55%, rgba(14, 8, 6, 0) 100%);
}

.site-nav a {
  color: var(--nav-ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 0.35rem 0;
}

.site-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.banner {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #1a1210;
}

.banner picture,
.banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

@media (max-width: 700px) {
  .banner {
    aspect-ratio: 4 / 3;
  }

  .banner img {
    object-position: center 38%;
  }

  .site-nav {
    justify-content: center;
    padding-bottom: 2rem;
  }
}

.identity {
  text-align: center;
  padding: clamp(2rem, 5vw, 3.25rem) var(--space) 2rem;
  border-bottom: 1px solid var(--rule);
}

.identity h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.15rem, 6vw, 3.5rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 0.45rem;
}

.identity .tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  margin: 0 auto;
  max-width: 36rem;
}

.identity .preview-note {
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

main {
  display: block;
}

.section {
  padding: clamp(2.25rem, 5vw, 3.5rem) var(--space);
  max-width: var(--wide);
  margin: 0 auto;
}

.section-intro,
.prose {
  max-width: var(--measure);
}

.section h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.15rem);
  margin: 0 0 1.25rem;
  letter-spacing: 0.01em;
}

.section-lead {
  margin: -0.4rem 0 1.75rem;
  color: var(--ink-soft);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 16rem));
  gap: 1.75rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(28, 22, 18, 0.12);
  color: inherit;
}

.book-card .cover {
  display: block;
  aspect-ratio: 992 / 1586;
  background: var(--paper-deep);
  overflow: hidden;
}

.book-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card .card-body {
  padding: 0.9rem 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.book-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.book-card .subtitle,
.book-card .series {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.book-detail {
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
}

.book-detail + .book-detail {
  margin-top: 2.25rem;
}

.book-detail .cover {
  margin: 0;
  background: var(--paper-deep);
  box-shadow: 0 6px 18px rgba(28, 22, 18, 0.14);
}

.book-detail .cover img {
  display: block;
  width: 100%;
  height: auto;
}

.book-detail h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.book-detail .subtitle,
.book-detail .series {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-soft);
}

.blurb {
  margin: 0 0 1.15rem;
}

.buy-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}

.buy-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 1.1rem 1.35rem;
}

.buy-group h5 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.buy-group ul,
.buy-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
}

.buy-link {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.buy-link:hover {
  background: var(--ember);
  border-color: var(--ember);
  color: #fff;
}

.prose p {
  margin: 0 0 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.contact a {
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.4rem var(--space) 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .book-detail {
    grid-template-columns: 1fr;
  }

  .book-detail .cover {
    max-width: 14rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
