/*
 * Design B: 문서·이력서 느낌
 * - 박스·배경·알약 태그 대신 구분선과 글자 굵기로 위계를 만든다
 * - 블루는 링크에만 쓴다
 */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-sub: #444444;
  --text-muted: #777777;
  --rule: #e2e2e2;
  --rule-strong: #1a1a1a;
  --accent: #1f5fd1;
  --code-bg: #f3f3f3;
  --max: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --text: #e6e6e6;
    --text-sub: #bdbdbd;
    --text-muted: #8a8a8a;
    --rule: #2e2e2e;
    --rule-strong: #e6e6e6;
    --accent: #7aa7ff;
    --code-bg: #222222;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141414;
  --text: #e6e6e6;
  --text-sub: #bdbdbd;
  --text-muted: #8a8a8a;
  --rule: #2e2e2e;
  --rule-strong: #e6e6e6;
  --accent: #7aa7ff;
  --code-bg: #222222;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { line-height: 1.4; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding-left: 1.2em; }
li + li { margin-top: 0.25em; }
strong { font-weight: 650; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}
pre {
  margin: 0;
  background: var(--code-bg);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.6;
}
pre code { background: none; padding: 0; font-size: inherit; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--text); color: var(--bg); padding: 6px 12px; z-index: 100; }
.skip-link:focus { left: 16px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--rule); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 12px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 18px; font-size: 0.92rem; }
.header-nav a { color: var(--text-sub); text-decoration: none; }
.header-nav a:hover { color: var(--text); text-decoration: underline; }
.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--text-sub);
  width: 28px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

main.container { padding-top: 48px; padding-bottom: 80px; }

/* Section: 이력서식 제목 + 굵은 선 */
.section { margin-top: 52px; }
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--rule-strong);
  margin-bottom: 18px;
}

