/* ==========================================================================
   집쭉 가이드 — 공용 스타일 (브랜드 시스템 상속)
   메인 사이트(css/style.css)와 같은 토큰·모티프를 사용합니다.
   ========================================================================== */

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F5F4EE;
  --ink: #141318;
  --ink-secondary: #34323A;
  --soft: #56535F;
  --faint: #6F6B7A;
  --line: #E8E6DF;
  --line-strong: #D5D2C8;
  --accent: #FF4D26;
  --accent-ink: #C62B07;
  --accent-tint: #FFF1EC;
  --accent-gradient: linear-gradient(135deg, #FF6036 0%, #FF3D18 100%);
  --ok: #10B981;
  --ok-tint: #ECFDF5;
  --ok-ink: #047857;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 2px 6px rgba(20, 19, 24, 0.04);
  --shadow-md: 0 10px 28px -10px rgba(20, 19, 24, 0.09);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg: #0D0C11;
  --surface: #17151D;
  --surface-2: #201E27;
  --ink: #F5F4EE;
  --ink-secondary: #DBD8CE;
  --soft: #B3AEBC;
  --faint: #918CA0;
  --line: #262430;
  --line-strong: #383444;
  --accent: #FF613D;
  --accent-ink: #FFA38C;
  --accent-tint: #2B1611;
  --accent-gradient: linear-gradient(135deg, #FF6E4A 0%, #FF4D26 100%);
  --ok: #34D399;
  --ok-tint: #0B291E;
  --ok-ink: #A7F3D0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px -10px rgba(0, 0, 0, 0.6);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

:where(a, button, summary, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* 접근성: 키보드 건너뛰기 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 800;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 상단 내비 ---------- */
.g-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.g-nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.g-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.g-brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.g-nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.g-nav__link {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 750;
  color: var(--soft);
}

.g-nav__link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.g-nav__link--on {
  color: var(--accent);
  background: var(--accent-tint);
}

.g-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 8px 20px -10px rgba(255, 77, 38, 0.6);
  white-space: nowrap;
}

.g-theme {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--soft);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.g-theme:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ---------- 레이아웃 ---------- */
.g-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.g-main {
  padding: 48px 0 96px;
}

.g-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 48px;
  align-items: start;
}

/* ---------- 문서 헤더 ---------- */
.g-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.g-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.g-title {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 850;
  margin: 0 0 14px;
}

.g-lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--soft);
  margin: 0 0 22px;
  max-width: 62ch;
}

.g-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 30px;
}

.g-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
}

/* ---------- 본문 ---------- */
.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.85;
}

.prose h2 {
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.35;
  letter-spacing: -0.025em;
  font-weight: 850;
  margin: 52px 0 14px;
  padding-top: 22px;
  border-top: 1px dashed var(--line-strong);
}

.prose h3 {
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 30px 0 10px;
}

.prose p {
  margin: 0 0 16px;
  color: var(--ink-secondary);
}

.prose strong {
  color: var(--ink);
  font-weight: 800;
}

.prose em {
  font-style: normal;
  color: var(--accent-ink);
  font-weight: 750;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink-secondary);
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--accent);
  font-weight: 800;
}

.prose a {
  color: var(--accent-ink);
  border-bottom: 1px solid rgba(255, 77, 38, 0.35);
}

.prose a:hover {
  border-bottom-color: var(--accent);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-tint);
  color: var(--accent-ink);
  border: 1px solid rgba(255, 77, 38, 0.22);
  border-radius: 5px;
  padding: 1px 6px;
  word-break: break-all;
}

/* 표 */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 15px;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-2);
  font-weight: 800;
  color: var(--ink);
}

.prose tbody tr:nth-child(even) td {
  background: rgba(20, 19, 24, 0.02);
}

[data-theme="dark"] .prose tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* 콜아웃 */
.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  font-size: 15.5px;
  line-height: 1.7;
}

.callout__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: var(--ok-tint);
}

.callout--ok .callout__label {
  color: var(--ok-ink);
}

/* 단계 */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 46px;
  border-left: 2px dashed rgba(255, 77, 38, 0.28);
  margin-left: 15px;
}

.steps li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -16px;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px dashed rgba(255, 77, 38, 0.5);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 850;
}

.steps li b {
  display: block;
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 4px;
}

.steps li p {
  margin: 0;
  color: var(--soft);
  font-size: 15.5px;
}

/* 체크리스트 */
.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  color: var(--ink-secondary);
  font-size: 16px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px dashed var(--accent);
  background: var(--accent-tint);
}

/* CTA 카드 */
.cta-card {
  margin-top: 56px;
  padding: 28px;
  border-radius: var(--r-xl);
  border: 1px dashed rgba(255, 77, 38, 0.35);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.cta-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.cta-card p {
  margin: 0 0 18px;
  color: var(--soft);
  font-size: 15.5px;
}

.cta-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent-gradient);
  color: #fff;
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 사이드바 목차 */
.toc {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  font-size: 13.5px;
}

.toc__title {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 6px 0;
  color: var(--soft);
  line-height: 1.5;
  border-bottom: 1px dashed transparent;
}

.toc a:hover {
  color: var(--accent);
}

/* 허브 카드 */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.guide-card__no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.guide-card h2 {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  line-height: 1.4;
}

.guide-card p {
  margin: 0 0 16px;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.65;
  flex: 1;
}

.guide-card__meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
}

/* 푸터 */
.g-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 34px 0 46px;
  font-size: 13.5px;
  color: var(--soft);
}

.g-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.g-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.g-footer__links a:hover {
  color: var(--accent);
}

.g-footer__note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.6;
}

/* 반응형 */
@media (max-width: 940px) {
  .g-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .toc {
    position: static;
    order: -1;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .g-nav__links {
    display: none;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16.5px;
  }
  .g-main {
    padding: 32px 0 72px;
  }
  .prose {
    font-size: 16.5px;
  }
  .prose h2 {
    margin-top: 40px;
  }
  .cta-card {
    padding: 22px;
  }
  .prose table {
    font-size: 14px;
  }
  .prose th,
  .prose td {
    padding: 8px 10px;
  }
}

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

@media print {
  .g-nav,
  .toc,
  .cta-card,
  .g-footer {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .prose a {
    border: 0;
    color: #000;
  }
}
