/* ================================================
   THE FOUNDING — Main Stylesheet
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lato:wght@300;400;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f0f14;
  --bg2:        #16161f;
  --bg3:        #1e1e2a;
  --border:     #2e2e3e;
  --gold:       #c9a96e;
  --gold-light: #e2c98a;
  --gold-dim:   #7a6340;
  --text:       #d4cfc7;
  --text-dim:   #8a8578;
  --text-bright:#f0ebe2;
  --red:        #8b3a3a;
  --font-head:  'Playfair Display', Georgia, serif;
  --font-body:  'Lato', sans-serif;
  --font-read:  'EB Garamond', Georgia, serif;
  --max-w:      1100px;
  --radius:     6px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
p { margin-bottom: 1rem; }

/* ── Utility ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.section { padding: 5rem 0; }
.section--sm { padding: 3rem 0; }
.text-gold { color: var(--gold); }
.text-dim  { color: var(--text-dim); }
.serif     { font-family: var(--font-head); }
.text-center { text-align: center; }

.tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .25rem .75rem;
  border-radius: 20px;
  background: rgba(201,169,110,.12);
  color: var(--gold);
  border: 1px solid rgba(201,169,110,.25);
}
.tag--locked {
  background: rgba(139,58,58,.15);
  color: #c47b7b;
  border-color: rgba(139,58,58,.3);
}
.tag--free {
  background: rgba(80,160,100,.12);
  color: #7dbb8f;
  border-color: rgba(80,160,100,.25);
}

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 2rem 0; color: var(--gold-dim);
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-primary {
  background: var(--gold);
  color: #0f0f14;
}
.btn-primary:hover {
  background: var(--gold-light);
  color: #0f0f14;
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-outline:hover {
  background: rgba(201,169,110,.1);
  color: var(--gold-light);
}

/* ── Navigation ── */
nav.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,15,20,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .02em;
}
.nav-logo span { color: var(--text-dim); font-weight: 400; font-style: italic; font-size: 1rem; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  color: var(--text);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-links .btn { padding: .5rem 1.2rem; font-size: .8rem; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* ── Hero ── */
.hero {
  min-height: 92vh;
  display: flex; align-items: center;
  background: linear-gradient(160deg, #0f0f14 0%, #1a1420 50%, #0f0f14 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,169,110,.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5rem; align-items: center;
  max-width: var(--max-w); margin: 0 auto; padding: 4rem 2rem;
}
.hero-eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text-bright);
  margin-bottom: 1.25rem;
}
.hero-title em { color: var(--gold); font-style: italic; }
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-book {
  position: relative;
  display: flex; justify-content: center; align-items: center;
}
.hero-book-cover {
  width: 280px; height: 420px;
  background: linear-gradient(145deg, #2a1f0e, #1a1208);
  border-radius: 4px 12px 12px 4px;
  box-shadow: -8px 8px 40px rgba(0,0,0,.7), 4px 0 0 #3a2a10, inset -2px 0 8px rgba(0,0,0,.4);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem;
  border: 1px solid #3a2a10;
}
.book-cover-title {
  font-family: var(--font-head);
  font-size: 2rem; font-weight: 700;
  color: var(--gold);
  text-align: center; line-height: 1.2;
  margin-bottom: .5rem;
}
.book-cover-ornament {
  color: var(--gold-dim); font-size: 1.5rem; margin: 1rem 0;
}
.book-cover-author {
  font-family: var(--font-head);
  font-style: italic; color: var(--gold-dim);
  font-size: .95rem; text-align: center;
}
.latest-badge {
  position: absolute; top: 20px; right: -10px;
  background: var(--gold); color: #0f0f14;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  padding: .4rem .8rem; border-radius: 4px;
  box-shadow: 0 4px 12px rgba(201,169,110,.3);
}

/* ── Stats bar ── */
.stats-bar {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.stats-inner {
  display: flex; justify-content: center; gap: 4rem;
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-head);
  font-size: 1.8rem; font-weight: 700; color: var(--gold);
  display: block;
}
.stat-label { font-size: .75rem; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }

/* ── Section headings ── */
.section-head { margin-bottom: 3rem; }
.section-head h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--text-bright);
  margin-bottom: .5rem;
}
.section-head p { color: var(--text-dim); max-width: 500px; }
.section-head.centered { text-align: center; }
.section-head.centered p { margin: 0 auto; }

/* ── Chapter cards ── */
.chapter-grid {
  display: grid; gap: 1rem;
}
.chapter-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem; align-items: center;
  transition: border-color .2s, transform .15s;
  text-decoration: none;
  color: inherit;
}
.chapter-card:hover {
  border-color: var(--gold-dim);
  transform: translateX(4px);
  color: inherit;
}
.chapter-card.locked { opacity: .75; cursor: default; }
.chapter-card.locked:hover { transform: none; border-color: var(--border); }
.chapter-num {
  font-family: var(--font-head); font-size: 1.4rem;
  font-weight: 700; color: var(--gold-dim); text-align: center;
}
.chapter-info h3 {
  font-family: var(--font-head); font-size: 1.05rem;
  color: var(--text-bright); margin-bottom: .2rem;
}
.chapter-info p { color: var(--text-dim); font-size: .85rem; margin: 0; }
.chapter-meta { text-align: right; }
.chapter-meta small { display: block; color: var(--text-dim); font-size: .78rem; margin-top: .3rem; }

