/* ==========================================================
   Hogyeong Jin — Portfolio
   순수 HTML/CSS. 색은 :root 토큰만 바꾸면 전체 테마가 바뀐다.
   ========================================================== */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Noto+Sans+KR:wght@400;500;700&display=swap");

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1c1d1f;
  --text-2: #55585e;
  --text-3: #85888e;
  --line: #e3e0d8;
  --accent: #b4441c;        /* 주 강조색 (테라코타) */
  --accent-soft: #f6e5dc;
  --ok: #2f7a4f;
  --warn: #9a6a00;

  --radius: 10px;
  --maxw: 1080px;
  --font: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517;
    --surface: #1b1c1f;
    --surface-2: #232428;
    --text: #ecebe7;
    --text-2: #b3b2ad;
    --text-3: #85847f;
    --line: #2e3034;
    --accent: #e9825a;
    --accent-soft: #3a2419;
    --ok: #6cc08f;
    --warn: #d9a93c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141517;
  --surface: #1b1c1f;
  --surface-2: #232428;
  --text: #ecebe7;
  --text-2: #b3b2ad;
  --text-3: #85847f;
  --line: #2e3034;
  --accent: #e9825a;
  --accent-soft: #3a2419;
  --ok: #6cc08f;
  --warn: #d9a93c;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
