/* ==========================================================================
   오라클마크 (OracleMark) — 기본 타이포그래피 · 지류 질감 · 레이아웃 · 간기(Header/Footer)
   ========================================================================== */
:root {
  --bg1: #110d09;
  --bg2: #18120c;
  --surface: #1d160f;
  --surface-raised: #251c13;
  --surface-inset: #130e09;
  --text: #f2e5c9;
  --muted: #b5a282;
  --accent: #d49b38;
  --accent2: #c4281c;
  --seal-ink: #b82216;
  --seal-text: #fbf3e4;
  --border-strong: rgba(212, 155, 56, 0.42);
  --border-fine: rgba(212, 155, 56, 0.18);
  --line: rgba(212, 155, 56, 0.24);
  --ink-shadow: rgba(0, 0, 0, 0.78);
  --radius: 2px;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --display: 'Cinzel', 'Noto Serif KR', serif;
  --maxw: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.68;
  min-height: 100vh;
  background-color: var(--bg1);
  /* 한지 발문(簾紋) 가로결 + 목판 먹물 농담 */
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 245, 220, 0.014) 0px,
      rgba(255, 245, 220, 0.014) 1px,
      transparent 1px,
      transparent 5px
    ),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg1) 100%);
  background-attachment: fixed;
  transition: background-color 0.35s ease, color 0.25s ease;
  overflow-x: hidden;
  position: relative;
}

/* 문화권 목판 기하 격자 문양 레이어 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: var(--pattern, none);
  background-size: var(--pattern-size, 64px);
  opacity: 0.9;
}

/* SVG 종이 섬유 질감 오버레이 */
.grain-svg {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.paper-grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  filter: url(#uiPaperGrain);
  opacity: 0.75;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 4px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.26;
  margin: 0 0 0.55em;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: min(100% - 32px, var(--maxw));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--seal-ink);
  color: var(--seal-text);
  padding: 8px 16px;
  font-weight: 700;
  z-index: 99;
}

.skip:focus {
  left: 8px;
}

/* ── 섹션 표제 (고판화 권수제 · 어미 장식) ── */
.sec-header {
  text-align: center;
  margin-bottom: 28px;
}

.sec-kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: 3px 12px;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 10px;
}

.sec-title {
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  font-weight: 900;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.sec-rule {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  opacity: 0.8;
}

.sec-lead {
  text-align: center;
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto 2rem;
  font-size: 0.96rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.6em 0 0;
  line-height: 1.55;
}

/* ── 상단 간기(Colophon) 및 판각소 헤더 (NO Glassmorphism) ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  box-shadow: 0 3px 0 var(--surface-inset), 0 4px 0 var(--border-fine);
}

.colophon-strip {
  background: var(--surface-inset);
  border-bottom: 1px solid var(--border-fine);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 4px 0;
}

.colophon-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

@media (max-width: 720px) {
  .colophon-in span:last-child {
    display: none;
  }
}

.header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

/* 전각 주인(朱印) 스타일 로고 인장 */
.logo-seal {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--seal-ink);
  color: var(--seal-text);
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.15rem;
  border: 1px solid var(--seal-text);
  outline: 2px solid var(--seal-ink);
  box-shadow: 2px 2px 0 var(--ink-shadow);
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-text strong {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
}

.logo-text small {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.92rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-header nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.site-header .nav-out {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.84rem;
  border: 1px solid var(--border-fine);
  padding: 3px 9px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 판본(Edition) 전환 스탬프 버튼 그룹 */
.edition-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  background: var(--surface-inset);
  padding: 2px;
  gap: 2px;
}

.ed-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.76rem;
  padding: 4px 9px;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s;
}

.ed-btn:hover {
  color: var(--text);
}

.ed-btn.is-active {
  background: var(--seal-ink);
  color: var(--seal-text);
}

@media (max-width: 899px) {
  .site-header nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-in .edition-switch {
    display: none;
  }
}

main {
  display: block;
}

section {
  scroll-margin-top: 84px;
}

.make,
.result,
.about {
  padding-block: 44px 22px;
}

/* ── 하단 간기(Footer Colophon) ── */
.site-footer {
  margin-top: 64px;
  border-top: 2px solid var(--border-strong);
  background: var(--surface-inset);
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
  position: relative;
}

.site-footer::before {
  content: '';
  display: block;
  border-top: 1px solid var(--border-fine);
  margin-top: -36px;
  margin-bottom: 32px;
}

.footer-box {
  position: relative;
}

.footer-seal {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  color: var(--seal-ink);
  border: 2px solid var(--seal-ink);
  padding: 4px 12px;
  margin-bottom: 16px;
  transform: rotate(-1.5deg);
}

.site-footer .disclaimer {
  max-width: 740px;
  margin: 0 auto 1.1em;
  line-height: 1.7;
}

.foot-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  margin-bottom: 10px;
}

.copy {
  font-family: var(--mono);
  font-size: 0.76rem;
  opacity: 0.78;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
