/*
 * 포트폴리오 — 세이지 차콜 문서 (디자인 규칙: AGENTS.md 「디자인 규칙」, 근거: docs/design-brief.md)
 * 색·치수는 Frond(src/style.css)·sage-charcoal-theme(build.mjs BASE)·unity-slot-widget(styles.css)에서 옮겼다.
 * 라이트가 기본, 다크는 prefers-color-scheme(저장값이 light 가 아닐 때)과 [data-theme="dark"] 두 곳에 같은 값을 둔다.
 * 색을 더하거나 바꾸면 세 블록(:root · 다크 미디어 쿼리 · [data-theme="dark"])과 맨 아래 인쇄 블록을 함께 고친다.
 */

:root {
  color-scheme: light;
  --bg: #fcfdfc;
  --surface: #f0f3f0;
  --fg: #2c3333;
  --muted: #515b56;
  --line: #dae1da;
  --accent: #567e65;
  --accent-text: #3f6150;   /* surface·행 위 강조 글자 (#567e65 는 surface 위 4.11 이라 글자에 쓰지 않는다) */
  --on-accent: #ffffff;
  --row: #f3f5f3;           /* 위젯 카드 행 = fg 4% */
  --row-hover: #ebeeec;     /* fg 7% */
  --inset: #fcfdfc;         /* 펼친 행 안의 라벨/값 면 */
  --line-soft: #e5eae5;
  --tab-bg: #e2e7e2;
  --tab-line: #bbc2bc;
  --toc-hover: rgba(86, 126, 101, 0.12);
  --badge-bg: #96bea1;
  --badge-fg: #1b2221;
  --img-ring: rgba(44, 51, 51, 0.1);
  --sel: rgba(86, 126, 101, 0.24);
  --show-sun: none;
  --show-moon: block;

  --font-ui: "Pretendard Variable", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Malgun Gothic 은 monospace 뒤에 둔다 (앞에 두면 ASCII 칸 폭이 벌어진다 — Frond tokens.css) */
  --font-mono: "D2Coding", "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace, "Malgun Gothic";
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --side-w: 264px;
  --head-h: 48px;
  --gutter: clamp(16px, 5vw, 40px);
  --kv-label: 72px;         /* 라벨/값 표의 라벨 열 — 문서 전체에서 한 값 */
  --rail: 240px;            /* 짧은 대표 작업의 그림 열 · 경력 표의 회사 열 */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b2221;
    --surface: #262e2c;
    --fg: #e4eae4;
    --muted: #949a96;
    --line: #474e4c;
    --accent: #96bea1;
    --accent-text: #96bea1;
    --on-accent: #1b2221;
    --row: #232a29;
    --row-hover: #29302f;
    --inset: #1b2221;
    --line-soft: #343c3a;
    --tab-bg: #121716;
    --tab-line: #636a67;
    --toc-hover: rgba(150, 190, 161, 0.12);
    --badge-bg: #3f6150;
    --badge-fg: #ffffff;
    --img-ring: rgba(228, 234, 228, 0.1);
    --sel: rgba(150, 190, 161, 0.36);
    --show-sun: block;
    --show-moon: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b2221;
  --surface: #262e2c;
  --fg: #e4eae4;
  --muted: #949a96;
  --line: #474e4c;
  --accent: #96bea1;
  --accent-text: #96bea1;
  --on-accent: #1b2221;
  --row: #232a29;
  --row-hover: #29302f;
  --inset: #1b2221;
  --line-soft: #343c3a;
  --tab-bg: #121716;
  --tab-line: #636a67;
  --toc-hover: rgba(150, 190, 161, 0.12);
  --badge-bg: #3f6150;
  --badge-fg: #ffffff;
  --img-ring: rgba(228, 234, 228, 0.1);
  --sel: rgba(150, 190, 161, 0.36);
  --show-sun: block;
  --show-moon: none;
}

/* ------------------------------------------------------------------ */
/* 바탕                                                                 */
/* ------------------------------------------------------------------ */

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 한국어 줄바꿈 (Frond ko.css) */
:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; line-break: auto; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
a[href^="http"], a[href^="mailto"] { overflow-wrap: anywhere; }
.nw { white-space: nowrap; }
.sep { color: var(--muted); margin: 0 0.45em; }

