:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --rule: #e4e4e4;
  --text: #111111;
  --text-dim: #5a5a5a;
  --text-faint: #999999;
  --accent: #000000;
  --accent-soft: #00000012;
  --accent-2: #6b6b6b;
  --accent-2-soft: #0000000a;
  --hazard: #000000;
  --hazard-soft: #00000012;
  --focus: #000000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Pretendard Variable", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: -0.001em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
}

.display, h1, h2, h3, h4,
.job .org, .project-card .name, table.spec td.k, .issue-title, .resume-head .lbl {
  font-family: Pretendard, "Pretendard Variable", "Noto Sans KR", "Segoe UI", sans-serif;
  font-weight: 700;
}

/* Cascadia/Consolas/JetBrains have no Hangul glyphs, so Korean inside .mono
   elements (예: "완료", "미해결") was silently falling back to the OS default
   Korean font instead of Pretendard — fixed by chaining Pretendard right after. */
.mono {
  font-family: "Cascadia Code", "SF Mono", Consolas, "JetBrains Mono", ui-monospace,
    Pretendard, "Pretendard Variable", "Noto Sans KR", monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

h1, h2, h3 { text-wrap: balance; margin: 0; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 28px; }
.prose { max-width: 64ch; }

/* ---------- ruler motif ---------- */
.ruler {
  height: 22px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  user-select: none;
}
.ruler span {
  flex: 1 0 auto;
  width: 64px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  border-left: 1px solid var(--rule);
  padding-left: 5px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; font-size: 13px; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; letter-spacing: 0.02em; text-decoration: none; }
.brand .name {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.brand .kr { color: var(--text-faint); font-family: "Noto Serif KR", serif; font-size: 13px; }
.topnav { display: flex; gap: 22px; flex-wrap: wrap; }
.topnav a {
  text-decoration: none; color: var(--text-dim);
  text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; font-weight: 600;
}
.topnav a:hover { color: var(--accent); }
.topnav a.active { color: var(--accent); }

/* ---------- breadcrumb (project pages) ---------- */
.crumb {
  padding: 18px 0 0; font-size: 12px; color: var(--text-faint);
}
.crumb a { color: var(--text-faint); text-decoration: none; border-bottom: 1px dotted var(--text-faint); }
.crumb a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 40px; }
.eyebrow {
  display: block;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 22px; font-weight: 600;
}
.eyebrow .dot { display: none; }

h1.title {
  font-size: clamp(34px, 5vw, 52px); line-height: 1.16;
  font-weight: 700; letter-spacing: -0.01em;
}
h1.title .accent { color: var(--accent); }

.subhead { margin-top: 22px; color: var(--text-dim); max-width: 58ch; font-size: 17px; line-height: 1.7; }

.contact-strip {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
  color: var(--text-faint);
}
.contact-strip a { color: var(--text-faint); text-decoration: none; }
.contact-strip a:hover { color: var(--accent); }

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 40px 0 8px; border-top: 1px solid var(--rule);
}
.stat { padding: 16px 18px 0; border-left: 1px solid var(--rule); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat .n { font-size: 21px; color: var(--text); font-weight: 700; }
.stat .l { margin-top: 4px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- project index (home) ---------- */
.project-grid { margin: 8px 0 26px; border-top: 1px solid var(--rule); }
.project-card {
  padding: 22px 0; text-decoration: none; color: inherit;
  display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: center;
  border-bottom: 1px solid var(--rule);
}
.project-card .tag { font-size: 13px; color: var(--text-faint); font-weight: 600; }
.project-card .name { font-size: 18px; font-weight: 700; color: var(--text); }
.project-card .desc { margin-top: 4px; font-size: 13.5px; color: var(--text-dim); }
.project-card .go { font-size: 18px; color: var(--text-faint); transition: transform .15s, color .15s; }
.project-card:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.project-card:hover .go { color: var(--accent); transform: translateX(3px); }
@media (max-width: 640px) { .project-card { grid-template-columns: 1fr; } .project-card .go { display: none; } }

/* ---------- resume ---------- */
.resume { margin: 26px 0; border-top: 1px solid var(--rule); }
.resume-head { padding: 16px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.resume-head .lbl { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.resume-head a { font-size: 12px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--rule); }
.resume-head a:hover { border-color: var(--text); }
.resume-block { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.resume-block h4 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px; }
.resume-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 8px 0; font-size: 13.5px; }
.resume-row .rk { color: var(--text-faint); }
.resume-row .rv { color: var(--text-dim); }
.resume-row .rv b { color: var(--text); font-weight: 700; }
@media (max-width: 640px) { .resume-row { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- sections ---------- */
section { padding: 68px 0; border-top: 1px solid var(--rule); scroll-margin-top: 76px; }
section:first-of-type { border-top: none; }

.section-head {
  margin-bottom: 32px;
}
.section-num {
  display: block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600; margin-bottom: 14px;
}
h2.section-title { font-size: clamp(24px, 3.2vw, 30px); font-weight: 700; letter-spacing: -0.01em; }
.section-tag {
  display: block; margin-top: 8px; font-size: 13px;
  color: var(--text-faint);
}
.section-tag a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--text-faint); }
.section-body { display: block; }
.section-body > .col { grid-column: unset; }

.status-chip {
  display: inline-block; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; color: var(--text-faint); margin-left: 10px; vertical-align: middle;
}
.status-chip.done { color: var(--text-faint); }
.status-chip.done::before { content: "· "; }
.status-chip.progress { color: var(--text); }
.status-chip.progress::before { content: "· "; }

.callout {
  border-left: 2px solid var(--text); padding: 2px 0 2px 18px; margin: 24px 0;
  color: var(--text-dim); font-size: 15.5px; line-height: 1.7;
}
.callout b { color: var(--text); font-weight: 700; }
.callout.warn { border-color: var(--text); }

/* ---------- career ---------- */
.job {
  display: grid; grid-template-columns: 170px 1fr; gap: 20px;
  padding: 26px 0; border-top: 1px solid var(--rule);
}
.job:first-child { border-top: none; padding-top: 0; }
.job .when { font-size: 12px; letter-spacing: 0.04em; color: var(--text-faint); padding-top: 3px; text-transform: uppercase; }
.job .org { font-size: 17px; font-weight: 700; }
.job .role { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.achv-list { margin: 16px 0 0; display: flex; flex-direction: column; gap: 14px; }
.achv { display: block; }
.achv::before { content: none; }
.achv .head { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.45; }
.achv .sub { margin-top: 4px; font-size: 13.5px; color: var(--text-faint); line-height: 1.6; }
/* second line of a split topic ("A — B" → A / B) */
.head-2 { display: block; margin-top: 2px; font-weight: 600; color: var(--text-dim); }
.achv .head .head-2, .tl-head .head-2, .tl-era .h .head-2 { font-size: 13.5px; }
.issue-title .head-2 { font-size: 13px; }
h3 .head-2 { font-size: 0.8em; margin-top: 4px; }
.achv .sub b { color: var(--text); font-weight: 700; }
.edu {
  margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--rule);
  font-size: 13.5px; color: var(--text-faint);
  display: flex; flex-wrap: wrap; gap: 6px 22px;
}
.edu b { color: var(--text-dim); }

/* ---------- table of contents ---------- */
.toc { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 18px 0; margin: 28px 0; }
.toc-title { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toc li { font-size: 14.5px; }
.toc a { color: var(--text-dim); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc .n { color: var(--text-faint); margin-right: 4px; }

/* ---------- plantuml image card ---------- */
.uml-card {
  background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 16px 0; margin: 22px 0;
  overflow-x: auto; text-align: center;
}
.uml-card img { max-width: 100%; height: auto; display: inline-block; }
.uml-card .cap { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }

/* ---------- diagrams ---------- */
.mermaid-wrap {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--surface);
  padding: 18px 0; margin: 26px 0; overflow-x: auto;
}
.mermaid-wrap .cap {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 12px;
}
pre.mermaid { margin: 0; background: transparent !important; }

pre.diagram {
  background: var(--surface-2); padding: 16px 20px;
  overflow-x: auto; font-family: "Cascadia Code", Consolas,
    Pretendard, "Pretendard Variable", "Noto Sans KR", monospace; font-size: 12.5px;
  line-height: 1.6; color: var(--text-dim); margin: 24px 0;
}
pre.diagram .hi { color: var(--text); font-weight: 700; }
pre.diagram .hi2 { color: var(--text-dim); font-weight: 700; }

.tbl-wrap { overflow: auto; margin: 26px 0; border-top: 1px solid var(--rule); }
table.spec { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 13.5px; }
table.spec th, table.spec td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.spec thead th {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
}
table.spec tbody tr:last-child td { border-bottom: none; }
table.spec td.k { color: var(--text); font-weight: 700; white-space: nowrap; }

/* ---------- issue cards ---------- */
.issues { margin: 26px 0; border-top: 1px solid var(--rule); }
.issue-card { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.issue-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.issue-num { font-size: 12px; color: var(--text-faint); }
.issue-title { font-size: 14.5px; font-weight: 700; }
.issue-title a { color: var(--text); text-decoration: none; }
.issue-title a:hover { color: var(--text); text-decoration: underline; }
.issue-state {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  margin-left: auto;
}
.issue-state.open { color: var(--text); }
.issue-state.open::before { content: "● "; font-size: 8px; }
.issue-state.closed { color: var(--text-faint); }
.issue-state.closed::before { content: "○ "; font-size: 8px; }
.issue-body { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); line-height: 1.65; }

/* ---------- collapsible bug lists ---------- */
details.collapse { margin: 22px 0; }
details.collapse > .issues { margin: 12px 0 0; }
details.collapse summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: transparent; font-size: 14px; font-weight: 700; color: var(--text);
}
details.collapse summary::-webkit-details-marker { display: none; }
details.collapse summary::before {
  content: "▸"; color: var(--text-faint); font-size: 12px; transition: transform .15s;
}
details.collapse[open] summary::before { transform: rotate(90deg); }
details.collapse summary:hover { color: var(--text); }
details.collapse summary:hover::before { color: var(--text); }
details.collapse summary .count {
  margin-left: auto; font-size: 11px; color: var(--text-faint); font-weight: 400;
  font-family: "Cascadia Code", "SF Mono", Consolas, "JetBrains Mono", ui-monospace,
    Pretendard, "Pretendard Variable", "Noto Sans KR", monospace;
}

/* ---------- real captures ---------- */
.gbuffer-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--rule); margin: 26px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.gbuffer-row figure { margin: 0; background: var(--bg); }
.gbuffer-row img { display: block; width: 100%; height: auto; }
.gbuffer-row figcaption {
  padding: 8px 0; font-size: 11px; letter-spacing: 0.04em;
  color: var(--text-faint);
}

.gif-embed { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 26px 0; }
.gif-embed img { display: block; width: 100%; height: auto; }
.gif-embed figcaption {
  padding: 10px 0;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-faint);
}
.gif-embed figcaption b { color: var(--text-dim); font-weight: 700; }
.gif-embed figcaption a { color: var(--text); text-decoration: underline; }

