:root {
  --ink: #1f2f26;
  --muted: #5b665d;
  --paper: #fffdf7;
  --bg: #f4efe4;
  --line: #d7cbb7;
  --green: #386641;
  --sage: #6a994e;
  --gold: #d5a021;
  --red: #a6423f;
  --shadow: 0 18px 42px rgba(47, 39, 25, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7.25rem;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(106, 153, 78, 0.22), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(213, 160, 33, 0.18), transparent 24rem),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--green);
  color: white;
}

.skip-link:focus {
  left: 1rem;
}

.hero,
main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 4rem 0;
}

.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 8px 24px rgba(47, 39, 25, 0.1);
  backdrop-filter: blur(12px);
}

.sticky-nav-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 4.25rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.sticky-nav a {
  text-decoration: none;
}

.sticky-nav .site-link {
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.sticky-nav span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-nav .search-link {
  min-height: 2.6rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 2rem;
  align-items: end;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 10vw, 8.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.08rem;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-panel,
.intro article,
.filters,
.book-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 1.4rem;
}

.hero-panel strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

main {
  display: grid;
  gap: 3rem;
}

.intro,
.catalog {
  padding-bottom: 2rem;
}

.section-heading {
  max-width: 860px;
  margin-bottom: 1.2rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.intro article {
  padding: 1.35rem;
}

#catalog,
.filters {
  scroll-margin-top: 7.25rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(170px, 0.8fr));
  gap: 0.9rem;
  align-items: end;
  padding: 1rem;
}

.filters label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: white;
  color: var(--ink);
  font: inherit;
}

.check-row {
  display: flex !important;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.55rem;
}

.check-row input {
  width: 1.1rem;
  min-height: auto;
  height: 1.1rem;
}

.reset-button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: var(--green);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 1rem 0;
  color: var(--muted);
  font-weight: 800;
}

.status-row p {
  margin-bottom: 0;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 1rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
}

.book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f1e5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}

.book-cover.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.book-card h3 {
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.08;
}

.meta,
.isbn {
  color: var(--muted);
  font-size: 0.92rem;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  background: #eef4e7;
  color: #2e4f35;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.topic {
  background: #fff1c9;
  color: #684c00;
}

.badge.grade {
  background: #f7dedb;
  color: #77332f;
}

.book-card details {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.book-card summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  background: rgba(255,255,255,0.5);
  color: var(--muted);
  text-align: center;
}

footer {
  padding: 3rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .intro-grid,
  .filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero,
  main,
  footer {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .sticky-nav-inner {
    width: min(100% - 22px, 1180px);
    grid-template-columns: 1fr auto;
  }

  .sticky-nav span {
    display: none;
  }
}