::selection { background: var(--sel); }

img { max-width: 100%; }

a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); transition: text-decoration-color 0.15s; }
a:hover { text-decoration-color: currentColor; }

/* mono 는 Pretendard 보다 획이 굵고 x높이가 커서 한 단계 작게, 문장 안에서는 흐린 색으로 */
.mono { font-family: var(--font-mono); font-size: 0.84em; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }

/* 포커스 링은 요소 자기 모양(.tab 7 7 0 0 · .row-head 8 · .icon-btn 6 · 목차 4 …)을 따른다 — 여기서 radius 를 덮어쓰지 않는다 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
button:focus-visible, .icon-btn:focus-visible, .topics a:focus-visible, .toc a:focus-visible, .side-docs a:focus-visible, .media a:focus-visible { outline-offset: -2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 12px; border-radius: 6px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* 테마 전환 크로스페이드 (Frond: View Transition 250ms) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 250ms; }

/* ------------------------------------------------------------------ */
/* 셸: 목차 열 + 읽기 판 + 상태 줄                                         */
/* ------------------------------------------------------------------ */

.shell { min-height: 100vh; }

.side { background: var(--surface); color: var(--fg); }

@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    grid-template-areas: "side main" "status status";
    grid-template-rows: 1fr auto;
    /* 목차 열의 면·경계선은 격자에 칠한다 — 붙어 있는 목차 상자(100vh)가 끝난 아래까지 열이 이어진다 */
    background: linear-gradient(to right, var(--surface) 0 calc(var(--side-w) - 1px), var(--line) 0 var(--side-w), transparent 0);
  }
  .side { grid-area: side; }
  .doc { grid-area: main; }
  .status { grid-area: status; }
}

.side-head {
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 20px;
}

.side-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity 0.15s, visibility 0.15s;
}

.side-tools { display: flex; align-items: center; gap: 2px; }

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); color: var(--fg); }
.icon-btn:active { background: color-mix(in srgb, var(--fg) 12%, transparent); }
/* 좁은 화면 머리 띠의 이력서 링크 — 스크롤해도 늘 보이게 (넓은 화면은 목차 열 아래 「문서」가 맡는다) */
.side-resume { text-decoration: none; }

.i {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.i-sun { display: var(--show-sun); }
.i-moon { display: var(--show-moon); }

.side-caption {
  margin: 14px 0 4px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  position: relative;
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.toc a:hover { background: var(--toc-hover); }
.toc ol ol a { padding-left: 20px; font-size: 13px; color: var(--muted); }
.toc a[aria-current] { color: var(--accent-text); font-weight: 600; }
.toc > ol > li > a[aria-current]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.toc li + li { margin-top: 1px; }

.side-docs ul { list-style: none; margin: 0; padding: 0; }
.side-docs a {
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.5;
  text-decoration: none;
}
.side-docs a:hover { background: var(--toc-hover); }

/* 넓은 화면: 목차 열은 화면 높이만큼 붙어 있다 (면·선은 .shell 이 칠한다) */
@media (min-width: 1024px) {
  .side {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
  }
  .toc-btn, .side-resume { display: none; }
  .side-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 12px 16px;
  }
  .side-docs { margin-top: auto; padding-top: 20px; }
}

/* 좁은 화면: 위에 붙는 머리 띠, 목차는 버튼으로 펼친다 (문서 흐름을 밀지 않고 띠 아래로 겹친다) */
@media (max-width: 1023.98px) {
  html { scroll-padding-top: var(--head-h); } /* 키보드 포커스·앵커 이동이 머리 띠 밑으로 숨지 않게 */
  .side {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--line);
  }
  .side-head {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 calc(var(--gutter) - 8px) 0 var(--gutter); /* 버튼 안쪽 여백 8px 만큼 당겨 아이콘이 본문 오른쪽 끝에 맞는다 */
  }
  /* 소개(h1·이력서 버튼)가 보이는 동안은 머리 띠의 이름·이력서 링크를 숨긴다 — 같은 것이 두 번 보이지 않게 */
  .side.at-intro .side-name, .side.at-intro .side-resume { opacity: 0; visibility: hidden; }
  .side-resume { transition: opacity 0.15s, visibility 0.15s, background-color 0.15s, color 0.15s; }
  .side-body {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--head-h));
    max-height: calc(100dvh - var(--head-h));
    overflow-y: auto;
    padding: 0 max(calc(var(--gutter) - 8px), calc((100% - 940px) / 2 + var(--gutter) - 8px)) 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.14);
  }
  .side.is-open .side-body { display: block; }
  .side-docs { margin-top: 8px; }
  .toc a, .side-docs a { padding-top: 8px; padding-bottom: 8px; }
  .toc > ol > li > a[aria-current]::before { left: -8px; top: 9px; bottom: 9px; }
}