.reel { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1px; background: var(--rule); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 26px 0; }
.reel-card {
  background: var(--bg); padding: 16px; text-decoration: none;
  display: flex; flex-direction: column; gap: 6px; color: inherit;
}
.reel-card:hover .cap { text-decoration: underline; text-underline-offset: 3px; }
.reel-card .kind {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-weight: 700;
}
.reel-card .kind::before { content: "▶"; font-size: 8px; }
.reel-card .cap { font-size: 13.5px; font-weight: 700; color: var(--text); }
.reel-card .desc { font-size: 12px; color: var(--text-faint); }

/* ---------- arena visualizer ---------- */
.arena { margin: 26px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.arena-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.arena-head .lbl { text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; color: var(--text-faint); }
.arena-head .val { font-size: 12px; color: var(--text-dim); }
canvas#arenaCanvas { display: block; width: 100%; height: 108px; cursor: crosshair; }
.arena-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 14px; font-size: 11.5px; color: var(--text-faint); }
.legend { display: flex; gap: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; display: inline-block; }
.legend i.a { background: var(--text); }
.legend i.f { background: var(--rule); border: 1px solid var(--text-faint); }

.why { margin-top: 14px; font-size: 14px; color: var(--text-faint); }
.why b { color: var(--text-dim); }

.stack { margin: 28px 0; border-top: 1px solid var(--rule); }
.stack .layer { padding: 13px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: baseline; }
.stack .layer .name { color: var(--text); font-weight: 700; font-size: 12.5px; }
.stack .layer .desc { font-size: 13.5px; color: var(--text-dim); }
.stack .layer.dim .name, .stack .layer.dim .desc { color: var(--text-faint); }

