:root {
  --cream: #F7F4EE; --cream-dark: #EDE9E0; --ink: #1A1714; --ink-soft: #2C2925;
  --mist: #4A4540; --silver: #888078; --gold: #B8935A; --gold-light: #D4B483;
  --gold-pale: #F2EAD8; --teal: #2D6A5F; --teal-pale: #E8F2EF; --teal-light: #4A9B8A;
  --serif: 'Cormorant Garamond', 'Noto Serif KR', serif;
  --sans: 'Noto Sans KR', sans-serif;
  --max-w: 720px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--cream); color: var(--ink); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; }
#progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: linear-gradient(90deg, var(--teal), var(--gold)); z-index: 999; transition: width 0.1s linear; }

/* 파트 오프너 */
.part-opener { min-height: 60vh; background: var(--ink-soft); display: flex; flex-direction: column; justify-content: flex-end; padding: 5rem 3rem 4rem; position: relative; overflow: hidden; border-top: 2px solid var(--ink); }
.part-opener::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 50% at 20% 80%, rgba(45,106,95,0.08) 0%, transparent 60%); pointer-events: none; }
.part-deco { position: absolute; right: -1rem; top: 1rem; font-family: var(--serif); font-size: 16rem; font-weight: 300; font-style: italic; color: rgba(255,255,255,0.025); line-height: 1; pointer-events: none; }
.part-meta { max-width: var(--max-w); width: 100%; margin: 0 auto; position: relative; z-index: 1; }
.part-num { font-size: 0.6rem; letter-spacing: 0.22em; color: var(--teal-light); text-transform: uppercase; margin-bottom: 0.8rem; }
.part-title { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 3rem); font-weight: 300; color: #FAFAF8; line-height: 1.15; margin-bottom: 1.5rem; }
.part-epigraph { font-family: var(--serif); font-style: italic; font-size: 0.88rem; color: rgba(255,255,255,0.4); line-height: 1.85; max-width: 520px; }
.part-rule { max-width: var(--max-w); margin: 2.5rem auto 0; height: 0.5px; background: rgba(184,147,90,0.3); position: relative; z-index: 1; }

/* 챕터 헤더 */
.chapter { border-top: 1px solid rgba(184,147,90,0.15); }
.chapter-header { min-height: 40vh; background: linear-gradient(180deg, rgba(44,41,37,0.97) 0%, rgba(44,41,37,0.93) 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 4rem 3rem 3.5rem; position: relative; overflow: hidden; }
.chapter-header::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 50% at 10% 90%, rgba(45,106,95,0.06) 0%, transparent 60%); pointer-events: none; }
.ch-num { font-size: 0.58rem; letter-spacing: 0.22em; color: var(--teal-light); text-transform: uppercase; margin-bottom: 0.7rem; position: relative; z-index: 1; max-width: var(--max-w); margin-left: auto; margin-right: auto; width: 100%; }
.ch-title { font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 300; line-height: 1.2; color: #FAFAF8; letter-spacing: -0.01em; position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto; width: 100%; }
.ch-title em { font-style: italic; color: var(--gold-light); }
.ch-rule { max-width: var(--max-w); margin: 2rem auto 0; height: 0.5px; background: rgba(184,147,90,0.25); position: relative; z-index: 1; }

/* 본문 */
.chapter-body { max-width: var(--max-w); margin: 0 auto; padding: 4.5rem 3rem 6rem; }
p { font-size: 1.02rem; line-height: 2.05; color: var(--ink); margin-bottom: 1.6rem; font-weight: 300; }
.drop-cap::first-letter { font-family: var(--serif); font-size: 4.2rem; font-weight: 300; font-style: italic; float: left; line-height: 0.78; margin: 0.1em 0.12em 0 0; color: var(--gold); }
h3 { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 300; line-height: 1.2; color: var(--ink); margin: 3rem 0 1rem; }
h3 em { font-style: italic; color: var(--teal); }

/* 인용 */
.pull-quote { margin: 3.5rem -1.5rem; padding: 2.5rem 3rem; background: var(--ink-soft); border-radius: 2px; position: relative; overflow: hidden; }
.pull-quote::before { content: '\201C'; position: absolute; top: -1rem; left: 1.5rem; font-family: var(--serif); font-size: 8rem; font-weight: 300; color: rgba(184,147,90,0.15); line-height: 1; pointer-events: none; }
.pull-quote p { font-family: var(--serif); font-style: italic; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 300; line-height: 1.65; color: #FAFAF8; margin: 0; position: relative; z-index: 1; }
.pull-quote cite { display: block; margin-top: 1rem; font-family: var(--sans); font-style: normal; font-size: 0.68rem; letter-spacing: 0.12em; color: rgba(184,147,90,0.65); text-transform: uppercase; position: relative; z-index: 1; }
.q-block { margin: 1.5rem 0; padding: 1rem 1.6rem; border-left: 2px solid rgba(184,147,90,0.3); }
.q-block p { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--mist); margin: 0 0 0.5rem; line-height: 1.8; }
.q-block p:last-child { margin-bottom: 0; }

/* 박스 */
.insight-box { margin: 2.5rem 0; padding: 1.8rem 2.2rem; background: var(--teal-pale); border: 0.5px solid rgba(45,106,95,0.2); border-radius: 4px; }
.insight-label { font-size: 0.6rem; letter-spacing: 0.18em; color: var(--teal); text-transform: uppercase; margin-bottom: 0.9rem; }
.insight-box p { font-size: 0.91rem; color: var(--ink); margin-bottom: 0.7rem; line-height: 1.9; }
.insight-box p:last-child { margin-bottom: 0; }
.insight-box strong { font-weight: 400; color: var(--teal); }
.info-box { margin: 2.5rem 0; padding: 1.8rem 2.2rem; background: var(--gold-pale); border: 0.5px solid rgba(184,147,90,0.3); border-radius: 4px; }
.info-label { font-size: 0.6rem; letter-spacing: 0.18em; color: var(--gold); text-transform: uppercase; margin-bottom: 0.9rem; }
.info-box p { font-size: 0.91rem; color: var(--ink); margin-bottom: 0.7rem; line-height: 1.9; }
.info-box p:last-child { margin-bottom: 0; }

/* 구분선 */
.divider { display: flex; align-items: center; gap: 1rem; margin: 3.5rem 0; }
.divider-line { flex: 1; height: 0.5px; background: var(--cream-dark); }
.divider-mark { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--silver); }

