:root {
  --paper: #f4eee4;
  --paper-deep: #e9dfcf;
  --ink: #1f1b18;
  --muted: #574d44;
  --accent: #8f4327;
  --rule: #d5c8b4;
  --walnut: #231a15;
  --walnut-light: #3a2a20;
  --cream: #f1e6d2;
  --brass: #d9aa62;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

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

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

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 8px 14px;
  background: var(--cream);
  color: var(--walnut);
  font-family: var(--sans);
  font-size: 0.875rem;
  z-index: 30;
}
.skip-link:focus { top: 12px; }

/* Buttons and small links */

.button {
  display: inline-block;
  padding: 11px 24px;
  border: 2px solid var(--accent);
  color: var(--ink);
  background: transparent;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.button:hover { background: var(--accent); color: var(--paper); }
.button.dark { background: var(--walnut); border-color: var(--walnut); color: var(--cream); }
.button.dark:hover { background: var(--accent); border-color: var(--accent); }

.text-link {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.text-link::after { content: " \203A"; }

.more { margin: 28px 0 0; text-align: center; }

/* Header and the Books menu */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--walnut);
  color: var(--cream);
  border-bottom: 1px solid var(--walnut-light);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--cream);
  text-decoration: none;
  font-size: clamp(1.125rem, 2.6vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wordmark svg { width: 42px; height: 42px; flex: none; }
.wordmark:hover { color: var(--brass); }
.wordmark:focus-visible { outline-color: var(--brass); }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px 28px;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
}
.nav-list > li > a, .nav-menu > summary {
  display: inline-block;
  padding: 6px 0;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.nav-list > li > a:hover, .nav-menu > summary:hover { color: var(--brass); }
.nav-list > li > a[aria-current="page"], .nav-menu > summary.current, .nav-menu[open] > summary {
  border-bottom-color: var(--brass);
}
.nav-list a:focus-visible, .nav-menu > summary:focus-visible { outline-color: var(--brass); }

.nav-menu > summary { list-style: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0 3px 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.nav-menu[open] > summary::after { transform: rotate(-135deg); margin-bottom: -1px; }

.mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--walnut-light);
  box-shadow: 0 18px 30px rgba(31, 27, 24, 0.28);
  font-weight: 400;
}
.mega-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr);
  gap: 24px 32px;
  padding-top: 28px;
  padding-bottom: 32px;
}
.mega-head {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-weight: 700;
  font-size: 0.9375rem;
}
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col li + li { margin-top: 6px; }
.mega-col a { color: var(--ink); text-decoration: none; font-size: 0.9375rem; }
.mega-col a:hover { color: var(--accent); text-decoration: underline; }
.mega-feature { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.mega-art {
  display: flex;
  justify-content: center;
  padding: 18px 12px;
  margin-bottom: 8px;
  background: radial-gradient(ellipse at 50% 120%, rgba(217, 170, 98, 0.3), transparent 65%), var(--walnut);
}
.mega-art .row-cover { width: 64px; }
.mega-feature-title { font-weight: 700; }
.mega-feature-more { font-size: 0.875rem; color: var(--accent); }
.mega-feature:hover .mega-feature-more { text-decoration: underline; }

/* Hero: the logo and a shelf of covers */

.hero {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(217, 170, 98, 0.18), transparent 60%),
    var(--walnut);
  color: var(--cream);
  padding-top: 44px;
  overflow: hidden;
}

.hero-logo {
  max-width: 440px;
  margin: 0 auto;
}
.hero-logo img { width: 100%; }

.hero-lede {
  max-width: 40ch;
  margin: 18px auto 36px;
  text-wrap: balance;
  text-align: center;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.3;
}

.shelf-wrap { position: relative; }

.bookshelf {
  list-style: none;
  margin: 0;
  padding: 0 16px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
}

.bookshelf li { flex: none; }

.shelf-cover {
  width: auto;
  height: 190px;
  max-width: none;
  border-radius: 2px 4px 4px 2px;
  box-shadow: inset 4px 0 6px rgba(0, 0, 0, 0.25), 0 10px 18px rgba(0, 0, 0, 0.45);
}
.bookshelf li:nth-child(3n + 2) .shelf-cover { height: 172px; }
.bookshelf li:nth-child(4n + 3) .shelf-cover { height: 182px; }

/* The ninth book leans. */
.bookshelf li:nth-child(9) {
  transform: rotate(7deg);
  transform-origin: bottom right;
  margin-left: 14px;
}

