:root {
  --ink: #070a16;
  --navy: #071535;
  --royal: #123bd7;
  --cyan: #10bceb;
  --yellow: #ffc51d;
  --paper: #ffffff;
  --muted: #6a7283;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(18, 59, 215, 0.22), transparent 38rem),
    #050814;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

button { font: inherit; }

.reader {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem;
}

.reader-header {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand-lockup {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 700;
}

.brand-the {
  color: inherit;
  font-style: italic;
  margin-right: 0.2em;
}

.header-meta {
  color: #cad2e6;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.book-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
  align-items: center;
  gap: 0.75rem;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.book {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  height: min(76vh, 860px);
  perspective: 2200px;
}

.spread {
  height: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 1.25rem 2.25rem rgba(0, 0, 0, 0.52));
  transform-style: preserve-3d;
}

.spread.turn-next { animation: turnNext 300ms ease-in both; }
.spread.turn-previous { animation: turnPrevious 300ms ease-in both; }
.spread.arrive-next { animation: arriveNext 320ms ease-out both; }
.spread.arrive-previous { animation: arrivePrevious 320ms ease-out both; }

.page {
  position: relative;
  height: 100%;
  aspect-ratio: 8.5 / 11;
  overflow: hidden;
  background: var(--paper);
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.page.left {
  border-radius: 8px 1px 1px 8px;
  box-shadow: inset -18px 0 26px -24px rgba(0, 0, 0, 0.7);
}

.page.right {
  border-radius: 1px 8px 8px 1px;
  box-shadow: inset 18px 0 26px -24px rgba(0, 0, 0, 0.7);
}

.page.single {
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cover {
  display: grid;
  grid-template-rows: 12% 2% 1fr;
  background: #fff;
}

.cover-top {
  background: #000;
  display: grid;
  place-items: center;
  padding: .55rem 1.5rem;
}

.cover-top img {
  width: min(62%, 300px);
  height: auto;
  object-fit: contain;
}

.cover-blue-bar { background: var(--cyan); }

.cover-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(.45rem, 1.2vh, .8rem) 7% .6rem;
  background:
    linear-gradient(180deg, #fff 0 72%, #f5f7fc 72% 100%);
}

.cover-kicker {
  color: var(--navy);
  font-size: clamp(0.7rem, 1.6vh, 1rem);
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  margin-bottom: .3rem;
}

.cover-photo {
  width: min(82%, 500px);
  overflow: hidden;
  border: 4px solid var(--yellow);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(8, 21, 52, .22);
  background: #030817;
}

.cover-photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.cover-title {
  margin: .4rem 0 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 4.6vh, 3.75rem);
  line-height: 0.98;
  white-space: nowrap;
}

.cover-title .the {
  color: #000;
  font-style: italic;
}

.yellow-rule {
  width: min(84%, 520px);
  height: 5px;
  margin: .45rem auto;
  border-radius: 999px;
  background: var(--yellow);
}

.cover-subtitle {
  color: var(--royal);
  font-size: clamp(1rem, 2.5vh, 1.7rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cover-saying {
  margin: .4rem 0 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2.6vh, 1.6rem);
  font-style: normal;
  font-weight: 700;
  line-height: 1.08;
}

.cover-saying .the {
  color: #000;
  font-style: italic;
}

.cover-saying-lead,
.cover-saying-brand {
  display: block;
}

.cover-saying-brand {
  margin-top: 0.08em;
  white-space: nowrap;
}

.cover-year {
  margin-top: auto;
  color: var(--navy);
  font-size: clamp(0.8rem, 1.8vh, 1.05rem);
  font-weight: 800;
}

.cover-location {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: clamp(0.68rem, 1.5vh, 0.92rem);
  line-height: 1.25;
}

.edge-control {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, opacity .2s ease;
}

.edge-control:hover:not(:disabled) { background: var(--royal); transform: scale(1.05); }
.edge-control:focus-visible, .toolbar-button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.edge-control:disabled, .toolbar-button:disabled { opacity: .35; cursor: default; }

.toolbar {
  width: min(780px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(10rem, auto) 1fr auto;
  align-items: center;
  gap: .65rem;
}

.toolbar-button {
  min-height: 2.8rem;
  padding: .65rem 1rem;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.toolbar-button:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.toolbar-button.primary { background: var(--royal); border-color: var(--royal); }
.toolbar-button.primary:hover:not(:disabled) { background: #244ae0; }
.icon-button { min-width: 2.8rem; padding-inline: .8rem; }

.page-status {
  color: #e4e8f4;
  text-align: center;
  font-size: .95rem;
}

.reader-help {
  margin: 0;
  color: #9ca6bd;
  text-align: center;
  font-size: .82rem;
}

@keyframes turnNext {
  to { transform: rotateY(-12deg) translateX(-4%); opacity: 0; }
}

@keyframes turnPrevious {
  to { transform: rotateY(12deg) translateX(4%); opacity: 0; }
}

@keyframes arriveNext {
  from { transform: rotateY(10deg) translateX(4%); opacity: 0; }
}

@keyframes arrivePrevious {
  from { transform: rotateY(-10deg) translateX(-4%); opacity: 0; }
}

@media (max-width: 760px) {
  .reader { padding: .75rem .6rem 1rem; gap: .65rem; }
  .reader-header { align-items: center; }
  .header-meta { display: none; }
  .book-stage { grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem; gap: .25rem; }
  .book { height: min(72vh, 760px); }
  .edge-control { width: 2.4rem; height: 2.4rem; font-size: 1.8rem; }
  .toolbar { grid-template-columns: 1fr auto 1fr; }
  .icon-button { display: none; }
  .reader-help { font-size: .74rem; }
  .cover-title { font-size: clamp(1.35rem, 5.7vw, 2.2rem); }
  .cover-photo { width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  .spread.turn-next, .spread.turn-previous, .spread.arrive-next, .spread.arrive-previous { animation: none; }
}
