:root {
  color-scheme: dark;
  --navy: #07182d;
  --navy-deep: #030d1c;
  --gold: #d39a43;
  --ivory: #f5f2eb;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: radial-gradient(circle at 50% 28%, #102b4e 0, var(--navy) 38%, var(--navy-deep) 100%);
  color: var(--ivory);
  font-family: Inter, Arial, sans-serif;
}

button, a { font: inherit; }

.viewer-shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 42px) 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.viewer-header, .viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.45rem, 3vw, 2.25rem); font-weight: 400; }

.book-stage {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#book { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42); }

.nav-button {
  position: absolute;
  z-index: 10;
  top: 50%;
  width: 46px;
  height: 62px;
  border: 1px solid rgba(211, 154, 67, 0.55);
  border-radius: 8px;
  background: rgba(3, 13, 28, 0.76);
  color: var(--ivory);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.nav-button:hover, .nav-button:focus-visible { background: var(--gold); color: var(--navy-deep); outline: none; }
.nav-button:disabled { opacity: 0.25; cursor: default; }
.nav-previous { left: 0; }
.nav-next { right: 0; }

.viewer-footer { min-height: 42px; }
#page-indicator { color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: var(--gold);
  color: var(--navy-deep);
  text-decoration: none;
  cursor: pointer;
}

.button:hover, .button:focus-visible { filter: brightness(1.12); outline: 2px solid var(--ivory); outline-offset: 2px; }
.button-secondary { background: transparent; color: var(--ivory); }

@media (max-width: 700px) {
  .viewer-shell { padding: 10px 8px 12px; gap: 8px; }
  .viewer-header { align-items: flex-start; }
  .eyebrow { font-size: 0.62rem; }
  .nav-button { width: 38px; height: 52px; font-size: 2rem; background: rgba(3, 13, 28, 0.6); }
  .viewer-footer { align-items: flex-start; }
  .actions { gap: 6px; }
  .button { min-height: 34px; padding: 7px 9px; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