.ledge {
  height: 22px;
  background: linear-gradient(#7b5434, #5a3b24 45%, #3e281a);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 220, 170, 0.25);
}

/* Sections */

.section { padding: 56px 0 8px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  font-weight: 400;
  font-size: clamp(1.625rem, 3.4vw, 2.375rem);
  line-height: 1.2;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.section-title.centered { justify-content: center; text-align: center; }
.section-title.centered::after { display: none; }

/* Rows of covers on a colour panel (series panels, cards, the menu) */

.cover-row { display: flex; justify-content: center; align-items: flex-end; gap: 4%; width: 100%; }
.row-item { flex: 0 1 22%; }
.row-cover {
  width: 100%;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

/* Wide series panel: text card beside a banner of covers */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 16px;
}
.feature.flip { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.feature.flip .feature-text { order: 2; }

.feature-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 36px 40px;
  background: #fffaf2;
  border: 1px solid var(--rule);
}
.kicker {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.feature-title {
  margin: 0 0 12px;
  font-weight: 400;
  font-size: clamp(1.75rem, 3.4vw, 2.375rem);
  line-height: 1.15;
}
.feature-line { margin: 0 0 26px; font-size: 1.125rem; line-height: 1.55; }

.feature-art {
  display: flex;
  align-items: center;
  padding: 44px 6%;
  min-height: 340px;
  background:
    radial-gradient(ellipse at 50% 115%, color-mix(in srgb, var(--pen-accent) 40%, transparent), transparent 62%),
    var(--pen-bg);
}
.feature-art:hover .row-cover { transform: translateY(-4px); }
.row-cover { transition: transform 0.2s ease; }

/* Series cards, two side by side */

.series-pair {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.series-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fffaf2;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.series-art {
  display: flex;
  align-items: center;
  padding: 36px 8%;
  min-height: 260px;
  background:
    radial-gradient(ellipse at 50% 115%, color-mix(in srgb, var(--pen-accent) 40%, transparent), transparent 62%),
    var(--pen-bg);
}
.series-card a:hover .row-cover { transform: translateY(-4px); }
.series-text { display: flex; flex-direction: column; padding: 22px 30px 26px; }
.series-name {
  align-self: flex-start;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--accent);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.series-author { margin-top: 6px; font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }
.series-line { margin-top: 10px; font-size: 1.125rem; line-height: 1.5; }

/* Tabs: New releases / Coming soon */

.tab-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0 0 26px;
}
.tab-list[hidden] { display: none; }
.tab-list [role="tab"] {
  padding: 9px 22px;
  border: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.tab-list [role="tab"]:hover { color: var(--ink); }
.tab-list [role="tab"][aria-selected="true"] { border-color: var(--accent); color: var(--ink); }
.tab-heading { margin: 0 0 16px; font-weight: 400; font-size: 1.375rem; }
.tab-panel + .tab-panel { margin-top: 36px; }
.tabs-ready .tab-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tabs-ready .tab-panel + .tab-panel { margin-top: 0; }
.tab-panel[hidden] { display: none; }

/* Book grids */

.book-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 28px 20px;
}
.book[hidden] { display: none; }
.book a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}
.book-cover {
  width: 100%;
  margin-bottom: 8px;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 0 8px 18px rgba(31, 27, 24, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.book a:hover .book-cover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(31, 27, 24, 0.34); }
.book a:hover .book-title { text-decoration: underline; text-underline-offset: 0.15em; }
.book-title { font-size: 1.0625rem; line-height: 1.3; font-weight: 600; }
.book-meta { font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }

.badge {
  align-self: flex-start;
  padding: 2px 9px;
  border: 1px solid var(--muted);
  border-radius: 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Genre tiles */

.genre-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.genre-tile a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fffaf2;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.genre-art {
  display: flex;
  justify-content: center;
  padding: 22px 0 20px;
  background:
    radial-gradient(ellipse at 50% 115%, color-mix(in srgb, var(--pen-accent) 40%, transparent), transparent 62%),
    var(--pen-bg);
}
.genre-art .fan { width: 140px; height: 112px; margin: 0; }
.genre-art .fan-cover { width: 64px; }
.genre-art .fan-item { left: calc(var(--i) * 38px); }
.genre-art .fan[style*="--count:1"] .fan-item { left: 38px; }
.genre-name {
  padding: 14px 12px 16px;
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.3;
}
.genre-tile a:hover .genre-name { text-decoration: underline; text-underline-offset: 0.15em; }

/* Covers fanned out (genre tiles, author cards) */

.fan {
  position: relative;
  display: block;
  height: 150px;
  margin: 22px 22px 0;
}
.fan-item {
  position: absolute;
  bottom: 0;
  left: calc(var(--i) * 46px);
  transform: rotate(calc((var(--i) - 1) * 5deg));
  transform-origin: bottom center;
}
.fan-item:nth-child(2) { z-index: 2; }
.fan-cover {
  width: 88px;
  border-radius: 2px 3px 3px 2px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}
.fan[style*="--count:1"] .fan-item { left: calc(50% - 36px); transform: none; }

/* Inner pages */

.page { padding-top: 40px; }
.page-title { margin: 0 0 8px; font-weight: 400; font-size: clamp(2.25rem, 5vw, 3rem); line-height: 1.15; }
.page-intro { max-width: 60ch; margin: 0 0 28px; font-size: 1.125rem; color: var(--muted); }

.jump { margin: 0 0 8px; }
.jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jump a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: #fffaf2;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.875rem;
  text-decoration: none;
}
.jump a:hover { border-color: var(--accent); color: var(--accent); }

.catalog-genre { padding-top: 44px; }
.catalog-genre .section-title { margin-bottom: 4px; }
.catalog-author { margin: 0 0 8px; font-family: var(--sans); font-size: 0.9375rem; color: var(--muted); }
.catalog-series { padding-top: 22px; }
.catalog-series-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.catalog-series h3 { margin: 0; font-size: 1.375rem; line-height: 1.3; }
.catalog-line { max-width: 70ch; margin: 4px 0 18px; color: var(--muted); }
.catalog-series-head + .book-grid { margin-top: 18px; }

/* Author cards */

.authors-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}

.pen-name a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--pen-bg);
  color: var(--pen-fg);
  text-decoration: none;
  border-top: 4px solid var(--pen-accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pen-name a:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31, 27, 24, 0.3); }
