:root {
  color-scheme: light;
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-muted: #f2efe9;
  --text: #1f1c17;
  --muted: #5d5a50;
  --border: #e3ded4;
  --accent: #7443ff;
  --accent-dark: #4b2cc3;
  --highlight: rgba(116, 67, 255, 0.08);
  --panel-lilac: linear-gradient(135deg, #ffffff, #f3ecff);
  --panel-gold: linear-gradient(135deg, #fffdf5, #f7f3e8);
  --nav-height: 70px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  display: block;
}

.site-shell {
  flex: 1;
}

nav {
  background: rgba(15, 12, 11, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem min(5vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

nav .logo {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f8f7f4;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

nav a {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

nav a:hover,
nav a:focus {
  color: #fff;
}

.hero {
  background: linear-gradient(120deg, #0f0c0b, #201035 65%, #3c1875);
  color: #fff;
  padding: 4rem min(5vw, 2rem) 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 45%), rgba(5, 4, 4, 0.65);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin: 0 0 0.5rem;
}

.hero p {
  margin: 0;
  font-size: 1.15rem;
  color: #f5f2ea;
}

.hero-marquee {
  position: absolute;
  bottom: 1rem;
  left: 0;
  width: 100%;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
  animation: none;
  will-change: transform;
  overflow: hidden;
}

.hero-marquee::before,
.hero-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  pointer-events: none;
  z-index: 2;
}

.hero-marquee::before {
  left: 0;
  background: linear-gradient(90deg, rgba(18, 12, 10, 0.9), transparent);
}

.hero-marquee::after {
  right: 0;
  background: linear-gradient(-90deg, rgba(18, 12, 10, 0.9), transparent);
}

.hero-marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  flex-wrap: nowrap;
  flex: none;
  animation: hero-scroll 35s linear infinite;
}

.hero-cover img {
  height: 170px;
  width: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 0.8rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

@keyframes hero-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 640px) {
  .hero {
    padding-bottom: 8rem;
  }

  .hero-marquee {
    gap: 0.5rem;
    width: 100%;
    bottom: 0.25rem;
    justify-content: center;
  }

  .hero-cover img {
    height: 120px;
    border-radius: 0.65rem;
    transform: translate3d(0, 0, 0);
  }
}

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

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(12px);
}

.stat-card span {
  display: block;
  font-size: 2.4rem;
  font-weight: 600;
  color: #fff;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem min(5vw, 2rem) 4rem;
  width: 100%;
}

section + section {
  margin-top: 3rem;
}

.section-panel {
  border-radius: 1.75rem;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.06);
}

.section-header {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-family: 'Playfair Display', serif;
}

.section-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 540px;
}

.section-header--inline {
  margin-bottom: 1.5rem;
}

.link-pill {
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
}

.link-pill:hover {
  background: rgba(116, 67, 255, 0.15);
}

.section-header--inline .link-pill {
  flex-shrink: 0;
}

.filters {
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.08);
  margin-top: -4rem;
  position: relative;
  z-index: 2;
}

.sticky-filter {
  position: sticky;
  top: calc(var(--nav-height) + 0.5rem);
  z-index: 4;
  backdrop-filter: blur(6px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.search-docked {
  position: fixed;
  top: calc(var(--nav-height) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 1.5rem));
  margin-top: 0;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.sticky-filter.hidden {
  transform: translateY(-120%);
  opacity: 0;
}

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

#search-results {
  position: absolute;
  background: var(--surface);
  border-radius: 1.25rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  padding: 0;
  display: none;
  z-index: 9;
  max-height: 70vh;
  overflow: hidden;
}

#search-results.active {
  display: block;
}

#search-results-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 1rem 1rem;
}

#search-results .grid {
  padding: 0;
}

#search-results .card {
  border: 1px solid var(--border);
  box-shadow: none;
}

#search-results .card:hover {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}

.search-results-content {
  padding: 1rem 1rem 0;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.search-results-header p {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-close {
  border: none;
  background: transparent;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--accent);
}

.search-close:hover {
  color: var(--accent-dark);
}

#search-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 5;
  display: none;
}

#search-backdrop.active {
  display: block;
}

body.search-open {
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted);
  gap: 0.35rem;
}

input[type="search"],
select {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}

.card {
  background: linear-gradient(140deg, #ffffff, #f8f3ea);
  border-radius: 1.4rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: inset 0 0 0 1px rgba(227, 222, 212, 0.6), 0 20px 40px rgba(15, 13, 10, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin: 0;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px rgba(227, 222, 212, 0.6), 0 30px 70px rgba(15, 13, 10, 0.12);
}

.card-link {
  display: block;
  color: inherit;
}

.person-header,
.book-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.book-header > div {
  margin-top: 0;
}

.person-link,
.book-link {
  text-decoration: none;
  color: inherit;
}

.person-link:hover h3,
.book-link:hover h3 {
  text-decoration: underline;
}

.person-detail-card {
  text-align: center;
}

.person-detail-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.avatar-hero {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

.sticky-subheader {
  position: sticky;
  top: calc(var(--nav-height) + 0.75rem);
  background: var(--surface);
  padding: 1rem 0;
  z-index: 3;
}

.person-books {
  margin-top: 2rem;
}

.person-books .grid {
  margin-top: 1rem;
}

.similar-section {
  margin-top: 3rem;
}

.book-detail-card {
  text-align: center;
}

.book-cover-large {
  width: 220px;
  height: 330px;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  margin: 0 auto 1rem;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  object-fit: cover;
  border: 3px solid var(--surface-muted);
}

.book-cover-small {
  width: 70px;
  height: 100px;
  border-radius: 0.95rem;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #fff;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  background: var(--surface-muted);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.recommender-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.avatar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.avatar-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  display: block;
  flex-shrink: 0;
}

.avatar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.25rem 0;
}

.recommender-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
}

.cta-link {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Playfair Display', serif;
}

.cta-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.cta-link:hover::after {
  transform: translateX(4px);
}

.list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.book-preview-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
}

.book-preview-grid a {
  display: inline-flex;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-preview-grid a:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.book-preview-grid img {
  width: 65px;
  height: 90px;
  object-fit: cover;
  display: block;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.pagination button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination button:not(:disabled):hover {
  background: var(--accent);
  color: #fff;
}

.pagination span {
  font-weight: 600;
  color: var(--muted);
}

.genre-book-samples {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0 0.25rem;
}

.genre-book-samples a {
  width: 48px;
  height: 68px;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: inline-flex;
}

.genre-book-samples img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  color: #4a4540;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #34343c;
  color: #f4f4f4;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.9rem 1rem;
  gap: 0.75rem;
  font-size: 0.95rem;
  z-index: 20;
  transform: translateY(120%);
  transition: transform 0.3s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner button {
  background: #00b39f;
  color: #ffffff;
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.cookie-banner button:hover {
  filter: brightness(1.05);
}

.loading,
.error-state {
  padding: 2rem;
  border-radius: 1rem;
  border: 1px dashed var(--border);
  text-align: center;
}

@media (max-width: 720px) {
  .filters {
    margin-top: -2rem;
  }

  nav .nav-inner {
    flex-direction: column;
  }

  .person-header,
  .book-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

}
.sticky-heading {
  position: sticky;
  top: 1rem;
  z-index: 4;
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.switch-label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  gap: 0.35rem;
  min-width: 200px;
}
