/* 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; }
