* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: #e8dcc8;
  color: #321d12;
}

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

.topbar {
  height: 76px;
  background: #f3eadc;
  border-bottom: 4px solid #8a5a27;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-transform: uppercase;
}

.logo {
  width: 42px;
  height: 42px;
  border: 2px solid #9a6a30;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #9a6a30;
  font-size: 24px;
}

.brand span {
  display: block;
  font-size: 12px;
  text-transform: none;
  opacity: .75;
}

nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  text-transform: uppercase;
}

.btn-small,
.btn {
  background: linear-gradient(#d7a255, #a66b2b);
  color: #24140b;
  padding: 11px 18px;
  border-radius: 3px;
  border: 1px solid #7d4b18;
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
  font-weight: bold;
  display: inline-block;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
}

.hero {
  min-height: 430px;
  background:
    linear-gradient(rgba(25,13,7,.35), rgba(25,13,7,.70)),
    url("assets/theatre.jpg");
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff0d5;
}

.hero-content {
  max-width: 900px;
  padding: 40px 24px;
  text-shadow: 0 4px 10px rgba(0,0,0,.75);
}

.hero h1 {
  font-size: clamp(36px, 6vw, 66px);
  font-weight: normal;
  font-style: italic;
  margin: 0 0 18px;
}

.subtitle {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 15px;
  margin-bottom: 34px;
}

.quote {
  font-size: clamp(25px, 4vw, 42px);
  font-style: italic;
  line-height: 1.35;
}

.author {
  font-size: 22px;
  font-style: italic;
}

main {
  max-width: 1180px;
  margin: auto;
  background: #efe4d3;
  border-left: 1px solid #b9925a;
  border-right: 1px solid #b9925a;
}

.legacy,
.content-section,
.activities,
.flipbook-section,
.support,
.contacts {
  padding: 48px 6%;
  border-bottom: 1px solid rgba(108,72,35,.35);
}

h2 {
  text-align: center;
  font-size: clamp(34px, 4vw, 50px);
  font-style: italic;
  font-weight: normal;
  margin: 0 0 34px;
}

.legacy-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 420px;
  border: 4px solid #8c5d2a;
  background: #d9c2a0;
  box-shadow: inset 0 0 80px rgba(56,30,14,.35), 0 15px 35px rgba(0,0,0,.25);
}

.portrait {
  background:
    linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.25)),
    url("assets/maestro.jpg");
  background-size: cover;
  background-position: center;
  min-height: 420px;
}

.legacy-text {
  padding: 65px 55px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.legacy-text h3 {
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.05;
  margin: 0 0 28px;
}

.legacy-text p,
.content-section p,
.support p,
.contacts p,
.section-title-left p {
  font-size: 22px;
  line-height: 1.65;
  font-style: italic;
}

.content-section {
  text-align: center;
}

.content-section p {
  max-width: 870px;
  margin: auto;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.activity-grid article {
  padding: 20px 35px;
  border-right: 1px solid rgba(88,55,23,.35);
}

.activity-grid article:last-child {
  border-right: none;
}

.icon {
  font-size: 46px;
  color: #9a6428;
  margin-bottom: 12px;
}

.activity-grid h3 {
  font-size: 28px;
  margin: 0 0 10px;
}

.activity-grid p {
  font-size: 18px;
  font-style: italic;
}

.flipbook-section {
  background: #e5d4bb;
}

.section-title-left h2 {
  text-align: left;
  margin-bottom: 6px;
}

.section-title-left p {
  margin-top: 0;
}

.flipbook-wrap {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 35px;
  align-items: center;
}

.book-cover-panel {
  background: #f3eadc;
  border: 1px solid rgba(105,65,25,.35);
  padding: 24px;
  box-shadow: 0 12px 26px rgba(0,0,0,.18);
}

.book-cover-panel img {
  width: 100%;
  display: block;
  border: 8px solid #2b1a12;
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}

.book-cover-panel h3 {
  font-size: 28px;
  margin: 22px 0 8px;
}

.book-cover-panel p {
  font-size: 18px;
  line-height: 1.55;
  font-style: italic;
}

.book-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 650px);
  background: #4a2e1c;
  padding: 12px;
  box-shadow: 0 18px 38px rgba(0,0,0,.32);
  perspective: 1200px;
}

.page {
  background: #fff8e8;
  min-height: 390px;
  overflow: hidden;
  border: 1px solid #c5a36e;
}

.left-page {
  border-right: 2px solid #8c5d2a;
  transform-origin: right center;
}

.right-page {
  border-left: 2px solid #8c5d2a;
  transform-origin: left center;
}

.page img {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  display: block;
}

.book-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #8a5a27;
  background: #f3eadc;
  color: #321d12;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}

.book-arrow:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.page-counter {
  text-align: center;
  margin-top: 18px;
  font-style: italic;
  font-size: 18px;
}

.support {
  text-align: center;
  background:
    linear-gradient(rgba(45,26,14,.75), rgba(45,26,14,.75)),
    url("assets/theatre.jpg");
  background-size: cover;
  color: #fff0d5;
}

.support h2 {
  text-align: center;
}

.contacts {
  text-align: center;
}

.contacts h2 {
  text-align: center;
}

footer {
  background: #1f130d;
  color: #d7c4a6;
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,8,5,.86);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.open {
  display: flex;
}

.modal-box {
  position: relative;
  width: min(980px, 96vw);
  max-height: 94vh;
  background: #efe4d3;
  padding: 28px;
  border: 4px solid #8c5d2a;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  width: 42px;
  height: 42px;
  border: 0;
  background: #321d12;
  color: #fff0d5;
  font-size: 34px;
  cursor: pointer;
}

.modal-book {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.modal-book img {
  max-width: min(650px, 75vw);
  max-height: 70vh;
  object-fit: contain;
  background: white;
  box-shadow: 0 14px 35px rgba(0,0,0,.35);
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    padding: 16px;
    flex-direction: column;
    gap: 12px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }

  .legacy-card,
  .flipbook-wrap {
    grid-template-columns: 1fr;
  }

  .legacy-text {
    padding: 36px 26px;
  }

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

  .activity-grid article {
    border-right: none;
    border-bottom: 1px solid rgba(88,55,23,.35);
  }

  .book {
    width: 100%;
  }

  .page,
  .page img {
    min-height: 280px;
  }
}