/* ------------------------------------------------------------------ */
/* 읽기 판                                                              */
/* ------------------------------------------------------------------ */

.doc {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 40px 96px;
  container-type: inline-size; /* 2단 배치는 화면 폭이 아니라 읽기 판 폭으로 정한다 (목차 열 유무와 무관) */
}

[id] { scroll-margin-top: 24px; }
@media (max-width: 1023.98px) {
  [id] { scroll-margin-top: 16px; } /* + html scroll-padding-top(머리 띠) */
  .doc { padding: 28px var(--gutter) 72px; }
}

h1 {
  margin: 0 0 14px;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  font-size: clamp(30px, 6vw, 38px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 22px;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; }

p { margin: 0 0 12px; }

.block { margin-top: 72px; }

/* 소개 ---------------------------------------------------------------- */

.role { margin: 0; font-size: 17px; font-weight: 600; }
.role-en { color: var(--muted); font-weight: 400; font-size: 15px; }
.role-en::before { content: "·"; margin: 0 0.4em 0 0.15em; }

/* 경력 요약 한 줄 — 가운뎃점은 항목 뒤에 붙여 줄이 "·"로 시작하지 않게 */
.facts-line {
  display: flex;
  flex-wrap: wrap;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}
.facts-line li { white-space: nowrap; }
.facts-line .mono { margin-right: 2px; }
.facts-line li:not(:last-child)::after { content: "·"; margin: 0 0.5em; }

.intro-grid { display: grid; gap: 28px 40px; margin-top: 20px; }
@container (min-width: 760px) {
  .intro-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: start; }
}

.lead { margin: 0 0 6px; font-size: 17px; line-height: 1.75; }
.lead-sub { margin: 0; font-size: 15px; color: var(--muted); }

.link-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 20px 0 0;
  font-size: 15px;
}
.link-line .sep { margin: 0; }
.btn-accent {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }

/* 위젯 구획 라벨: 라벨 + 오른쪽 개수 + 아래 1px 선 */
.group-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.group-label .count { font-family: var(--font-mono); font-weight: 400; font-size: 12px; }

/* 참여작 팀 성과 — 카드 없이 라벨/값 표와 같은 결의 줄 */
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list li { padding: 8px 0; }
.team-list li + li { border-top: 1px solid var(--line-soft); }
.team-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.45; }
.team-desc { display: block; margin-top: 1px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
/* 소개가 한 단일 때(읽기 판 600~759px)는 이름 | 성과 두 칸 — 짧은 대표 작업의 글 열과 같은 자리 */
@container (min-width: 600px) and (max-width: 759.98px) {
  .team-list li { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); column-gap: 28px; align-items: baseline; }
  .team-desc { margin-top: 0; }
}

.footnote { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

.app-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--img-ring);
  background: var(--surface);
}

/* 라벨/값 표 (unity-slot-widget 펼친 행) */
.kv { margin: 0; }
.kv > div {
  display: grid;
  grid-template-columns: var(--kv-label) minmax(0, 1fr);
  gap: 14px;
  padding: 7px 0;
}
.kv > div + div { border-top: 1px solid var(--line-soft); }
.kv dt { color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.kv dd { margin: 0; font-size: 15px; min-width: 0; }
.kv dd ul { margin: 0; padding-left: 1.1em; }
.kv dd ul.plain { list-style: none; padding-left: 0; }
.kv dd li + li { margin-top: 2px; }
.kv dd ul:not(.plain) { list-style: disc; }
.kv dd li::marker { color: var(--muted); }

/* 대표 작업 ----------------------------------------------------------- */

.featured-list { display: grid; }

.feat-fig { margin: 0; }
.feat-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--img-ring);
  background: var(--surface);
}
.feat-fig figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.feat-fig figcaption a { color: var(--muted); }
.feat-fig figcaption a:hover { color: var(--fg); }

