@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600&display=swap");

:root {
  color-scheme: light;
  --paper: #f5f2eb;
  --paper-light: #fcfaf6;
  --ink: #1d2924;
  --muted: #727a70;
  --green: #355b45;
  --green-dark: #294936;
  --line: #e6e1d7;
  --orange: #e99b68;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper-light);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px;
  padding: 0 max(6.5vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(29, 41, 36, .08);
  background: var(--paper);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.wordmark-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-family: "Playfair Display", serif;
  font-size: 17px;
  font-style: italic;
  letter-spacing: -.08em;
}

.wordmark-amp { color: #b57d52; font-family: "Playfair Display", serif; font-style: italic; }
.topbar-note { color: var(--muted); font-size: 12px; }

.intro {
  min-height: 386px;
  padding: 58px max(11vw, 32px) 52px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  background: var(--paper);
}

.intro-copy { position: relative; z-index: 1; max-width: 560px; }
.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--orange);
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 16px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(42px, 5.2vw, 66px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.06;
}

h1 em { color: var(--green); font-weight: 500; }
.intro-description { max-width: 410px; margin-bottom: 0; color: #69716a; font-size: 14px; line-height: 1.75; }

.intro-art { width: 280px; height: 265px; position: relative; flex: 0 0 280px; margin: 0 6vw 0 20px; }
.art-sun { width: 216px; height: 216px; position: absolute; top: 20px; left: 32px; border-radius: 50%; background: #e8dfc9; }
.art-book { position: absolute; border-radius: 4px 9px 9px 4px; box-shadow: 14px 15px 26px rgba(48, 62, 49, .15); }
.art-book-back { width: 132px; height: 178px; top: 62px; left: 108px; transform: rotate(12deg); background: #c97f59; }
.art-book-front {
  width: 135px;
  height: 187px;
  top: 50px;
  left: 55px;
  display: flex;
  align-items: center;
  padding: 19px;
  transform: rotate(-8deg);
  background: #3d654e;
  color: #f7e9ce;
  font-family: "Playfair Display", serif;
  font-size: 23px;
  line-height: 1.02;
}

.art-book-front::before { content: ""; width: 1px; position: absolute; top: 0; bottom: 0; left: 9px; background: rgba(247, 233, 206, .4); }
.art-book-front i { width: 27px; height: 27px; position: absolute; right: 16px; bottom: 15px; border: 1px solid #e8b277; border-radius: 50%; }
.art-book-front i::after { content: ""; width: 8px; height: 8px; position: absolute; top: 8px; left: 8px; border-radius: 50%; background: #e8b277; }
.art-spark { position: absolute; color: #bd8054; }
.art-spark-one { top: 13px; right: 9px; font-size: 25px; }
.art-spark-two { bottom: 26px; left: 11px; font-size: 17px; }

.library { max-width: 1200px; margin: 0 auto; padding: 66px 32px 74px; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.eyebrow-dark { margin-bottom: 8px; color: #9a7456; }
h2 { margin-bottom: 0; font-family: "Playfair Display", Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.035em; }
.result-count { margin-bottom: 5px; color: var(--muted); font-size: 12px; }

.search-form {
  height: 54px;
  max-width: 660px;
  display: flex;
  align-items: center;
  margin-bottom: 17px;
  padding: 5px 6px 5px 18px;
  border: 1px solid #ded9cf;
  border-radius: 6px;
  background: white;
  box-shadow: 0 3px 12px rgba(54, 53, 44, .03);
}

.search-icon { width: 14px; height: 14px; position: relative; margin-right: 13px; border: 1.6px solid #818981; border-radius: 50%; }
.search-icon::after { content: ""; width: 6px; height: 1.6px; position: absolute; right: -5px; bottom: -2px; transform: rotate(45deg); background: #818981; }
.search-form input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-form input::placeholder { color: #9a9f98; }
.search-form:focus-within { border-color: #78927f; box-shadow: 0 0 0 3px rgba(53, 91, 69, .1); }
.search-form button { min-width: 105px; height: 42px; border: 0; border-radius: 4px; background: var(--green); color: white; font-size: 12px; font-weight: 600; transition: background .2s ease; }
.search-form button:hover { background: var(--green-dark); }
.search-form button span { margin-left: 9px; color: #edbd91; }

.catalogue-note { max-width: 660px; display: flex; align-items: flex-start; gap: 10px; margin: 0 0 33px; color: var(--muted); }
.catalogue-note p { margin: 0; font-size: 11px; line-height: 1.6; }
.note-icon { width: 15px; height: 15px; flex: 0 0 15px; display: grid; place-items: center; margin-top: 1px; border: 1px solid #aeb4ac; border-radius: 50%; font-family: Georgia, serif; font-size: 10px; font-style: italic; }

.status-message { min-height: 0; color: #6d756d; font-size: 13px; }
.status-message:not(:empty) { min-height: 45px; }
.status-message.error { color: #9e493e; }
.retry-button { margin-left: 10px; padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 700; text-decoration: underline; }

.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 25px; }
.book-card { min-width: 0; overflow: hidden; border: 1px solid #e8e4dc; border-radius: 7px; background: white; box-shadow: 0 4px 15px rgba(42, 48, 42, .035); transition: transform .2s ease, box-shadow .2s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(42, 48, 42, .09); }
.cover-wrap { height: 215px; position: relative; overflow: hidden; background: #e8e3d8; }
.cover-wrap::after { content: ""; position: absolute; inset: 52% 0 0; pointer-events: none; background: linear-gradient(transparent, rgba(22, 30, 25, .16)); }
.book-cover { width: 100%; height: 100%; display: block; object-fit: cover; color: transparent; }
.cover-placeholder { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; color: #849084; font-family: "Playfair Display", serif; font-size: 30px; }
.cover-placeholder[hidden] { display: none; }
.book-copy { padding: 17px 18px 18px; }
.book-author { overflow: hidden; margin: 0 0 6px; color: #9a7456; font-size: 10px; font-weight: 700; letter-spacing: .11em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.book-title { min-height: 48px; margin: 0 0 8px; font-family: "Playfair Display", Georgia, serif; font-size: 19px; font-weight: 600; line-height: 1.25; }
.book-description { min-height: 53px; display: -webkit-box; overflow: hidden; margin: 0 0 16px; color: #737a73; font-size: 11px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.book-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.listen-button { min-height: 37px; display: inline-flex; align-items: center; gap: 9px; padding: 0 13px; border: 0; border-radius: 4px; background: var(--green); color: white; font-size: 11px; font-weight: 600; transition: background .2s ease; }
.listen-button:hover { background: var(--green-dark); }
.play-symbol { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #edbd91; }
.listen-button[aria-expanded="true"] .play-symbol { width: 8px; height: 10px; border: 0; border-right: 2px solid #edbd91; border-left: 2px solid #edbd91; }
.book-year { color: #92988f; font-size: 10px; }
.audio-panel { margin: 0 18px 17px; padding-top: 14px; border-top: 1px solid #eeeae2; }
.audio-panel[hidden] { display: none; }
.audio-label { display: block; margin-bottom: 7px; color: #657067; font-size: 10px; font-weight: 600; }
.track-select { width: 100%; min-height: 36px; margin-bottom: 10px; padding: 0 8px; border: 1px solid #ddd9d0; border-radius: 4px; color: var(--ink); background: #fff; font-size: 11px; }
.audio-player { width: 100%; height: 38px; }
.audio-message { margin: 0; color: #747c74; font-size: 11px; line-height: 1.5; }
.audio-message.error { color: #9e493e; }
.panel-retry { margin: 8px 0 0; padding: 0; border: 0; color: var(--green); background: none; font-size: 11px; font-weight: 700; text-decoration: underline; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 42px; color: var(--muted); font-size: 12px; }
.pagination[hidden] { display: none; }
.page-button { min-height: 37px; padding: 0 13px; border: 1px solid #dcd8ce; border-radius: 4px; color: var(--green); background: white; font-size: 11px; font-weight: 600; }
.page-button:disabled { cursor: default; opacity: .42; }

.footer { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px max(6.5vw, 24px); border-top: 1px solid var(--line); background: var(--paper); }
.footer-mark { font-size: 13px; }
.footer-mark .wordmark-icon { width: 26px; height: 26px; font-size: 14px; }
.footer p, .footer-credit { margin: 0; color: var(--muted); font-size: 10px; }
.sr-only { width: 1px; height: 1px; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 900px) {
  .intro { padding-right: 7vw; padding-left: 8vw; }
  .intro-art { margin-right: 0; transform: scale(.85); transform-origin: center right; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar { height: 64px; }
  .topbar-note { font-size: 10px; }
  .intro { min-height: auto; padding: 48px 25px 41px; }
  .intro-art { width: 130px; height: 165px; flex-basis: 130px; margin-left: -10px; transform: scale(.64); transform-origin: center right; }
  .intro-copy { margin-right: -15px; }
  h1 { font-size: clamp(39px, 10vw, 53px); }
  .intro-description { max-width: 300px; font-size: 12px; }
  .library { padding: 45px 20px 55px; }
  .library-heading { align-items: start; }
  h2 { font-size: 29px; }
  .result-count { text-align: right; }
  .search-form { height: 50px; padding-left: 12px; }
  .search-form button { min-width: 79px; height: 38px; }
  .search-form button span { margin-left: 4px; }
  .book-grid { grid-template-columns: 1fr; gap: 18px; }
  .book-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-content: start; }
  .cover-wrap { height: 100%; min-height: 174px; grid-row: span 2; }
  .book-copy { padding: 14px 13px 10px; }
  .book-title { min-height: 0; font-size: 17px; }
  .book-description { min-height: 0; margin-bottom: 12px; -webkit-line-clamp: 2; }
  .book-author { font-size: 9px; }
  .book-actions { align-items: center; }
  .listen-button { min-height: 34px; padding: 0 10px; font-size: 10px; }
  .book-year { font-size: 9px; }
  .audio-panel { grid-column: 2; margin: 0 13px 14px; padding-top: 10px; }
  .footer { flex-wrap: wrap; }
  .footer-credit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
