:root {
  --bg: #f4efe4;
  --bg-soft: #fff8ea;
  --ink: #1a1d24;
  --ink-soft: #3f4755;
  --brand: #7a2f0c;
  --brand-strong: #5a1e00;
  --line: #d6c7ad;
  --accent: #d89d30;
  --radius: 18px;
  --shadow: 0 20px 40px rgba(26, 29, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, #ffe1a3 0%, rgba(255, 225, 163, 0) 45%),
    linear-gradient(180deg, #f7f0e4 0%, #f4efe4 100%);
  font-family: "Manrope", sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: "Cinzel", serif;
  line-height: 1.2;
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 239, 228, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.brand {
  display: grid;
}

.brand-top {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.brand-main {
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--brand);
}

.hero {
  padding: 82px 0 54px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 26px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.78rem;
}

.hero h1 {
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  margin-bottom: 14px;
}

.hero-copy {
  color: var(--ink-soft);
  max-width: 62ch;
}

.hero-card,
.panel,
.ebook-card,
.sale-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 22px;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.section {
  padding: 48px 0 64px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 22px;
}

.ebook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: 96px;
}

.catalog-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 18px 0 12px;
}

.catalog-sidebar-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.catalog-sidebar-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.search-label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
}

.search-input {
  width: 100%;
  border: 1px solid rgba(122, 47, 12, 0.2);
  border-radius: 14px;
  background: #fffdf7;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-input:focus {
  border-color: rgba(122, 47, 12, 0.55);
  box-shadow: 0 0 0 4px rgba(216, 157, 48, 0.18);
}

.search-input::placeholder {
  color: #7d776c;
}

.ebook-list {
  display: grid;
  gap: 6px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}

.ebook-list-link {
  display: block;
  padding: 4px 0;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.45;
  transition: color 180ms ease;
}

.ebook-list-link:hover {
  color: var(--brand);
}

.catalog-empty {
  grid-column: 1 / -1;
}

.catalog-empty h2 {
  margin-bottom: 8px;
}

.catalog-empty p {
  margin: 0;
  color: var(--ink-soft);
}

.ebook-card {
  padding: 22px;
  transition: transform 220ms ease;
}

.ebook-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}

.cover-link {
  display: block;
  margin-bottom: 14px;
}

.ebook-card:hover {
  transform: translateY(-4px);
}

.category {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.subtitle,
.description,
.lead,
.note {
  color: var(--ink-soft);
}

.card-bottom {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.price {
  font-weight: 800;
  color: var(--brand-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(90deg, var(--brand), #944117);
  color: #fff;
}

.btn-outline {
  border: 1px solid var(--brand);
  color: var(--brand-strong);
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--brand);
  font-weight: 700;
}

.two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 24px;
}

.panel .btn {
  margin-top: 14px;
}

.panel.accent {
  background: linear-gradient(160deg, #fff7e8 0%, #ffeec7 100%);
}

.author-photo-wrap {
  margin: 0 0 16px;
}

.author-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(122, 47, 12, 0.24);
}

.author-photo-fallback {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  font-family: "Cinzel", serif;
  color: var(--brand-strong);
  background:
    linear-gradient(135deg, rgba(216, 157, 48, 0.16) 0%, rgba(122, 47, 12, 0.1) 100%),
    #fffaf0;
}

.author-photo-fallback[hidden] {
  display: none !important;
}

.clean-list,
.contact-list {
  margin: 0;
  padding-left: 20px;
}

.sale-box {
  margin-top: 20px;
  padding: 18px;
}

.landing-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 18px;
  border: 1px solid rgba(122, 47, 12, 0.24);
}

.cover-fallback {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  font-family: "Cinzel", serif;
  color: var(--brand-strong);
  background:
    linear-gradient(135deg, rgba(216, 157, 48, 0.16) 0%, rgba(122, 47, 12, 0.1) 100%),
    #fffaf0;
}

.cover-fallback span {
  max-width: 20ch;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  background: #f1e8d7;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .hero-grid,
  .two-col,
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: static;
  }

  .ebook-list {
    max-height: none;
  }

  .ebook-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-wrap {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero {
    padding-top: 48px;
  }
}