.feat-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 14px;
}
.feat-period { color: var(--muted); font-size: 13px; }
.feat-headline { margin: 4px 0 0; font-size: 16px; line-height: 1.6; font-weight: 500; }
.feat-more { margin: 10px 0 0; font-size: 14px; }
.feat-more a { font-weight: 600; }

/* 첫 대표 작업: 읽기 판 폭 그대로의 배너 + 아래 설명 */
.feat-lead .feat-body { margin-top: 18px; }
.feat-lead h3 { font-size: 22px; }
.feat-lead .kv { margin-top: 14px; border-top: 1px solid var(--line); }
.feat-lead .kv dd { font-size: 14.5px; }

/* 나머지 둘: 작은 그림 + 제목·한 줄·역할 */
.feat-compact { display: grid; gap: 14px 28px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.feat-lead + .feat-compact { margin-top: 36px; }
@container (min-width: 600px) {
  .feat-compact { grid-template-columns: var(--rail) minmax(0, 1fr); align-items: start; }
}
/* 좁은 판: 작은 그림 옆에 제목·기간, 아래로 한 줄·역할 — 첫 항목의 큰 배너와 무게를 나눈다 */
@container (max-width: 599.98px) {
  .feat-compact { grid-template-columns: 120px minmax(0, 1fr); gap: 0 14px; align-items: center; }
  .feat-compact .feat-body { display: contents; }
  .feat-compact .feat-fig { grid-area: 1 / 1; }
  .feat-compact .feat-head { grid-area: 1 / 2; flex-direction: column; align-items: flex-start; gap: 0; }
  .feat-compact .feat-headline, .feat-compact .feat-role, .feat-compact .feat-more { grid-column: 1 / -1; }
  .feat-compact .feat-headline { margin-top: 12px; }
}
.feat-compact h3 { font-size: 18px; }
.feat-compact .feat-headline { font-size: 15px; }
.feat-role { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--fg); }
.feat-role-label { color: var(--muted); margin-right: 6px; }

/* 전체 작업: Frond 탭 + 위젯 카드 행 ---------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--tab-line);
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 2px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  flex: none;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px 7px;
  border: 1px solid var(--tab-line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: var(--tab-bg);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] {
  background: var(--bg);
  color: var(--fg);
  box-shadow: inset 0 2px 0 var(--accent), 0 1px 0 var(--bg);
  z-index: 1;
}
.tab .count { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); }

.panel { padding-top: 14px; }
.panel-hint { margin: 0 0 18px; font-size: 14px; color: var(--muted); max-width: 52em; }

.group + .group { margin-top: 22px; }
/* 회사 이름은 대문자로 바꾸지 않는다 — 경력 표·데이터와 같은 표기 (CookApps · Nine Digits) */
.group .group-label { margin-bottom: 8px; letter-spacing: 0.01em; font-size: 12.5px; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.row { border-radius: 8px; background: var(--row); }

.row-head {
  appearance: none;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 16px;
  grid-template-areas:
    "icon title period chev"
    "icon meta  meta   chev"
    "icon blurb blurb  chev";
  column-gap: 14px;
  row-gap: 1px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}
.row-head:hover { background: var(--row-hover); }
.row-head.quiet-focus:focus-visible { outline: none; } /* 첫 로드 딥링크로 옮긴 포커스 — 키를 누르면 링이 돌아온다 (script.js quietFocus) */
.row.plain .row-head {
  grid-template-columns: minmax(0, 1fr) auto 16px;
  grid-template-areas:
    "title period chev"
    "meta  meta   chev"
    "blurb blurb  chev";
}

.row-icon { grid-area: icon; width: 44px; height: 44px; border-radius: 10px; margin-top: 2px; }
/* 묶음 항목: 포함 타이틀 아이콘 넷을 2×2 로 */
.icon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  overflow: hidden;
}
.icon-grid img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }

