/* ============================================================
   여덟글자 · 공통 스타일
   아이덴티티 02 오행(五行)
   ============================================================ */

:root {
  /* 오행 5색 */
  --mok:  #1F7A5C;   /* 목 청 */
  --hwa:  #D6453D;   /* 화 적 */
  --to:   #D9A441;   /* 토 황 */
  --geum: #C9CCC7;   /* 금 백 */
  --su:   #1C2A3A;   /* 수 흑 */

  /* 기본 */
  --bg:      #FAFAF7;
  --surface: #FFFFFF;
  --ink:     #16181A;
  --muted:   #8C9096;
  --muted-2: #4C5157;
  --rule:    #E4E5E0;
  --dark:    #1C2A3A;
  --dark-2:  #24334A;
  --dark-mut:#8FA0B5;
  --dark-rl: #35455C;

  --w: 1140px;
  --r: 4px;
  --shadow: 0 1px 2px rgba(22,24,26,.04), 0 8px 24px rgba(22,24,26,.05);
  --ease: cubic-bezier(.2,.7,.3,1);
}

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

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

body {
  margin: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system,
               BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; margin: 0 auto; }

/* ─────────── 헤더 ─────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,247,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  display: flex; align-items: center; gap: 32px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-name {
  font-size: 20px; font-weight: 800; letter-spacing: -.045em;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; font-size: 15px; font-weight: 500;
  color: var(--muted-2); border-radius: var(--r);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(22,24,26,.04); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 8px; margin-left: auto;
}
.nav-toggle span {
  display: block; width: 20px; height: 1.5px; background: var(--ink);
  margin: 4px 0; transition: transform .2s var(--ease), opacity .2s var(--ease);
}

/* ─────────── 버튼 ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; font-size: 15px; font-weight: 600;
  border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; transition: all .18s var(--ease);
  font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--su); color: #fff; }
.btn-primary:hover { background: #101b28; }
.btn-ghost { border-color: var(--rule); color: var(--muted-2); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn-accent { background: var(--hwa); color: #fff; }
.btn-accent:hover { background: #bf3830; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ─────────── 심볼 ─────────── */
.mark { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.mark span { aspect-ratio: 1; border-radius: 2px; }
.mark.lg { gap: 4px; }
.mark.lg span { border-radius: 4px; }

/* ─────────── 섹션 ─────────── */
section { padding: 88px 0; }
section.tight { padding: 60px 0; }
.dark { background: var(--dark); color: #fff; }
.dark .eyebrow { color: var(--to); }
.dark .lead { color: var(--dark-mut); }
.dark h2, .dark h3 { color: #fff; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}
h1 {
  font-size: clamp(34px, 5.4vw, 54px); font-weight: 800;
  letter-spacing: -.045em; line-height: 1.18; margin: 0 0 20px;
}
h2 {
  font-size: clamp(26px, 3.4vw, 36px); font-weight: 800;
  letter-spacing: -.04em; line-height: 1.28; margin: 0 0 16px;
}
h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -.03em;
  line-height: 1.4; margin: 0 0 10px;
}
h4 {
  font-size: 16px; font-weight: 700; letter-spacing: -.025em;
  margin: 0 0 8px;
}
.lead {
  font-size: 17px; color: var(--muted-2); line-height: 1.8;
  margin: 0 0 24px; max-width: 68ch;
}
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

/* ─────────── 카드 ─────────── */
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 28px;
}
.card-pad-sm { padding: 20px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

.tag {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin-right: 8px; vertical-align: 1px;
}

/* ─────────── 표 ─────────── */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 14px; text-align: left; vertical-align: top; }
thead th {
  background: var(--dark); color: #fff; font-weight: 600; font-size: 14px;
  letter-spacing: -.01em;
}
tbody tr { border-bottom: 1px solid var(--rule); }
tbody tr:last-child { border-bottom: 0; }
tbody td:first-child { font-weight: 600; }
.table-wrap {
  overflow-x: auto; border: 1px solid var(--rule);
  border-radius: var(--r); background: var(--surface);
}

/* ─────────── 명식판 ─────────── */
.chart {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.pillar-label {
  font-size: 12px; color: var(--muted); text-align: center;
  margin-bottom: 7px; letter-spacing: .06em;
}
.glyph {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); position: relative;
  font-size: clamp(24px, 4.6vw, 38px); font-weight: 500;
  line-height: 1; transition: transform .2s var(--ease);
}
.glyph small {
  font-size: 11px; font-weight: 500; color: var(--muted);
  margin-top: 6px; letter-spacing: .02em;
}
.glyph.me { border-color: var(--hwa); border-width: 2px; }
.glyph.me::after {
  content: '일간'; position: absolute; top: -9px; right: -6px;
  background: var(--hwa); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 2px; letter-spacing: .02em;
}
.glyph.empty { color: var(--muted); border-style: dashed; }

/* 오행 막대 */
.ohaeng-bar { display: flex; height: 34px; border-radius: 3px; overflow: hidden; }
.ohaeng-bar i {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; font-style: normal;
  min-width: 0; transition: flex .4s var(--ease);
}

/* ─────────── 폼 ─────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted-2); }
input[type=number], input[type=text], select {
  font-family: inherit; font-size: 15px; padding: 11px 13px;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); color: var(--ink); width: 100%;
  transition: border-color .16s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--su); }
.hint { font-size: 12.5px; color: var(--muted); }

/* ─────────── 유형 격자 ─────────── */
.type-grid { display: grid; grid-template-columns: 30px repeat(10, 1fr); gap: 5px; }
.type-cell {
  aspect-ratio: 1; border-radius: 3px; border: 1px solid transparent;
  cursor: pointer; transition: transform .14s var(--ease), box-shadow .14s var(--ease);
  position: relative;
}
.type-cell:hover { transform: scale(1.12); box-shadow: var(--shadow); z-index: 2; }
.type-cell.active { border-color: var(--ink); border-width: 2px; }
.axis-label {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted-2);
}

