* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at top, #5a4230, #3d291a 70%);
  font-family: Georgia, 'Times New Roman', serif;
  color: #e8d9b8;
}

/* ---------- Top bar ---------- */
.topbar {
  text-align: center;
  padding: 40px 20px 24px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 2.3em;
  letter-spacing: 0.04em;
  color: #f0e2c0;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.topbar p {
  margin: 0;
  color: #b39d7a;
  font-style: italic;
  letter-spacing: 0.02em;
}

/* ---------- Boxed content area (the "cover") ---------- */
.box-wrap {
  display: flex;
  justify-content: center;
  padding: 0 20px 40px;
}

.box {
  display: flex;
  width: 100%;
  max-width: 980px;
  height: 640px;
  background: linear-gradient(160deg, #2e2015, #1c130c 60%, #150d08);
  border: 1px solid #100a05;
  border-radius: 6px;
  box-shadow:
    0 20px 50px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
nav {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #33241873, #241a11);
  background-color: #29200f;
  border-right: 1px solid #100a05;
  padding: 14px 0;
  overflow-y: auto;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav li {
  border-bottom: 1px solid #382a1c;
}

nav button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-left: 4px solid transparent;
  text-align: left;
  padding: 13px 20px;
  color: #cbb490;
  font-family: Georgia, serif;
  font-size: 0.95em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease, border-color 0.2s ease;
}

nav button:hover {
  background-color: rgba(199, 154, 67, 0.10);
  color: #f2e6c9;
  padding-left: 24px;
}

nav button.active {
  background-color: rgba(199, 154, 67, 0.16);
  color: #f2e6c9;
  border-left-color: #c79a43;
  padding-left: 24px;
}

nav button .zone {
  display: block;
  font-size: 0.75em;
  font-style: italic;
  color: #9a8564;
  margin-top: 2px;
}

/* ---------- Main display (interior of the cover) ---------- */
main {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 48px;
  display: grid;
  place-items: center;
  align-items: safe center;
  background: radial-gradient(ellipse at 50% 0%, #241a11, #150d08 75%);
}

/* ---------- The paper page itself ---------- */
.page {
  grid-column: 1;
  grid-row: 1;
  max-width: 540px;
  width: 100%;
  background: #efe2c3;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(139,101,61,0.10), transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(139,101,61,0.12), transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(107,68,42,0.08), transparent 60%);
  border-radius: 2px;
  box-shadow:
    0 14px 34px rgba(0,0,0,0.55),
    0 2px 6px rgba(0,0,0,0.3);
  padding: 38px 44px 46px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.page.active {
  opacity: 1;
  pointer-events: auto;
}

.page img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 18px;
  border: 1px solid #cbb98f;
}

.page h2 {
  font-size: 1.55em;
  margin: 0 0 3px;
  color: #2b2013;
  letter-spacing: 0.01em;
}

.page .meta {
  font-size: 0.88em;
  color: #6e5b3e;
  margin: 0 0 18px;
  font-style: italic;
}

.page .text {
  font-size: 1.05em;
  line-height: 1.7;
  color: #2b2013;
  margin: 0;
}

/* ---------- Footer link bar ---------- */
footer {
  text-align: center;
  padding: 4px 20px 36px;
  font-size: 0.85em;
  color: #8a7860;
  font-style: italic;
}

footer p {
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .topbar h1 {
    font-size: 1.8em;
  }

  .box {
    flex-direction: column;
    height: auto;
    max-height: 85vh;
  }

  nav {
    width: 100%;
    max-height: 160px;
    border-right: none;
    border-bottom: 1px solid #100a05;
  }

  main {
    padding: 28px 16px;
    min-height: 400px;
  }

  .page {
    width: 100%;
    padding: 26px 22px 30px;
  }
}