.row-title {
  grid-area: title;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
  min-width: 0;
}
.row-sub { display: contents; }
.row-period { grid-area: period; align-self: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.row-meta { grid-area: meta; font-size: 13px; color: var(--muted); line-height: 1.5; }
/* 한 줄 설명은 앞에서부터 채운다 (li 의 text-wrap: pretty 를 받으면 짧은 첫 줄 "신규팀 개발"만 남기고 내려 보낸다) */
.row-blurb { grid-area: blurb; font-size: 14px; line-height: 1.55; margin-top: 3px; text-wrap: wrap; }
.row.is-open .row-blurb { display: none; } /* 펼치면 아래 설명이 같은 내용을 더 자세히 말한다 */
.row-chev { grid-area: chev; align-self: center; color: var(--muted); transition: transform 240ms var(--ease); }
.row.is-open .row-chev { transform: rotate(180deg); }
.row.is-open > .row-head { border-radius: 8px 8px 0 0; }

/* 팀 성과 표시 (접힌 행의 순위·수상·리텐션 구간) */
.team-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  border: 1px solid var(--tab-line);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted);
  vertical-align: 1px;
}

/* shields 결 상태 배지 — 예외(미출시·참여·공개 여부)에만 */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* 펼침: 0fr → 1fr (Frond 패널 240ms) */
.row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms var(--ease); }
.row-body[hidden] { display: none; }
.row.is-open .row-body { grid-template-rows: 1fr; }
.row-inner { overflow: hidden; min-height: 0; }

.detail {
  margin: 0 8px 8px;
  padding: 18px 20px 14px;
  border-radius: 6px;
  background: var(--inset);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.detail-headline { margin: 0 0 6px; font-size: 16px; font-weight: 600; line-height: 1.55; }
.detail-summary { margin: 0 0 16px; font-size: 15px; }
.detail .kv { border-top: 1px solid var(--line-soft); }
.detail .kv dd { font-size: 14.5px; }

/* 그림 줄 — 누르면 원본을 새 탭에서 연다 */
.media {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}
.media a { position: relative; flex: none; display: block; max-width: 100%; border-radius: 6px; } /* relative: 숨김 글자(새 탭)가 가로 스크롤 상자 밖으로 새지 않게 */
.media img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;  /* 넓은 배너는 판 폭에 맞춰 비율대로 줄고, 세로 화면은 높이 240px 에 맞춘다 */
  max-height: 240px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--img-ring);
  background: var(--surface);
  transition: filter 0.15s;
}
.media a:hover img { filter: brightness(0.94); }

.minor { list-style: none; display: flex; flex-wrap: wrap; gap: 14px 18px; margin: 0 0 16px; padding: 0; }
.minor li { width: 76px; text-align: center; font-size: 12px; line-height: 1.4; color: var(--muted); }
.minor img { display: block; width: 52px; height: 52px; margin: 0 auto 6px; border-radius: 12px; box-shadow: 0 0 0 1px var(--img-ring); }

.detail-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.copy-btn { font-size: 12.5px; }
/* 자동 복사가 막혔을 때 버튼 옆에 보이는 주소 (골라 둔 상태로 나온다) */
.copy-fallback {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 440px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--tab-line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* 코드 ----------------------------------------------------------------- */

.topics { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0 24px; }
@container (min-width: 560px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 두 줄 행: 토픽 이름 / 흐린 mono 앵커 — 2열에서 앵커가 옆 열 이름에 붙어 보이지 않게 이름 바로 아래에 둔다 */
.topics a {
  display: flex;
  flex-direction: column;
  margin: 0 -10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.45;
  transition: background-color 0.15s;
}
.topics a:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.topic-name { font-size: 15px; font-weight: 600; }
.topic-anchor { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.more-line { margin: 14px 0 0; font-size: 15px; }
.more-line a { font-weight: 600; }

/* 경력 ----------------------------------------------------------------- */

.about-grid { display: grid; gap: 20px 36px; }
.about-copy p:last-child { margin-bottom: 0; }
.about-photo { margin: 0; }
.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--img-ring);
  background: var(--surface);
}
@container (min-width: 560px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) 132px; align-items: start; }
}
@container (max-width: 559.98px) {
  .about-photo { order: -1; width: 104px; }
}

