/* 색상은 여기서 한 번에 바꿀 수 있습니다 */
:root {
  --dark: #111111;        /* 머리말·배너·꼬리말 배경 (검정에 가까운 색) */
  --dark-2: #2a2a2a;      /* 펼침 메뉴 등 보조 어두운 색 */
  --on-dark: #d9d5cc;     /* 어두운 배경 위 본문 글씨 */
  --bg: #fcfbf7;          /* 페이지 바탕 (흰색에 가까운 베이지) */
  --bg-2: #f3efe6;        /* 표 머리 등 옅은 면 */
  --line: #e6e0d3;        /* 구분선 */
  --ink: #1a1a1a;         /* 본문 글씨 */
  --muted: #5b5548;       /* 보조 글씨 */
  --accent: #1f6fc0;      /* 강조색 (링크·번호) */
  --accent-soft: #8cc8ff; /* 어두운 배경 위 강조색 */
  --card: #ffffff;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #b9b1a1 var(--bg); }
button, input, select, textarea { font-family: inherit; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}
::selection { background: #cfe3f7; color: var(--ink); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-header :focus-visible, .hero :focus-visible, .recruit :focus-visible, .site-footer :focus-visible { outline-color: var(--accent-soft); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.icon { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
time, .year, .pub .no, .cv .yr, .topic .num, .pillar .num { font-variant-numeric: tabular-nums; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--dark); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { color: #fff; display: flex; flex-direction: column; line-height: 1.25; }
.brand:hover { text-decoration: none; }
.brand strong { font-size: 17px; letter-spacing: .01em; }
.brand span { font-size: 12px; color: var(--accent-soft); letter-spacing: .04em; }
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav > li { position: relative; }
.nav a { color: #fff; display: block; padding: 10px 14px; font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: var(--accent-soft); }
.nav .sub {
  display: none; position: absolute; top: 100%; left: 0; min-width: 160px;
  list-style: none; margin: 0; padding: 6px; background: var(--dark-2);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.nav li:hover > .sub, .nav li:focus-within > .sub { display: block; }
.nav .sub a { font-weight: 500; letter-spacing: .04em; }
.menu-btn { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 10px; }
.menu-btn svg { width: 24px; height: 24px; display: block; }

/* ---------- 공통 섹션 ---------- */
main { min-height: 60vh; }
.page-head { background: var(--dark) center 60% / cover no-repeat; color: #fff; padding: 64px 0 56px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.25; }
.page-head p { margin: 12px 0 0; color: var(--on-dark); max-width: 720px; }
.section { padding: 56px 0; scroll-margin-top: 68px; }
.section h2 { font-size: 24px; margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); padding: 24px; }
.muted { color: var(--muted); }
.btn {
  display: inline-block; padding: 12px 22px; font-weight: 600; font-size: 15px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn.ghost:hover { border-color: #fff; }
.error { background: #fff3f3; border: 1px solid #f0b4b4; color: #8a1c1c; padding: 16px; margin: 24px 0; }

/* ---------- HOME ---------- */
.hero { background: var(--dark) center / cover no-repeat; color: #fff; padding: 36px 0 28px; overflow: hidden; }
.hero .wrap > div { max-width: 600px; padding: 20px 0; }
.hero h1 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.25; margin: 0 0 20px; white-space: pre-line; text-wrap: balance; }
.hero p { color: var(--on-dark); font-size: 17px; margin: 0 0 28px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { display: block; color: var(--ink); transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s; padding-top: 0; }
.pillar .thumb { margin: 0 -24px 18px; height: 190px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pillar .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pillar .thumb img[src$=".png"] { object-fit: contain; padding: 12px; }
.pillar:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.10); }
.pillar .num { font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .1em; }
.pillar h3 { margin: 6px 0 4px; font-size: 19px; }
.pillar .en { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.pillar p { margin: 0; color: var(--muted); font-size: 15px; }
.recruit { background: var(--dark); color: #fff; padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.recruit h2 { color: #fff; }
.recruit p { color: var(--on-dark); margin: 0 0 16px; white-space: pre-line; }
.recruit .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.recruit .tags span { border: 1px solid rgba(255,255,255,.3); padding: 4px 14px; font-size: 14px; }
.recruit .contact { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); padding: 20px; font-size: 15px; display: grid; gap: 6px; }
.recruit .contact div { display: flex; align-items: center; gap: 8px; }
.recruit .contact .icon { color: var(--accent-soft); }
.recruit .contact a { color: var(--accent-soft); }
.recruit .contact .note { margin-top: 6px; color: var(--on-dark); }

.map iframe { display: block; width: 100%; height: 420px; border: 1px solid var(--line); }
.map p { margin: 12px 0 0; }

/* ---------- NEWS 목록 ---------- */
.news-list { display: grid; gap: 14px; }
.news-item { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: start; }
.news-item time { font-weight: 700; color: var(--accent); font-size: 15px; }
.news-item h3 { margin: 0 0 4px; font-size: 18px; }
.news-item p { margin: 0; color: var(--muted); }
.news-item img { margin-top: 12px; max-height: 320px; object-fit: cover; }

/* ---------- PI ---------- */
.pi { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
.pi .photo { overflow: hidden; border: 1px solid var(--line); }
.pi .contact { margin-top: 16px; font-size: 15px; }
.pi .contact div { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.pi .contact div:last-child { border-bottom: 0; }
.pi .contact b { min-width: 52px; color: var(--muted); font-weight: 600; }
.pi .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pi .links a, .pub-links a { border: 1px solid var(--line); background: var(--card); padding: 10px 16px; font-size: 14px; line-height: 1.6; display: inline-block; }
.pub-links { margin: 0 0 32px; }
.pub-links a { font-size: 18px; padding: 13px 21px; }
.pi h2.name { font-size: 32px; margin: 0; }
.pi .title { color: var(--muted); margin: 4px 0 28px; }
.cv h3 { font-size: 15px; letter-spacing: .12em; color: var(--accent); margin: 28px 0 10px; }
.cv ul { list-style: none; margin: 0; padding: 0; }
.cv li { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cv li .yr { font-weight: 700; }
.cv .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cv .chips span { background: var(--card); border: 1px solid var(--line); padding: 4px 12px; }

/* ---------- RESEARCH ---------- */
.topic { padding: 48px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.topic:last-of-type { border-bottom: 0; }
.topic .head { display: flex; gap: 18px; align-items: baseline; margin-bottom: 14px; }
.topic .num { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.topic h2 { margin: 0; font-size: 26px; }
.topic .ko { color: var(--muted); font-size: 15px; margin: 2px 0 0; }
.topic .desc { font-size: 17px; max-width: 860px; }
.topic h3 { font-size: 15px; letter-spacing: .1em; color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin: 32px 0; align-items: center; }
.gallery figure { margin: 0; display: flex; align-items: center; justify-content: center; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery figure:only-child { grid-column: 1 / -1; max-width: 820px; margin: 0 auto; }
.gallery img { cursor: zoom-in; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.refs { margin: 8px 0 0; padding-left: 20px; }
.refs li { margin-bottom: 8px; font-size: 15px; }
.refs .t { font-weight: 600; }
.refs a, .pub .j a { overflow-wrap: anywhere; }
.projects li { grid-template-columns: 1fr; }
.projects .meta { color: var(--muted); font-size: 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 92vh; max-width: 96vw; background: #fff; }

/* ---------- GROUP ---------- */
.waiting { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.waiting > * { min-width: 0; }
.waiting h2 { font-size: 30px; line-height: 1.3; }
.waiting > svg { width: 100%; height: auto; }
.waiting .contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.waiting .contact-line span { display: inline-flex; align-items: center; gap: 6px; }
.cell-you { animation: pulse 1.8s ease-in-out infinite; }
.bolt { animation: blink 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { fill-opacity: .12; } 50% { fill-opacity: .55; } }
@keyframes blink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.member { text-align: center; }
.member img { width: 140px; height: 140px; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--bg-2); }
.member h3 { margin: 0; font-size: 18px; }
.member .role { color: var(--accent); font-weight: 600; font-size: 14px; }
.member p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; background: var(--card); overflow: hidden; border: 1px solid var(--line); }
table.list th, table.list td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
table.list th { background: var(--bg-2); font-size: 14px; }

/* ---------- PUBLICATIONS ---------- */
.year { font-size: 22px; font-weight: 800; color: var(--dark); margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--dark); }
.year:first-child { margin-top: 0; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pub .no { color: var(--accent); font-weight: 700; }
.pub .t, .pub .a, .pub .j { max-width: 80ch; }
.pub .t { font-weight: 600; font-size: 16px; }
.pub .a { font-size: 14.5px; color: #3a362e; margin: 2px 0; }
.pub .a b { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pub .j { font-size: 14.5px; }
.pub .j i { color: var(--dark-2); font-weight: 600; }
.pub .hl { margin-top: 3px; max-width: 80ch; font-size: 14px; font-weight: 600; color: #9a3a1a; }
.pub .hl a { color: inherit; font-weight: 500; text-decoration: underline; }
.pub .press { margin-top: 3px; max-width: 80ch; font-size: 14px; color: var(--muted); }
.pub .press span { font-weight: 600; margin-right: 8px; }

/* ---------- 푸터 ---------- */
.site-footer { background: var(--dark); color: #c9c4b9; padding: 40px 0; margin-top: 40px; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer strong { color: #fff; font-size: 16px; }
.site-footer a { color: var(--accent-soft); }
.site-footer p { margin: 4px 0; }

/* ---------- 모바일 ---------- */
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--dark); padding: 8px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav.open { display: flex; }
  .nav .sub { display: block; position: static; background: none; box-shadow: none; padding: 0 0 0 14px; }
  .hero { padding: 28px 0 24px; }
  .hero .wrap > div { padding: 12px 0; }
  .recruit, .pi, .waiting { grid-template-columns: 1fr; }
  .pillars, .gallery { grid-template-columns: 1fr; }
  .recruit { padding: 28px 22px; }
  .pi .photo { max-width: 280px; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .cv li { grid-template-columns: 1fr; gap: 0; }
  .pub { grid-template-columns: 40px minmax(0, 1fr); }
  .wrap { padding: 0 16px; }
  table.list th:nth-child(4), table.list td:nth-child(4) { display: none; }
}

/* 움직임 줄이기 설정을 켠 방문자에게는 애니메이션을 끔 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cell-you, .bolt { animation: none; }
  .pillar, .pillar:hover { transition: none; transform: none; }
}
