/* 읽기 전에 먼저 보는 구약성경 — 공통 스타일
   글씨체는 Pretendard 하나, 색은 가죽·양피지·금색, 한글은 어절 단위로만 줄바꿈 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --leather: #3b2316; --leather-2: #5a3a26; --night: #1c110a;
  --parch: #f6efe3; --parch-2: #efe4d1; --card: #fffaf2;
  --ink: #2a1a10; --muted: #7a6656; --line: #e3d5bf;
  --gold: #c9a45c; --gold-soft: #f4e7c8;
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --wrap: 1100px; --nav-h: 58px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--parch); color: var(--ink); font-family: var(--font); line-height: 1.65; }
body { word-break: keep-all; overflow-wrap: break-word; line-break: strict; text-wrap: pretty; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
/* 한글은 어절(띄어쓰기) 단위로만 줄을 바꾼다. 어떤 요소도 이 규칙을 풀지 않도록 한 번 더 못박는다 */
body * { word-break: keep-all; }
h1, h2, h3, h4, .ctitle, .quote { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img, video, iframe { max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }

/* ── 버튼: 글자 수와 상관없이 같은 크기 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; width: 200px; height: 52px; border-radius: 26px;
  font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px;
  border: 1.5px solid transparent; cursor: pointer; transition: background .2s, color .2s; }
.btn.sm { width: 160px; height: 38px; border-radius: 19px; font-size: 13px; }
.btn.gold { background: var(--gold); color: var(--night); }
.btn.gold:hover { background: #dcb66e; }
.btn.ghost { border-color: rgba(255,255,255,.7); color: #fff; background: transparent; }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.dark { background: var(--leather); color: #fff; }
.btn.dark:hover { background: var(--leather-2); }
.btn.line { border-color: #c9b79c; color: var(--leather-2); background: #fff; }
.btn.line:hover { background: var(--gold-soft); }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── 강조 상자: 글 속 **중요한 말** ── */
.key { font-weight: 800; color: var(--leather); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 1px 8px; margin: 0 1px; white-space: nowrap; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.card .key, .step .key { background: #fff; }
.intro .key { background: var(--parch); }

/* ── 상단바 ── */
.nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); width: calc(100% - 28px); max-width: var(--wrap);
  height: var(--nav-h); border-radius: 29px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 22px; z-index: 50; transition: background .3s, box-shadow .3s, border-color .3s;
  background: rgba(255,250,242,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid transparent; box-shadow: 0 6px 24px rgba(28,17,10,.18); }
.nav.clear { background: rgba(255,250,242,.08); border-color: rgba(255,255,255,.18); box-shadow: none; }
.brand { font-weight: 800; font-size: 15px; color: var(--leather); display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand i { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--leather); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 14px; }
.nav.clear .brand { color: #fff; }
.links { display: none; gap: 4px; }
.links button { width: 120px; height: 38px; border-radius: 19px; border: none; background: none; font-weight: 600; font-size: 14px;
  color: var(--leather-2); cursor: pointer; white-space: nowrap; }
.links button:hover, .links button.on { background: var(--gold-soft); }
.nav.clear .links button { color: #fff; }
.nav.clear .links button:hover, .nav.clear .links button.on { background: rgba(255,255,255,.14); }
.ham { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--gold-soft); border: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--leather); cursor: pointer; font-size: 18px; }

/* ── 구약 메뉴 (네 묶음 접기·펼치기) ── */
.menu { position: fixed; top: calc(14px + var(--nav-h) + 10px); left: 50%; transform: translateX(-50%) translateY(-8px);
  width: calc(100% - 28px); max-width: var(--wrap); max-height: calc(100vh - 100px); overflow-y: auto;
  background: rgba(255,250,242,.98); border-radius: 22px; box-shadow: 0 18px 48px rgba(28,17,10,.3);
  z-index: 49; opacity: 0; pointer-events: none; transition: .25s; }
.menu.open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.grp { border-top: 1px solid var(--line); }
.grp:first-child { border-top: none; }
.grp-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; background: none;
  border: none; font-weight: 700; font-size: 15px; color: var(--leather); cursor: pointer; text-align: left; }
.grp-head small { font-weight: 500; color: var(--muted); font-size: 12px; white-space: nowrap; }
.grp .books { display: none; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; padding: 0 22px 16px; background: var(--parch-2); }
.grp.open .books { display: grid; }
.grp.open .grp-head { background: var(--parch-2); }
.bk { display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 8px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk.live { background: var(--leather); color: #fff; border-color: var(--leather); font-weight: 700; }
.bk.cur { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ── 옆 메뉴 (넓은 화면, 유리 효과) ── */
.side { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 10px; z-index: 48; }
.side a { position: relative; width: 56px; height: 56px; border-radius: 50%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; font-size: 10px; font-weight: 700; color: var(--leather);
  background: rgba(255,250,242,.55); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.6); box-shadow: 0 6px 18px rgba(28,17,10,.18); transition: transform .2s, background .2s, color .2s; }
.side a b { font-size: 17px; line-height: 1; }
.side a:hover { background: rgba(59,35,22,.82); color: #fff; transform: translateX(-3px); }
.side a.gn { background: rgba(201,164,92,.72); color: var(--night); }
.side a.gn:hover { background: rgba(201,164,92,.95); color: var(--night); }
.side a::before { content: attr(data-tip); position: absolute; right: 66px; top: 50%; transform: translateY(-50%);
  background: var(--night); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: .2s; }
.side a:hover::before { opacity: 1; }

/* ── 하단 탭 (좁은 화면) ── */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; display: grid; grid-template-columns: repeat(4, 1fr); z-index: 50;
  background: rgba(255,250,242,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: none; background: none;
  font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 0; }
.tabbar b { font-size: 18px; line-height: 1; }
.tabbar .on { background: var(--leather); color: #fff; }

@media (min-width: 900px) {
  .links { display: flex; }
  .ham, .tabbar { display: none; }
  .side { display: flex; }
}
@media (max-width: 899px) {
  body { padding-bottom: 64px; }
}

/* ── 바닥글 ── */
.foot { background: var(--night); color: rgba(255,255,255,.62); padding: 44px 0; font-size: 13px; text-align: center; }
.foot b { color: #fff; }
.foot .maker { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.foot .maker a { color: var(--gold); }
.foot .maker a:hover { text-decoration: underline; }

/* ── 구역 공통 ── */
section { padding: 72px 0; }
.eyebrow { font-size: 12px; letter-spacing: 2px; color: #a2743c; font-weight: 700; margin-bottom: 10px; }
h1, h2, h3 { font-family: var(--font); }
h2 { font-weight: 800; font-size: clamp(26px, 4vw, 38px); margin: 0 0 14px; color: var(--leather); line-height: 1.3; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 16px; max-width: 640px; margin: 0 0 32px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ── 첫 화면 ── */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff; overflow: hidden; padding: 120px 20px 110px; background: var(--night); }
.hero .poster { position: absolute; inset: 0; background: url("../assets/hero-poster.jpg") center 70% / cover no-repeat; }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; opacity: 0; transition: opacity 1.2s; }
.hero video.ready { opacity: 1; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28,17,10,.55) 0%, rgba(28,17,10,.25) 45%, rgba(28,17,10,.5) 100%); }
.hero .in { position: relative; width: 100%; max-width: 760px; }
.tag { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.45); border-radius: 20px; padding: 7px 16px;
  font-size: 13px; margin-bottom: 26px; background: rgba(0,0,0,.2); }
.tag b { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
/* 첫 화면 흐르는 문구: 옛 꼬리표의 두 배 폭, 글이 오른쪽에서 왼쪽으로 천천히 흐른다 */
.ticker { width: min(720px, 100%); height: 40px; margin: 0 auto 42px; border: 1px solid rgba(255,255,255,.45); border-radius: 20px;
  background: rgba(0,0,0,.22); overflow: hidden; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.ticker-track { display: inline-flex; white-space: nowrap; will-change: transform; animation: ticker 42s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding: 0 28px; font-size: 14px; color: rgba(255,255,255,.92); }
.ticker-item b { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: inline-block; flex: 0 0 7px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.hero h1 { font-weight: 900; font-size: clamp(36px, 6.4vw, 68px); line-height: 1.18; margin: 0 0 20px; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { font-size: clamp(15px, 2vw, 18px); opacity: .92; margin: 0 auto 34px; max-width: 560px; }
.hero .btns { justify-content: center; }
.scroll { position: absolute; bottom: 40px; left: 0; right: 0; text-align: center; font-size: 11px; letter-spacing: 4px; opacity: .6; }
@media (max-width: 899px) { .hero video { display: none; } }

/* ── 원리 ── */
.why { background: var(--parch-2); }
.wcards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.wc { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px 22px; display: flex; flex-direction: column; }
.wc .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--leather); color: var(--gold); display: flex; align-items: center;
  justify-content: center; font-size: 20px; margin-bottom: 14px; }
.wc h3 { margin: 0 0 8px; font-size: 17px; color: var(--leather); }
.wc p { margin: 0 0 14px; font-size: 14px; color: var(--muted); flex: 1; }
.wc .ref { font-size: 12px; color: #a2743c; border-top: 1px dashed var(--line); padding-top: 10px; }
.quote { margin: 36px auto 0; max-width: 720px; text-align: center; font-weight: 800; font-size: clamp(17px, 2.4vw, 22px); color: var(--leather); line-height: 1.6; }
.quote small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ── 읽는 방법 ── */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.step .num { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-soft); color: var(--leather); font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }

/* ── 구약 소개 ── */
.groups { background: var(--leather); color: #fff; }
.groups h2 { color: #fff; }
.groups .eyebrow { color: var(--gold); }
.groups .lead { color: rgba(255,255,255,.75); }
.gcards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.gc { background: rgba(255,250,242,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; }
.gc h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.gc .n { color: var(--gold); font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.gc p { margin: 0 0 14px; font-size: 13px; color: rgba(255,255,255,.75); line-height: 1.7; flex: 1; }
.badge { display: inline-flex; align-items: center; justify-content: center; width: 130px; height: 30px; border-radius: 15px;
  font-size: 12px; background: rgba(255,255,255,.1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.badge.live { background: var(--gold); color: var(--night); font-weight: 700; }

/* ── 영상 자리 (첫 페이지·장 페이지 공통) ── */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: linear-gradient(160deg, #241510, #4a2d1c);
  box-shadow: 0 20px 50px rgba(28,17,10,.28); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: rgba(255,250,242,.85); font-weight: 700; font-size: clamp(15px, 2.2vw, 20px); }
.player .empty i { font-style: normal; width: 64px; height: 64px; border-radius: 50%; border: 1.5px dashed rgba(255,250,242,.5);
  display: flex; align-items: center; justify-content: center; font-size: 22px; }

/* ── 지금 볼 수 있는 영상 ── */
.stage-info { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 26px; }
.stage-info .t { font-size: 13px; color: var(--muted); }
.stage-info .t b { display: block; font-size: 20px; color: var(--leather); font-weight: 800; }
.book-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.book-tabs button { width: 160px; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-weight: 600;
  font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-tabs button.on { background: var(--leather); color: #fff; border-color: var(--leather); }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.ch { padding: 0; font-family: inherit; position: relative; aspect-ratio: 1; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 700;
  font-size: 14px; background: #fff; border: 1px solid var(--line); color: #b7a894; cursor: default; }
.ch.live { background: var(--leather); color: #fff; border-color: var(--leather); cursor: pointer; }
.ch.live:hover { background: var(--leather-2); }
.ch.vid::after { content: "▶"; position: absolute; right: 6px; bottom: 4px; font-size: 8px; color: var(--gold); }
.ch.now { outline: 3px solid var(--gold); outline-offset: 2px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--leather); vertical-align: -1px; margin-right: 4px; }
.soon { color: var(--muted); font-size: 15px; }
@media (max-width: 380px) { .chapters { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; } }

/* ── 책·장 페이지 ── */
.page { padding: calc(14px + var(--nav-h) + 30px) 0 60px; }
.crumb { font-size: 12px; color: #a2743c; font-weight: 600; margin-bottom: 10px; }
.crumb a:hover { text-decoration: underline; }
.page h1 { font-weight: 900; font-size: clamp(28px, 4.6vw, 42px); color: var(--leather); margin: 0 0 6px; letter-spacing: -.02em; line-height: 1.25; }
.page .sub { color: var(--muted); margin: 0 0 18px; }
.intro { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin: 0 0 26px; color: var(--ink); white-space: pre-line; }
.ctitle { font-size: clamp(22px, 3.4vw, 30px); font-weight: 900; color: var(--leather); margin: 20px 0 2px; letter-spacing: -.02em; }
.range { display: inline-block; font-size: 12px; font-weight: 700; color: var(--leather-2); background: var(--gold-soft); border-radius: 10px; padding: 2px 10px; margin-bottom: 14px; }
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } .cards .wide { grid-column: 1 / -1; } }
.card { background: var(--card); border-radius: 18px; padding: 16px 18px; border: 1px solid #eee3d2; }
.card h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .5px; color: #8a5a2b; }
.card p { margin: 0; white-space: pre-line; }
.card ul { margin: 0; padding-left: 18px; }
.card li + li { margin-top: 4px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.chip { display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 16px; background: var(--gold-soft);
  font-size: 13px; color: var(--leather); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.pn a, .pn span { display: flex; align-items: center; height: 48px; border-radius: 14px; padding: 0 16px; font-weight: 700; color: var(--leather);
  background: #fff; border: 1px solid var(--line); }
.pn .next { justify-content: flex-end; }
.pn span { color: #c9bba8; }
.pn .blank { visibility: hidden; }
.notice { text-align: center; padding: 60px 0; }
.notice h1 { margin-bottom: 12px; }
.notice .btns { justify-content: center; margin-top: 24px; }
.draft-banner { position: fixed; left: 14px; bottom: 14px; z-index: 47; white-space: nowrap;
  background: #b4442a; color: #fff; font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
@media (max-width: 899px) { .draft-banner { bottom: 76px; } }

/* 옆 메뉴가 내용을 가리지 않도록, 화면이 아주 넓지 않을 때는 오른쪽 여백을 둔다 */
@media (min-width: 900px) and (max-width: 1319px) {
  section .wrap, .page .wrap { padding-right: 96px; }
}

/* 좁은 화면: 구약 메뉴의 아래쪽이 하단 탭에 가리지 않도록 높이를 줄인다 */
@media (max-width: 899px) {
  .menu { max-height: calc(100vh - (14px + var(--nav-h) + 10px) - 64px - 12px); max-height: calc(100dvh - (14px + var(--nav-h) + 10px) - 64px - 12px); }
}