/* ---------- KPI row (hero) ---------- */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 34px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.kpi { padding: 16px 16px 18px; border-left: 1px solid var(--rule); min-width: 0; }
.kpi:first-child { border-left: none; padding-left: 0; }
.kpi .v {
  font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1; color: var(--text); white-space: nowrap;
}
.kpi .v .u { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-left: 4px; letter-spacing: 0; }
.kpi .l { margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--text-faint); }
.kpi .l b { color: var(--text-dim); font-weight: 600; }
@media (max-width: 760px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: none; padding-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- stack map (home) — modules & libraries expand in place ---------- */
.stackmap { margin: 6px 0 0; }
.sm-engine { border: 1px solid var(--text); padding: 16px 18px 14px; transition: box-shadow .2s; }
.sm-engine[data-rel="user"] { box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 4px var(--text); }
.sm-head { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.sm-head .sm-meta { margin-left: auto; }
.sm-name { font-size: 16px; font-weight: 700; color: var(--text); }
a.sm-name { text-decoration: none; border-bottom: 1px solid var(--rule); }
a.sm-name:hover { border-color: var(--text); }
.sm-head .status-chip { margin-left: 0; }
.sm-engine[data-rel="user"] .sm-head::after {
  content: "사용"; order: 3; font-size: 10px; letter-spacing: .08em; font-weight: 700;
  background: var(--text); color: #fff; padding: 0 6px; line-height: 17px;
}
.sm-meta { font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; }
.sm-mods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.sm-mod {
  appearance: none; display: block; width: 100%; text-align: left; cursor: pointer; font: inherit;
  border: 1px solid var(--rule); background: var(--bg); padding: 10px 11px 11px; min-width: 0;
  transition: background .15s, border-color .15s;
}
.sm-mod b { display: block; font-size: 13px; color: var(--text); }
.sm-mod b::after { content: " +"; color: var(--text-faint); font-weight: 400; }
.sm-mod span { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.45; color: var(--text-dim); }
.sm-mod:hover { border-color: var(--text); }
.sm-mod[aria-expanded="true"] { background: var(--text); border-color: var(--text); }
.sm-mod[aria-expanded="true"] b, .sm-mod[aria-expanded="true"] span { color: #fff; }
.sm-mod[aria-expanded="true"] b::after { content: " −"; color: #bdbdbd; }
.sm-modpanel { margin-top: 8px; padding: 12px 14px; background: var(--surface-2); border-left: 2px solid var(--text); animation: sm-in .22s ease; }
.sm-modpanel p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.65; color: var(--text-dim); }
.sm-modpanel a { font-size: 12.5px; color: var(--text); }
.sm-threads { margin-top: 12px; font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; }
.sm-threads b { color: var(--text-dim); font-weight: 700; }
.sm-down { position: relative; padding: 10px 0 10px 46px; font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; }
.sm-down::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: var(--text); }
.sm-libs { position: relative; list-style: none; margin: 0; padding: 0; }
.sm-libs::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 22px; width: 1px; background: var(--text); }
.sm-libs li { position: relative; margin-left: 46px; }
.sm-libs li::before {
  content: ""; position: absolute; left: -28px; top: 17px; width: 11px; height: 11px;
  background: var(--bg); border: 1px solid var(--text); border-radius: 50%; z-index: 1; transition: background .15s;
}
.sm-libs li::after { content: ""; position: absolute; left: -17px; top: 22px; width: 17px; height: 1px; background: var(--rule); }
.sm-libs li.open::before, .sm-libs li[data-rel]::before { background: var(--text); }
.sm-libs li.open::before { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--text); }
.sm-lib {
  appearance: none; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto 18px; gap: 2px 16px; align-items: baseline;
  padding: 11px 14px; border: 1px solid var(--rule); border-top: none; background: var(--bg); transition: background .15s;
}
.sm-libs li:first-child .sm-lib { border-top: 1px solid var(--rule); }
.sm-lib .sm-name { font-size: 14px; }
.sm-lib::after { content: "+"; justify-self: end; font-size: 15px; color: var(--text-faint); line-height: 1; }
.sm-role { font-size: 13px; color: var(--text-dim); }
.sm-lib:hover, .sm-lib:focus-visible, .sm-lib[aria-expanded="true"] { background: var(--text); }
.sm-lib:hover .sm-name, .sm-lib:hover .sm-role, .sm-lib:hover .sm-meta, .sm-lib:hover::after,
.sm-lib:focus-visible .sm-name, .sm-lib:focus-visible .sm-role, .sm-lib:focus-visible .sm-meta, .sm-lib:focus-visible::after,
.sm-lib[aria-expanded="true"] .sm-name, .sm-lib[aria-expanded="true"] .sm-role, .sm-lib[aria-expanded="true"] .sm-meta,
.sm-lib[aria-expanded="true"]::after { color: #fff; }
.sm-lib[aria-expanded="true"]::after { content: "−"; }
.sm-libs li[data-rel] .sm-name::after {
  margin-left: 8px; font-size: 10px; letter-spacing: .06em; font-weight: 700; vertical-align: 2px;
  border: 1px solid currentColor; padding: 0 5px; line-height: 15px; display: inline-block;
}
.sm-libs li[data-rel="dep"] .sm-name::after { content: "의존"; }
.sm-libs li[data-rel="user"] .sm-name::after { content: "사용"; }
.sm-libs li[data-rel] .sm-lib { background: var(--surface-2); }
.sm-libs li[data-rel] .sm-lib:hover { background: var(--text); }
.sm-panel {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .28s ease, visibility 0s linear .28s;
}
.sm-panel.open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .28s ease, visibility 0s; }
.sm-panel-in { overflow: hidden; min-height: 0; padding: 0 14px; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.sm-panel-in > :first-child { margin-top: 16px; }
.sm-panel.open .sm-panel-in { border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
.sm-sum { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: var(--text-dim); max-width: 70ch; }
.sm-points { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sm-libs .sm-points li { margin: 0; padding: 10px 12px; background: var(--surface-2); }
.sm-libs .sm-points li::before, .sm-libs .sm-points li::after { content: none; }
.sm-points b { display: block; font-size: 13px; color: var(--text); line-height: 1.45; }
.sm-points span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.55; color: var(--text-dim); }
.sm-rel { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 10px; margin: 0 0 4px; font-size: 12.5px; }
.sm-rel dt { font-size: 10.5px; letter-spacing: .08em; font-weight: 700; color: var(--text-faint); padding-top: 2px; }
.sm-rel dd { margin: 0; color: var(--text); }
.sm-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; }
.sm-actions a { color: var(--text); }
.sm-ext { margin: 14px 0 0 46px; font-size: 11.5px; color: var(--text-faint); }
@keyframes sm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.reuse { margin: 26px 0 0; border-top: 1px solid var(--rule); }
.reuse-row {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 18px;
  padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px;
}
.reuse-row .k { font-weight: 700; color: var(--text); }
.reuse-row .d { color: var(--text-dim); }
@media (max-width: 760px) {
  .sm-mods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-lib { grid-template-columns: minmax(0, 1fr) 18px; }
  .sm-lib .sm-role, .sm-lib .sm-meta { grid-column: 1; }
  .sm-lib::after { grid-column: 2; grid-row: 1; }
  .sm-points { grid-template-columns: minmax(0, 1fr); }
  .sm-head .sm-meta { margin-left: 0; flex-basis: 100%; }
  .reuse-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- dependency chain (library pages) ---------- */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin: 26px 0 0; font-size: 12px; }
.chain .lbl {
  flex-basis: 100%; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 4px; font-weight: 600;
}
.chain a { display: inline-block; padding: 3px 9px; border: 1px solid var(--rule); color: var(--text-dim); text-decoration: none; }
.chain a:hover { border-color: var(--text); color: var(--text); }
.chain a.on { background: var(--text); border-color: var(--text); color: #fff; font-weight: 700; }
.chain i { font-style: normal; color: var(--text-faint); padding: 0 1px; }

/* ---------- timeline ---------- */
.tl { list-style: none; margin: 22px 0 0; padding: 0; }
.tl-era {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px;
  padding: 22px 0 6px; border-top: 1px solid var(--rule); scroll-margin-top: 80px;
}
.tl-era:first-child { border-top: none; padding-top: 4px; }
.tl-era .n { font-size: 11px; color: var(--text-faint); letter-spacing: 0.06em; padding-top: 4px; text-align: right; }
.tl-era .h { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.45; }
.tl-era .h small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-faint); }
.tl-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; }
.tl-date { font-size: 12px; color: var(--text-faint); padding: 11px 0 0; text-align: right; white-space: nowrap; }
.tl-body { position: relative; border-left: 1px solid var(--rule); padding: 9px 0 11px 20px; min-width: 0; }
.tl-body::before {
  content: ""; position: absolute; left: -4px; top: 17px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--text);
}
.tl-item.minor .tl-body::before { background: var(--bg); border: 1px solid var(--text-faint); width: 5px; height: 5px; left: -4px; top: 18px; }
.tl-repo {
  display: inline-block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  color: var(--text-dim); border: 1px solid var(--rule); padding: 0 6px; margin-right: 8px;
  line-height: 17px; vertical-align: 2px;
}
.tl-item.key .tl-repo { background: var(--text); border-color: var(--text); color: #fff; }
.tl-head { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.55; }
.tl-sub { margin-top: 3px; font-size: 13.5px; line-height: 1.65; color: var(--text-dim); }
.tl-sub b { color: var(--text); }
.tl a { color: inherit; text-underline-offset: 2px; }
@media (max-width: 640px) {
  .tl-era, .tl-item { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tl-era .n { text-align: left; }
  .tl-date { text-align: left; padding: 8px 0 0 21px; border-left: 1px solid var(--rule); }
  .tl-body { padding-top: 2px; }
  .tl-body::before { top: -11px; }
}

/* ---------- commit heatmap ---------- */
.hm { position: relative; margin: 22px 0 0; }
.hm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hm svg { display: block; width: 100%; height: auto; min-width: 720px; }
.hm.single svg { min-width: 640px; }
.hm .cell { cursor: default; }
.hm .cell:hover, .hm .cell.hot { stroke: var(--text); stroke-width: 1.5; }
.hm .rowlbl { font-size: 12px; font-weight: 700; fill: var(--text); }
.hm a .rowlbl { text-decoration: underline; text-decoration-color: var(--rule); }
.hm .yr { font-size: 11px; fill: var(--text-faint); }
.hm .era-line { stroke: var(--text); stroke-width: 1; fill: none; }
.hm .era-n { font-size: 10.5px; font-weight: 700; fill: var(--text); }
.hm .ysep { stroke: var(--rule); stroke-width: 1; }
.hm-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; flex-wrap: wrap;
  margin-top: 12px; font-size: 11.5px; color: var(--text-faint);
}
.hm-legend { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hm-legend i { width: 12px; height: 12px; display: inline-block; }
.hm-legend span { margin: 0 4px; }
.hm-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3;
  background: var(--text); color: #fff; padding: 6px 10px 7px; font-size: 11.5px; line-height: 1.4;
  white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .08s;
}
.hm-tip b { display: block; font-size: 14px; }
.hm-tip em { display: block; font-style: normal; color: #bdbdbd; font-size: 11px; }
.hm-tip em:empty { display: none; }
.hm-tip.show { opacity: 1; }
.hm .cell.has { cursor: pointer; }
.hm .cell.sel { stroke: var(--text); stroke-width: 2; }
.hm.compact .hm-foot { margin-top: 8px; }
button.hm-month {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--text); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px;
}
button.hm-month:hover { text-decoration-color: var(--text); }

/* ---------- commit drill-down panel ---------- */
.hm-panel { margin: 16px 0 0; border-top: 2px solid var(--text); border-bottom: 1px solid var(--rule); background: var(--bg); }
.hp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 0 12px; }
.hp-title b { display: block; font-size: 20px; letter-spacing: -0.01em; color: var(--text); line-height: 1.2; }
.hp-title span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-faint); }
.hp-close {
  appearance: none; flex: none; width: 32px; height: 32px; border: 1px solid var(--rule); background: var(--bg);
  color: var(--text-dim); font-size: 18px; line-height: 1; cursor: pointer;
}
.hp-close:hover { border-color: var(--text); color: var(--text); }
.hp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 12px; }
.hp-chip {
  appearance: none; border: 1px solid var(--rule); background: var(--bg); padding: 3px 9px;
  font: inherit; font-size: 12px; color: var(--text-dim); cursor: pointer;
}
.hp-chip:hover { border-color: var(--text); color: var(--text); }
.hp-chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.hp-chip .n { margin-left: 6px; opacity: 0.7; }
.hp-body { border-top: 1px solid var(--rule); max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; }
.hp-empty { margin: 14px 0; font-size: 13px; color: var(--text-faint); }
.hp-day {
  position: sticky; top: 0; z-index: 1; display: flex; gap: 10px; align-items: baseline;
  padding: 12px 0 6px; background: var(--bg); font-size: 11.5px; color: var(--text-faint); border-bottom: 1px solid var(--rule);
}
.hp-day b { font-size: 12.5px; color: var(--text); }
.cm { border-bottom: 1px solid var(--rule); }
.cm-row {
  appearance: none; width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px;
  align-items: baseline; padding: 9px 6px; border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
}
.cm-row.multi { grid-template-columns: 46px auto minmax(0, 1fr) auto; }
.cm-row:hover, .cm-row[aria-expanded="true"] { background: var(--surface-2); }
.cm-time { font-size: 11.5px; color: var(--text-faint); }
.cm-repo {
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--text-dim);
  border: 1px solid var(--rule); padding: 0 5px; line-height: 16px; background: var(--bg); white-space: nowrap;
}
.cm-title { font-size: 13.5px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.cm-stat { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.cm-detail { padding: 4px 6px 16px 62px; background: var(--surface-2); }
.cm-desc { margin: 0 0 12px; padding-left: 16px; font-size: 13px; line-height: 1.65; color: var(--text-dim); }
.cm-desc li { margin: 2px 0; }
.cm-desc li.sub { list-style: none; margin-left: 4px; color: var(--text-faint); }
.cm-desc li.sub::before { content: "↳ "; }
.cm-nodesc { margin: 0 0 10px; font-size: 12.5px; color: var(--text-faint); }
.cm-k { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--text-faint); margin-bottom: 6px; }
.cm-areas { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; font-size: 12px; margin-bottom: 10px; }
.cm-area { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.cm-bar { display: flex; height: 8px; background: var(--bg); }
.cm-bar i { display: block; height: 100%; }
.cm-bar .add { background: var(--text); }
.cm-bar .del { background: #b5b5b5; }
.cm-num { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.cm-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 11.5px; color: var(--text-faint); }
.cm-link { color: var(--text); }
.cm-local { color: var(--text-dim); }
@media (max-width: 640px) {
  .cm-row, .cm-row.multi { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .cm-row.multi .cm-repo { display: none; }
  .cm-detail { padding-left: 10px; }
  .cm-areas { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .hp-body { max-height: none; }
}
.era-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; border-top: 1px solid var(--rule); }
.era-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.era-list li b { color: var(--text); margin-right: 6px; }
.era-list li .mono { display: block; font-size: 10.5px; color: var(--text-faint); }
.era-list a { color: inherit; text-decoration: none; }
.era-list a:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .era-list { grid-template-columns: minmax(0, 1fr); } }
table.spec.compact th, table.spec.compact td { padding: 6px 12px 6px 0; }
table.spec.compact td.num, table.spec.compact th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- inline SVG diagrams ---------- */
.fig { margin: 26px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0 16px; }
.fig .cap {
  display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 12px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint);
}
.fig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fig-scroll > svg { display: block; width: 100%; height: auto; min-width: 760px; }
.fig .note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-faint); }
.fig .note b { color: var(--text-dim); }
svg.dg { font-family: Pretendard, "Pretendard Variable", "Noto Sans KR", "Segoe UI", sans-serif; }
svg.dg .box { fill: var(--bg); stroke: var(--text); stroke-width: 1; }
svg.dg .box-soft { fill: var(--surface-2); stroke: var(--rule); stroke-width: 1; }
svg.dg .box-ink { fill: var(--text); stroke: var(--text); stroke-width: 1; }
svg.dg .box-dash { fill: var(--bg); stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 4 3; }
svg.dg .lane { fill: var(--surface-2); }
svg.dg .t { fill: var(--text); font-size: 13px; font-weight: 700; }
svg.dg .t-inv { fill: #fff; font-size: 13px; font-weight: 700; }
svg.dg .s { fill: var(--text-dim); font-size: 11.5px; }
svg.dg .s-inv { fill: #d9d9d9; font-size: 11.5px; }
svg.dg .m {
  font-family: "Cascadia Code", "SF Mono", Consolas, "JetBrains Mono", ui-monospace, Pretendard, monospace;
  fill: var(--text-faint); font-size: 10.5px; letter-spacing: 0.04em;
}
svg.dg .m-ink { font-family: "Cascadia Code", "SF Mono", Consolas, ui-monospace, Pretendard, monospace; fill: var(--text); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; }
svg.dg .edge { stroke: var(--text); stroke-width: 1.2; fill: none; }
svg.dg .edge-soft { stroke: var(--text-faint); stroke-width: 1; fill: none; stroke-dasharray: 4 3; }
svg.dg .rule { stroke: var(--rule); stroke-width: 1; }
svg.dg a:hover .box, svg.dg a:focus-visible .box { fill: var(--surface-2); }

footer { border-top: 1px solid var(--rule); padding: 48px 0 60px; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-end; }
.foot-line { color: var(--text-dim); font-size: 14px; max-width: 46ch; }
.contact { display: flex; gap: 20px; flex-wrap: wrap; }
.contact a {
  text-decoration: none; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--rule); padding-bottom: 2px;
}
.contact a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 640px) {
  .section-body, .job { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .ruler span { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
