/* 디자인 시스템: docs/design/design-system.md */
:root {
  --bg: #ffffff;
  --panel: #ee2828;
  --panel-soft: #fde6e6;
  --ink: #0e0e0e;
  --muted: #6a5d5a;
  --line: #ecdcdc;
  --card: #ffffff;
  --footer: #0e0e0e;
  --r-panel: 28px;
  --r-card: 20px;
  --shadow: 0 8px 24px rgba(14, 14, 14, 0.08);
  --display: "Archivo", "Pretendard Variable", sans-serif;
  --text: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--text); word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 헤더 */
.top { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.mark { width: 22px; height: 22px; }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .nav { display: none; } .top .btn-pill { margin-left: auto; } }

/* 버튼 */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 22px; font-weight: 500; font-size: 14px; text-decoration: none;
}
.btn-pill[disabled] { opacity: 0.6; cursor: default; }
.btn-round {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--ink); color: #fff; display: grid; place-items: center;
}
.btn-round svg { width: 20px; height: 20px; }
.btn-round:disabled { opacity: 0.6; cursor: wait; }

/* 히어로 */
.hero { background: var(--panel); border-radius: var(--r-panel); padding: 8px 32px 36px; overflow: hidden; container-type: inline-size; position: relative; }
.mega {
  font-family: var(--display); font-stretch: 125%; font-weight: 900;
  font-size: min(16.5cqi, 184px); line-height: 0.86; letter-spacing: -0.02em;
  color: #fff; margin: 12px 0 20px; white-space: nowrap;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: end; }
h1 { font-size: clamp(22px, 2.8vw, 32px); line-height: 1.35; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 20px; max-width: 20em; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px;
  padding: 6px 6px 6px 22px; max-width: 640px; box-shadow: var(--shadow);
}
.search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; background: transparent; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.chips-label { font-size: 13px; font-weight: 500; margin-right: 4px; }
.chip {
  border: 1px solid rgba(14, 14, 14, 0.25); background: rgba(255, 255, 255, 0.55);
  color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.chip:hover { background: #fff; }
.hero-note { font-size: 14px; color: #3b2b28; margin: 18px 0 0; }
.trust { background: var(--card); border-radius: var(--r-card); padding: 20px 22px; box-shadow: var(--shadow); }
.trust-title { font-weight: 600; margin: 0 0 10px; }
.trust ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.trust li { padding-left: 14px; position: relative; }
.trust li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
@media (max-width: 860px) {
  .hero { padding: 4px 20px 24px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* 답변 */
.answers { display: grid; gap: 16px; margin-top: 20px; }
.answers:empty { display: none; }
.answer { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; }
.answer .q { font-weight: 600; margin: 0 0 10px; }
.answer .a { margin: 0; white-space: pre-wrap; }
.answer .err { color: #8a3b12; margin: 0; }
.answer .label { display: inline-block; margin: 0 0 8px; font-size: 12px; font-weight: 500; background: var(--panel-soft); border-radius: 999px; padding: 2px 10px; }
.answer .src { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
.answer .src a { color: var(--ink); }
.answer .note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.answer .btn-pill { margin-top: 16px; }

/* 섹션 */
.section { margin-top: 72px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 32px; margin-bottom: 24px; }
h2 { font-size: clamp(26px, 4vw, 40px); line-height: 1.2; font-weight: 600; letter-spacing: -0.03em; margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* 가이드 카드 */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 20px; min-height: 210px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card);
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.card:nth-child(8n+2), .card:nth-child(8n+7) { background: var(--panel-soft); border-color: transparent; }
.card-no { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 13px; color: var(--muted); }
.card h3 { font-size: 17px; line-height: 1.35; font-weight: 600; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; background: #fff; }
.card-q { font-size: 13px; color: var(--muted); margin: 0; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 500; }
.card .btn-round { width: 38px; height: 38px; pointer-events: none; }
.card .btn-round svg { width: 16px; height: 16px; }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } .card { min-height: 0; } }

/* 가이드 팝업 */
.modal { border: 0; padding: 0; border-radius: var(--r-panel); width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 48px); background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgba(14, 14, 14, 0.25); }
.modal::backdrop { background: rgba(14, 14, 14, 0.45); }
.modal-inner { padding: 24px 28px 28px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.modal-close svg { width: 18px; height: 18px; }
.modal h2 { font-size: clamp(22px, 3vw, 28px); margin: 8px 0 12px; }
.modal-body { margin-top: 18px; }
.modal-body .summary { background: var(--panel-soft); border-radius: 16px; padding: 14px 18px; margin: 0 0 20px; }
.modal-body h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; }
.modal-body ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.modal-body .srcs { list-style: none; padding: 0; font-size: 14px; }

.modal-body .srcs span { color: var(--muted); }
.modal-body .empty { color: var(--muted); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn-ghost { border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 10px 22px; font-weight: 500; font-size: 14px; }
.btn-ghost[disabled] { opacity: 0.5; cursor: default; }
@media (max-width: 560px) {
  .modal { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .modal-inner { padding: 18px 16px 28px; }
}

/* 업체 띠 */
.band { background: var(--panel); border-radius: var(--r-panel); padding: 28px 32px 32px; }
.pill-label { display: inline-block; background: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 500; }
.band-grid { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-top: 16px; }
.band-grid h2 { max-width: 9.5em; }
.band-grid p { margin: 0 0 18px; color: #3b2b28; font-size: 15px; }
@media (max-width: 860px) { .band { padding: 22px 20px 24px; } .band-grid { grid-template-columns: minmax(0, 1fr); } }

/* 푸터 */
.foot { background: var(--footer); color: #fff; margin-top: 80px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; padding-top: 36px; padding-bottom: 40px; }
.foot-brand { font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.foot-text { margin: 0; font-size: 13px; color: #b9bfbe; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } }
.modal-close:focus-visible, .btn-pill:focus-visible, .btn-ghost:focus-visible, .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.modal-close:focus:not(:focus-visible) { outline: none; }
.trust strong, .answer .src strong { font-weight: 600; }
.answer .src a { font-weight: 500; }
.modal-body .srcs a { font-weight: 500; }

/* 이미지 배치 */
.hero-side { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: -150px; }
.hero-person { display: block; height: 280px; width: auto; margin-bottom: -22px; position: relative; z-index: 0; pointer-events: none; }
.hero-side .trust { position: relative; z-index: 1; width: 100%; }
.band-photo { display: block; width: 100%; height: 280px; object-fit: cover; object-position: center 60%; border-radius: var(--r-panel); }
.band-photo + .band { position: relative; margin: -72px 24px 0; background: rgba(238, 40, 40, 0.95); }
@media (max-width: 860px) {
  .hero-side { margin-top: 0; }
  .hero-person { height: 220px; }
  .band-photo { height: 180px; }
  .band-photo + .band { margin: -40px 12px 0; }
}

/* 첫 화면 가이드는 두 줄까지만 */
.grid.preview .card:nth-child(n+9) { display: none; }
@media (max-width: 1024px) { .grid.preview .card:nth-child(n+5) { display: none; } }
@media (max-width: 560px) { .grid.preview .card:nth-child(n+5) { display: none; } }
.section-head .more { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.section-head .more .btn-round { width: 38px; height: 38px; }
.section-head .more .btn-round svg { width: 16px; height: 16px; }
.head-right { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.section.first { margin-top: 24px; }
.hero > :not(.hero-star) { position: relative; }

/* 카드 링크: 제목만 링크지만 카드 전체를 누를 수 있게 한다 */
.card-link { color: inherit; text-decoration: none; }
.card { position: relative; }

/* 가이드·질문 개별 페이지 */
.article { max-width: 820px; padding-top: 24px; padding-bottom: 40px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); }
.article h1 { font-size: clamp(26px, 4vw, 38px); margin: 8px 0 12px; max-width: none; }
.article .summary { background: var(--panel-soft); border-radius: 16px; padding: 16px 20px; margin: 20px 0; }
.article-body h2 { font-size: 20px; font-weight: 600; margin: 28px 0 10px; letter-spacing: -0.02em; }
.article-body ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.article-body .srcs { list-style: none; padding: 0; font-size: 14px; }
.article-body .srcs span, .updated, .faq-meta { color: var(--muted); }
.article-body.faq section { border-bottom: 1px solid var(--line); padding: 4px 0 18px; }
.article-body.faq h2 { font-size: 18px; }
.article-body.faq p { margin: 0 0 8px; }
.faq-meta { font-size: 13px; }
.updated { font-size: 13px; margin-top: 28px; }
.article .modal-actions .btn-ghost { text-decoration: none; display: inline-flex; align-items: center; }
.related { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 20px; }
.related h2 { font-size: 18px; margin: 0 0 10px; }
.related ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* 빨간 패널 안 글자는 흰색으로 반전 */
.hero, .band { color: #fff; }
.hero .hero-note, .band-grid p { color: rgba(255, 255, 255, 0.92); }
.hero .chips-label { color: #fff; }
.hero .chip { border-color: rgba(255, 255, 255, 0.7); background: transparent; color: #fff; }
.hero .chip:hover { background: #fff; color: var(--panel); }
.hero .search, .hero .trust { color: var(--ink); }
.band .pill-label { color: var(--panel); }
.band .btn-pill { background: #fff; color: var(--panel); }
.hero .chip:focus-visible, .band .btn-pill:focus-visible { outline-color: #fff; }
.hero-star { position: absolute; z-index: 0; width: 150px; height: 150px; left: -40px; top: 105px; pointer-events: none; }
@media (max-width: 860px) { .hero-star { width: 96px; height: 96px; left: auto; right: 4px; top: 30px; } }
