:root {
  --ink: #1f2933;
  --muted: #5b6770;
  --paper: #ffffff;
  --header: #6f88af;
  --line: #e6e8ec;
  --shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
  --site: #b5314b;
  --design: #358aab;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--paper);
  font-family: Roboto, Manrope, system-ui, sans-serif;
}

a {
  color: inherit;
}

.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;
}

.topbar {
  height: 18px;
  background: var(--header);
}

.intro,
.catalog,
.footer-copy {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.intro {
  display: grid;
  justify-items: center;
  padding: 28px 0 8px;
  text-align: center;
}

.brand-logo {
  width: auto;
  max-width: min(720px, 100%);
  height: 150px;
  object-fit: contain;
  margin-bottom: 18px;
}

.intro p {
  max-width: 760px;
  margin: 0;
  color: #333;
  font-size: 1.05rem;
  line-height: 1.7;
}

.catalog {
  padding: 28px 0 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  margin: 0 auto 28px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.search svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: #8b95a1;
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d1d5db;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.search-clear:hover {
  background: #9ca3af;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 20px;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.book-card img {
  width: 100%;
  max-width: 210px;
  height: 280px;
  object-fit: contain;
  background: transparent;
  transition: transform 160ms ease;
}

.book-card:hover img,
.book-card:focus-visible img {
  transform: translateY(-3px);
}

.book-card h3,
.book-card p {
  width: 100%;
  margin: 0;
  text-align: center;
}

.book-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.book-card p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 36px 0 12px;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.pagination button:hover,
.pagination button:focus-visible {
  background: #eef2f7;
  outline: none;
}

.pagination button[aria-current="page"] {
  background: var(--header);
  color: #fff;
}

.pagination button:disabled {
  color: #b0b7bf;
  cursor: default;
}

.footer-copy {
  padding: 12px 0 56px;
  text-align: center;
}

.footer-copy p {
  max-width: 760px;
  margin: 0 auto 14px;
  color: #333;
  font-size: 1.02rem;
  line-height: 1.7;
}

.contact {
  color: inherit;
  text-decoration: underline;
  letter-spacing: 0.04em;
}

.desktop-only-break {
  display: none;
}

@media (min-width: 721px) {
  .desktop-only-break {
    display: block;
  }
}

.credit a {
  font-weight: 700;
  text-decoration: none;
}

.credit-site {
  color: var(--site);
}

.credit-design {
  color: var(--design);
}

.empty {
  grid-column: 1 / -1;
  padding: 40px 12px 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .brand-logo {
    height: 110px;
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-card img {
    height: 240px;
  }
}

@media (max-width: 480px) {
  .intro,
  .catalog,
  .footer-copy {
    width: min(1240px, calc(100% - 24px));
  }

  .book-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px 12px;
  }
}
