/* 『상신 버튼은 누르지 않는다』 — IBM Carbon 디자인 시스템 번안
   IBM Plex Sans KR · 직각 모서리 · 블루 액센트(#0f62fe) · 독서용 17px/1.8 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #ffffff;
  color: #161616;
  font-family: "IBM Plex Sans KR", "IBM Plex Sans", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 상단 바 */
.top-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.85rem;
}
.top-bar a { color: #0f62fe; text-decoration: none; }
.top-bar a:hover { text-decoration: underline; }
.top-title {
  flex: 1;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: #525252;
}
.top-pos {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: #8d8d8d;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* 챕터 머리 */
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #0f62fe;
  margin-bottom: 0.7rem;
}
h1 {
  font-size: 2.3rem;
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.stage {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: #8d8d8d;
  margin: 0.9rem 0 0;
}
.title-rule {
  border-bottom: 1px solid #e0e0e0;
  margin: 1.6rem 0 2.4rem;
}

/* 본문 */
h2 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 3.2rem 0 1rem;
}
p { margin-bottom: 1.45rem; }

/* 리드 문단 — 각 장의 첫 단락 */
.lede {
  font-size: 1.07em;
  line-height: 1.85;
}

a { color: #0f62fe; text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 600; }

code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82em;
  background: #f4f4f4;
  padding: 0.15em 0.4em;
}

/* 커밋 메시지 인라인 인용 — dt(블루)와 구분되는 무채색 칩 */
.cm {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84em;
  background: #f4f4f4;
  padding: 0.1em 0.3em;
}

/* 날짜·시각 — 커밋 타임스탬프의 시각적 구분 */
.dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88em;
  font-weight: 500;
  color: #0043ce;
}

blockquote {
  margin: 1.7rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid #0f62fe;
  background: #f4f4f4;
}
blockquote .commit {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  display: block;
  color: #161616;
}

/* 코드 펜스 — 부록의 실물 아티팩트 */
pre.artifact {
  background: #262626;
  color: #f4f4f4;
  margin: 1.7rem 0;
  padding: 1.2rem 1.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-x: auto;
}

/* 이름표 붙은 항목 — 부록 A·B의 '배우는 것', '점검' */
dl.spec {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.45rem 0;
  margin: 0 0 1.45rem;
  padding-left: 1.1rem;
  border-left: 2px solid #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.75;
}
dl.spec dt { font-weight: 600; color: #0f62fe; }

ul, ol { margin: 0 0 1.3rem 1.4rem; }
li { margin-bottom: 0.6rem; }
li::marker { color: #0f62fe; }

table {
  border-collapse: collapse;
  margin: 1.7rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
  width: 100%;
}
th, td {
  text-align: left;
  padding: 0.65rem 1rem;
  vertical-align: top;
}
thead th { background: #e0e0e0; font-weight: 600; }
tbody td { border-bottom: 1px solid #e0e0e0; }
tbody tr:hover { background: #f4f4f4; }
td:first-child, th:first-child { white-space: nowrap; }

/* 실측 데이터 차트 — 커밋 곡선 */
figure.chart {
  margin: 2.2rem 0;
  padding: 1.2rem 0.4rem 0.9rem;
  background: #f4f4f4;
  border-top: 2px solid #0f62fe;
}
figure.chart svg { display: block; }
figure.chart figcaption {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: #525252;
  line-height: 1.6;
  margin-top: 0.6rem;
  padding: 0 1rem;
}
/* 용어 상자 — 전문 용어는 본문에서 떼어 여기서만 푼다 */
aside.terms {
  margin: 1.8rem 0;
  padding: 1rem 1.3rem 1.1rem;
  border: 1px solid #c6c6c6;
  border-left: 3px solid #0f62fe;
  background: #fbfbfb;
}
aside.terms dl { margin: 0; display: block; }
aside.terms dt {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  font-weight: 500;
  color: #161616;
  margin-top: 0.9rem;
}
aside.terms dt:first-of-type { margin-top: 0; }
aside.terms .term-tag {
  flex: none;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  font-weight: 400;
  color: #0f62fe;
}
aside.terms dd {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #393939;
}

/* 이 장에서 남은 것 — 마무리 패널 */
section.takeaways {
  background: #f4f4f4;
  border-top: 2px solid #0f62fe;
  padding: 1.5rem 1.6rem;
  margin-top: 3.2rem;
}
section.takeaways > :last-child { margin-bottom: 0; }
section.takeaways code,
section.takeaways .cm { background: #e0e0e0; }
.takeaway-eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: #0f62fe;
  margin: 0 0 0.2rem;
}
.takeaway-title { margin-top: 0.2rem; }

/* 이전/다음 장 이동 */
.chapter-nav {
  margin-top: 4rem;
  padding-top: 1.3rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.chapter-nav a:last-child { text-align: right; }

/* 표지 + 목차 */
.cover { padding-top: 5rem; }
.cover-title {
  font-size: 3rem;
  font-weight: 300;
  line-height: 1.25;
  margin-bottom: 0.8rem;
}
.cover-subtitle {
  font-size: 1.05rem;
  color: #525252;
  margin-bottom: 0.5rem;
}
.toc-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.2rem;
}
.toc { list-style: none; margin: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid #e0e0e0;
  color: #161616;
}
.toc a:hover { background: #f4f4f4; text-decoration: none; }
.toc-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #0f62fe;
}
.toc-label { flex: 1; }
.toc-teaser {
  display: block;
  font-size: 0.82rem;
  color: #525252;
  margin-top: 0.15rem;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.8rem; }
  .cover-title { font-size: 2.2rem; }
  dl.spec { grid-template-columns: 1fr; gap: 0; }
  dl.spec dt { margin-top: 0.7rem; }
  dl.spec dt:first-child { margin-top: 0; }
  dl.spec dt:empty { display: none; }  /* 이어지는 항목 — 빈 이름표 자리를 없앤다 */
  dl.spec dd { margin-bottom: 0.35rem; }
}
