/* ═══════════════════════════════════════════════════════
   디자인 토큰 — 색이나 폰트를 바꾸려면 여기만 수정하세요
   ═══════════════════════════════════════════════════════ */
:root {
  --bg:         #ffffff;
  --bg-soft:    #f6f7f9;
  --border:     #e4e6ea;
  --text:       #16181d;
  --text-soft:  #5c6270;
  --accent:     #2f6feb;
  --accent-soft:#eaf0fe;

  --radius: 12px;
  --wrap: 820px;
  --nav-h: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
          "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* 시스템이 다크 모드일 때 (사용자가 토글로 직접 고르지 않은 경우) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #101216;
    --bg-soft:    #171a20;
    --border:     #2a2e37;
    --text:       #e8eaee;
    --text-soft:  #9aa1ae;
    --accent:     #6f9dff;
    --accent-soft:#1b2333;
  }
}

/* 토글로 다크 모드를 직접 선택했을 때 */
:root[data-theme="dark"] {
  --bg:         #101216;
  --bg-soft:    #171a20;
  --border:     #2a2e37;
  --text:       #e8eaee;
  --text-soft:  #9aa1ae;
  --accent:     #6f9dff;
  --accent-soft:#1b2333;
}

/* ═══════════════════════════════════════════════════════
   기본 스타일
   ═══════════════════════════════════════════════════════ */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

/* 이미지·영상이 어떤 경우에도 제 칸을 넘지 않도록 하는 안전장치 */
img, video { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -0.02em; }

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

/* ═══════════════════════════════════════════════════════
   네비게이션
   ═══════════════════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav__brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.nav__brand:hover { text-decoration: none; color: var(--accent); }

.nav__links {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.nav__links a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color .15s ease, background .15s ease;
}
.nav__links a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav__links a.is-active { color: var(--accent); background: var(--accent-soft); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-soft); }
.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  grid-area: 1 / 1;
}
/* 라이트 모드에선 달, 다크 모드에선 해를 보여준다 (누르면 바뀔 모드를 암시) */
.icon-sun { display: none; }
.icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
.hero {
  padding: 96px 0 72px;
}

.hero__eyebrow {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text-soft);
}

.hero__name {
  margin: 0;
  font-size: clamp(38px, 8vw, 60px);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.hero__tagline {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 2.4vw, 19px);
  color: var(--text-soft);
}

.hero__links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

