/* Pyroculinary : 재(ash)의 종이, 먹의 글자, 인주(印朱)의 낙관 하나 */
:root {
  --paper: #f6f5f2;
  --ink: #23211f;
  --smoke: #6f6b66;
  --line: #dcd9d3;
  --seal: #a3312b;
  --measure: 34em;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.9;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
a:hover { color: var(--seal); }
a:focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }

/* 머리와 꼬리 */
.site-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.75rem clamp(1.25rem, 5vw, 4rem);
}
.site-head .brand {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.site-head nav { display: flex; gap: 1.5rem; font-size: 0.95rem; }
.site-head nav a { text-decoration: none; color: var(--smoke); }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--ink); }

.site-foot {
  padding: 3rem clamp(1.25rem, 5vw, 4rem) 2.5rem;
  color: var(--smoke);
  font-size: 0.85rem;
}

/* 대문 */
.gate {
  min-height: calc(100vh - 10rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(2rem, 8vw, 9rem);
  padding: 2rem clamp(1.25rem, 5vw, 4rem) 4rem;
  max-width: 72rem;
  margin: 0 auto;
}

.gate-words { max-width: 26em; }
.gate-words .reading {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 300;
  line-height: 1.75;
  margin: 0 0 0.75rem;
}
.gate-words .source { color: var(--smoke); font-size: 0.9rem; margin: 0 0 3.5rem; }

.doors { list-style: none; margin: 0; padding: 0; }
.doors li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.doors li:last-child { border-bottom: 1px solid var(--line); }
.doors a { display: block; text-decoration: none; }
.doors .door-name { display: block; font-weight: 600; font-size: 1.15rem; }
.doors .door-note { display: block; color: var(--smoke); font-size: 0.92rem; }
.doors a:hover .door-name { color: var(--seal); }
.doors .closed .door-name { color: var(--smoke); font-weight: 400; }

.verse {
  position: relative;
  writing-mode: vertical-rl;
  font-weight: 300;
  font-size: clamp(3.2rem, 7vw, 5.6rem);
  line-height: 1.45;
  letter-spacing: 0.18em;
  margin: 0;
  justify-self: end;
}
.verse .ch { display: inline-block; opacity: 1; }
.seal {
  writing-mode: horizontal-tb;
  position: absolute;
  left: -3.2rem;
  bottom: 0.4rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--seal);
  color: var(--seal);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  border-radius: 3px;
  transform: rotate(-4deg);
}

@media (prefers-reduced-motion: no-preference) {
  .verse .ch { opacity: 0; animation: ink-in 900ms ease forwards; }
  .seal { opacity: 0; animation: stamp 500ms ease-out forwards; animation-delay: 2.2s; }
}
@keyframes ink-in { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: blur(0); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.25); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

@media (max-width: 760px) {
  .gate { grid-template-columns: 1fr; min-height: auto; padding-top: 1rem; }
  .verse { order: -1; justify-self: center; font-size: clamp(2.6rem, 14vw, 3.6rem); }
  .seal { left: -2.6rem; width: 2rem; height: 2rem; font-size: 1.1rem; }
  .site-head nav { gap: 1rem; }
}

/* 읽는 페이지 */
.reading-page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 2rem) 2rem;
}
.reading-page h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.4;
  margin: 1.5rem 0 0.5rem;
}
.reading-page h1 .title-en { display: block; font-size: 0.5em; font-weight: 400; color: var(--smoke); letter-spacing: 0.02em; margin-top: 0; line-height: 1.3; }
.reading-page .byline { color: var(--smoke); font-size: 0.92rem; margin: 0 0 3.5rem; }
.reading-page h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 4.5rem 0 1.5rem;
  line-height: 1.5;
}
.reading-page p {
  margin: 0 0 1.1em;
  text-align: justify;
  text-indent: 1em;
  word-break: normal;
  line-break: strict;
}
.reading-page .byline { text-indent: 0; text-align: left; }
.reading-page .epigraph {
  margin: 0 0 3rem;
  padding: 0;
  text-align: center;
}
.reading-page .epigraph p { text-indent: 0; text-align: center; margin: 0; }
.reading-page .epigraph .hanja { font-size: 1.6rem; font-weight: 600; letter-spacing: 0.12em; margin-bottom: 0.4rem; }
.reading-page .epigraph::after { content: ""; display: block; width: 100%; height: 1px; margin: 2.2rem auto 0; background: var(--line); }
.reading-page .epigraph .src { color: var(--smoke); font-size: 0.9rem; margin-top: 0.4rem; }

