/* ============================================================
   Hyundong Jin · Personal Homepage · style.css
   ============================================================ */

:root {
  --bg:        #ffffff;
  --surface:   #ffffff;
  --text:      #18181b;
  --muted:     #71717a;
  --faint:     #a1a1aa;
  --border:    #e4e4e7;
  --accent:    #2563eb;
  --accent-lt: #eff6ff;
  --green:     #059669;
  --green-lt:  #d1fae5;
  --nav-h:     52px;
  --max-w:     900px;
  --radius:    6px;
  --thumb-w:   240px;   /* ← 썸네일 너비: 여기 하나만 바꾸면 전체 적용 */
  --thumb-h:   120px;   /* ← 썸네일 높이: 여기 하나만 바꾸면 전체 적용 */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .75; }
ul { list-style: none; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ───────────────────────────────────────────── */
#navbar {
  position: sticky;
  top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 2rem;
  justify-content: space-between;
  transition: box-shadow .3s;
}
#navbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.06); }
.brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--text) !important;
  opacity: 1 !important;
}
#navbar nav { display: flex; gap: 1.6rem; }
#navbar nav a {
  font-size: .8rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); opacity: 1;
  transition: color .2s;
}
#navbar nav a:hover, #navbar nav a.active { color: var(--accent); }

/* ── LAYOUT ────────────────────────────────────────── */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }

/* ── HERO ──────────────────────────────────────────── */
#hero { padding: 3rem 0 1.2rem; border-bottom: 1px solid var(--border); }
.hero-inner {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3rem; align-items: start;
}
.hero-photo {
  width: 180px; height: auto;
  object-fit: contain; object-position: top center;
  border-radius: 5px;
  box-shadow: 0 4px 28px rgba(0,0,0,.11);
}
.hero-name {
  font-family: 'DM Serif Display', serif;
  font-size: 3rem; line-height: 1.05;
  letter-spacing: -.015em; margin-bottom: .3rem;
}
.hero-email { color: var(--muted); font-size: .88rem; margin-bottom: 1.3rem; }
.hero-bio p { max-width: 580px; }
.hero-bio p + p { margin-top: .7rem; }
.hero-bio a { border-bottom: 1px solid transparent; transition: border-color .2s; opacity: 1; }
.hero-bio a:hover { border-color: var(--accent); opacity: 1; }
.hero-links { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.6rem; }
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .32rem .85rem;
  border: 1.5px solid var(--border); border-radius: 100px;
  font-size: .82rem; font-weight: 500;
  color: var(--text) !important; background: var(--surface);
  transition: border-color .2s, color .2s, background .2s;
  opacity: 1 !important;
}
.pill:hover { border-color: var(--accent); color: var(--accent) !important; background: var(--accent-lt); }
.pill svg { width: 14px; height: 14px; }

/* ── SECTIONS ──────────────────────────────────────── */
.section {
  padding: 1.2rem 0; border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(20px);
  transition: opacity .55s ease, transform .55s ease;
}
.section.visible { opacity: 1; transform: none; }
.section:last-child { border-bottom: none; }
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.65rem; margin-bottom: 1.2rem; letter-spacing: -.01em;
}

/* ── ABOUT ─────────────────────────────────────────── */
.about-text p { max-width: 680px; }
.about-text p + p { margin-top: .75rem; }
.about-interest {
  margin-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: .4rem;
}
.interest-tag {
  font-size: .8rem; font-weight: 600;
  padding: .25rem .7rem;
  background: var(--accent-lt);
  border: 1px solid #bfdbfe;
  border-radius: 100px;
  color: var(--accent);
}

/* ── EDUCATION ─────────────────────────────────────── */
.edu-list { display: flex; flex-direction: column; gap: 1.5rem; }
.edu-item {
  display: grid; grid-template-columns: 150px 1fr;
  gap: 1.2rem; align-items: start;
}
.edu-period { font-size: .82rem; color: var(--muted); font-weight: 500; padding-top: 3px; }
.edu-degree { font-weight: 600; font-size: .95rem; }
.edu-school { font-size: .87rem; color: var(--muted); margin-top: .15rem; }
.edu-school a { color: var(--accent); opacity: 1; }
.edu-school a:hover { text-decoration: underline; opacity: 1; }