/* ── Gallery grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.gallery-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, transform .15s;
  cursor: pointer;
}
.gallery-item:hover { border-color: var(--gold-dim); transform: translateY(-3px); }
.gallery-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: .85rem;
}
.gallery-thumb-placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--bg3), #1a1a2e);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--gold-dim); gap: .5rem;
}
.gallery-thumb-placeholder .icon { font-size: 2rem; }
.gallery-caption { padding: .9rem 1rem; }
.gallery-caption h4 { font-family: var(--font-head); color: var(--text-bright); font-size: .95rem; margin-bottom: .2rem; }
.gallery-caption p  { color: var(--text-dim); font-size: .8rem; margin: 0; }

/* ── Blog posts ── */
.blog-list { display: grid; gap: 1.5rem; }
.blog-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 2rem;
  display: grid; grid-template-columns: 1fr auto;
  gap: 1rem; align-items: start;
  transition: border-color .2s;
  text-decoration: none; color: inherit;
}
.blog-card:hover { border-color: var(--gold-dim); color: inherit; }
.blog-card-date { color: var(--text-dim); font-size: .8rem; margin-bottom: .4rem; }
.blog-card h3 { font-family: var(--font-head); font-size: 1.2rem; color: var(--text-bright); margin-bottom: .5rem; }
.blog-card p  { color: var(--text-dim); font-size: .9rem; margin: 0; }
.blog-card-arrow { color: var(--gold-dim); font-size: 1.4rem; align-self: center; }

/* ── Audio player ── */
.audio-list { display: grid; gap: 1rem; }
.audio-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.audio-card-top { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.audio-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: #0f0f14;
  border: none; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s;
}
.audio-play-btn:hover { background: var(--gold-light); }
.audio-info h4 { font-family: var(--font-head); color: var(--text-bright); font-size: 1rem; margin-bottom: .2rem; }
.audio-info small { color: var(--text-dim); font-size: .8rem; }
audio { width: 100%; accent-color: var(--gold); }
audio::-webkit-media-controls-panel { background: var(--bg3); }

/* ── Payment gate ── */
.gate-card {
  background: linear-gradient(135deg, #1a1408, #1e1a10);
  border: 1px solid rgba(201,169,110,.3);
  border-radius: 10px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 500px; margin: 3rem auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.gate-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.gate-card h3 { font-family: var(--font-head); font-size: 1.6rem; color: var(--text-bright); margin-bottom: .75rem; }
.gate-card p  { color: var(--text-dim); margin-bottom: 1.5rem; }
.gate-price {
  font-family: var(--font-head); font-size: 2.5rem;
  font-weight: 700; color: var(--gold); margin-bottom: 1.5rem;
  display: block;
}
.gate-features { list-style: none; margin-bottom: 2rem; }
.gate-features li { color: var(--text-dim); font-size: .9rem; padding: .3rem 0; }
.gate-features li::before { content: '✦ '; color: var(--gold-dim); }
.gate-note { font-size: .78rem; color: var(--text-dim); margin-top: 1rem; }

/* ── Reader view ── */
.reader-container { max-width: 720px; margin: 0 auto; padding: 3rem 2rem 6rem; }
.reader-header { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.reader-chapter-num { color: var(--gold-dim); font-size: .85rem; letter-spacing: .15em; text-transform: uppercase; margin-bottom: .5rem; }
.reader-title { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 3rem); color: var(--text-bright); margin-bottom: 1rem; line-height: 1.15; }
.reader-meta { color: var(--text-dim); font-size: .85rem; }
.reader-body {
  font-family: var(--font-read);
  font-size: 1.15rem; line-height: 1.95;
  color: #c8c3ba;
}
.reader-body p { margin-bottom: 1.5rem; }
.reader-body h3 { font-family: var(--font-head); color: var(--gold); margin: 2.5rem 0 1rem; }
.reader-body .scene-break { text-align: center; color: var(--gold-dim); margin: 2.5rem 0; letter-spacing: .5em; }
.reader-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border);
}

/* ── Footer ── */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem; margin-bottom: 2rem;
}
.footer-brand h3 { font-family: var(--font-head); font-size: 1.3rem; color: var(--gold); margin-bottom: .5rem; }
.footer-brand p  { color: var(--text-dim); font-size: .88rem; max-width: 280px; }
.footer-col h4 { color: var(--text-bright); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { color: var(--text-dim); font-size: .88rem; }
.footer-col ul li a:hover { color: var(--gold); }
.footer-bottom {
  max-width: var(--max-w); margin: 0 auto; padding: 1.5rem 2rem 0;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-dim); font-size: .8rem;
}

/* ── Notification banner ── */
.banner {
  background: linear-gradient(90deg, #1a1408, #1e1208, #1a1408);
  border-bottom: 1px solid rgba(201,169,110,.2);
  padding: .65rem 2rem;
  text-align: center;
  font-size: .82rem; color: var(--text-dim);
}
.banner a { color: var(--gold); font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-book { order: -1; }
  .hero-book-cover { width: 200px; height: 300px; }
  .book-cover-title { font-size: 1.4rem; }
  .stats-inner { gap: 2rem; flex-wrap: wrap; justify-content: space-around; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: .5rem; text-align: center; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); gap: 1rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .chapter-card { grid-template-columns: 2.5rem 1fr; }
  .chapter-meta { display: none; }
  .blog-card { grid-template-columns: 1fr; }
  .blog-card-arrow { display: none; }
}
