:root {
  --ink: #161816;
  --muted: #62665f;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --wash: #efeee8;
  --line: #d9d7ce;
  --green: #2e5d55;
  --clay: #9b6040;
  --blue: #455e7b;
  --gold: #b38b45;
  --shadow: 0 24px 80px rgba(20, 24, 22, 0.14);
  --reader-size: 19px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(217, 215, 206, 0.8);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--paper);
  background: var(--clay);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a,
.nav-button,
.filter,
.reader-actions button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 7px 10px;
  text-decoration: none;
  color: var(--muted);
  cursor: pointer;
}

.topnav a:hover,
.nav-button:hover,
.filter:hover,
.reader-actions button:hover {
  border-color: var(--line);
  background: var(--wash);
  color: var(--ink);
}

.language-panel {
  position: fixed;
  top: 68px;
  right: clamp(14px, 3vw, 34px);
  z-index: 30;
  display: none;
  width: min(420px, calc(100vw - 28px));
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.language-panel.is-open {
  display: block;
}

.panel-inner {
  padding: 24px;
}

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

.language-grid a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  text-decoration: none;
  background: #f8f7f2;
}

main {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  overflow: hidden;
  padding: clamp(72px, 12vh, 128px) 0 42px;
}

#councilCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(251,250,247,0.94) 0%, rgba(251,250,247,0.82) 44%, rgba(251,250,247,0.2) 100%);
  pointer-events: none;
}

.hero-copy,
.hero-meta {
  position: relative;
  z-index: 1;
}

.hero-copy {
  width: min(820px, 100%);
  padding: 0 0 clamp(30px, 8vh, 76px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.08;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(58px, 10vw, 132px);
}

h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
}

h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

p {
  margin: 0;
}

.lead {
  width: min(720px, 100%);
  color: #2b2d29;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.32;
}

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

.primary-action,
.secondary-action,
.book-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  border-radius: 6px;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.secondary-action,
.book-card button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.74);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span {
  border: 1px solid rgba(217, 215, 206, 0.8);
  border-radius: 999px;
  background: rgba(255,255,255,0.64);
  padding: 7px 11px;
}

.intro-band,
.method {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(28px, 7vw, 96px);
  padding: clamp(58px, 9vw, 104px) 0;
  border-bottom: 1px solid var(--line);
}

.intro-band > p,
.method-text {
  color: #2d302d;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.45;
}

.method-text p + p {
  margin-top: 22px;
}

.lab-footer {
  padding: 18px 0 46px;
}

.lab-footer a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.lab-footer img {
  width: 28px;
  height: 28px;
  display: block;
  opacity: 0.82;
}

.lab-footer a:hover {
  color: var(--ink);
}

.series-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 34px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.series-map article {
  min-height: 230px;
  padding: 24px;
  background: var(--surface);
}

.series-map span,
.book-meta {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.series-map p,
.book-card p {
  color: var(--muted);
}

.books-section {
  padding: clamp(64px, 9vw, 112px) 0;
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter {
  border-color: var(--line);
}

.filter.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

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

.book-card {
  position: relative;
  display: flex;
  min-height: 355px;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.book-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--green);
}

.book-card-layout {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.book-strip {
  position: relative;
  overflow: hidden;
  min-height: 238px;
  border-radius: 4px;
  background: var(--wash);
}

.book-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(251,250,247,0.1), rgba(22,24,22,0.22));
  pointer-events: none;
}

.book-strip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.82) contrast(0.96);
  opacity: 0;
  animation: image-reveal 900ms ease forwards;
}

.book-copy {
  min-width: 0;
}

.book-card[data-level="youth"]::before {
  background: var(--blue);
}

.book-card[data-level="adult"]::before {
  background: var(--clay);
}

.book-card h3 {
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
}

.book-card button {
  width: 100%;
  background: #f8f7f2;
}

.reader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}

.reader.is-open {
  display: block;
}

.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 16, 0.42);
}

.reader-panel {
  position: absolute;
  inset: 22px;
  display: grid;
  grid-template-rows: auto 1fr;
  max-width: 1180px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.reader-header h2 {
  font-size: clamp(26px, 4vw, 44px);
}

.reader-kicker {
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reader-actions button {
  border-color: var(--line);
  color: var(--ink);
}

.reader-body {
  overflow: auto;
  padding: clamp(28px, 6vw, 78px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--reader-size);
  line-height: 1.78;
}

.reader-art {
  width: min(760px, 100%);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  margin: 0 0 clamp(34px, 6vw, 68px);
  border-radius: 6px;
  background: var(--wash);
}

.reader-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.84) contrast(0.97);
  opacity: 0;
  animation: image-reveal 1100ms ease forwards;
}

.reader-body h1,
.reader-body h2,
.reader-body h3 {
  max-width: 780px;
}

.reader-body h1 {
  font-size: clamp(36px, 6vw, 68px);
}

.reader-body h2 {
  margin-top: 16px;
  font-size: clamp(24px, 4vw, 42px);
}

.reader-body h3 {
  margin-top: 46px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reader-body p,
.reader-body ol,
.reader-body ul {
  max-width: 760px;
}

.reader-body p {
  margin: 0 0 18px;
}

.reader-body strong {
  color: var(--green);
}

body.reader-open {
  overflow: hidden;
}

@keyframes image-reveal {
  from {
    opacity: 0;
    transform: scale(1.012);
  }

  to {
    opacity: 0.9;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .topbar,
  .section-head,
  .reader-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .intro-band,
  .method,
  .series-map,
  .book-grid {
    grid-template-columns: 1fr;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(251,250,247,0.95) 0%, rgba(251,250,247,0.82) 58%, rgba(251,250,247,0.3) 100%);
  }

  .book-card {
    min-height: 300px;
  }

  .book-card-layout {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
  }

  .book-strip {
    min-height: 220px;
  }

  .reader-panel {
    inset: 8px;
  }
}