.career {
  width: 100%;
  margin-top: 28px;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.career th, .career td { padding: 10px 16px 10px 0; text-align: left; vertical-align: middle; }
.career thead th {
  padding-top: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.career tbody th { font-weight: 600; }
.career tbody tr + tr > * { border-top: 1px solid var(--line-soft); }
.career .period { white-space: nowrap; }
.career .period .mono { font-size: 13.5px; color: var(--fg); margin-right: 3px; }
.career .col-bar { width: 36%; padding-right: 0; }

/* 시간축 (사용률 바가 아니다): 1px 선 위에 재직 구간, 해마다 눈금 + 머리 칸에 연도 */
.career thead .col-bar { position: relative; }
.axis { position: relative; display: block; height: 1.4em; }
.axis span {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.track { position: relative; display: block; height: 1px; background: var(--line); }
.track .tick { position: absolute; top: -3px; height: 7px; width: 1px; background: var(--line); }
.track .fill { position: absolute; top: -3px; height: 7px; border-radius: 1px; background: var(--accent); min-width: 3px; }

@media (max-width: 719.98px) {
  .career .col-bar { display: none; }
  .career .period { white-space: normal; }
}
@container (min-width: 600px) {
  .career .col-co { width: calc(var(--rail) + 28px); }
}

.kv-stack { margin-top: 24px; border-top: 1px solid var(--line); }
.kv-stack dd { line-height: 1.75; }

.kv-contact .mono { font-size: 14px; }
.kv-contact > div:first-child { padding-top: 0; } /* h2 밑줄이 위 경계를 맡는다 */

/* 상태 줄 (Frond 상태바 결, 페이지 끝) ---------------------------------- */

.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 6px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.status p { margin: 0; }
.status .mono { font-size: 1em; }
.status a { color: var(--muted); text-decoration: none; }
.status a:hover { color: var(--fg); text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* 좁은 화면 행 배치                                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 719.98px) {
  /* 아이콘 옆은 제목·기간 두 줄만, 설명은 아이콘 밑까지 넓게 */
  .row-head {
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    grid-template-areas:
      "icon  title chev"
      "icon  sub   sub"
      "blurb blurb blurb";
    column-gap: 12px;
    padding: 12px;
  }
  .row-icon { width: 40px; height: 40px; margin-top: 0; }
  .row-sub { display: block; grid-area: sub; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
  .row-period { font-size: 11.5px; }
  .row-period + .row-meta::before { content: "·"; margin: 0 5px; }
  .row-blurb { margin-top: 8px; }
  .row.plain .row-head {
    grid-template-columns: minmax(0, 1fr) 20px;
    grid-template-areas: "title chev" "sub sub" "blurb blurb";
  }
  .row.plain .row-blurb { margin-top: 4px; }
  .row-chev { justify-self: end; }
  .kv-contact .mono { font-size: 13px; }
  .detail { margin: 0 6px 6px; padding: 16px 14px 12px; }
  .detail .kv { --kv-label: 60px; }
  .kv > div { gap: 10px; }
  .media img { max-height: 180px; }
  .media a:not(:only-child) { max-width: 85%; } /* 넓은 배너가 판을 다 채우면 옆 그림이 있는 줄 모른다 — 다음 그림이 조금 보이게 */
  .role-en { display: block; margin-top: 2px; }
  .role-en::before { content: none; }
  .lead { font-size: 16px; }
  .block { margin-top: 64px; }
}

@media (max-width: 380px) {
  .kv > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* 고대비(Windows forced colors): 바탕·그림자가 사라지므로 고른 탭과 카드 행·펼친 표의 경계를 선으로 남긴다 */
@media (forced-colors: active) {
  .tab[aria-selected="true"] { border-color: Highlight; border-top-width: 3px; }
  .row { border: 1px solid CanvasText; }
  .detail { border: 1px solid CanvasText; }
  .toc > ol > li > a[aria-current]::before { background: Highlight; forced-color-adjust: none; }
}

/* ------------------------------------------------------------------ */
/* PDF(?pdf=1) · 인쇄 — 모든 작업을 펼친 문서                              */
/*   html[data-pdf="1"]: PDF 생성(scripts/generate-pdfs.mjs)과 그 화면 미리보기                */
/*   @media print: 브라우저 인쇄와 PDF 생성(인쇄 매체로 찍는다) — 두 곳의 숨김 목록을 같게 둔다   */
/* ------------------------------------------------------------------ */

.pdf-doc, .on-paper { display: none; }

html[data-pdf="1"] .skip-link,
html[data-pdf="1"] .side,
html[data-pdf="1"] .link-line,
html[data-pdf="1"] #featured,
html[data-pdf="1"] .tabs,
html[data-pdf="1"] #work-panels,
html[data-pdf="1"] .more-line,
html[data-pdf="1"] .about-photo,
html[data-pdf="1"] .status-top,
html[data-pdf="1"] .on-screen { display: none !important; }

html[data-pdf="1"] .pdf-doc { display: block; }
html[data-pdf="1"] .on-paper { display: inline; }
html[data-pdf="1"] .doc-links a { display: block; width: fit-content; }
html[data-pdf="1"] .doc-links .sep { display: none; }
html[data-pdf="1"] .shell { display: block; background: none; }
html[data-pdf="1"] .block { margin-top: 44px; }
html[data-pdf="1"] .about-grid { grid-template-columns: minmax(0, 1fr); }
html[data-pdf="1"] .status { background: none; }
html[data-pdf="1"] *, html[data-pdf="1"] *::before, html[data-pdf="1"] *::after { transition: none !important; animation: none !important; }

/* 펼친 목록: 카테고리 제목 → 작업 블록 (화면의 펼친 행과 같은 라벨/값 표) */
.pdf-cat + .pdf-cat { margin-top: 40px; }
.pdf-cat-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  break-after: avoid;
}
.pdf-cat-title .count { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.pdf-cat-hint { margin: 8px 0 4px; font-size: 13.5px; color: var(--muted); break-after: avoid; }

.pdf-project { padding: 18px 0 10px; }
.pdf-project + .pdf-project { border-top: 1px solid var(--line-soft); }
.pdf-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; break-inside: avoid; break-after: avoid; }
.pdf-head.plain { display: block; }
.pdf-icon { width: 40px; height: 40px; }
.pdf-head h4 { margin: 0; font-size: 16.5px; line-height: 1.4; font-weight: 700; letter-spacing: -0.01em; }
.pdf-meta { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pdf-headline { margin: 10px 0 4px; font-size: 14.5px; line-height: 1.55; font-weight: 600; break-after: avoid; }
.pdf-summary { margin: 0 0 10px; font-size: 14px; line-height: 1.65; }
.pdf-project .kv { border-top: 1px solid var(--line-soft); }
.pdf-project .kv > div { padding: 5px 0; break-inside: avoid; }
.pdf-project .kv dt { font-size: 12.5px; line-height: 1.7; }
.pdf-project .kv dd { font-size: 13.5px; line-height: 1.65; }
.pdf-url { font-family: var(--font-mono); font-size: 0.86em; color: var(--accent-text); overflow-wrap: anywhere; }

@media print {
  /* 다크 테마로 인쇄해도 밝은 문서가 나오게 토큰을 라이트 값으로 고정 (선택자 셋 = 위 테마 블록 셋) */
  :root, :root[data-theme], :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #f0f3f0;
    --fg: #2c3333;
    --muted: #515b56;
    --line: #dae1da;
    --accent: #567e65;
    --accent-text: #3f6150;
    --on-accent: #ffffff;
    --line-soft: #e5eae5;
    --img-ring: rgba(44, 51, 51, 0.1);
  }

  .skip-link,
  .side,
  .link-line,
  #featured,
  .tabs,
  #work-panels,
  .more-line,
  .about-photo,
  .status-top,
  .on-screen,
  .copy-btn,
  .row-chev { display: none !important; }

  .pdf-doc { display: block; }
  .on-paper { display: inline; }
  .doc-links a { display: block; width: fit-content; }
  .doc-links .sep { display: none; }

  html { scroll-behavior: auto; }
  body { background: #ffffff; }
  .shell { display: block; min-height: 0; background: none; }
  .doc { max-width: none; padding: 0; }
  .block { margin-top: 36px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .status { margin-top: 28px; padding: 8px 0 0; background: none; }

  h1, h2, h3, h4, .group-label { break-after: avoid; }
  .team-list li, .career, .kv > div, .topics li { break-inside: avoid; }
  a { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
