:root {
  --bg: #f8faf8;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #1f3a43;
  --muted: #54717b;
  --line: rgba(58, 107, 118, 0.18);
  --accent: #7eb9c7;
  --accent-strong: #4b8fa0;
  --shadow: 0 24px 60px rgba(61, 91, 100, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), transparent 35%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, white) 0%, var(--bg) 55%, white 100%);
  font: 16px/1.6 Georgia, "Times New Roman", serif;
}

body.lightbox-open {
  overflow: hidden;
}

body[data-theme="blue"] {
  --bg: #f7fbfc;
  --text: #1f3f4a;
  --muted: #5d7e88;
  --line: rgba(88, 141, 157, 0.18);
  --accent: #9dcfe0;
  --accent-strong: #5e98ad;
}

body[data-theme="green"] {
  --bg: #f8fbf8;
  --text: #26453d;
  --muted: #628176;
  --line: rgba(93, 145, 118, 0.18);
  --accent: #abd6bf;
  --accent-strong: #62987a;
}

body[data-theme="red"] {
  --bg: #fcf8f7;
  --text: #4b3230;
  --muted: #866667;
  --line: rgba(166, 109, 103, 0.2);
  --accent: #e1b1aa;
  --accent-strong: #b8736d;
}

a {
  color: inherit;
}

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

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero,
.intro-panel,
.catalog-section {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 44px;
  border-radius: 32px;
}

.hero-grid {
  margin-top: 24px;
}

.hero-compact h1 {
  max-width: none;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.catalog-subtitle {
  margin-bottom: 0;
  color: var(--accent-strong);
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--accent-strong);
}

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

h1 {
  max-width: 18ch;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 0.95;
  margin-bottom: 20px;
}

.hero:not(.hero-compact) h1 {
  max-width: none;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.05;
  margin-bottom: 10px;
}

h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-copy,
.section-copy,
.intro-panel p,
.book-copy {
  max-width: 72ch;
  color: var(--muted);
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.summary-card {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

.summary-card:hover,
.summary-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-strong);
}

.summary-card strong {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.summary-card span {
  display: block;
  color: var(--muted);
}

.summary-card .count {
  display: grid;
  gap: 2px;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 26%, white);
  color: var(--text);
}

.summary-card .count span {
  display: block;
}

.content {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

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

.language-column {
  display: grid;
  gap: 14px;
}

.intro-panel,
.catalog-section {
  border-radius: 28px;
  padding: 32px;
}

.story-section p {
  margin-bottom: 0;
}

.collection-subsection {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.section-heading,
.toolbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: end;
}

.section-heading {
  margin-bottom: 22px;
}

.section-link {
  display: grid;
  gap: 2px;
  white-space: nowrap;
  align-self: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  background: var(--surface-strong);
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.search-field {
  display: grid;
  gap: 8px;
  min-width: min(100%, 360px);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
}

.search-field input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent-strong) 50%, white);
  outline-offset: 2px;
}

.stats {
  display: grid;
  gap: 2px;
  margin-bottom: 0;
  color: var(--muted);
  text-align: right;
}

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

.book-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.book-card h3 {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.book-meta {
  display: grid;
  gap: 4px;
}

.book-meta a {
  color: var(--accent-strong);
  text-decoration: none;
}

.book-meta a:hover,
.book-meta a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .hero,
  .intro-panel,
  .catalog-section {
    padding: 24px;
    border-radius: 24px;
  }

  .bilingual-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.thumb-link {
  display: grid;
  gap: 8px;
  justify-items: start;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.thumb-link img {
  width: 50px;
  height: auto;
  image-rendering: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.eyebrow-english {
  margin-top: -4px;
}

.section-title-english {
  margin-bottom: 0;
  color: var(--accent-strong);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 38, 42, 0.72);
  cursor: pointer;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-frame {
  max-width: min(92vw, 1100px);
  max-height: 92vh;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.lightbox-frame img {
  max-width: 100%;
  max-height: calc(92vh - 28px);
  width: auto;
  height: auto;
  border-radius: 14px;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 20px;
  }

  .hero,
  .intro-panel,
  .catalog-section {
    padding: 24px;
    border-radius: 24px;
  }

  .section-heading,
  .toolbar {
    align-items: start;
  }

  .stats {
    text-align: left;
  }

  .hero:not(.hero-compact) h1 {
    max-width: 12ch;
  }
}
