/* 책결 사이트 — 휴대폰이 기본, 768px부터 데스크톱 배치. 색은 앱 테마(src/theme.ts)와 같다. */
:root {
  --bg: #F7F0E8;
  --paper: #FFF8EF;
  --line: #E9DCCC;
  --dash: #C9B8A6;
  --ink: #3B2D25;
  --body: #4E3E34;
  --muted: #72625A;
  --green: #3F6F63;
  --green-deep: #2C5449;
  --rust: #9A5B3E; /* 「하나·둘·셋」 번호 */
  --on-green: #FFF8EF;
  --on-green-soft: #E9DCCC;
  --serif: 'Nanum Myeongjo', 'AppleMyungjo', serif;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --gutter: 20px;
  --section: 56px;
}
@media (min-width: 768px) {
  :root { --section: 88px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}
@media (min-width: 768px) { body { font-size: 17px; } }
img { max-width: 100%; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.serif { font-family: var(--serif); font-weight: 800; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* 머리글 */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font-family: var(--serif); font-weight: 800; font-size: 20px; }
.header-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 15px; text-decoration: none; }

/* 버튼 */
.stores { display: flex; flex-direction: column; gap: 10px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 24px; border-radius: 12px; font-weight: 600; font-size: 16px; text-decoration: none; }
.btn-primary { background: var(--green-deep); color: var(--on-green); }
.btn-primary:hover { color: var(--on-green); background: #234339; }
.btn-secondary { background: var(--paper); color: var(--green-deep); border: 1px solid var(--line); }
.store-note { font-size: 13px; color: var(--muted); }
@media (min-width: 768px) {
  .stores { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .btn { display: inline-flex; min-height: 52px; }
}

/* 홈: 첫 화면 */
.hero { display: flex; flex-direction: column; gap: 40px; padding-top: 24px; padding-bottom: var(--section); }
.hero-text { display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(34px, 9vw, 56px); line-height: 1.3; letter-spacing: -0.01em; }
.hero-lead { font-size: 17px; max-width: 30em; }
@media (min-width: 768px) {
  .hero { flex-direction: row; align-items: center; gap: 56px; padding-top: 48px; }
  .hero-text { flex: 1 1 0; gap: 24px; }
  .hero-lead { font-size: 18px; }
  .hero figure { flex: 1 1 0; }
}
.quote-card { margin: 0 auto; max-width: 400px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px 22px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(59, 45, 37, 0.08); }
.quote-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.quote-meta span:last-child { font-variant-numeric: tabular-nums; }
.quote-card blockquote { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.75; color: var(--ink); }
.quote-note { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.quote-tags { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.pill { padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.hero figure { margin: 0; }

/* 홈: 기능 */
.band-paper { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section { padding-top: var(--section); padding-bottom: var(--section); }
.section-title { font-family: var(--serif); font-weight: 800; font-size: clamp(26px, 6.5vw, 34px); line-height: 1.4; }
.features { display: flex; flex-direction: column; gap: 56px; margin-top: 40px; }
.feature { display: flex; flex-direction: column; gap: 24px; }
.feature-text { display: flex; flex-direction: column; gap: 10px; }
.feature-num { font-family: var(--serif); font-size: 15px; color: var(--rust); }
.feature h3 { font-size: 21px; line-height: 1.45; }
.feature-media { display: flex; flex-direction: column; gap: 10px; }
.shot { width: 100%; max-width: 280px; margin: 0 auto; border-radius: 22px; border: 6px solid var(--ink); }
.shot-empty { aspect-ratio: 9 / 19.5; border: 1px dashed var(--dash); background: var(--bg); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.chip-on { background: var(--green-deep); border-color: var(--green-deep); color: var(--on-green); }
@media (min-width: 768px) {
  .features { gap: 72px; margin-top: 56px; }
  .feature { flex-direction: row; align-items: center; gap: 56px; }
  .feature:nth-child(even) { flex-direction: row-reverse; }
  .feature-text, .feature-media { flex: 1 1 0; min-width: 0; }
  .feature h3 { font-size: 22px; }
  .shot-empty { aspect-ratio: auto; height: 320px; max-width: none; }
}

/* 홈: 모임 */
.band-green { background: var(--green-deep); color: var(--on-green-soft); }
.band-green .section-title { color: var(--on-green); }
.club-list { margin: 32px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 24px; }
.club-list li { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(247, 240, 232, 0.3); padding-top: 18px; }
.club-list strong { font-size: 18px; color: var(--on-green); }
@media (min-width: 768px) {
  .club-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
}

/* 홈: 마지막 권유 */
.closing { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.closing .stores { width: 100%; max-width: 420px; }
@media (min-width: 768px) { .closing .stores { justify-content: center; max-width: none; } }

/* 바닥글 */
.site-footer { border-top: 1px solid var(--line); padding-top: 40px; padding-bottom: 40px; }
.footer-cols { display: flex; flex-direction: column; gap: 28px; }
.footer-about { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.footer-about .serif { font-size: 18px; color: var(--ink); }
.footer-about p { color: var(--muted); }
.footer-mail { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; align-self: flex-start; }
.doc-list { margin: 0; padding: 0; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.doc-list li + li { border-top: 1px solid var(--line); }
.doc-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 12px 18px; text-decoration: none; color: var(--ink); }
.doc-list b { font-weight: 500; display: block; }
.doc-list small { display: block; font-size: 13px; color: var(--muted); }
.doc-list svg { flex: none; }
.copyright { margin-top: 28px; font-size: 13px; color: var(--muted); }
@media (min-width: 768px) {
  .footer-cols { flex-direction: row; justify-content: space-between; gap: 64px; }
  .footer-about { flex: 1 1 280px; }
  .footer-docs { flex: 0 1 300px; }
  .doc-list { background: none; border: 0; border-radius: 0; }
  .doc-list li + li { border-top: 0; }
  .doc-list a { min-height: 44px; padding: 8px 0; color: var(--body); text-decoration: underline; text-underline-offset: 3px; }
  .doc-list small, .doc-list svg { display: none; }
}

/* 문서 페이지 */
.doc-layout { padding-top: 16px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 32px; }
.toc-side { display: none; }
@media (min-width: 900px) {
  .doc-layout { flex-direction: row; align-items: flex-start; gap: 64px; padding-top: 32px; padding-bottom: 80px; }
  .toc-side { display: block; flex: 0 0 240px; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; font-size: 15px; line-height: 1.55; }
  .toc-mobile { display: none; }
}
.toc-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.toc-list { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc-list a { display: block; padding: 7px 0 7px 16px; color: var(--body); text-decoration: none; }
.toc-list a:hover { color: var(--green); }
.doc-article { flex: 1 1 auto; min-width: 0; max-width: 680px; display: flex; flex-direction: column; gap: 28px; }
.doc-head { display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.doc-head h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(28px, 7vw, 40px); line-height: 1.35; }
.doc-dates { font-size: 14px; color: var(--muted); }
.toc-mobile { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.toc-mobile summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-weight: 500; color: var(--ink); }
.toc-mobile .toc-list { margin: 0 16px 12px; }
.mail-box { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.mail-box span { font-size: 14px; color: var(--muted); }
.mail-box a { font-size: clamp(20px, 5.5vw, 26px); font-weight: 700; word-break: break-all; }

.prose { line-height: 1.8; }
.prose > * + * { margin-top: 16px; }
.prose h2 { font-size: 21px; line-height: 1.5; margin-top: 48px; scroll-margin-top: 16px; }
.prose h3 { font-size: 18px; line-height: 1.5; margin-top: 32px; }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); }
.prose code { font-size: 0.92em; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.table-wrap table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th { color: var(--ink); font-weight: 600; }
/* 계정 삭제 안내: 앱 없이 따라 하는 사람이 단계를 놓치지 않게 번호를 크게 */
.steps ol { list-style: none; padding-left: 0; counter-reset: step; }
.steps ol > li { counter-increment: step; position: relative; padding-left: 44px; min-height: 32px; }
.steps ol > li + li { margin-top: 12px; }
.steps ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--green-deep); color: var(--on-green); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }

.other-docs { border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.other-docs p { font-size: 13px; color: var(--muted); }
.other-docs ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.other-docs a { display: flex; align-items: center; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); }

.doc-band { border-top: 1px solid var(--line); background: var(--paper); }
.doc-band .wrap { padding-top: 36px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 20px; }
.doc-band .serif { font-size: 18px; color: var(--ink); }
.doc-band p { font-size: 15px; color: var(--muted); }
.doc-band .btn { align-self: flex-start; min-height: 48px; }
@media (min-width: 768px) {
  .doc-band .wrap { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* 404 */
.notfound { padding-top: 64px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.notfound h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(28px, 7vw, 40px); }
.band-lead { margin-top: 14px; max-width: 560px; }
