* {
  box-sizing: border-box;
}

:root {
  --ink: #172027;
  --ink-soft: #41505a;
  --paper: #fffdf6;
  --steel: #4e6876;
  --steel-deep: #2f4b5a;
  --steel-pale: #dce5e8;
  --gold: #b39258;
  --white: #fff;
}

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--white);
  color: var(--ink);
  font-family: "Inter", "Avenir Next", Arial, sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

.book_header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 92px;
  padding: 18px clamp(20px, 4vw, 52px);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.brand_icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand_text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: .82;
}

.book_page {
  width: 100%;
  height: 100svh;
  min-width: 0;
  min-height: 0;
  padding: 106px clamp(12px, 3vw, 46px) 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
}

.book_download_row {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.book_download_link {
  min-width: 0;
  min-height: 46px;
  padding: 13px 21px;
  border: 1px solid var(--steel-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--steel-deep);
  text-align: center;
  text-decoration: none;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.book_download_link:hover {
  color: var(--white);
  background: var(--steel-deep);
  transform: translateY(-2px);
}

.book_stage {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(220, 229, 232, .35), transparent 42%);
}

.book {
  width: min(520px, 100%);
  min-width: 0;
  height: 100%;
}

.tract_page {
  width: 520px;
  height: 720px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 39, .12);
  background:
    linear-gradient(90deg, rgba(47, 75, 90, .07), transparent 8%),
    var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}

.tract_page:nth-child(even) {
  background:
    linear-gradient(270deg, rgba(47, 75, 90, .07), transparent 8%),
    var(--paper);
}

.page_inner {
  height: 100%;
  min-width: 0;
  padding: 42px 42px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page_inner h1,
.page_inner h2,
.page_inner h3,
.page_inner p,
.page_inner li {
  margin: 0;
  overflow-wrap: anywhere;
}

.page_inner h1,
.page_inner h2,
.page_inner h3 {
  color: var(--steel-deep);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
}

.page_inner h2 {
  font-size: 2.4rem;
  line-height: .98;
}

.page_inner h3 {
  font-size: 1.55rem;
  line-height: 1.08;
}

.page_inner p,
.page_inner li {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.52;
}

.page_inner ul,
.page_inner ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 9px;
}

.page_inner blockquote {
  margin: 3px 0 0;
  padding: 18px 0 0 18px;
  border-left: 2px solid var(--gold);
}

.page_inner blockquote p {
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.42rem;
  line-height: 1.28;
}

.page_kicker {
  order: 20;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  color: var(--steel);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: center;
  text-transform: uppercase;
}

.cover_page {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 45%),
    linear-gradient(160deg, #263f4d, #14232b 74%);
  color: var(--white);
}

.cover_page .page_inner {
  padding: 54px 48px 38px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.cover_page .cover_logo {
  width: 104px;
  height: 104px;
  margin-bottom: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.cover_page .cover_eyebrow {
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.cover_page .page_inner h1 {
  max-width: 400px;
  color: var(--white);
  font-size: 4rem;
  line-height: .83;
}

.cover_page .cover_rule {
  width: 72px;
  height: 1px;
  margin: 8px 0 2px;
  background: var(--gold);
}

.cover_page .cover_subtitle {
  max-width: 360px;
  color: rgba(255, 255, 255, .82);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.22;
}

.cover_page .cover_name {
  margin-top: auto;
  color: rgba(255, 255, 255, .68);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.opening_page .page_inner {
  justify-content: center;
}

.opening_page .ministry_label {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.opening_page h2 {
  font-size: 3.35rem;
}

.question_page {
  background:
    radial-gradient(circle at 85% 12%, rgba(179, 146, 88, .22), transparent 28%),
    #f2f5f4;
}

.question_page .page_inner {
  justify-content: center;
}

.question_page h2 {
  max-width: 390px;
  font-size: 3.65rem;
}

.question_page .honesty_prompt {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.dense_page .page_inner {
  gap: 12px;
}

.dense_page .page_inner p,
.dense_page .page_inner li {
  font-size: .88rem;
  line-height: 1.43;
}

.closing_page {
  background: linear-gradient(150deg, #edf2f1, #fffdf6 64%);
}

.closing_page .page_inner {
  justify-content: center;
  text-align: center;
  align-items: center;
}

.closing_page h2 {
  max-width: 390px;
  font-size: 3.25rem;
}

.closing_page .closing_line {
  width: 74px;
  height: 2px;
  background: var(--gold);
}

.closing_page blockquote {
  max-width: 390px;
  padding: 20px 0 0;
  border-left: 0;
  border-top: 1px solid var(--gold);
}

.book_controls {
  width: min(520px, 100%);
  min-width: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
}

.book_button {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 32, 39, .24);
  background: var(--white);
  color: var(--steel-deep);
  cursor: pointer;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.book_button:hover {
  border-color: var(--steel-deep);
  background: var(--steel-deep);
  color: var(--white);
}

.page_status {
  min-width: 0;
  overflow: hidden;
  color: var(--steel);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.book.fallback_book .tract_page {
  display: none;
}

.book.fallback_book .tract_page.active_page {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 540px) {
  .book_header {
    height: 80px;
    padding: 12px 18px;
  }

  .brand_icon {
    width: 50px;
    height: 50px;
  }

  .brand_text {
    font-size: 24px;
  }

  .book_page {
    padding: 90px 8px 12px;
    gap: 9px;
  }

  .book_download_link {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    font-size: .63rem;
  }

  .book_controls {
    grid-template-columns: 78px minmax(0, 1fr) 78px;
    gap: 6px;
  }

  .book_button {
    min-height: 41px;
    padding-inline: 7px;
    font-size: .59rem;
  }

  .page_status {
    font-size: .6rem;
  }
}

@media print {
  @page {
    size: 520px 720px;
    margin: 0;
  }

  html,
  body {
    width: 520px;
    height: auto;
    overflow: visible;
    background: var(--white);
  }

  .book_header,
  .book_download_row,
  .book_controls {
    display: none !important;
  }

  .book_page,
  .book_stage,
  .book {
    display: block;
    width: 520px !important;
    height: auto !important;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  .tract_page,
  .book.fallback_book .tract_page {
    display: block !important;
    width: 520px !important;
    height: 720px !important;
    break-after: page;
    page-break-after: always;
    box-shadow: none;
  }

  .tract_page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
  }
}