/* Hero */
.hero { display: flex; gap: 24px; align-items: flex-start; }
.hero-photo { width: 100px; height: 129px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.hero h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.01em; }
.hero h1 .en { font-size: 1rem; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.hero .roles { color: var(--text-sub); margin-top: 2px; }
.hero .tagline { margin-top: 14px; font-weight: 600; }
.hero .summary { margin-top: 4px; color: var(--text-sub); }

/* 버튼 → 텍스트 링크 */
.link-row { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 12px; font-size: 0.94rem; }
.link-row .btn + .btn::before { content: "·"; color: var(--text-muted); margin: 0 10px; text-decoration: none; display: inline-block; }
.btn { color: var(--accent); }
.btn svg { display: none; }
.btn.primary { font-weight: 600; }

/* 일하는 방식 */
.strengths { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; }
.strength h3 { font-size: 0.98rem; margin-bottom: 4px; }
.strength p { color: var(--text-sub); font-size: 0.92rem; }

/* Projects: 카드 대신 구분선 */
.project-list { display: block; }
.project-card { padding: 22px 0; border-top: 1px solid var(--rule); }
.project-card:first-child { border-top: 0; padding-top: 0; }
.project-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.project-card h3 { font-size: 1.12rem; }
.project-card h3 a { color: var(--text); text-decoration: none; }
.project-card h3 a:hover { text-decoration: underline; }
.period { color: var(--text-muted); font-size: 0.88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.project-meta { color: var(--text-muted); font-size: 0.9rem; }
.project-desc { margin-top: 8px; }
.project-card ul { margin-top: 8px; color: var(--text-sub); font-size: 0.95rem; }
.project-card ul strong { color: var(--text); font-weight: 600; }

/* 태그 → 한 줄 텍스트 */
.tags { display: flex; flex-wrap: wrap; margin-top: 10px; padding: 0; list-style: none; font-size: 0.85rem; color: var(--text-muted); }
.tags li { margin: 0; }
.tags li + li::before { content: "·"; margin: 0 7px; }

/* 기술 스택 · 자격증 */
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.two-col .section-title { margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 0.93rem; }
.kv dt { font-weight: 600; white-space: nowrap; }
.kv dd { margin: 0; color: var(--text-sub); }
.plain-list { list-style: none; padding: 0; margin: 0; font-size: 0.93rem; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 3px 0; }
.plain-list .date { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline .item { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.timeline .item:first-child { padding-top: 0; }
.timeline .item p { color: var(--text-sub); font-size: 0.92rem; }
.timeline .item h3 { font-size: 0.98rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 22px 0; color: var(--text-muted); font-size: 0.85rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--text-sub); }

/* ===== 상세 페이지 ===== */
.breadcrumb { font-size: 0.88rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.detail-title { font-size: 1.85rem; font-weight: 700; margin-top: 8px; }
.detail-lead { color: var(--text-sub); margin-top: 8px; }

.info-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 24px 0 0;
  padding: 14px 0;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  font-size: 0.93rem;
}
.info-grid dt { font-weight: 600; }
.info-grid dd { margin: 0; color: var(--text-sub); }
.info-grid ul { padding-left: 1.1em; }

/* 숫자 요약: 테두리 없이 위쪽 선 */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 24px; margin-top: 16px; }
.metric { padding: 10px 0; border-top: 1px solid var(--rule); }
.metric .value { font-size: 1.3rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.4; }
.metric .label { font-size: 0.86rem; color: var(--text-sub); margin-top: 2px; }

.toc { margin-top: 32px; font-size: 0.92rem; }
.toc h2 { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc ol ol { margin-top: 2px; }
.toc li + li { margin-top: 1px; }
.toc a { color: var(--text-sub); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.part { margin-top: 64px; }
.part-label { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.part > h2 { font-size: 1.4rem; margin-top: 2px; padding-bottom: 8px; border-bottom: 2px solid var(--rule-strong); }
.part > .part-lead { color: var(--text-sub); margin-top: 10px; }

.topic { margin-top: 40px; }
.part > .topic:first-of-type { margin-top: 28px; }
.topic h3 { font-size: 1.12rem; }
.topic .one-liner { color: var(--text-sub); margin-top: 2px; }
.topic h4 { font-size: 0.98rem; margin: 22px 0 4px; }
.topic p + p { margin-top: 8px; }
.topic ul, .topic ol { color: var(--text-sub); }
.topic ul strong, .topic ol strong, .topic p strong { color: var(--text); }
.topic > p { color: var(--text-sub); }

/* 강조: 색 박스 대신 굵은 왼쪽 선 하나 */
.callout { margin-top: 18px; padding: 2px 0 2px 16px; border-left: 2px solid var(--rule-strong); }
.callout p { color: var(--text) !important; }
.callout p + p { margin-top: 4px; }

/* 표: 가로선만 */
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.89rem; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--rule-strong); }
td { color: var(--text-sub); }
td:first-child { color: var(--text); font-weight: 500; }
tr.chosen td { color: var(--text); font-weight: 650; }
tr.chosen td:last-child::after { content: " ✓"; }

/* 단계: 동그라미 번호 대신 숫자 텍스트 */
.steps { counter-reset: step; list-style: none; padding: 0; margin-top: 10px; }
.steps > li { counter-increment: step; position: relative; padding-left: 28px; margin: 0; }
.steps > li + li { margin-top: 14px; }
.steps > li::before { content: counter(step) "."; position: absolute; left: 0; top: 0; font-weight: 700; color: var(--text); }
.steps > li > strong { display: block; color: var(--text); }
.steps > li > strong small { font-weight: 400; color: var(--text-muted); }
.steps > li ul { margin-top: 2px; font-size: 0.94rem; }

.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 10px; }
.flow .node { flex: 1 1 160px; border: 1px solid var(--rule); padding: 10px 12px; font-size: 0.89rem; color: var(--text-sub); }
.flow .node strong { display: block; color: var(--text); }
.flow .arrow { align-self: center; color: var(--text-muted); }

/* 저장소 링크: 줄 목록 */
.repo-links { margin-top: 16px; font-size: 0.93rem; }
.repo-links a { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); color: var(--text); text-decoration: none; }
.repo-links a:first-child { border-top: 1px solid var(--rule); }
.repo-links a:hover { color: var(--accent); }
.repo-links a span { color: var(--accent); font-size: 0.88rem; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 72px; padding-top: 18px; border-top: 1px solid var(--rule); }
.pager a { display: block; font-size: 0.94rem; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager small { display: block; color: var(--text-muted); font-size: 0.8rem; }
.pager .next { text-align: right; margin-left: auto; }

/* 맨 위로 */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text-sub);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 20;
}
.to-top[hidden] { display: none; }
.to-top:hover { color: var(--text); border-color: var(--text-muted); }
.to-top svg { width: 18px; height: 18px; }