/* ── PUBLICATIONS ──────────────────────────────────── */
.pub-list { display: flex; flex-direction: column; gap: 1.1rem; }
.pub-item {
  display: grid;
  grid-template-columns: var(--thumb-w) 1fr;  /* ← 썸네일 너비 자동 반영 */
  gap: 1.1rem;
  align-items: start;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .2s;
}
.pub-item:hover { box-shadow: 0 2px 14px rgba(0,0,0,.07); }
.pub-thumb {
  width: var(--thumb-w);    /* ← 변수 사용 */
  height: var(--thumb-h);   /* ← 변수 사용 */
  object-fit: contain;      /* 잘림 없이 전체 표시 */
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ffffff;
}
.pub-thumb-ph {
  width: var(--thumb-w);    /* ← 변수 사용 */
  height: var(--thumb-h);   /* ← 변수 사용 */
  border-radius: 4px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #e9e9e5 0%, #d3d3cd 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: var(--muted); text-align: center;
  padding: .5rem; line-height: 1.3;
  flex-shrink: 0;
}
.pub-body {}
.pub-venue-row {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .35rem;
}
.venue-badge {
  font-size: .74rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--green); background: var(--green-lt);
  padding: .12rem .5rem; border-radius: 3px;
}
.venue-badge.conf { color: var(--accent); background: var(--accent-lt); }
.pub-title {
  font-weight: 600; font-size: .93rem;
  line-height: 1.45; margin-bottom: .25rem;
}
.pub-authors { font-size: .83rem; color: var(--muted); margin-bottom: .4rem; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: .84rem; color: var(--muted); margin-bottom: .35rem; }
.pub-note { font-size: .78rem; color: var(--muted); font-style: italic; margin-bottom: .35rem; }
.pub-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.pub-links a {
  font-size: .78rem; font-weight: 500;
  color: var(--accent); opacity: 1;
  padding: .18rem .6rem;
  border: 1px solid #bfdbfe; border-radius: 4px;
  background: var(--accent-lt);
  transition: background .15s, color .15s;
}
.pub-links a:hover { background: var(--accent); color: #fff !important; border-color: var(--accent); opacity: 1; }

/* ── PUBLICATION TOGGLE ────────────────────────────── */
.pub-hidden { display: none; }
.pub-hidden.visible { display: grid; }

#toggle-pub {
  font-size: .75rem; font-weight: 600;
  padding: .25rem .8rem;
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  background: var(--accent-lt);
  color: var(--accent);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background .2s, color .2s;
  vertical-align: middle;
  margin-left: .8rem;
}
#toggle-pub:hover { background: var(--accent); color: #fff; }

/* ── SUBSECTION TITLES ─────────────────────────────── */
.subsection-title {
  font-size: .82rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
  margin: 1.8rem 0 1rem;
}
.subsection-title:first-of-type { margin-top: 0; }
.svc-subhead {
  font-size: .8rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .45rem; margin-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}

/* ── MISC ──────────────────────────────────────────── */
.awards-list { display: flex; flex-direction: column; gap: .75rem; }
.award-item { display: flex; align-items: baseline; gap: .75rem; font-size: .93rem; }
.award-item::before {
  content: "◆"; font-size: .45rem; color: var(--accent);
  flex-shrink: 0; position: relative; top: -2px;
}
.award-org { font-size: .8rem; color: var(--muted); }

/* ── PATENTS ───────────────────────────────────────── */
.patent-list { display: flex; flex-direction: column; gap: .9rem; }
.patent-item { font-size: .9rem; }
.patent-title { font-weight: 600; }
.patent-meta { color: var(--muted); font-size: .83rem; }

/* ── PROJECTS ──────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 1rem; }
.project-item {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 1rem; align-items: baseline;
}
.project-period { font-size: .82rem; color: var(--muted); font-weight: 500; }
.project-name { font-weight: 600; font-size: .92rem; }
.project-funder { font-size: .83rem; color: var(--muted); font-style: italic; }

/* ── TALKS ─────────────────────────────────────────── */
.talks-list { display: flex; flex-direction: column; gap: 1rem; }
.talk-item {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 1rem; align-items: baseline;
}
.talk-date { font-size: .82rem; color: var(--muted); font-weight: 500; }
.talk-venue { font-weight: 600; font-size: .92rem; }
.talk-topic { font-size: .85rem; color: var(--muted); }

/* ── TEACHING ──────────────────────────────────────── */
.teaching-list { display: flex; flex-direction: column; gap: .75rem; }
.teach-item { display: flex; gap: .75rem; font-size: .9rem; align-items: baseline; }
.teach-year { font-size: .82rem; color: var(--muted); font-weight: 500; min-width: 44px; }
.teach-role { font-weight: 600; }
.teach-where { color: var(--muted); font-size: .85rem; }

/* ── SUBSECTION TITLES (within a merged section) ───── */
.subsection-title {
  font-size: .82rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 .9rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.subsection-title:first-of-type { margin-top: 0; }

/* ── SERVICES ──────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.svc-group h3, .svc-subhead {
  font-size: .8rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border);
  padding-bottom: .45rem; margin-bottom: .9rem;
}
.svc-list { display: flex; flex-direction: column; gap: .45rem; }
.svc-list li { font-size: .87rem; color: var(--text); }
.svc-list li span { color: var(--muted); font-size: .8rem; display: block; }

/* ── MISC ──────────────────────────────────────────── */
.misc-heading {
  font-size: .82rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.6rem; margin-bottom: .6rem;
}
.misc-heading:first-child { margin-top: 0; }
.misc-list { display: flex; flex-direction: column; gap: .35rem; list-style: none; }
.misc-list li {
  font-size: .9rem; display: flex; align-items: baseline;
  gap: .5rem; line-height: 1.5;
}
.misc-list li::before {
  content: "◆"; font-size: .4rem; color: var(--accent);
  flex-shrink: 0; position: relative; top: -2px;
}
.misc-main { color: var(--text); font-weight: 500; }
.misc-sub  { color: var(--muted); font-size: .85rem; }

/* ── FOOTER ────────────────────────────────────────── */
footer { text-align: center; padding: 2.5rem 2rem; font-size: .8rem; color: var(--faint); }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 680px) {
  .pub-item { grid-template-columns: 1fr; }
  .pub-thumb, .pub-thumb-ph { width: 100%; height: 120px; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-photo { width: 120px; height: 144px; }
  .hero-name { font-size: 2.2rem; }
  .edu-item { grid-template-columns: 1fr; gap: .3rem; }
  .project-item, .talk-item { grid-template-columns: 1fr; gap: .2rem; }
  .services-grid { grid-template-columns: 1fr; gap: 2rem; }
  #navbar nav { gap: .8rem; }
  #navbar nav a { font-size: .72rem; }
}
