:root {
  --paper: #f3efe4;
  --panel: #faf7ef;
  --ink: #161513;
  --muted: #6f6a5f;
  --line: #d3ccbb;
  --mono: 'IBM Plex Mono', Pretendard, 'Malgun Gothic', monospace;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Pretendard, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  background-color: var(--paper) !important;
  background-image:
    linear-gradient(rgba(22, 21, 19, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 21, 19, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* NiceGUI 기본 레이아웃 여백·정렬 제거 */
.nicegui-content {
  display: block !important;
  padding: 0 !important;
}

a, a:visited { color: inherit !important; text-decoration: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 36px; }

/* 상단 문서 정보 줄 */
.docbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 0;
  border-bottom: 2px solid var(--ink);
  font: 500 12px var(--mono);
  color: var(--muted);
}
.docbar-center { color: var(--ink); font-weight: 600; letter-spacing: 0.1em; }
.docbar nav { display: flex; gap: 22px; justify-self: end; }
.docbar nav a { color: var(--ink) !important; }
.docbar nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #2f8a4b; margin-right: 6px; vertical-align: 1px;
}

/* 문서 테두리 모서리 */
.sheet { position: relative; background: var(--panel); border: 1px solid var(--line); }
.sheet::before, .sheet::after {
  content: ""; position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--ink);
}
.sheet::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.sheet::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 12px var(--mono); padding: 3px 8px;
  border: 1px solid var(--line); background: var(--paper);
}

/* 맨 위: 사진 | 자기소개 */
.intro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 44px;
  align-items: center;
  margin-top: 48px;
  padding: 36px;
}
.photo { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; border: 1px solid var(--line); }
.photo-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--muted);
  background: repeating-linear-gradient(135deg, rgba(22, 21, 19, 0.05) 0 1px, transparent 1px 9px), var(--paper);
  font: 500 12px/1.7 var(--mono); color: var(--muted);
}
.name {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(48px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 700;
}
.cursor {
  display: inline-block; width: 0.42em; height: 0.08em; background: var(--ink);
  margin-left: 0.06em; vertical-align: 0.02em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.role { font-size: 20px; font-weight: 700; margin: 14px 0 12px; }
.bio { color: #3f3b34; line-height: 1.8; max-width: 640px; }
.bio p { margin: 0 0 8px; }
.bio p:last-child { margin-bottom: 0; }
.bio strong { color: var(--ink); }

/* 섹션 머리 */
.sec { margin-top: 64px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.anchor { position: relative; top: -24px; width: 0; }
.sec-no { font: 600 13px var(--mono); color: var(--muted); }
.sec-title { font-size: 20px; font-weight: 700; }
.sec-rule { flex: 1; border-bottom: 1px solid var(--ink); transform: translateY(-4px); }
.sec-count { font: 500 12px var(--mono); color: var(--muted); }

/* 프로젝트 */
.items { display: grid; gap: 12px; }
.item {
  display: grid;
  grid-template-columns: 48px 240px 1fr;
  gap: 24px;
  align-items: center;
  padding: 16px;
  transition: background .2s, transform .2s;
}
a.item:hover { background: #fffdf7; transform: translateX(3px); }
.item-no { font: 600 24px var(--mono); color: #bdb5a3; }
a.item:hover .item-no { color: var(--ink); }
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border: 1px solid var(--line); }
.thumb-empty {
  position: relative;
  background: repeating-linear-gradient(135deg, rgba(22, 21, 19, 0.05) 0 1px, transparent 1px 10px), #e9e3d5;
}
.thumb-empty .thumb-label { position: absolute; left: 8px; bottom: 6px; font: 500 10px var(--mono); color: var(--muted); }
.item-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.item-meta { font: 500 12px var(--mono); color: var(--muted); }
.item-desc { margin: 8px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* 경력 · 학력 표 */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; font: 500 12px var(--mono); color: var(--muted);
  padding: 12px 18px; border-bottom: 1px solid var(--ink);
}
.table td { padding: 16px 18px; border-bottom: 1px dotted var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.when { font: 500 13px var(--mono); color: var(--muted); white-space: nowrap; width: 170px; }
.table td b { font-weight: 700; }
.table td small { display: block; color: var(--muted); margin-top: 3px; font-size: 14px; line-height: 1.6; }

.foot {
  margin-top: 72px;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0 28px;
  border-top: 2px solid var(--ink);
  font: 500 11px var(--mono); color: var(--muted);
}

@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .docbar { grid-template-columns: 1fr auto; }
  .docbar-center { display: none; }
  .intro { grid-template-columns: 1fr; gap: 24px; padding: 22px; margin-top: 28px; }
  .intro > :first-child { width: 160px; }
  .item { grid-template-columns: 1fr; gap: 12px; }
  .table td.when { width: auto; padding-right: 8px; }
  .table th:first-child { padding-right: 8px; }
  .foot { flex-direction: column; }
}
