:root {
  --bg: #0b0d10;
  --bg-soft: #13171d;
  --paper: #e8dbc7;
  --text: #f4efe6;
  --muted: #b8aea1;
  --accent: #d39c47;
  --accent-soft: rgba(211, 156, 71, 0.14);
  --line: rgba(255,255,255,0.08);
  --shadow: 0 24px 70px rgba(0,0,0,0.4);
  --radius: 24px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(211,156,71,0.08), transparent 30%),
    linear-gradient(180deg, #0a0c0f 0%, #0d1015 50%, #0a0c0f 100%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 5vw;
  backdrop-filter: blur(16px);
  background: rgba(10, 12, 15, 0.74);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  color: var(--paper);
}
.main-nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}
.main-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color .2s ease;
}
.main-nav a:hover { color: var(--text); }
.menu-toggle {
  display: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
  font-size: 1.1rem;
}

.hero, .section {
  width: min(var(--max), 90vw);
  margin: 0 auto;
}
.hero {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 5rem;
}
.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.hero h1, .section-heading h2, .book-content h3, .news-card h3 {
  font-family: 'Cormorant Garamond', serif;
}
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.hero-text, .lead, .book-content p, .reading-copy p, .news-card p {
  color: var(--muted);
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font-weight: 600;
}
.btn-primary {
  background: var(--accent);
  color: #151515;
}
.btn-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
}
.hero-books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}
.cover-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.cover-card img {
  width: 100%;
  aspect-ratio: 4 / 6;
  object-fit: cover;
  border-radius: 18px;
}
.cover-caption {
  padding: 0.9rem 0.3rem 0.1rem;
  color: var(--paper);
  text-align: center;
  font-size: 0.95rem;
}
.featured-new {
  transform: translateY(35px);
}

.section {
  padding: 5rem 0;
  border-top: 1px solid var(--line);
}
.section-heading {
  margin-bottom: 2rem;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 3.8rem);
}
.author-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
  align-items: center;
}
.author-image-wrap {
  background: rgba(255,255,255,0.04);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.author-image {
  border-radius: 22px;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.lead {
  font-size: 1.15rem;
}
.book-list {
  display: grid;
  gap: 2rem;
}
.book-card {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 2rem;
  padding: 1.4rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-radius: 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.book-visual img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
}
.single-cover img {
  aspect-ratio: 4 / 6;
}
.book-tag {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: rgba(255,255,255,0.06);
}
.book-tag.highlight {
  background: var(--accent-soft);
  color: var(--accent);
}
.book-content h3 {
  margin: 0.75rem 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
}
.placeholder-text {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}
.buy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}
.buy-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(211,156,71,0.35);
  background: rgba(211,156,71,0.1);
  color: var(--paper);
  font-weight: 600;
  transition: transform .2s ease, background .2s ease;
}
.buy-tab:hover {
  transform: translateY(-2px);
  background: rgba(211,156,71,0.18);
}
.buy-tab.disabled {
  opacity: 0.58;
  pointer-events: none;
}
.micro-note, .warning-note {
  font-size: 0.92rem;
  color: #c7bfb2;
}
.reading-wrapper {
  display: grid;
  gap: 1.5rem;
}
.pdf-panel {
  min-height: 72vh;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  position: relative;
}
.pdf-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 72vh;
  padding: 2rem;
}
#pdfViewer {
  width: 100%;
  height: 72vh;
  border: 0;
  display: block;
  background: #111;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.news-card {
  padding: 1.4rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.news-type {
  display: inline-block;
  margin-bottom: 0.9rem;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.text-link {
  color: var(--paper);
  font-weight: 600;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 5vw 3rem;
  color: var(--muted);
  text-align: center;
}
code {
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
}

@media (max-width: 980px) {
  .hero,
  .author-grid,
  .book-card,
  .news-grid {
    grid-template-columns: 1fr;
  }
  .featured-new { transform: none; }
}

@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 5vw;
    left: 5vw;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(15, 18, 22, 0.98);
    border: 1px solid var(--line);
  }
  .main-nav.open { display: flex; }
  .hero { padding-top: 2rem; }
  .hero-books { grid-template-columns: 1fr; }
  .brand { max-width: 70%; line-height: 1.5; }
}


.news-card-featured {
  grid-column: span 2;
  background: linear-gradient(180deg, rgba(211,156,71,0.08), rgba(255,255,255,0.03));
}
.news-date {
  margin: 0 0 0.6rem;
  color: var(--paper);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}
.news-intro {
  color: var(--paper);
  font-weight: 600;
}
.news-actions {
  margin-top: 1.2rem;
}
.news-card-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 980px) {
  .news-card-featured {
    grid-column: span 1;
  }
}



@media (max-width: 760px) {
  .pdfjs-toolbar {
    gap: 0.75rem;
    padding: 0.75rem;
  }
  .pdf-page-status {
    font-size: 0.88rem;
  }
  .pdfjs-stage {
    padding: 0.6rem;
  }
}



/* Stable image-based book viewer */
.pdfimg-panel {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 72vh;
}
.pdfimg-stage {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: grid;
  place-items: start center;
  background: #0f1115;
}
#pdfPageImage {
  width: min(100%, 900px);
  height: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-drag: none;
}
