/* ============================================================
   여호와 닛시 (Jehovah-Nissi) — 공유 스타일
   말씀을 원문으로 읽는 무료 학습 공간
   ============================================================ */

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

:root {
  --bg: #faf6ee;
  --surface: #fffdf8;
  --surface-2: #f4eede;
  --ink: #2b2621;
  --ink-soft: #5c5347;
  --ink-faint: #8a8072;
  --line: #e7dfce;
  --line-soft: #efe8d8;
  --accent: #9a7b2e;       /* antique gold — 깃발 */
  --accent-deep: #7a5f1f;
  --accent-wash: #f6eed9;
  --greek-ink: #1f1b16;
  --maxw: 720px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60,50,30,.05), 0 8px 30px rgba(80,66,38,.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Serif KR', 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.85;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.grk {
  font-family: 'EB Garamond', 'Noto Serif KR', Georgia, serif;
  color: var(--greek-ink);
  letter-spacing: 0;
}

/* ---------- 레이아웃 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.wrap--wide { max-width: 940px; }

/* ---------- 헤더 ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,248,.82);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.site-head__row {
  max-width: 940px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.brand__mark {
  font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.34rem;
  letter-spacing: .01em; color: var(--ink);
}
.brand__mark b { color: var(--accent-deep); font-weight: 600; }
.brand__tag { font-size: .78rem; color: var(--ink-faint); letter-spacing: .02em; }
.site-nav { display: flex; gap: 20px; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .92rem;
  border-bottom: 1px solid transparent; padding-bottom: 2px; transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--accent-deep); border-color: var(--accent); }

/* ---------- 히어로 ---------- */
.hero { padding: 74px 0 56px; text-align: center; }
.hero__eyebrow {
  font-size: .82rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-deep); margin: 0 0 18px;
}
.hero__title {
  font-family: 'EB Garamond','Noto Serif KR',serif;
  font-weight: 600; font-size: clamp(2rem, 5.4vw, 2.9rem);
  line-height: 1.28; margin: 0 0 20px; color: var(--ink);
  word-break: keep-all;
}
.hero__lede {
  font-size: 1.08rem; color: var(--ink-soft); margin: 0 auto 30px; max-width: 560px;
  word-break: keep-all;
}
.hero__verse {
  font-style: italic; color: var(--ink-faint); font-size: .95rem; margin-top: 34px;
}
.hero__verse .grk { font-style: normal; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; font-weight: 500;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, background .15s;
}
.btn--primary { background: var(--accent-deep); color: #fff8e8; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--accent-deep); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); background: var(--accent-wash); }

/* ---------- 섹션 ---------- */
section { padding: 8px 0; }
.section-title {
  font-family: 'EB Garamond','Noto Serif KR',serif; font-weight: 600;
  font-size: 1.5rem; color: var(--ink); margin: 48px 0 6px; text-align: center;
}
.section-sub { text-align: center; color: var(--ink-faint); font-size: .95rem; margin: 0 0 26px; }

/* ---------- 코스 카드 ---------- */
.course {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px 30px 26px; margin: 22px auto;
}
.course__kicker { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-deep); margin: 0 0 8px; }
.course__title { font-family:'EB Garamond','Noto Serif KR',serif; font-weight:600; font-size:1.5rem; margin:0 0 8px; }
.course__desc { color: var(--ink-soft); font-size: .98rem; margin: 0 0 22px; word-break: keep-all; }
.stage-list { display: grid; gap: 12px; }
.stage {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2);
  text-decoration: none; color: inherit; transition: border-color .15s, background .15s, transform .12s;
}
.stage--live { background: var(--accent-wash); border-color: #e6d4a3; }
.stage--live:hover { transform: translateY(-1px); border-color: var(--accent); }
.stage--soon { opacity: .72; cursor: default; }
.stage__no {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: .82rem; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--accent-deep);
}
.stage--live .stage__no { background: var(--accent-deep); color: #fff8e8; border-color: var(--accent-deep); }
.stage__body { flex: 1; }
.stage__name { font-weight: 600; font-size: 1rem; color: var(--ink); }
.stage__meta { font-size: .84rem; color: var(--ink-faint); }
.stage__cta { font-size: .85rem; color: var(--accent-deep); white-space: nowrap; }
.stage__badge { font-size: .72rem; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* ---------- 소개/원칙 ---------- */
.about { max-width: 640px; margin: 40px auto 0; }
.about p { color: var(--ink-soft); word-break: keep-all; }
.about .lead { color: var(--ink); }
.principle-grid { display: grid; gap: 16px; margin-top: 22px; }
@media (min-width: 620px){ .principle-grid { grid-template-columns: 1fr 1fr; } }
.principle {
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: var(--surface);
}
.principle h4 { margin: 0 0 6px; font-size: 1rem; color: var(--accent-deep); font-weight: 600; }
.principle p { margin: 0; font-size: .92rem; }

/* ---------- 이메일 가입 ---------- */
.subscribe {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; text-align: center; margin: 48px auto 12px; max-width: 620px;
}
.subscribe h3 { margin: 0 0 6px; font-size: 1.25rem; font-family:'EB Garamond','Noto Serif KR',serif; }
.subscribe p { margin: 0 0 18px; color: var(--ink-soft); font-size: .95rem; }
.subscribe__form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.subscribe__form input[type=email] {
  flex: 1; min-width: 220px; max-width: 320px; padding: 12px 16px; font-family: inherit; font-size: .98rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.subscribe__form input:focus { outline: none; border-color: var(--accent); }
.subscribe__note { font-size: .8rem; color: var(--ink-faint); margin-top: 12px; }

/* ---------- 푸터 ---------- */
.site-foot {
  margin-top: 64px; border-top: 1px solid var(--line);
  padding: 34px 0 46px; text-align: center; color: var(--ink-faint); font-size: .86rem;
}
.site-foot .grk { color: var(--ink-soft); }
.site-foot a { color: var(--ink-soft); }

/* ============================================================
   레슨 페이지
   ============================================================ */
.lesson { padding: 40px 0 20px; }
.lesson__kicker {
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-deep); margin: 0 0 12px;
}
.lesson__title {
  font-family: 'EB Garamond','Noto Serif KR',serif; font-weight: 600;
  font-size: clamp(1.7rem, 4.6vw, 2.3rem); line-height: 1.3; margin: 0 0 10px; word-break: keep-all;
}
.lesson__title .grk { font-weight: 600; }
.lesson__sub { color: var(--ink-faint); font-size: .98rem; margin: 0 0 8px; }
.lesson hr.rule { border: none; border-top: 1px solid var(--line); margin: 30px 0; }

.lesson h2 {
  font-family: 'EB Garamond','Noto Serif KR',serif; font-weight: 600; font-size: 1.35rem;
  margin: 42px 0 8px; color: var(--ink); scroll-margin-top: 80px;
}
.lesson h2 .num { color: var(--accent); margin-right: .4em; }
.lesson h3 { font-size: 1.08rem; font-weight: 600; margin: 26px 0 6px; color: var(--ink); }
.lesson p { color: var(--ink); word-break: keep-all; }
.lesson strong { color: var(--accent-deep); }

.callout {
  background: var(--accent-wash); border: 1px solid #ecdcb0; border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 16px 20px; margin: 22px 0; font-size: .95rem; color: var(--ink-soft);
}
.callout b { color: var(--accent-deep); }

.note {
  font-size: .9rem; color: var(--ink-faint); border-top: 1px solid var(--line-soft);
  padding-top: 14px; margin-top: 26px;
}

/* 표 */
.tbl-scroll { overflow-x: auto; margin: 18px 0; border-radius: 10px; border: 1px solid var(--line); }
table.gtbl { width: 100%; border-collapse: collapse; font-size: .94rem; background: var(--surface); min-width: 460px; }
table.gtbl th {
  background: var(--surface-2); color: var(--ink-soft); font-weight: 600; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .82rem; letter-spacing: .02em;
}
table.gtbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.gtbl tr:last-child td { border-bottom: none; }
table.gtbl .letter { font-family: 'EB Garamond', serif; font-size: 1.28rem; color: var(--greek-ink); white-space: nowrap; }
table.gtbl .ipa { color: var(--ink-soft); font-size: .9rem; white-space: nowrap; }
table.gtbl--narrow { min-width: 320px; }

/* 소리내어 읽기 카드 */
.readcard { display: grid; gap: 10px; margin: 18px 0; }
.readrow {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.readrow .word { font-family: 'EB Garamond', serif; font-size: 1.7rem; color: var(--greek-ink); }
.readrow .rom { color: var(--accent-deep); font-weight: 600; }
.readrow .gloss { color: var(--ink-soft); font-size: .92rem; }

/* 레슨 하단 내비 */
.lesson-nav { display: flex; justify-content: space-between; gap: 14px; margin: 40px 0 8px; flex-wrap: wrap; }
.lesson-nav .spacer { flex: 1; }

.backlink { display: inline-block; margin: 8px 0 0; color: var(--ink-soft); text-decoration: none; font-size: .92rem; }
.backlink:hover { color: var(--accent-deep); }

/* ============================================================
   인터랙티브 연습 (플래시카드 · 퀴즈 · 오디오 · 진도)
   ============================================================ */
.practice { margin: 22px 0 8px; }

/* 오디오 버튼 */
.audio-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--accent-deep);
  font-size: .8rem; line-height: 1; padding: 0; transition: background .15s, border-color .15s, transform .1s;
  vertical-align: middle;
}
.audio-btn:hover { background: var(--accent-wash); border-color: var(--accent); }
.audio-btn:active { transform: scale(.94); }
.audio-btn.is-playing { background: var(--accent-deep); color: #fff8e8; border-color: var(--accent-deep); }

/* 플래시카드 */
.flash {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; text-align: center;
}
.flash__count { font-size: .82rem; color: var(--ink-faint); margin: 0 0 12px; letter-spacing: .04em; }
.flash__card {
  min-height: 176px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px; cursor: pointer; user-select: none; transition: border-color .15s;
}
.flash__card:hover { border-color: var(--accent); }
.flash__letter { font-family: 'EB Garamond', serif; font-size: 3.4rem; line-height: 1; color: var(--greek-ink); }
.flash__hint { font-size: .82rem; color: var(--ink-faint); }
.flash__back { display: none; }
.flash.is-flipped .flash__back { display: block; }
.flash.is-flipped .flash__hint { display: none; }
.flash__name { font-family: 'EB Garamond','Noto Serif KR',serif; font-size: 1.3rem; color: var(--ink); }
.flash__ipa { color: var(--ink-soft); font-size: .95rem; }
.flash__kr { color: var(--accent-deep); font-weight: 600; font-size: 1.05rem; }
.flash__note { color: var(--ink-faint); font-size: .82rem; max-width: 320px; margin: 4px auto 0; }
.flash__controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.mini-btn {
  font-family: inherit; font-size: .88rem; cursor: pointer; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft); transition: background .15s, border-color .15s, color .15s;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-wash); }