/* ─────────── 유틸 ─────────── */
.divider { height: 1px; background: var(--rule); border: 0; margin: 0; }
.note {
  font-size: 13.5px; color: var(--muted); line-height: 1.7;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 100px; font-size: 13px; font-weight: 600;
  background: rgba(22,24,26,.05); color: var(--muted-2);
}
.pill.soon { background: rgba(217,164,65,.16); color: #8a6516; }
.stack { display: flex; flex-direction: column; }
.gap-s { gap: 10px; } .gap-m { gap: 20px; } .gap-l { gap: 40px; }
.center { text-align: center; }
.mt-s { margin-top: 12px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 56px; }
.hangul { font-size: 13px; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* 인용 */
.quote {
  border-left: 3px solid var(--hwa); padding: 4px 0 4px 20px;
  font-size: 18px; line-height: 1.75; color: var(--ink);
}

/* 순서 목록 */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: s; position: relative; padding-left: 44px;
  margin-bottom: 22px;
}
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--su); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.steps li:last-child { margin-bottom: 0; }

/* 체크 목록 */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li {
  position: relative; padding-left: 22px; margin-bottom: 10px;
  color: var(--muted-2);
}
.checks li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 8px; height: 8px; border-radius: 2px; background: var(--mok);
}

/* ─────────── 푸터 ─────────── */
.site-footer {
  background: var(--dark); color: var(--dark-mut);
  padding: 64px 0 40px; font-size: 14px;
}
.site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.site-footer a { color: var(--dark-mut); transition: color .16s var(--ease); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--dark-rl);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px;
}


/* 2단 분할 — 좁은 화면에서 자동으로 한 단 */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split.top { align-items: start; }
.split.wide { grid-template-columns: 1.15fr 1fr; }
.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) {
  .split, .split.wide { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* ─────────── 반응형 ─────────── */
@media (max-width: 900px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  section { padding: 60px 0; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; background: var(--bg);
    border-bottom: 1px solid var(--rule); padding: 12px 24px 20px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-actions { display: none; }
  .g2, .g4 { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 24px repeat(10, 1fr); gap: 3px; }
  .chart { gap: 6px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