.law {
  margin: 2.2rem 0 0;
  padding: 0;
  font-size: 1.12rem;
  font-weight: 600;
  text-align: center;
}
.law p { text-indent: 0; text-align: center; margin: 0; }

.reading-page ol { padding-left: 1.6em; margin: 0 0 1.4em; }
.reading-page ol li { margin: 0.3em 0; }

/* 헌장 조문 */
.article { text-indent: 0 !important; }
.article .no { font-weight: 600; }
.charter-list { padding-left: 2.6em !important; }

.back { margin-top: 4rem; font-size: 0.95rem; }

/* ───────── 시장 ───────── */
.market { max-width: 64rem; margin: 0 auto; padding: 1rem clamp(1.25rem, 5vw, 3rem) 2rem; }
.page-title { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 600; line-height: 1.4; margin: 1.5rem 0 0.3rem; }
.page-lead { color: var(--smoke); margin: 0 0 2.5rem; }
.sample-note { display: inline-block; font-size: 0.82rem; color: var(--seal); border: 1px solid var(--seal); border-radius: 3px; padding: 0 0.5em; line-height: 1.7; }

/* 평가 기준 공개 (헌장 제18조) */
.criteria-strip { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); padding: 1.2rem 0 1.3rem; margin: 0 0 3rem; }
.criteria-strip h2 { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.8rem; }
.criteria-strip dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem 1.6rem; margin: 0; font-size: 0.86rem; line-height: 1.7; }
.criteria-strip dt { font-weight: 600; }
.criteria-strip dd { margin: 0; color: var(--smoke); }
.criteria-strip .more { margin: 0.9rem 0 0; font-size: 0.86rem; }

.area-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin: 0 0 1rem; font-size: 0.95rem; }
.area-nav a { text-decoration: none; color: var(--smoke); }
.area-nav a:hover { color: var(--ink); }

.area { padding: 2.5rem 0 1rem; border-top: 1px solid var(--line); }
.area-head { display: flex; align-items: baseline; gap: 0.8rem; margin: 0 0 1.6rem; }
.area-head .mark { color: var(--seal); font-weight: 600; font-size: 1.25rem; }
.area-head h2 { font-size: 1.3rem; font-weight: 600; margin: 0; }
.area-head .en { color: var(--smoke); font-size: 0.85rem; }
.area-head .note { color: var(--smoke); font-size: 0.9rem; margin-left: auto; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 2.4rem 2rem; list-style: none; margin: 0; padding: 0; }
.card a { display: block; text-decoration: none; }
.plate { aspect-ratio: 1 / 1; background: #ecebe7; border: 1px solid var(--line); display: grid; place-items: center; color: #c9c5be; font-size: clamp(3rem, 6vw, 4.5rem); font-weight: 300; margin: 0 0 0.9rem; position: relative; }
.plate .tag { position: absolute; top: 0.6rem; left: 0.6rem; font-size: 0.72rem; color: var(--smoke); letter-spacing: 0.04em; }
.card .name { display: block; font-weight: 600; font-size: 1.02rem; }
.card .line { display: block; color: var(--smoke); font-size: 0.88rem; line-height: 1.6; margin: 0.15rem 0 0.35rem; }
.card .price { display: block; font-size: 0.98rem; }
.card a:hover .name { color: var(--seal); }
.empty-shelf { color: var(--smoke); font-size: 0.92rem; }

/* 상품 화면 : 사진 한 장, 글 한 편, 값 하나, 버튼 하나 (헌장 제25조) */
.item { max-width: 64rem; margin: 0 auto; padding: 1rem clamp(1.25rem, 5vw, 3rem) 2rem; }
.item-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; margin: 1.5rem 0 4rem; }
.item-top .plate { font-size: clamp(5rem, 12vw, 9rem); margin: 0; }
.crumb { font-size: 0.86rem; color: var(--smoke); margin: 0 0 0.6rem; }
.crumb a { text-decoration: none; }
.item h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 600; line-height: 1.4; margin: 0 0 0.3rem; }
.item .partner { color: var(--smoke); font-size: 0.92rem; margin: 0 0 1.6rem; }
.item .the-price { font-size: 1.5rem; font-weight: 600; margin: 0; }
.item .price-sub { color: var(--smoke); font-size: 0.86rem; margin: 0.1rem 0 1.6rem; }
.item .item-line { font-size: 1.05rem; margin: 0 0 1.8rem; }