.pen-name a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.pen-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 22px 20px;
}
.pen-name .genre {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pen-accent);
}
.pen-name .name {
  margin: 4px 0 6px;
  font-size: 1.625rem;
  line-height: 1.2;
}
.pen-name .pitch { display: block; margin: 0 0 10px; font-size: 1rem; line-height: 1.5; }
.pen-series { display: block; margin: 0 0 14px; font-family: var(--sans); font-size: 0.875rem; line-height: 1.5; }
.pen-name .visit {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pen-accent);
}

/* Text pages */

.prose { max-width: 752px; padding-top: 36px; padding-bottom: 16px; }
.prose h1 { margin: 0 0 4px; font-weight: 400; font-size: 2.25rem; line-height: 1.2; }
.prose h2 { margin: 28px 0 6px; font-size: 1.25rem; }
.prose p { margin: 0 0 12px; }
.prose .meta { font-family: var(--sans); font-size: 0.875rem; color: var(--muted); }

/* Footer */

.site-footer {
  margin-top: 72px;
  background: var(--walnut);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
  padding-top: 44px;
  padding-bottom: 32px;
}
.footer-brand .wordmark { font-size: 1.125rem; }
.footer-brand .wordmark svg { width: 34px; height: 34px; }
.footer-brand p { margin: 12px 0 0; color: var(--brass); }
.footer-head {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8125rem;
  color: var(--brass);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 6px; }
.footer-base { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--walnut-light); }
.footer-base p { margin: 0; font-size: 0.875rem; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--brass); text-decoration: underline; }
.site-footer a:focus-visible { outline-color: var(--brass); }

/* Smaller screens */

@media (max-width: 900px) {
  .mega-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mega-feature { display: none; }
  .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); }
  .feature.flip .feature-text { order: 0; }
  .feature-art { min-height: 0; padding: 32px 6%; }
  .genre-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .header-bar { flex-direction: column; align-items: flex-start; padding-bottom: 8px; }
  .nav-list { gap: 4px 20px; font-size: 0.9375rem; }
  .mega-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 20px; padding-bottom: 24px; }
  .mega-col:last-of-type { grid-column: 1 / -1; }
  .mega-col:last-of-type ul { columns: 2; column-gap: 24px; }
  .mega-col:last-of-type li { break-inside: avoid; }
  .hero { padding-top: 32px; }
  .hero-lede { margin: 12px auto 28px; }
  .bookshelf { height: 140px; gap: 8px; }
  .shelf-cover { height: 132px; }
  .bookshelf li:nth-child(3n + 2) .shelf-cover { height: 120px; }
  .bookshelf li:nth-child(4n + 3) .shelf-cover { height: 126px; }
  .section { padding-top: 40px; }
  .feature-text { padding: 26px 22px; }
  .series-pair { grid-template-columns: minmax(0, 1fr); }
  .series-art { min-height: 0; padding: 28px 8%; }
  .series-text { padding: 18px 20px 22px; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .book-title { font-size: 0.9375rem; }
  .book-meta { font-size: 0.8125rem; }
  .tab-list { gap: 8px; }
  .tab-list [role="tab"] { padding: 8px 12px; font-size: 0.8125rem; }
  .genre-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genre-art .fan { width: 124px; height: 100px; }
  .genre-art .fan-cover { width: 58px; }
  .genre-art .fan-item { left: calc(var(--i) * 33px); }
  .genre-art .fan[style*="--count:1"] .fan-item { left: 33px; }
  .genre-name { font-size: 1rem; }
  .fan { height: 100px; margin: 18px 18px 0; }
  .fan-item { left: calc(var(--i) * 34px); }
  .fan-cover { width: 60px; }
  .pen-text { padding: 14px 18px 16px; }
  .pen-name .name { font-size: 1.4375rem; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .pen-name a, .book-cover, .row-cover { transition: none; }
  .pen-name a:hover, .book a:hover .book-cover, .feature-art:hover .row-cover,
  .series-card a:hover .row-cover { transform: none; }
}
