:root {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  background: #e9e1d3;
  color: #302a23;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.82), transparent 38rem),
    #e9e1d3;
}

button { font: inherit; }

.viewer {
  width: min(1200px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.topbar, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #7a6248;
  font-family: system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 500; }

.page-info { text-align: right; font-family: system-ui, sans-serif; }
.page-info strong, .page-info span { display: block; }
.page-info strong { font-size: .95rem; overflow-wrap: anywhere; }
.page-info span { margin-top: 4px; color: #765f46; font-size: .85rem; }

.page-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 22px);
}

.image-wrap {
  min-height: 420px;
  height: calc(100vh - 190px);
  display: grid;
  place-items: center;
}

#journalImage {
  display: none;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: white;
  border-radius: 3px;
  box-shadow: 0 18px 50px rgba(53, 40, 25, .24), 0 2px 7px rgba(53, 40, 25, .18);
}

.message { max-width: 34rem; text-align: center; font-family: system-ui, sans-serif; color: #735d45; }

.nav-button {
  width: clamp(44px, 6vw, 62px);
  aspect-ratio: 1;
  border: 1px solid rgba(70, 53, 34, .18);
  border-radius: 50%;
  background: rgba(255, 252, 246, .76);
  color: #51402e;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(61, 43, 24, .1);
}

.nav-button:hover:not(:disabled), .text-button:hover:not(:disabled) { background: #fffdf8; }
button:focus-visible { outline: 3px solid #9b6b35; outline-offset: 3px; }
button:disabled { opacity: .28; cursor: default; }

footer { min-height: 36px; color: #745f49; font: .85rem system-ui, sans-serif; text-align: center; }
.text-button { border: 0; background: transparent; color: #493725; font-weight: 700; cursor: pointer; padding: 9px; }

@media (max-width: 620px) {
  .viewer { padding: 14px 10px; gap: 10px; }
  .topbar { align-items: flex-end; }
  .page-stage { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 4px; }
  .image-wrap { min-height: 300px; height: calc(100vh - 175px); }
  .nav-button { width: 40px; }
  footer span { display: none; }
}