.btn { display: block; width: 100%; border: 0; border-radius: 4px; background: var(--ink); color: var(--paper); font: inherit; font-size: 1.02rem; font-weight: 600; padding: 0.9rem 1rem; cursor: pointer; text-align: center; text-decoration: none; }
.btn:hover { background: var(--seal); color: var(--paper); }
.btn[disabled] { background: #bdb9b2; cursor: not-allowed; }
.btn-note { color: var(--smoke); font-size: 0.84rem; margin: 0.6rem 0 0; line-height: 1.6; }

.progress { height: 3px; background: var(--line); margin: 0.2rem 0 0.4rem; }
.progress span { display: block; height: 100%; background: var(--seal); }
.group-count { font-size: 0.92rem; margin: 0 0 1.4rem; }

.tariff { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: 0.95rem; }
.tariff td { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.tariff td:last-child { text-align: right; }
.tariff label { cursor: pointer; display: flex; gap: 0.6rem; align-items: center; }

.checked-badge { display: inline-block; font-size: 0.8rem; border: 1px solid var(--ink); border-radius: 3px; padding: 0 0.5em; margin: 0 0 1rem; }

.item-body { max-width: var(--measure); margin: 0 auto; }
.item-body h2 { font-size: 1.15rem; font-weight: 600; margin: 3.2rem 0 1rem; }
.item-body p { text-align: justify; text-indent: 1em; word-break: normal; line-break: strict; margin: 0 0 1.1em; }
.item-body .interest { text-indent: 0; color: var(--smoke); font-size: 0.9rem; border-left: 2px solid var(--line); padding-left: 0.9rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.6rem; margin: 0; font-size: 0.93rem; }
.facts dt { color: var(--smoke); }
.facts dd { margin: 0; }
.broker-notice { font-size: 0.86rem; color: var(--smoke); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 3rem; }

/* 결제 시트 : 세 번의 결정 (헌장 제27조) */
.sheet { border: 0; padding: 0; width: min(30rem, 100vw - 2rem); border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(35,33,31,0.18); }
.sheet::backdrop { background: rgba(35,33,31,0.35); }
.sheet form { padding: 1.6rem 1.6rem 1.4rem; }
.sheet h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.2rem; }
.sheet .sum { color: var(--smoke); font-size: 0.9rem; margin: 0 0 1.4rem; }
.step { margin: 0 0 1.3rem; }
.step-no { font-size: 0.78rem; color: var(--seal); font-weight: 600; letter-spacing: 0.05em; }
.step label { display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 0.4rem; }
.field { width: 100%; font: inherit; font-size: 0.95rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.pays { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pays label { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--line); border-radius: 4px; padding: 0.55rem 0.7rem; margin: 0; cursor: pointer; background: #fff; }
.pays input { accent-color: var(--seal); }
.sheet .close { position: absolute; top: 0.8rem; right: 1rem; background: none; border: 0; font: inherit; font-size: 1.3rem; color: var(--smoke); cursor: pointer; }

/* 안내 페이지의 표 */
.plain-list { padding-left: 1.4em; margin: 0 0 1.4em; }
.plain-list li { margin: 0.35em 0; }
.flow { list-style: none; counter-reset: f; padding: 0; margin: 0 0 1.6em; }
.flow li { counter-increment: f; padding: 0.5rem 0 0.5rem 2.4rem; position: relative; border-bottom: 1px solid var(--line); }
.flow li::before { content: counter(f); position: absolute; left: 0.2rem; top: 0.5rem; color: var(--seal); font-weight: 600; }
.reading-page .form-box { border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem; margin: 1.5rem 0 2rem; background: #fbfaf8; }
.reading-page .form-box p { text-indent: 0; }
.reading-page .form-box label { display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 0.35rem; }
.reading-page .form-box .field { margin: 0 0 1rem; }

/* 공통 꼬리 : 중개자 고지 (헌장 제6조) */
.site-foot .legal { max-width: 46rem; line-height: 1.75; margin: 0 0 0.8rem; }
.site-foot .foot-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.3rem; margin: 0 0 0.8rem; }
.site-foot .foot-links a { text-decoration: none; }

@media (max-width: 860px) {
  .criteria-strip dl { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .item-top { grid-template-columns: 1fr; }
  .area-head { flex-wrap: wrap; }
  .area-head .note { margin-left: 0; width: 100%; }
  .criteria-strip dl { grid-template-columns: 1fr; }
  .shelf { grid-template-columns: 1fr 1fr; gap: 1.8rem 1rem; }
  .pays { grid-template-columns: 1fr; }
}
.item-body .broker-notice { text-indent: 0; margin-top: 2.4rem; }
.item-body .facts + h2 { margin-top: 3.2rem; }
.tariff input { accent-color: var(--seal); }
@media (max-width: 420px) { .site-head { flex-wrap: wrap; gap: 0.4rem 1rem; } .site-head nav { gap: 0.9rem; font-size: 0.9rem; } }

/* ───────── 대문 : 붓이 쓰고 먹이 번진다 ───────── */
.ink-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.gate-page {
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .39 0 0 0 0 .34 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.gate-page .verse {
  writing-mode: horizontal-tb;
  display: flex;
  flex-direction: row-reverse;
  gap: clamp(0.4rem, 1.6vw, 1.4rem);
  letter-spacing: 0;
  font-size: inherit;
  line-height: 1;
}
.gate-page .verse .col { display: flex; flex-direction: column; }
.gate-page .verse .ch {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 42%, transparent 58%);
          mask-image: linear-gradient(to bottom, #000 0, #000 42%, transparent 58%);
  -webkit-mask-size: 100% 260%; mask-size: 100% 260%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0 100%; mask-position: 0 100%;
  opacity: 1;
  animation: brush-write 0.9s cubic-bezier(.5,.05,.4,1) var(--d) forwards;
}
.gate-page .verse .ink { fill: #1b1917; }
.gate-page .verse .bleed {
  fill: #1b1917;
}
.gate-page .verse .seal {
  position: absolute;
  left: clamp(-4.2rem, -6vw, -3.2rem);
  bottom: 0.2rem;
  width: clamp(2.8rem, 4.6vw, 3.8rem);
  height: auto;
  display: block;
  border: 0;
  border-radius: 0;
  transform: rotate(-3deg);
  opacity: 1;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(circle at 46% 52%, #000 0, #000 30%, rgba(0,0,0,.45) 42%, transparent 56%);
          mask-image: radial-gradient(circle at 46% 52%, #000 0, #000 30%, rgba(0,0,0,.45) 42%, transparent 56%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 50% 50%; mask-position: 50% 50%;
  -webkit-mask-size: 0% 0%; mask-size: 0% 0%;
  animation: seal-drop 2.8s cubic-bezier(.1,.55,.25,1) var(--seal, 8s) forwards;
}
.gate-page .verse-text { font-size: clamp(3.2rem, 7vw, 5.6rem); writing-mode: vertical-rl; }
.gate-page .gate-words { opacity: 0; animation: words-in 1.2s ease var(--after, 6.5s) forwards; }
.gate-words .reading-en { color: var(--smoke); font-size: 0.82rem; font-style: italic; letter-spacing: 0.01em; margin: -2.8rem 0 3.2rem; }

@keyframes brush-write { from { -webkit-mask-position: 0 100%; mask-position: 0 100%; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes ink-bleed { 0% { opacity: 0; transform: scale(0.94); } 18% { opacity: 0.42; } 100% { opacity: 0.2; transform: scale(1.07); } }
@keyframes seal-press { 0% { opacity: 0; transform: rotate(-3deg) scale(1.25); } 60% { opacity: 1; transform: rotate(-3deg) scale(0.97); } 100% { opacity: 1; transform: rotate(-3deg) scale(1); } }
@keyframes words-in { to { opacity: 1; } }

.gate-done .gate-page .verse .ch, html.gate-done .verse .ch { animation: none; -webkit-mask-image: none; mask-image: none; }

html.gate-done .verse .seal { animation: none; opacity: 1; transform: rotate(-3deg); }
html.gate-done .gate-words { animation: none; opacity: 1; }

@media (max-width: 760px) {
  .gate-page .verse { justify-self: center; }
  
  .gate-page .verse .seal { left: -2.9rem; width: 2.6rem; }
  .gate-page .gate-words { animation-delay: 0.6s; }
}

/* 헌장의 항, 서사의 짧은 단락 */
.reading-page .clause { text-indent: 0; padding-left: 1em; margin: 0 0 0.45em; }
.reading-page .article + .clause, .reading-page .article + p { margin-top: -0.3em; }
.reading-page .article { margin-top: 1.6em; }
.epic p { text-indent: 0; text-align: left; margin: 0 0 1.4em; }
.epic .law { margin: 2.4rem 0 0; }

.gate-page .verse .seal-soak {
  position: absolute; left: clamp(-4.2rem, -6vw, -3.2rem); bottom: 0.2rem;
  width: clamp(2.8rem, 4.6vw, 3.8rem); height: auto; transform: rotate(-3deg);
  mix-blend-mode: multiply; filter: blur(5px); opacity: 0;
  animation: seal-soak 4.5s cubic-bezier(.1,.55,.25,1) calc(var(--seal, 8s) + 0.4s) forwards;
}
@keyframes seal-soak { 0% { opacity: 0; transform: rotate(-3deg) scale(0.96); } 20% { opacity: 0.35; } 100% { opacity: 0.18; transform: rotate(-3deg) scale(1.08); } }
html.gate-done .verse .seal-soak { animation: none; opacity: 0.18; transform: rotate(-3deg) scale(1.08); }
@media (max-width: 760px) { .gate-page .verse .seal-soak { left: -2.9rem; width: 2.6rem; } }

@keyframes seal-drop {
  0%   { -webkit-mask-size: 0% 0%; mask-size: 0% 0%; filter: blur(3px); }
  35%  { filter: blur(1.2px); }
  100% { -webkit-mask-size: 320% 320%; mask-size: 320% 320%; filter: blur(0); }
}
html.gate-done .verse .seal { -webkit-mask-image: none; mask-image: none; filter: none; }

.gate-page .verse .cell { position: relative; display: block; width: clamp(4.4rem, 9.6vw, 8.2rem); margin: -0.35rem 0; }
.gate-page .verse .bleed-svg { position: absolute; inset: 0; width: 100%; height: auto; overflow: visible; opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity; animation: ink-bleed 5s cubic-bezier(.15,.6,.3,1) calc(var(--d) + 0.85s) forwards; }
html.gate-done .verse .bleed-svg { animation: none; opacity: 0.2; transform: scale(1.07); }
@media (max-width: 760px) { .gate-page .verse .cell { width: clamp(3.4rem, 17vw, 4.6rem); } }

/* 머리 메뉴는 어느 페이지에서나 위에 떠 있다 */
.site-head {
  position: sticky; top: 0; z-index: 50;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
  background: rgba(246,245,242,0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.site-head.scrolled { border-bottom-color: var(--line); }
html { scroll-padding-top: 4.5rem; }

/* 시장의 영역 메뉴 : 시장 안에서는 어디를 보든 머리 메뉴 아래에 떠 있다 */
.area-nav {
  position: sticky; top: var(--head-h, 4.3rem); z-index: 40;
  margin: 0 0 1rem; padding: 0.75rem 0;
  background: rgba(246,245,242,0.94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.area-nav a.on { color: var(--ink); font-weight: 600; }
.market-page { scroll-padding-top: calc(var(--head-h, 4.3rem) + 3.6rem); }
.item .area-nav { margin-bottom: 0.5rem; }
@media (max-width: 760px) {
  .area-nav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .area-nav::-webkit-scrollbar { display: none; }
}

/* 언어 전환 */
.site-head nav { align-items: baseline; }
.site-head .langs { display: inline-flex; gap: 0.55rem; margin-left: 0.6rem; padding-left: 1rem; border-left: 1px solid var(--line); font-size: 0.82rem; }
.site-head .langs a { color: var(--smoke); text-decoration: none; }
.site-head .langs a[aria-current] { color: var(--ink); font-weight: 600; }
html[lang="zh-Hans"] body { font-family: "Noto Serif SC", "Noto Serif KR", serif; }
html[lang="ja"] body { font-family: "Noto Serif JP", "Noto Serif KR", serif; }
html[lang="en"] .reading-page p, html[lang="en"] .item-body p { word-break: normal; text-indent: 0; text-align: left; hyphens: auto; }
html[lang="zh-Hans"] .reading-page p, html[lang="ja"] .reading-page p { line-break: strict; }
.reading-page .epigraph .pron { color: var(--smoke); font-size: 0.92rem; margin-bottom: 0.3rem; }
@media (max-width: 760px) {
  .site-head { flex-wrap: wrap; gap: 0.3rem 1rem; }
  .site-head nav { flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.88rem; }
  .site-head .langs { margin-left: 0; padding-left: 0; border-left: 0; }
}

/* 서가 */
.shelf-page { max-width: 64rem; margin: 0 auto; padding: 1rem clamp(1.25rem, 5vw, 3rem) 2rem; }
.shelf-page .shelf-row { border-top: 1px solid var(--line); padding: 2rem 0 1rem; }
.shelf-page .shelf-row h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1.4rem; }
.books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 2rem 1.6rem; }
.book .spine { aspect-ratio: 3 / 4; background: #ecebe7; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 0.9rem; margin: 0 0 0.8rem; position: relative; }
.book .spine .btitle { font-weight: 600; font-size: 1rem; line-height: 1.45; }
.book .spine .bauthor { font-size: 0.78rem; color: var(--smoke); }
.book .spine .own { position: absolute; top: 0.55rem; right: 0.6rem; width: 1.5rem; height: 1.5rem; border: 1.5px solid var(--seal); color: var(--seal); font-size: 0.72rem; display: grid; place-items: center; border-radius: 2px; transform: rotate(-4deg); }
.book .orig { font-size: 0.78rem; color: var(--smoke); margin: 0 0 0.2rem; }
.book .bline { font-size: 0.86rem; line-height: 1.6; margin: 0 0 0.4rem; }
.book .soon { font-size: 0.78rem; color: var(--smoke); }
.shelf-page .own-note { font-size: 0.86rem; color: var(--smoke); margin: 0 0 2rem; }
.book .spine .btitle { padding-right: 1.9rem; }

/* 파트너와 관리 화면 */
.partner-page, .admin-page { max-width: 44rem; }
.reading-page .form-box h2.box-title { margin-top: 0; font-size: 1.15rem; }
.reading-page .form-box .help, .reading-page .help { display: block; font-size: 0.82rem; color: var(--smoke); margin: -0.2rem 0 0.4rem; text-indent: 0; }
.reading-page .form-box select.field, .reading-page .form-box textarea.field { font-family: inherit; }
.req { color: var(--seal); font-size: 0.72rem; font-weight: 600; margin-left: 0.3rem; }
.form-msg { color: var(--seal); font-size: 0.9rem; min-height: 1.2em; text-indent: 0; }
.form-msg.ok { color: #2f6b3a; }
.row2, .row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.actions .btn { width: auto; padding: 0.7rem 1.4rem; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.danger { border-color: var(--seal); color: var(--seal); }
.btn.small { display: inline-block; width: auto; padding: 0.4rem 1rem; font-size: 0.88rem; }
.preview { display: block; max-width: 12rem; margin: 0.6rem 0; border: 1px solid var(--line); }
.consent-title { font-size: 1rem; margin: 2rem 0 0.4rem; }
.consent { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.consent .check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.consent .check input { margin-top: 0.35rem; accent-color: var(--seal); }
.consent details { margin: 0.4rem 0 0 1.5rem; font-size: 0.85rem; }
.consent summary { cursor: pointer; color: var(--smoke); }
.legal-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1rem; font-size: 0.86rem; }
.legal-table th, .legal-table td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
.legal-table th { background: #efede9; font-weight: 600; white-space: nowrap; }
.draft-note { text-indent: 0 !important; color: var(--seal); border: 1px solid var(--seal); padding: 0.5rem 0.8rem; font-size: 0.88rem; }
.legal-page p { text-align: left; }
.item-list { list-style: none; padding: 0; }
.item-list li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: baseline; }
.item-list a { text-decoration: none; font-weight: 600; }
.kind { font-size: 0.75rem; color: var(--smoke); border: 1px solid var(--line); padding: 0 0.4em; border-radius: 3px; font-weight: 400; }
.st { font-size: 0.78rem; padding: 0 0.5em; border-radius: 3px; background: #ecebe7; }
.st-published, .st-approved { background: #e3efe5; color: #2f6b3a; }
.st-review, .st-pending { background: #f6ecd9; color: #8a5a12; }
.st-rejected { background: #f6e1df; color: var(--seal); }
.note { width: 100%; font-size: 0.82rem; color: var(--seal); }
.who { font-size: 0.9rem; color: var(--smoke); text-indent: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; margin-bottom: 1.4rem; }
.tabs a { text-decoration: none; color: var(--smoke); }
.tabs a.on { color: var(--ink); font-weight: 600; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; margin: 0 0 1rem; background: #fbfaf8; }
.card p { text-indent: 0; margin: 0 0 0.6rem; }
.card .field { margin: 0.6rem 0; }
@media (max-width: 760px) { .row2, .row3 { grid-template-columns: 1fr; } }
.spine.has-cover { background-size: cover; background-position: center; }
.spine.has-cover .btitle, .spine.has-cover .bauthor, .spine.has-cover .own { visibility: hidden; }
.buy-links { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; font-size: 0.85rem; text-indent: 0; margin: 0.3rem 0 0; }
.sheet .agree { display: flex; gap: 0.45rem; align-items: flex-start; font-size: 0.85rem; margin: 0.35rem 0; font-weight: 400; }
.sheet .agree input { margin-top: 0.3rem; accent-color: var(--seal); }
.sheet .agree a { color: inherit; }
.reading-page .form-box .f label { margin-top: 0.9rem; }

/* 책 소개 화면 */
.book-page { max-width: 60rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.book-page .crumb { font-size: 0.9rem; margin: 0 0 1.6rem; }
.book-page .crumb a { color: var(--smoke); text-decoration: none; }
.book-detail { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 2.4rem; align-items: start; }
.book-cover img { width: 100%; display: block; border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,0.12); }
.book-cover .spine.big { aspect-ratio: 3 / 4; background: #ecebe7; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 1.4rem; }
.book-cover .spine.big .btitle { font-weight: 600; font-size: 1.3rem; line-height: 1.45; }
.book-cover .spine.big .bauthor { font-size: 0.85rem; color: var(--smoke); }
.book-info h1 { font-size: 1.9rem; margin: 0 0 0.3rem; line-height: 1.35; }
.book-info .orig, .book-info .subtitle { color: var(--smoke); margin: 0 0 0.3rem; }
.book-info .author { margin: 0 0 1.4rem; }
.book-info .line { font-size: 1.1rem; line-height: 1.8; border-left: 2px solid var(--seal); padding-left: 1rem; margin: 0 0 1.6rem; }
.book-info h2 { font-size: 1rem; margin: 2rem 0 0.7rem; }
.buy-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.buy-row .btn { width: auto; padding: 0.7rem 1.3rem; }
.book-info .btn-note { margin-top: 0.8rem; }
.book-info .own-note { margin-top: 1.6rem; font-size: 0.85rem; }
.book .spine, .book .bline { cursor: pointer; }
.book a.book-link { color: inherit; text-decoration: none; display: block; }
@media (max-width: 760px) { .book-detail { grid-template-columns: 1fr; } .book-cover { max-width: 14rem; } }
.book-info .soon { font-size: 0.95rem; color: var(--smoke); margin: 0; }
/* 시장 안의 서가 칸 */
.market .shelf-how { font-size: 0.88rem; color: var(--smoke); margin: -0.4rem 0 1rem; }
.book-card .plate.has-cover { background-size: cover; background-position: center; aspect-ratio: 3 / 4; }
.book-card .price { color: var(--smoke); font-weight: 400; }
/* 사업자 정보 명판 */
.site-foot .biz { display: flex; flex-wrap: wrap; gap: 0.15rem 1.2rem; font-size: 0.78rem; color: var(--smoke); line-height: 1.7; max-width: 60rem; }
.site-foot .biz b { font-weight: 600; }
.site-foot .biz a { color: inherit; }
/* 첫 화면 문구 : 上品 */
.gate-words .motto { font-size: 1.5rem; font-weight: 600; line-height: 1.75; letter-spacing: -0.01em; margin: -1rem 0 3.4rem; padding-top: 1.3rem; position: relative; }
.gate-words .motto::before { content: ""; position: absolute; top: 0; left: 0; width: 2.2rem; height: 2px; background: var(--seal); }
.gate-words .motto ruby.jp { ruby-position: over; color: var(--seal); font-size: 1.55em; font-weight: 600; letter-spacing: 0.02em; margin: 0 0.02em 0 0.1em; }
.gate-words .motto ruby.jp rt { font-size: 0.34em; font-weight: 400; color: var(--smoke); letter-spacing: 0.08em; }
@media (max-width: 760px) { .gate-words .motto { font-size: 1.3rem; } }
/* 첫 화면 한 장 : 본문을 화면 높이 한 장 안 세로 가운데에 둔다 */
@media (min-width: 761px) {
  .gate-page .gate { min-height: calc(100vh - var(--head-h, 4.4rem)); box-sizing: border-box; padding-top: 2rem; padding-bottom: 2rem; align-items: center; }
  .gate-page .verse { align-self: start; margin-top: 0.4rem; }
  .gate-page .gate-words .reading { margin-bottom: 0.4rem; }
  .gate-page .gate-words .source { margin: 0 0 0.2rem; font-size: 0.82rem; }
  .gate-page .gate-words .reading-en { margin: 0 0 1.8rem; font-size: 0.78rem; }
  .gate-page .gate-words .motto { margin: 0 0 1.8rem; padding-top: 1rem; }
  .gate-page .doors li { padding: 0.75rem 0; }
  .gate-page .doors .door-name { font-size: 1.08rem; }
  .gate-page .doors .door-note { font-size: 0.86rem; }
}
@media (min-width: 761px) {
  .gate-page .gate { align-items: start; align-content: center; }
  .gate-page .verse { margin-top: 0.9rem; }
}
@media (min-width: 761px) and (max-height: 840px) {
  .gate-page .gate { padding-top: 1.2rem; padding-bottom: 1.2rem; }
  .gate-page .gate-words .reading { font-size: 1.4rem; line-height: 1.6; }
  .gate-page .gate-words .reading-en { margin-bottom: 1.3rem; }
  .gate-page .gate-words .motto { font-size: 1.35rem; margin-bottom: 1.3rem; padding-top: 0.8rem; line-height: 1.65; }
  .gate-page .doors li { padding: 0.6rem 0; }
}

/* 上品 문구 : 한 줄, 큰따옴표 */
@media (min-width: 761px) { .gate-page .gate-words .motto { white-space: nowrap; } }
.gate-page .gate-words .motto { position: relative; padding-top: 0.6rem; }
.gate-page .gate-words .motto::before { display: none; }
.gate-words .motto .q { font-family: Georgia, "Times New Roman", serif; color: var(--seal); font-weight: 400; line-height: 0; font-size: 2.6em; position: relative; }
.gate-words .motto .q-open { position: absolute; left: -0.5em; top: 0.86em; }
.gate-words .motto .q-close { top: 0.34em; margin-left: 0.08em; }
@media (max-width: 760px) { .gate-words .motto .q-open { position: relative; left: 0; top: 0.42em; margin-right: 0.06em; } .gate-page .gate-words .motto { font-size: 1.2rem; } }
html[lang^="zh"] .gate-words .motto, html[lang^="ja"] .gate-words .motto { font-size: 1.3rem; }
/* 초서를 조금 굵게 */
.gate-page .verse .ink { stroke: #1b1917; stroke-width: 16; stroke-linejoin: round; paint-order: stroke; }
/* 첫 화면 : 장터로 들어가는 문지방, 바랜 금색 한 줄 */
.gate-page .doors li:first-child { border-top: 2px solid #a8894e; }
/* 격식 : 두인, 관지, 성명인 */
.gate-page .verse .duin, .gate-page .verse .gwanji, .gate-page .verse .name-seal { position: absolute; display: block; height: auto; mix-blend-mode: multiply; opacity: 0; animation: words-in 1s ease forwards; }
.gate-page .verse .duin { right: clamp(-2.8rem, -3.4vw, -2rem); top: 6%; width: clamp(1.4rem, 2.1vw, 1.8rem); animation-delay: 0.3s; }
.gate-page .verse .gwanji { left: clamp(-2.95rem, -3.7vw, -2.25rem); bottom: calc(clamp(2.8rem, 4.6vw, 3.8rem) + clamp(2.1rem, 3.2vw, 2.8rem) + 2rem); width: clamp(1.05rem, 1.5vw, 1.3rem); animation-delay: calc(var(--seal, 8s) - 1.2s); }
.gate-page .verse .name-seal { left: clamp(-3.4rem, -4.3vw, -2.65rem); bottom: calc(clamp(2.8rem, 4.6vw, 3.8rem) + 1rem); width: clamp(2.1rem, 3.2vw, 2.8rem); transform: rotate(1.5deg); animation-delay: calc(var(--seal, 8s) - 0.4s); }
html.gate-done .verse .duin, html.gate-done .verse .gwanji, html.gate-done .verse .name-seal { animation: none; opacity: 1; }
@media (max-width: 760px) {
  .gate-page .verse .gwanji { width: 0.5rem; left: -1.7rem; bottom: calc(2.6rem + 1.9rem + 1.3rem); }
  .gate-page .verse .name-seal { width: 1.9rem; left: -2.3rem; bottom: calc(2.6rem + 0.7rem); }
  .gate-page .verse .duin { width: 1.05rem; right: -1.6rem; }
}
/* 서가 카드 : 긴 제목이 칸을 밀어내지 않게 */
.books .book { min-width: 0; }
.books .book .btitle, .books .book .bline { overflow-wrap: anywhere; }
.book .to-book { font-size: 0.82rem; margin: 0.4rem 0 0; text-indent: 0; }
.book .to-book a { color: var(--smoke); text-decoration: none; }
.book .to-book a:hover { color: var(--seal); }
html.shelf-loading .book .soon { visibility: hidden; }
