:root {
  --ink: #291d20;
  --muted: #77696c;
  --cream: #fbf7f1;
  --paper: #fffdf9;
  --rose: #a63f55;
  --rose-dark: #7f293e;
  --blush: #edd5d5;
  --gold: #d4a65c;
  --line: rgba(41, 29, 32, 0.12);
  --shadow: 0 24px 70px rgba(76, 42, 48, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  padding: 0 clamp(24px, 6vw, 96px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 247, 241, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50% 50% 50% 12%;
  color: white;
  background: var(--rose);
  font-style: italic;
}

.desktop-nav { display: flex; gap: 34px; }
.desktop-nav a { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.desktop-nav a:hover { color: var(--rose); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.language-switch {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  cursor: pointer;
}

.language-switch span {
  padding: 6px 9px;
  border-radius: 20px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.language-switch span.active { color: white; background: var(--ink); }

.icon-button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  cursor: pointer;
}

.hero {
  display: grid;
  min-height: 650px;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  overflow: hidden;
}

.hero-copy { padding: 72px clamp(24px, 6vw, 96px); }

.eyebrow {
  margin: 0 0 16px;
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

h1, h2, h3 { margin-top: 0; font-family: "Playfair Display", serif; }

h1 {
  max-width: 700px;
  margin-bottom: 24px;
  font-size: clamp(3.4rem, 6vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h1 em { color: var(--rose); font-weight: 600; }

.hero-description {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

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

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.button.primary { color: white; background: var(--rose); }
.button.primary:hover { background: var(--rose-dark); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); color: var(--ink); background: transparent; }

.hero-stats { display: flex; gap: 38px; margin-top: 56px; }
.hero-stats div { display: grid; gap: 4px; }
.hero-stats strong { font-family: "Playfair Display", serif; font-size: 1.4rem; }
.hero-stats span { color: var(--muted); font-size: 0.75rem; }

.hero-art {
  position: relative;
  align-self: stretch;
  min-height: 590px;
  overflow: hidden;
  background: #e9cbca;
}

.sun {
  position: absolute;
  top: 70px;
  right: 70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: #f5e7d0;
}

.arch {
  position: absolute;
  right: -40px;
  bottom: -120px;
  width: 78%;
  height: 82%;
  border: 35px solid rgba(166, 63, 85, 0.16);
  border-radius: 300px 300px 0 0;
}

.hero-book {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: 285px;
  height: 420px;
  padding: 38px 30px;
  flex-direction: column;
  justify-content: center;
  color: #f9eee3;
  border: 7px solid #f2dfc4;
  outline: 1px solid var(--rose);
  background:
    linear-gradient(rgba(64, 22, 34, 0.1), rgba(64, 22, 34, 0.4)),
    linear-gradient(145deg, #bd5971, #72243a);
  box-shadow: 25px 28px 50px rgba(66, 28, 35, 0.3);
  transform: translate(-50%, -50%) rotate(5deg);
}

.hero-book::before, .hero-book::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: rgba(246, 217, 188, 0.18);
}

.hero-book::before { top: 80px; left: 35px; width: 170px; height: 170px; }
.hero-book::after { right: 22px; bottom: 38px; width: 90px; height: 90px; }
.hero-book span, .hero-book strong, .hero-book i { position: relative; z-index: 1; }
.book-kicker { font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; }
.hero-book strong { margin: 28px 0; font-family: "Playfair Display", serif; font-size: 2.6rem; line-height: 1; }
.hero-book i { font-family: "Playfair Display", serif; }

.floating-note {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--rose);
  background: rgba(255,255,255,0.8);
  box-shadow: var(--shadow);
  font-family: "Playfair Display", serif;
}

.note-one { top: 18%; left: 12%; width: 70px; height: 70px; font-size: 3rem; }
.note-two { right: 12%; bottom: 14%; width: 54px; height: 54px; }

.ad-banner {
  display: grid;
  min-height: 100px;
  margin: 34px auto;
  max-width: min(970px, calc(100% - 48px));
  place-items: center;
  border: 1px dashed #baaeb0;
  color: #9c9092;
  background: #f2eee8;
  text-align: center;
}

.ad-banner span { font-size: 0.6rem; letter-spacing: 0.16em; }
.ad-banner p { margin: 5px 0 0; font-size: 0.8rem; }

.library { padding: 88px clamp(24px, 6vw, 96px) 110px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading h2, .newsletter h2 { margin-bottom: 0; font-size: clamp(2.4rem, 4vw, 4rem); }

.search {
  display: flex;
  min-width: min(360px, 100%);
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.search input { width: 100%; height: 46px; border: 0; outline: 0; background: transparent; }
.filters { display: flex; gap: 8px; margin: 32px 0; overflow-x: auto; }

.filters button {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.filters button.active { border-color: var(--ink); color: white; background: var(--ink); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 22px;
}

.book-card { position: relative; cursor: pointer; }
.book-card:hover .book-cover { transform: translateY(-6px); box-shadow: 0 22px 36px rgba(72, 40, 47, 0.18); }

.book-cover {
  position: relative;
  display: flex;
  aspect-ratio: 0.7;
  padding: 24px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: white;
  border-radius: 5px 12px 12px 5px;
  box-shadow: 8px 12px 26px rgba(72, 40, 47, 0.13);
  transition: 220ms ease;
}

.book-cover::before {
  position: absolute;
  inset: 0 auto 0 8px;
  width: 1px;
  content: "";
  background: rgba(255,255,255,0.25);
}

.book-cover::after {
  position: absolute;
  right: -30%;
  bottom: -15%;
  width: 90%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  content: "";
}

.cover-category { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.cover-title { position: relative; z-index: 1; font-family: "Playfair Display", serif; font-size: clamp(1.5rem, 2.5vw, 2.35rem); line-height: 1.02; }
.cover-author { position: relative; z-index: 1; font-family: "Playfair Display", serif; font-size: 0.8rem; font-style: italic; }

.favorite {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--rose);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
}

.favorite.active { color: white; background: var(--rose); }
.book-info { padding-top: 16px; }
.book-info h3 { margin-bottom: 6px; font-size: 1.2rem; }
.book-info p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.rating { float: right; color: var(--rose); font-weight: 700; }
.hidden { display: none; }
.empty-state { padding: 50px 0; color: var(--muted); text-align: center; }

.newsletter {
  display: grid;
  margin: 0 clamp(24px, 6vw, 96px) 96px;
  padding: 60px;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  color: #fff8f1;
  border-radius: 12px;
  background: var(--ink);
}

.newsletter .eyebrow { color: #e5a9b2; }
.newsletter form { display: flex; gap: 8px; }
.newsletter input { min-width: 260px; padding: 0 16px; border: 0; border-radius: 8px; }
.form-message { grid-column: 1 / -1; margin: 0; color: #e5a9b2; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-links { display: flex; align-items: center; gap: 14px; }
.footer-links a:hover { color: var(--rose); }

.reader-modal {
  width: min(960px, calc(100% - 30px));
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.reader-modal::backdrop { background: rgba(38, 25, 29, 0.75); backdrop-filter: blur(6px); }
.close-reader { position: fixed; z-index: 5; margin: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.reader-cover { height: 260px; background: var(--rose); }
.reader-content { max-width: 720px; margin: auto; padding: 55px 30px 80px; }
.reader-content h2 { margin-bottom: 5px; font-size: 3.5rem; }
.reader-author, .reader-meta, .reader-summary { color: var(--muted); }
.reader-meta { display: flex; gap: 20px; margin: 20px 0; font-size: 0.85rem; }
.reader-summary { line-height: 1.8; }
.reader-content hr { margin: 48px 0; border: 0; border-top: 1px solid var(--line); }
.chapter-label { color: var(--rose); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; }
.reader-content h3 { font-size: 2rem; }
.chapter-text { font-family: Georgia, serif; font-size: 1.12rem; line-height: 2; }
.chapter-text p:first-child::first-letter { float: left; margin: 4px 8px 0 0; color: var(--rose); font-family: "Playfair Display", serif; font-size: 4rem; line-height: 0.8; }
.inline-ad { display: grid; min-height: 120px; margin: 46px 0; place-items: center; border: 1px dashed #baaeb0; color: #9c9092; background: #f2eee8; }
.inline-ad small { align-self: end; font-size: 0.55rem; letter-spacing: 0.14em; }
.inline-ad span { align-self: start; font-size: 0.75rem; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 560px; }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter { grid-template-columns: 1fr; align-items: start; }
  .form-message { grid-column: auto; }
}

@media (max-width: 640px) {
  .site-header { height: 66px; padding: 0 18px; }
  .desktop-nav { display: none; }
  .brand { font-size: 1.1rem; }
  .brand-mark { width: 30px; height: 30px; }
  .favorites-button { display: none; }
  .hero { min-height: auto; }
  .hero-copy { padding: 64px 22px 50px; }
  h1 { font-size: 3.4rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-stats { gap: 20px; justify-content: space-between; margin-top: 42px; }
  .hero-art { min-height: 500px; }
  .hero-book { width: 240px; height: 355px; }
  .hero-book strong { font-size: 2.1rem; }
  .library { padding: 64px 18px 80px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search { min-width: 100%; }
  .book-grid { gap: 28px 12px; }
  .book-cover { padding: 17px; }
  .cover-title { font-size: 1.35rem; }
  .newsletter { margin: 0 18px 70px; padding: 38px 24px; }
  .newsletter form { flex-direction: column; }
  .newsletter input { min-width: 100%; min-height: 48px; }
  footer { align-items: flex-start; flex-direction: column; gap: 14px; }
  .footer-links { flex-wrap: wrap; }
  .reader-cover { height: 180px; }
  .reader-content h2 { font-size: 2.6rem; }
}