/* 아이콘은 글자색을 따라가므로 hover 시 함께 강조색으로 바뀐다 */
.hero__links svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
}
.hero__links a:hover {
  text-decoration: none;
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ═══════════════════════════════════════════════════════
   섹션 공통
   ═══════════════════════════════════════════════════════ */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section__title {
  margin: 0 0 32px;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section__num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.sub-title {
  margin: 40px 0 20px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}
.sub-title:first-of-type { margin-top: 0; }

/* ═══════════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════════ */
.about {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: start;
}
.about__text p { margin: 0 0 16px; }

/* "Research Interests" 같은 작은 라벨 */
.about__label {
  margin: 26px 0 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}
.about__label + .tags { margin-top: 12px; }

/* 사진이 이미 원형으로 잘린 투명 PNG라 테두리·배경 없이 그대로 얹는다.
   사진이 없을 때(.is-empty)만 이니셜용 배경과 테두리를 보여준다. */
.about__photo {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.about__photo.is-empty {
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.about__photo img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about__photo-fallback {
  grid-area: 1 / 1;
  font-size: 40px;
  font-weight: 700;
  color: var(--text-soft);
  opacity: 0;             /* 사진이 있으면 숨김 */
}
/* 사진 파일이 없으면 이니셜로 대체 */
.about__photo.is-empty img { display: none; }
.about__photo.is-empty .about__photo-fallback { opacity: 1; }

/* ═══════════════════════════════════════════════════════
   태그
   ═══════════════════════════════════════════════════════ */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
}
.tags li {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-soft);
}
/* ═══════════════════════════════════════════════════════
   PUBLICATIONS
   ═══════════════════════════════════════════════════════ */

/* Preprints / Conferences / Journals 소제목
   제목 아래에 선을 그어 그룹의 시작을 분명히 한다.
   (선이 항목 사이에만 있으면 그룹 경계가 안 보여 배치가 임의로 보인다) */
.pubs__group {
  margin: 40px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-soft);
}
.pubs__group:first-of-type { margin-top: 0; }

/* 제목 바로 아래 첫 논문은 위쪽 여백만 (선은 제목이 이미 그었다) */
.pubs__group + .pubs { padding-top: 4px; }

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub {
  display: grid;
  grid-template-columns: 170px 1fr;   /* 예전 연도·배지가 있던 칸과 같은 너비 */
  gap: 22px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.pub:first-child { border-top: none; padding-top: 0; }

/* ─── 논문별 티저 이미지 / 영상 ───
   자료마다 비율이 달라(1:1 ~ 2:1) 행 높이가 들쭉날쭉해지므로
   상자를 16:10으로 고정하고 contain으로 담는다. 잘리지 않고
   남는 자리는 배경색으로 채워진다. */
.pub__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.pub__thumb img,
.pub__thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 정방형 자료용 — 16:10 상자에 담으면 좌우가 비어 보이므로 1:1로 */
.pub__thumb--square { aspect-ratio: 1; }

/* 아직 자료가 없는 논문 자리 */
.pub__thumb--none {
  border-style: dashed;
}
.pub__thumb--none span {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  line-height: 1;
}

/* ─── 본문 ─── */
/* min-width:0 이 없으면 긴 제목이 칸을 밀어내 넘칠 수 있다 */
.pub__body { min-width: 0; }

.pub__title {
  margin: 0 0 7px;
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.45;
}

/* 제목 안의 위첨자 (예: RefGC-SR²) — 줄 간격이 벌어지지 않게 line-height 0 */
.pub__title sup {
  font-size: 0.68em;
  vertical-align: super;
  line-height: 0;
}

.pub__authors {
  margin: 0 0 3px;
  font-size: 14.5px;
  color: var(--text-soft);
}
/* 본인 이름 강조 */
.pub__authors strong {
  color: var(--text);
  font-weight: 650;
}
/* 공동 1저자(*) · 교신저자(†) 표시 */
.pub__authors sup {
  font-size: 0.75em;
  font-weight: 700;
  color: var(--accent);
  vertical-align: super;
  line-height: 0;
}

.pub__venue {
  margin: 0;
  font-size: 14.5px;
  color: var(--accent);
}

.pub__links {
  margin-top: 11px;
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: 500;
}

/* 각주 */
.pubs__note {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}
.pubs__note sup {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent);
  vertical-align: super;
  line-height: 0;
}

.pubs__more {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: var(--text-soft);
}

/* ═══════════════════════════════════════════════════════
   RESUME 타임라인
   ═══════════════════════════════════════════════════════ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline__item {
  display: grid;
  /* "Mar 2024 – Feb 2026" 이 한 줄에 들어가는 너비 */
  grid-template-columns: 170px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.timeline__item:first-child { border-top: none; padding-top: 0; }

.timeline__when {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-soft);
  padding-top: 3px;
}

.timeline__what h4 { margin: 0; font-size: 16.5px; font-weight: 650; }
.timeline__org {
  margin: 2px 0 10px;
  font-size: 14.5px;
  color: var(--accent);
}
.timeline__what ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--text-soft);
}
.timeline__what li { margin-bottom: 4px; }

.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}
.btn:hover {
  text-decoration: none;
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--border);
}
.footer p {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

/* ═══════════════════════════════════════════════════════
   스크롤 등장 애니메이션
   ═══════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════════════
   모바일
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero { padding: 64px 0 48px; }
  .section { padding: 48px 0; }

  .about {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .about__photo {
    width: 140px;
    order: -1;   /* 모바일에선 사진을 글 위로 */
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* 논문도 한 줄 배치로 접고, 썸네일은 폭을 꽉 채운다 */
  .pub {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pubs__group { margin-top: 28px; }

  .nav__links a { padding: 6px 9px; font-size: 14px; }
}

/* 애니메이션을 줄이도록 설정한 사용자 존중 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