/* 네비게이션 */
.ch-nav { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 3rem 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 0.5px solid rgba(184,147,90,0.2); }
.ch-nav a { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--teal); text-decoration: none; letter-spacing: 0.04em; padding: 0.6rem 1.2rem; border: 0.5px solid rgba(45,106,95,0.3); border-radius: 3px; transition: all 0.15s; }
.ch-nav a:hover { background: var(--teal-pale); border-color: var(--teal); }
.ch-nav .nav-toc { font-size: 0.75rem; color: var(--silver); text-decoration: none; letter-spacing: 0.1em; }
.ch-nav .nav-toc:hover { color: var(--teal); }

/* 구매 CTA */
.buy-cta { max-width: var(--max-w); margin: 0 auto 4rem; padding: 2rem 2.5rem; background: var(--ink-soft); border-radius: 4px; text-align: center; position: relative; overflow: hidden; }
.buy-cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(45,106,95,0.08) 0%, transparent 60%); pointer-events: none; }
.buy-cta p { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: rgba(255,255,255,0.6); margin-bottom: 0.6rem; position: relative; z-index: 1; }
.buy-cta .buy-note { font-size: 0.72rem; color: rgba(255,255,255,0.3); font-style: normal; margin-bottom: 1.2rem; }
.buy-cta-btns { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }
.buy-btn { display: inline-block; padding: 0.6rem 1.4rem; font-size: 0.78rem; letter-spacing: 0.1em; text-decoration: none; border-radius: 3px; transition: all 0.15s; }
.buy-btn.primary { background: var(--gold); color: var(--ink); font-weight: 400; }
.buy-btn.primary:hover { background: var(--gold-light); }
.buy-btn.secondary { border: 0.5px solid rgba(184,147,90,0.5); color: var(--gold-light); }
.buy-btn.secondary:hover { background: rgba(184,147,90,0.1); }
.freemeaner-note { text-align: center; font-size: 0.68rem; color: var(--silver); letter-spacing: 0.1em; padding: 1rem 3rem 3rem; max-width: var(--max-w); margin: 0 auto; }

/* 마지막 페이지 */
.book-end { background: var(--ink); padding: 5rem 3rem; text-align: center; }
.book-end-brand { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: rgba(255,255,255,0.4); margin-bottom: 0.6rem; }
.book-end-url { font-size: 0.8rem; letter-spacing: 0.12em; color: rgba(184,147,90,0.6); margin-bottom: 1.5rem; }
.book-end-copy { font-size: 0.68rem; color: rgba(255,255,255,0.18); line-height: 1.9; }

@media print {
  .ch-nav, .buy-cta, .freemeaner-note { display: none; }
  body::after { content: '이 책은 freemeaner.com에서 무료로 읽을 수 있습니다.'; display: block; text-align: center; font-size: 0.7rem; color: #888; padding: 2rem; }
}
@media (max-width: 700px) {
  .chapter-header, .part-opener { padding: 3.5rem 1.5rem 3rem; }
  .chapter-body { padding: 3rem 1.5rem 4rem; }
  .pull-quote { margin: 2.5rem 0; padding: 2rem 1.5rem; }
  .ch-nav { padding: 2rem 1.5rem 4rem; }
}