/* 이미지 */
.figure { margin: 18px 0 0; }
.figure > a { display: block; width: fit-content; max-width: 100%; margin: 0 auto; border: 1px solid var(--rule); background: #fff; }
.figure img { display: block; max-width: 100%; height: auto; }
.figure.tall img { max-height: 560px; object-fit: cover; object-position: top; }
.figure figcaption { margin-top: 6px; font-size: 0.84rem; color: var(--text-muted); text-align: center; }
.table-wrap caption { caption-side: bottom; margin-top: 6px; font-size: 0.84rem; color: var(--text-muted); text-align: center; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; margin-top: 18px; }
.figure-row .figure { margin: 0; }
.figure-row .figure > a { background: #1e1f22; }

.symptom { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; align-items: start; margin-top: 10px; }
.symptom .figure { margin: 0; }
.symptom-metrics { display: flex; flex-direction: column; }
.symptom-metrics .metric { padding: 14px 0; }
.symptom-metrics .metric:last-child { border-bottom: 1px solid var(--rule); }

/* 일하는 방식: 적용한 곳 */
.strength .applied { margin-top: 4px; font-size: 0.86rem; color: var(--text-muted); }
.strength .applied b { font-weight: 600; color: var(--text-sub); margin-right: 6px; }
.strength .applied a { color: var(--text-muted); text-decoration-color: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.strength .applied a:hover { color: var(--text-sub); text-decoration-color: currentColor; }

/* 상세 개요: 규모 숫자 아래 보조 설명 */
.metric .sub { font-size: 0.82rem; color: var(--text-muted); }
.overview-heading { font-size: 1rem; font-weight: 700; margin-top: 32px; }

/* 주요 기여: 제목 / 설명 / 핵심 수치, 구분선 행 */
.contrib { margin: 8px 0 0; padding: 0; list-style: none; }
.contrib li { display: grid; grid-template-columns: 9em 1fr; gap: 2px 16px; padding: 9px 0; margin: 0; border-top: 1px solid var(--rule); font-size: 0.93rem; }
.contrib li:last-child { border-bottom: 1px solid var(--rule); }
.contrib .name { font-weight: 650; color: var(--text); }
.contrib .desc { color: var(--text-sub); }
.contrib .result { grid-column: 2; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.achievement { margin-top: 12px; font-size: 0.93rem; color: var(--text-sub); }
.achievement strong { color: var(--text); margin-right: 10px; }

/* 번호 흐름: 화살표 대신 번호로 순서를 보인다 */
.flow-grid { counter-reset: fstep; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.flow-grid li { counter-increment: fstep; margin: 0; border: 1px solid var(--rule); padding: 8px 12px 10px; font-size: 0.88rem; color: var(--text-sub); }
.flow-grid li::before { content: counter(fstep); display: block; font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.flow-grid li strong { display: block; color: var(--text); }
.flow-grid li.auto { border-color: var(--rule-strong); }
.flow-grid li.auto::before { content: counter(fstep) " · 자동"; }

@media (max-width: 720px) {
  .contrib li { grid-template-columns: 1fr; }
  .contrib .result { grid-column: 1; }
  .flow-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  main.container { padding-top: 32px; }
  .hero { flex-direction: column; gap: 16px; }
  .hero-photo { width: 88px; height: 113px; }
  .hero h1 { font-size: 1.6rem; }
  .strengths { grid-template-columns: 1fr; gap: 14px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .two-col > section + section { margin-top: 44px; }
  .detail-title { font-size: 1.55rem; }
  .info-grid { grid-template-columns: 1fr; gap: 0; }
  .info-grid dd + dt { margin-top: 8px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd + dt { margin-top: 8px; }
  .header-nav a.hide-sm { display: none; }
  .flow .arrow { transform: rotate(90deg); flex-basis: 100%; text-align: center; }
  .timeline .item { flex-direction: column; gap: 0; }
  .symptom { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .theme-toggle, .skip-link, .pager, .to-top { display: none; }
  body { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}
