:root {
  --bg: #F6EDE1;
  --bar-bg: rgba(254, 246, 237, 0.92);
  --amore-red: #C82027;
  --ink: #1C1917;
  --ink-muted: #5F574F;
  --border: #E8DBC9;
  --shadow-page: 0 12px 34px -14px rgba(45, 25, 12, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* Sticky Top Quick-Jump Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.jump-pills {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.jump-pills::-webkit-scrollbar {
  display: none;
}

.jump-pill {
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  background: #FFFFFF;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.jump-pill:hover {
  color: var(--ink);
  border-color: #D2C0AA;
}

.jump-pill.is-active {
  background: var(--amore-red);
  border-color: var(--amore-red);
  color: #FFFFFF;
}

.pdf-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  transition: background-color 0.16s ease;
}

.pdf-btn:hover {
  background: var(--amore-red);
}

.pdf-btn svg {
  width: 14px;
  height: 14px;
}

/* PDF Pages Stack */
.pdf-viewer {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* EPIOSO Credit Footer */
.credit-footer {
  text-align: center;
  padding: 6px 16px 72px;
}

.credit-text {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.credit-text a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 25, 23, 0.25);
  transition: color 0.16s ease, border-color 0.16s ease;
}

.credit-text a:hover {
  color: var(--amore-red);
  border-color: var(--amore-red);
}

.pdf-page {
  margin: 0;
  background: #FEF6ED;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-page);
  scroll-margin-top: 62px;
}

.pdf-page img {
  display: block;
  width: 100%;
  height: auto;
}

/* Floating Page Counter */
.page-counter {
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 45;
  background: rgba(28, 25, 23, 0.84);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Scroll To Top */
.scroll-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 45;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.scroll-top:hover {
  background: var(--amore-red);
  transform: translateY(-2px);
}

.scroll-top svg {
  width: 19px;
  height: 19px;
}

/* Mobile Edge-to-Edge Clarity */
@media (max-width: 600px) {
  .pdf-viewer {
    padding: 8px 6px 64px;
    gap: 10px;
  }

  .pdf-page {
    border-radius: 6px;
  }
}