/* 강조 = 주황 글자, 형광펜 = 주황 밑줄 하이라이트 (편집 모드의 '강조'·'형광펜' 버튼) */
em { font-style: normal; color: var(--accent); font-weight: 500; }
mark {
  color: inherit; padding: 0 .1em; border-radius: 2px;
  background: linear-gradient(transparent 52%, color-mix(in srgb, var(--accent) 32%, transparent) 52%);
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.todo {                         /* 아직 채우지 않은 자리 표시 */
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 0 .35em;
  font-size: .9em;
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.brand span { color: var(--text-3); font-weight: 400; margin-left: .4em; font-size: .9em; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.nav-links a { color: var(--text-2); }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.nav-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  display: inline-grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { color: var(--text); }
.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 0; }
}

/* ---------- sections ---------- */
section { padding: 72px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
.page-main > section { border-bottom: 0; min-height: calc(100vh - 160px); }
.eyebrow {
  font-family: var(--mono); font-size: .8rem; color: var(--accent);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: .6em; display: block;
}
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-lead { color: var(--text-2); max-width: 680px; margin-bottom: 2.2em; }

/* ---------- hero ---------- */
.hero { padding: 88px 0 72px; }
.hero-grid {
  display: grid; align-items: center;
  grid-template-columns: clamp(96px, 24vw, 240px) 1fr;   /* 창이 줄면 사진도 비율대로 줄어듦 */
  gap: clamp(16px, 4vw, 48px);
}
.hero h1 { font-size: clamp(1.6rem, 5vw, 3rem); margin-bottom: .3em; }
.hero h1 .en { display: block; font-size: .45em; color: var(--text-3); font-weight: 400; margin-top: .4em; letter-spacing: 0; }
.hero .tagline { font-size: clamp(.98rem, 1.6vw, 1.15rem); color: var(--text); margin-bottom: 1.2em; }
.hero .meta { color: var(--text-2); font-size: clamp(.85rem, 1.3vw, .95rem); margin-bottom: 1.6em; }
.hero .meta li { margin-bottom: .15em; }
.hero .meta ul { list-style: none; padding: 0; margin: 0; }
.profile-photo {
  margin: 0; align-self: start;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff;
}
.profile-photo img { width: 100%; aspect-ratio: 638 / 820; object-fit: cover; }
@media (max-width: 520px) {
  .hero { padding: 48px 0 48px; }
  .hero-grid { align-items: start; }
}

/* ---------- introduction ---------- */
.intro-text { max-width: 760px; font-size: 1.02rem; }
.intro-text .lead { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 1.2em; }
.intro-text p { color: var(--text-2); }
.sub-title { font-size: 1.15rem; margin: 2.6em 0 1em; display: flex; align-items: baseline; gap: .6em; }
.sub-title .eyebrow { margin: 0; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  padding: 9px 16px; border-radius: 8px; font-size: .95rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn:hover { text-decoration: none; border-color: var(--text-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }

/* ---------- interests ---------- */
.interest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.interest {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: var(--surface);
}
.interest .num { font-family: var(--mono); color: var(--accent); font-size: .85rem; }
.interest h3 { font-size: 1.08rem; margin-top: .4em; }
.interest p { color: var(--text-2); font-size: .95rem; margin: 0; }

/* ---------- 대표 연구: PDF 뷰어 ---------- */
.pdf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.pdf-card { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.pdf-viewer {
  position: relative; background: #2a2b2e; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 3 / 4; border: 1px solid var(--line);
}
.pdf-stage {
  position: absolute; inset: 0; overflow: auto; padding: 14px 14px 72px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  scrollbar-color: #555 transparent;
}
.pdf-stage canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); flex-shrink: 0; }
.pdf-stage .pdf-msg { color: #bbb; font-size: .9rem; margin: auto; text-align: center; }
.pdf-stage .pdf-msg a { color: #fff; }
.pdf-open {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(30,30,32,.75); color: #fff;
}
.pdf-open:hover { background: rgba(30,30,32,.95); text-decoration: none; }
.pdf-bar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
  background: rgba(40,40,44,.88); color: #eee; border-radius: 999px; padding: 4px 8px;
  font-size: .85rem; backdrop-filter: blur(6px);
}
.pdf-bar .pg { padding: 0 8px; font-family: var(--mono); }
.pdf-bar .pg b { background: #1b1b1d; border-radius: 4px; padding: 1px 7px; font-weight: 400; }
.pdf-bar .sep { width: 1px; height: 18px; background: #555; margin: 0 4px; }
.pdf-bar button {
  background: none; border: 0; color: #eee; width: 30px; height: 30px; border-radius: 50%;
  font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.pdf-bar button:hover { background: rgba(255,255,255,.12); }
.pdf-bar .mag { width: 16px; height: 16px; opacity: .8; }
.pdf-viewer.native .pdf-stage { padding: 0; display: block; overflow: hidden; }
.pdf-viewer.native iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.pdf-viewer.native .pdf-msg { position: absolute; left: 0; right: 0; bottom: 8px; font-size: .78rem; }
.pdf-viewer.native .pdf-bar { display: none; }

/* 대표 연구 대시보드: 연구 주제별 패널 */
.research-board { display: grid; grid-template-columns: 1fr; gap: 20px; }
/* 데스크톱은 3칸 격자. PDF가 2개 이상인 패널은 자동으로 2칸 폭 → 패널 순서와 무관하게 정렬 */
@media (min-width: 900px) {
  .research-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-panel:has(.pdf-card + .pdf-card) { grid-column: span 2; }
}
.board-panel {
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface);
  padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.board-head { display: flex; justify-content: space-between; align-items: center; }
.board-head .eyebrow { margin: 0; }
.board-docs { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .board-panel:has(.pdf-card + .pdf-card) .board-docs { grid-template-columns: 1fr 1fr; } }
.board-docs .pdf-card figcaption { font-size: .82rem; color: var(--text-3); text-align: center; }
.board-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: auto; }
.board-title {
  display: block; font-weight: 700; font-size: 1.04rem; color: var(--text); line-height: 1.5;
}
.board-title:hover { color: var(--accent); text-decoration: none; }
.board-meta { color: var(--text-3); font-size: .85rem; margin: .3em 0 0; }

.pdf-card figcaption .t { font-weight: 500; line-height: 1.5; }
.pdf-card figcaption .v { color: var(--text-3); font-size: .86rem; margin-top: .2em; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 1.4em 0; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; }
.stat b { display: block; font-size: 1.3rem; font-family: var(--mono); font-weight: 500; }
.stat span { font-size: .8rem; color: var(--text-2); line-height: 1.4; display: block; }

/* ---------- tags / badges ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag {
  font-family: var(--mono); font-size: .75rem; color: var(--text-2);
  background: var(--surface-2); border-radius: 999px; padding: 2px 10px;
}
.badge {
  display: inline-block; font-size: .72rem; font-weight: 500; border-radius: 4px; padding: 1px 7px;
  border: 1px solid currentColor; vertical-align: middle;
}
.badge.ongoing { color: var(--accent); }
.badge.done { color: var(--ok); }
.badge.planned { color: var(--text-3); }
.badge.collab { color: var(--warn); }

/* ---------- projects grid ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 5px 14px; font-size: .88rem; cursor: pointer; font-family: inherit;
}
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); color: inherit; transition: border-color .15s, transform .15s;
}
a.card:hover { text-decoration: none; border-color: var(--text-3); transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 10; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .placeholder { font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--text-3); }
.card h3 { font-size: 1.05rem; margin: 0; }
.card p { color: var(--text-2); font-size: .92rem; margin: 0; flex: 1; }
.card.hidden { display: none; }

/* ---------- future research ---------- */
.future { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 880px) { .future { grid-template-columns: repeat(3, 1fr); } }
.future-item { padding: 22px; border-radius: var(--radius); background: var(--surface-2); }
.future-item h3 { font-size: 1.02rem; }
.future-item p { font-size: .94rem; color: var(--text-2); margin: 0; }
.future-item .q { font-family: var(--mono); font-size: .8rem; color: var(--accent); display: block; margin-bottom: .5em; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px 24px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline .when { font-family: var(--mono); font-size: .82rem; color: var(--text-3); }
.timeline .what { font-weight: 500; }
.timeline .detail { color: var(--text-2); font-size: .93rem; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 880px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- publications ---------- */
.pub { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.pub:last-child { border-bottom: 0; }
.pub .title { font-weight: 500; }
.pub .authors, .pub .venue { color: var(--text-2); font-size: .93rem; }
.pub .authors b { color: var(--text); }

/* ---------- skills ---------- */
.skill-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.skill-table th { text-align: left; font-weight: 500; color: var(--text-3); width: 34%; vertical-align: top; padding: 10px 12px 10px 0; }
.skill-table td { padding: 10px 0; color: var(--text-2); }
.skill-table tr + tr { border-top: 1px solid var(--line); }

/* ---------- contact / footer ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact-list li { display: flex; gap: 12px; }
.contact-list .k { font-family: var(--mono); font-size: .85rem; color: var(--text-3); width: 80px; flex-shrink: 0; padding-top: 2px; }
footer { padding: 32px 0 48px; color: var(--text-3); font-size: .85rem; }

/* ==========================================================
   프로젝트 상세 페이지
   ========================================================== */
.project-hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.back { font-size: .9rem; color: var(--text-2); display: inline-block; margin-bottom: 18px; }
.project-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.project-hero .en { color: var(--text-3); font-size: 1rem; margin-bottom: 1.2em; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 24px; margin: 1.6em 0; padding: 0; list-style: none; }
.facts li span { display: block; font-size: .78rem; color: var(--text-3); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.facts li { font-size: .95rem; }

.article { display: grid; grid-template-columns: 1fr; gap: 48px; padding: 48px 0 72px; }
@media (min-width: 980px) { .article { grid-template-columns: 200px 1fr; } }
.toc { position: sticky; top: 84px; align-self: start; font-size: .88rem; display: none; }
@media (min-width: 980px) { .toc { display: block; } }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; color: var(--text-3); margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover, .toc a.active { color: var(--text); border-left-color: var(--accent); text-decoration: none; }

.prose { max-width: 720px; min-width: 0; }
.prose section { padding: 0 0 48px; border: 0; }
.prose h2 { font-size: 1.45rem; padding-top: 8px; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose figure { margin: 1.8em 0; }
.prose figure img { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.prose figure.narrow img { max-width: 480px; margin: 0 auto; }
.prose figcaption { font-size: .85rem; color: var(--text-3); margin-top: .6em; text-align: center; }
.callout {
  border-left: 3px solid var(--accent); background: var(--surface-2);
  padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 1.4em 0; font-size: .95rem;
}
.callout b { color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 520px; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { background: var(--surface-2); font-weight: 500; color: var(--text-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.num { font-family: var(--mono); text-align: right; }
.fig-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .fig-grid { grid-template-columns: 1fr 1fr; } }
.fig-grid figure { margin: 0; }

/* ---------- 교육 · 수료 ---------- */
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cert { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.cert .when { font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.cert .what { font-weight: 500; margin: .2em 0; }
.cert .detail { color: var(--text-2); font-size: .9rem; }
.cert { display: flex; flex-direction: column; gap: 2px; }
.cert-thumb {
  display: block; width: 100%; padding: 0; margin: 0 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3;
}
.cert-thumb img { width: 100%; height: 100%; object-fit: contain; }
/* 수료증 이미지: 끌어서 저장·선택 방지 (열람 전용) */
.cert-thumb img, .lightbox img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* 크게 보기 */
.lightbox {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 10, 12, .82); backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; position: relative; max-width: min(900px, 100%); }
.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; background: #fff; }
.lightbox figure::after { content: ""; position: absolute; inset: 0; }   /* 이미지 위 투명 막: 우클릭 저장 방지 */
.lightbox figcaption { color: #ddd; font-size: .88rem; text-align: center; margin-top: 10px; }
.lightbox-close {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 20px; cursor: pointer;
}
