/* sungd.uk/cv — 이력서 리마스터 스타일 (단일 수직 축 에디토리얼 + 2단 마진 시스템)
   홈(sungd.uk)의 미니멀 타이포그래피, 여백, 색상 시스템을 계승 */

/* ── 글꼴: 홈과 같은 체계. 제목 SUIT, 요약 마루부리, 영문 Plus Jakarta Sans(알파벳만), 날짜 숫자 Geist Mono ── */
@font-face { font-family: "SUIT"; src: url("/fonts/SUIT-SemiBold.subset.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "SUIT"; src: url("/fonts/SUIT-Bold.subset.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "SUIT"; src: url("/fonts/SUIT-ExtraBold.subset.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "MaruBuri"; src: url("/fonts/MaruBuri-Regular.subset.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta Letters"; src: url("/fonts/PlusJakartaSans-400.latin.woff2") format("woff2"); font-weight: 400 500; font-display: swap; unicode-range: U+0041-005A, U+0061-007A; }
@font-face { font-family: "Jakarta Letters"; src: url("/fonts/PlusJakartaSans-600.latin.woff2") format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0041-005A, U+0061-007A; }
@font-face { font-family: "Geist Digits"; src: url("https://fonts.gstatic.com/s/geistmono/v6/or3yQ6H-1_WfwkMZI_qYPLs1a-t7PU0AbeE9KK5U5Cl4PuCTTNs.woff2") format("woff2"); font-weight: 400 500; font-display: swap; unicode-range: U+0030-0039; }

:root {
  --bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4f4f4f;
  --text-tertiary: #9a9a9a;
  --line: rgba(0, 0, 0, 0.08);
  --hover-bg: rgba(0, 0, 0, 0.035);
  --accent: #1a1a1a;
  --marker: rgba(255, 214, 51, 0.45);

  --font-sans: "Jakarta Letters", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --font-head: "Plus Jakarta Sans", "SUIT", Pretendard, sans-serif;
  --font-serif: "Jakarta Letters", "MaruBuri", serif;
  --font-date: "Geist Digits", "Jakarta Letters", Pretendard, sans-serif;
  --font-mono: monospace;
  color-scheme: light dark;

  /* 좌측 2단 마진형 기본 컬럼 너비 (대단락 17px 볼드 기준 3글자 여유) */
  --side-col-w: 58px;
  --side-col-gap: 16px;

  /* 타이포그래피 스케일 */
  --size-title: 1.375rem;     /* 22px 이름 */
  --size-sec: 1.0625rem;      /* 17px 섹션 대제목 (볼드 800) */
  --size-main: 0.96875rem;    /* 15.5px 메인 항목 */
  --size-desc: 0.875rem;      /* 14px 본문 설명 */
  --size-date: 0.8125rem;     /* 13px 날짜 */
  --size-badge: 0.71875rem;   /* 11.5px 뱃지 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090a0c;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --line: rgba(255, 255, 255, 0.09);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --accent: #f4f4f5;
    --marker: rgba(255, 214, 51, 0.3);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.nowrap {
  white-space: nowrap;
}

/* ── 레이아웃 컨테이너 (660px 2단 마진형) ── */
.cv-wrap {
  width: 100%;
  max-width: 660px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ── 상단 네비게이션 ── */
.nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-md-btn,
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4.5px;
  height: 24px;
  padding: 0 8px;
  box-sizing: border-box;
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.copy-md-btn:hover,
.lang-switch:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
  border-color: var(--line);
}

.copy-md-btn svg {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.copy-md-btn.copied {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}
.back-home:hover {
  color: var(--text-primary);
}

/* ── 프로필 헤더 ── */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-contact-right {
  text-align: right;
}
.header-contact-right .contact-link {
  font-size: 0.84375rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.header-contact-right .contact-link:hover {
  color: var(--accent);
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .avatar {
    filter: invert(1) brightness(0.9);
  }
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.name-ko {
  font-size: var(--size-title);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.name-en {
  font-size: var(--size-desc);
  font-weight: 400;
  color: var(--text-tertiary);
}

.role-line {
  font-size: var(--size-desc);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.contact-link {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  transition: color 0.15s ease;
}
.contact-link:hover {
  color: var(--text-primary);
}

/* ── 섹션 그룹 (좌측 2단 마진 시스템) ── */
.cv-sections {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.cv-sections > section {
  display: grid;
  grid-template-columns: var(--side-col-w) 1fr;
  gap: var(--side-col-gap);
  align-items: start;
  position: relative;
}

.sec-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 0;
}

.sec-title {
  font-size: var(--size-sec);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

.sec-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Google Scholar 인라인 공식 로고 링크 */
.pub-title-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.scholar-inline-btn {
  display: inline-flex;
  align-items: center;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 1px 2px;
  border-radius: 4px;
  transform: translateY(1px);
  transition: all 0.15s ease;
}
.scholar-inline-btn:hover {
  color: #4285F4;
  transform: translateY(1px) scale(1.12);
}
.scholar-logo-svg {
  display: inline-block;
  flex-shrink: 0;
}

/* ── 리스트 & 항목 ── */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.item-list.compact {
  gap: 8px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

#languages .item-row {
  justify-content: flex-start;
  gap: 16px;
}

#languages .lang-score {
  font-size: var(--size-main);
  font-weight: 400;
  color: var(--text-secondary);
}

#languages .item-date {
  font-size: 0.75rem;
}

.item-main {
  font-size: var(--size-main);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.5;
}

.item-main .org {
  color: var(--text-secondary);
  font-weight: 400;
}

.item-date {
  font-size: var(--size-date);
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.item-desc {
  font-size: var(--size-desc);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 4px;
  word-break: keep-all;
}

/* ── 요약문 (Summary) ── */
.summary-box {
  font-family: var(--font-serif);
  font-size: var(--size-desc);
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: keep-all;
  margin-bottom: 34px;
}

/* ── 팀별 상세 블록 & 성과 bullet ── */
.team-group {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 14px;
  margin-left: 3px;
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.team-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.team-dates {
  font-size: 0.78125rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.team-desc-line {
  font-size: 0.78125rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.team-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.team-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.team-bullets li {
  font-size: 0.84375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  position: relative;
  padding-left: 12px;
  word-break: keep-all;
}

.team-bullets li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

.bullet-tree {
  list-style: none;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-left: 14px;
  margin-left: 3px;
}

.bullet-item {
  font-size: var(--size-desc);
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.5;
}

.bullet-name {
  font-weight: 600;
  color: var(--text-primary);
}

.bullet-desc {
  color: var(--text-secondary);
}

/* ── 스킬 섹션 ── */
.skills-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 0.84375rem;
}

.skill-cat {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.skill-items {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── 인용 참조 링크 (위첨자 + 무채색) ── */
.cite-ref {
  display: inline;
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  font-weight: 600;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-left: 2px;
  letter-spacing: -0.02em;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}
.cite-ref:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ── 뱃지 태그 (논문 저자 표기 등) ── */
.badge-tag {
  font-size: var(--size-badge);
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  font-weight: 400;
  margin-left: 4px;
}

/* ── 수상 목록 (연도 좌측 정렬) ── */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 공통 항목 타이포그래피 (수상 및 논문 공통) */
.entry-title {
  font-size: var(--size-desc);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.45;
  word-break: keep-all;
}

.entry-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.entry-title a:hover {
  text-decoration: underline;
  text-underline-offset: 2.5px;
  text-decoration-color: var(--text-tertiary);
}

.entry-venue {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  word-break: keep-all;
}

/* ── 수상 (좌측 수상명 / 우측 연도 그리드) ── */
#awards .entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 14px;
  align-items: baseline;
}

#awards .entry-body {
  display: contents;
}

#awards .entry-title {
  grid-column: 1;
  grid-row: 1;
}

#awards .entry-year {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  font-size: var(--size-date);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

#awards .entry-venue {
  grid-column: 1 / -1;
  grid-row: 2;
}

/* ── 논문 그룹형 (저널 · 학회 · Preprint) & [J1] 2025 가로배치 ── */
.pub-group-wrap {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pub-category {
  display: flex;
  flex-direction: column;
}

.pub-style-a {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pub-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.25;
  margin-top: 1px;
}

.pub-entry {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 2px 8px;
  align-items: baseline;
}

.pub-left-col {
  display: contents;
}

.pub-code {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  line-height: 1.45;
  white-space: nowrap;
}

.pub-year {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  font-size: var(--size-date);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

.pub-entry .entry-body {
  display: contents;
}

.pub-entry .entry-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.78125rem;
  line-height: 1.4;
}

.pub-authors {
  grid-column: 2 / -1;
  grid-row: 2;
  font-size: 0.625rem;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  line-height: 1.4;
  margin: 1px 0 2px;
  word-break: keep-all;
}

.pub-authors .author-me {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--text-tertiary);
}

.pub-entry .entry-venue {
  grid-column: 2 / -1;
  grid-row: 3;
  font-size: 0.71875rem;
  line-height: 1.4;
}

.pub-footnote {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  margin-top: 14px;
  padding-left: 32px;
}

/* 연구실 프로젝트 인용 태그([J1] 등) 클릭 시 은은한 숨 쉬는 펄스 하이라이트 */
@keyframes target-pulse {
  0% {
    background-color: rgba(37, 99, 235, 0.16);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.16);
    border-radius: 4px;
  }
  65% {
    background-color: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.05);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

.pub-entry:target {
  animation: target-pulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  scroll-margin-top: 60px;
}

/* ── 푸터 ── */
footer {
  margin-top: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

footer a:hover {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   모바일 반응형 최적화 (화면 폭 700px 이하)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .cv-wrap {
    padding: 20px 16px 60px;
  }

  .profile-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }
  .header-contact-right {
    text-align: left;
  }

  .summary-box {
    margin-bottom: 22px;
  }

  /* 대섹션 그룹 간격 압축 */
  .cv-sections {
    margin-top: 24px;
    gap: 24px;
  }

  /* 대섹션 1열 상단 스택 전환 & 이중 마진 제거 */
  .cv-sections > section {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sec-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0;
  }

  .sec-title {
    margin-bottom: 0;
  }

  /* 본문 항목 간 상하 간격 압축 */
  .item-list {
    gap: 13px;
  }

  .team-group {
    margin-top: 10px;
    gap: 12px;
    padding-left: 12px;
  }

  .team-bullets {
    gap: 5px;
  }

  .pub-group-wrap {
    gap: 14px;
  }
  .pub-group-title {
    margin-bottom: 6px;
  }
  .pub-style-a {
    gap: 10px;
  }

  /* 수상 연도 우측 정렬 모바일 유지 */
  #awards .entry-row {
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
  }

  /* 논문 [J1] 24px + 본문 1fr + 우측 연도 모바일 3열 유지 */
  .pub-entry,
  .entry-row.pub-entry {
    grid-template-columns: 24px 1fr auto !important;
    gap: 2px 8px !important;
  }

  /* 스킬 모바일 압축 */
  .skills-wrap {
    gap: 8px;
  }
  .skill-row {
    grid-template-columns: 106px 1fr;
    gap: 10px;
    font-size: 0.8125rem;
  }
  .skill-cat {
    font-size: 0.78125rem;
    letter-spacing: -0.01em;
  }

  .pub-footnote {
    padding-left: 32px;
  }
}

/* ── 인쇄 및 PDF 저장 전용 스타일 (Cmd + P) ── */
/* ── 제목, 날짜 숫자, 링크 형광펜 ── */
.name-ko,
.sec-title,
.entry-title,
.team-title,
.skill-cat,
.pub-group-title {
  font-family: var(--font-head);
}
.name-ko {
  font-weight: 800;
}
.item-date,
.pub-year,
.team-dates,
.entry-year,
.lang-score {
  font-family: var(--font-date);
}
a.sec-link {
  text-decoration: underline;
  text-decoration-thickness: 0.3em;
  text-underline-offset: -0.16em;
  text-decoration-color: var(--marker);
  text-decoration-skip-ink: none;
}

/* 영문 섹션 제목(Publications 99px + Scholar 아이콘)이 왼쪽 칸을 넘지 않게 */
html[lang="en"] {
  --side-col-w: 124px;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 12mm 14mm 12mm;
  }

  :root {
    --bg: #ffffff !important;
    --text-primary: #111111 !important;
    --text-secondary: #3f3f46 !important;
    --text-tertiary: #71717a !important;
    --line: rgba(0, 0, 0, 0.12) !important;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cv-wrap {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 웹 전용 내비게이션, 푸터, 버튼 숨김 */
  .nav-top,
  footer,
  .scholar-inline-btn,
  .copy-md-btn,
  .preview-controller,
  .confirm-bar,
  .enh-controller {
    display: none !important;
  }

  header {
    margin-bottom: 16px !important;
  }

  .summary {
    font-size: 0.84rem !important;
    line-height: 1.55 !important;
    margin-bottom: 22px !important;
    color: var(--text-secondary) !important;
  }

  .cv-sections {
    margin-top: 18px !important;
    gap: 20px !important;
  }

  /* 2단 마진 인쇄 폭 최적화 */
  .cv-sections > section {
    grid-template-columns: 50px 1fr !important;
  }
  html[lang="en"] .cv-sections > section {
    grid-template-columns: 124px 1fr !important;
    gap: 14px !important;
  }

  /* 항목 중간에 어색한 페이지 분할 방지 */
  .team-group,
  .entry-row,
  .item-row,
  .skill-row,
  .pub-entry {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

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