.mini-btn--know { border-color: #bcd6b0; color: #4a6b39; }
.mini-btn--again { border-color: #e6c9a3; color: #8a5a1f; }
.mini-btn--wide { flex: 1; min-width: 120px; }

/* 퀴즈 */
.quiz {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-top: 16px;
}
.quiz__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.quiz__q { font-size: .84rem; color: var(--ink-faint); letter-spacing: .04em; }
.quiz__score { font-size: .84rem; color: var(--accent-deep); font-weight: 600; }
.quiz__prompt { text-align: center; margin: 8px 0 18px; }
.quiz__prompt .glyph { font-family: 'EB Garamond', serif; font-size: 3rem; color: var(--greek-ink); display: block; }
.quiz__prompt .ask { font-size: .95rem; color: var(--ink-soft); margin-top: 6px; }
.quiz__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz__opt {
  font-family: inherit; font-size: 1.05rem; cursor: pointer; padding: 14px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); transition: background .12s, border-color .12s;
}
.quiz__opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-wash); }
.quiz__opt.correct { background: #e9f2e0; border-color: #9dc07f; color: #3b5a25; }
.quiz__opt.wrong { background: #f6e6df; border-color: #e0a887; color: #8a4020; }
.quiz__opt:disabled { cursor: default; }
.quiz__done { text-align: center; }
.quiz__done p { font-size: 1.05rem; margin: 6px 0 14px; }

/* 진도 / 완료 */
.progress-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin: 24px 0 8px;
}
.progress-bar__text { font-size: .92rem; color: var(--ink-soft); flex: 1; min-width: 180px; }
.progress-bar__text b { color: var(--accent-deep); }
.badge-done {
  display: none; align-items: center; gap: 6px; font-size: .85rem; color: #4a6b39;
  background: #eaf3e1; border: 1px solid #bcd6b0; border-radius: 999px; padding: 5px 14px;
}
.is-complete .badge-done { display: inline-flex; }

.toast {
  position: absolute; transform: translate(-50%, -130%); background: var(--ink); color: #fdf7e8;
  font-size: .76rem; padding: 5px 11px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .18s; z-index: 50;
}
.toast.show { opacity: .96; }

@media (max-width: 520px){
  body { font-size: 17px; }
  .hero { padding: 54px 0 40px; }
  .quiz__opts { grid-template-columns: 1fr; }
}

/* ---------- 언어 전환 (다국어) ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-faint); }
.lang-switch b { color: var(--ink-soft); font-weight: 600; }
.lang-switch__soon::before { content: "·"; margin-right: 6px; opacity: .55; }
