/* =========================================================
   주소팡 - 공통 스타일
   ========================================================= */

/* ---------- 색상 토큰 (라이트) ---------- */
:root {
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --line: #e3e7ee;
  --ink: #16233a;
  --text: #3d4a63;
  --muted: #6b7689;
  --brand: #1d4e89;
  --brand-ink: #ffffff;
  --brand-soft: #e8eff8;
  --accent: #c2742f;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf2e3;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --shadow: 0 1px 2px rgba(22, 35, 58, .05), 0 4px 16px rgba(22, 35, 58, .04);
  --radius: 12px;
  --max: 1152px;
}

/* ---------- 색상 토큰 (다크) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0f1522;
    --surface: #151d2d;
    --surface-2: #1b2537;
    --line: #26324a;
    --ink: #eef2f8;
    --text: #c3cbda;
    --muted: #8c97ab;
    --brand: #5b93d6;
    --brand-ink: #0b1220;
    --brand-soft: #1c2a42;
    --accent: #e09a5c;
    --ok: #4ade80;
    --ok-soft: #14301f;
    --warn: #f5b04f;
    --warn-soft: #352816;
    --danger: #f87171;
    --danger-soft: #3a1a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --canvas: #0f1522;
  --surface: #151d2d;
  --surface-2: #1b2537;
  --line: #26324a;
  --ink: #eef2f8;
  --text: #c3cbda;
  --muted: #8c97ab;
  --brand: #5b93d6;
  --brand-ink: #0b1220;
  --brand-soft: #1c2a42;
  --accent: #e09a5c;
  --ok: #4ade80;
  --ok-soft: #14301f;
  --warn: #f5b04f;
  --warn-soft: #352816;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* ---------- 기본 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.3; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}

/* ---------- 섹션 ---------- */
.sec { padding: 80px 0; }
.sec.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { margin-bottom: 36px; max-width: 720px; }
.sec-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.sec-head p { margin: 10px 0 0; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.note a { color: var(--brand); }

/* ---------- 버튼 / 칩 / 배지 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 700; font-size: 14px;
}
.btn:hover { filter: brightness(1.08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip {
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--text);
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hd { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
}
.logo b { display: block; color: var(--ink); font-size: 17px; line-height: 1.2; }
.logo small { display: block; color: var(--muted); font-size: 11px; }

.gnb { display: flex; gap: 4px; }
.gnb a { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.gnb a:hover { background: var(--surface-2); color: var(--ink); }

.hd-tools { display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
#menuBtn { display: none; }

.mnav { display: none; border-top: 1px solid var(--line); padding: 8px 20px 16px; background: var(--surface); }
.mnav a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.mnav.open { display: block; }

/* ---------- 히어로 ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 64px 0; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.hero h1 {
  font-family: Hahmlet, "Pretendard Variable", serif;
  font-size: 42px; font-weight: 700; letter-spacing: -.02em;
}
.hero .lead { margin: 18px 0 26px; font-size: 17px; }

.info-stack { display: grid; gap: 12px; }
.info {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.info .k { font-size: 12px; color: var(--muted); }
.info .v { font-weight: 800; color: var(--ink); margin: 4px 0 2px; font-size: 16px; }
.info p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 소개 (주소모음이란) ---------- */
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
.two p { margin: 0 0 14px; }
.two h2 { font-size: 30px; font-weight: 800; margin-bottom: 18px; }
.cmp { display: grid; gap: 12px; align-content: start; }
.cmp > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.cmp .k { font-size: 12px; color: var(--accent); font-weight: 700; }
.cmp h3 { font-size: 17px; margin: 4px 0 6px; }
.cmp p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- 카테고리 카드 ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cat {
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.cat:hover { border-color: var(--brand); transform: translateY(-2px); }
.cat-top { display: flex; align-items: center; gap: 10px; }
.cat-ic {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink); color: var(--surface);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.cat h3 { font-size: 18px; }
.cat p { font-size: 14px; color: var(--muted); margin: 10px 0 14px; flex: 1; }
.cat .more { font-size: 13px; font-weight: 700; color: var(--brand); }

/* ---------- 단계 카드 ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- 통계 / 표 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--canvas); }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .n { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .n.sm { font-size: 22px; padding: 6px 0; }
.stat small { font-size: 12px; color: var(--muted); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
td b { color: var(--ink); }
.tbl-wrap.wrap-text td { white-space: normal; }

/* ---------- 이용 팁 ---------- */
.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tip { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tip .no { font-family: Hahmlet, serif; font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1; }
.tip h3 { font-size: 16px; margin-bottom: 4px; }
.tip p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- 위험 신호 ---------- */
.warns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.warn-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  background: var(--danger-soft); color: var(--text); font-size: 14px;
}
.warn-item i {
  font-style: normal; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--danger); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px;
}

/* ---------- FAQ ---------- */
.faq { max-width: 820px; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0;
  font-weight: 700; color: var(--ink);
  display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; font-size: 15px; }

/* ---------- 푸터 ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0 32px; font-size: 14px; }
.ft { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.ft h4 { margin: 0 0 10px; font-size: 14px; }
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--muted); }
.ft a:hover { color: var(--brand); }
.ft-desc { color: var(--muted); margin: 14px 0 0; max-width: 360px; }
.copy {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

.top-btn {
  position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: var(--surface); border: 0; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: var(--shadow);
}
.top-btn.show { opacity: 1; pointer-events: auto; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .gnb { display: none; }
  #menuBtn { display: grid; }
  .hero { padding: 44px 0; }
  .hero-grid, .two { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .steps, .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sec { padding: 56px 0; }
  .sec-head h2, .two h2 { font-size: 24px; }
  .tips, .warns, .ft { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
}
