/* 에너지정보처리연구실 홈페이지 공통 스타일 */
:root {
  --navy: #1D2760;
  --teal: #007A70;
  --teal-dark: #00665E;
  --gray: #595757;
  --text: #2B2F3A;
  --muted: #3F4450;
  --line: #E3E8EC;
  --line-2: #DCE3E7;
  --bg-soft: #F4F7F8;
  --bg-mint: #E8F3F1;
  --ph: #E6ECEF;
  --wrap: 1040px;
  --pad: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--teal); }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.section { padding-top: 72px; padding-bottom: 80px; }
.section.soft { background: var(--bg-soft); }
.stack { display: flex; flex-direction: column; gap: 32px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(6px);
}
.site-header .bar {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad);
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand img { height: 44px; width: auto; }
.nav { display: flex; gap: 4px; font-size: 15px; font-weight: 500; }
.nav { margin-right: -10px; }
.nav a { padding: 8px 10px; border-radius: 8px; color: var(--navy); white-space: nowrap; }
.nav a:hover { background: var(--bg-soft); color: var(--teal); }
.nav a[aria-current="page"] { font-weight: 700; color: var(--teal); }
.menu-btn {
  display: none; width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer;
  border-radius: 8px; color: var(--navy);
}
.menu-btn svg { width: 26px; height: 26px; margin: auto; }
.menu-btn .close { display: none; }
.menu-open .menu-btn .open { display: none; }
.menu-open .menu-btn .close { display: block; }

@media (max-width: 1000px) {
  .site-header .bar { height: 64px; }
  .brand img { height: 38px; }
  .menu-btn { display: flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: 8px var(--pad) 16px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(29, 39, 96, .08);
    font-size: 16px;
  }
  .menu-open .nav { display: flex; }
  .nav a { padding: 13px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a:hover { background: none; }
}

/* ---------- Hero / page banner ---------- */
.hero, .banner {
  position: relative; overflow: hidden; background: linear-gradient(180deg, #F6F9F9, #EEF3F4);
  border-bottom: 1px solid var(--line);
}
/* 배경 로고: 옅은 워터마크(base) + 그 모양대로만 지나가는 빛(fx) */
.emb {
  position: absolute; top: 50%; right: max(-40px, calc(50% - 560px));
  width: 440px; aspect-ratio: 400 / 403; transform: translateY(-50%); pointer-events: none;
}
.banner .emb { width: 380px; right: max(-30px, calc(50% - 520px)); }
.emb > i { position: absolute; inset: 0; display: block; }
.emb .base { background: url(../img/logos/emblem.png) center / contain no-repeat; opacity: .15; }
.emb .fx {
  -webkit-mask: url(../img/logos/emblem.png) center / contain no-repeat;
  mask: url(../img/logos/emblem.png) center / contain no-repeat;
  background: linear-gradient(115deg, transparent 0 34%, rgba(29, 39, 96, .35) 40%, rgba(0, 122, 112, .85) 46%, rgba(124, 194, 66, 1) 50%, rgba(0, 122, 112, .8) 54%, rgba(29, 39, 96, .3) 60%, transparent 66% 100%);
  filter: drop-shadow(0 0 10px rgba(124, 194, 66, .35));
  background-size: 300% 100%; background-position: 100% 0;
  animation: sweep-once 1.8s cubic-bezier(.4, 0, .2, 1) .5s both;
}
/* 홈: 1.8초 동안 지나가고 약 8초 쉬기 (주기 10초) */
.emb.loop .fx { animation: sweep-loop 10s cubic-bezier(.4, 0, .2, 1) .5s infinite both; }
@keyframes sweep-once { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes sweep-loop { 0% { background-position: 100% 0; } 18%, 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .emb .fx { animation: none; } }
.hero .wrap, .banner .wrap { position: relative; display: flex; flex-direction: column; }
.hero .wrap { padding-top: 120px; padding-bottom: 128px; gap: 12px; }
.hero h1 { font-size: 46px; line-height: 1.25; font-weight: 700; color: var(--navy); letter-spacing: -0.015em; }
.hero .en { font-size: 22px; font-weight: 500; color: var(--teal); }
.hero .desc { margin-top: 10px; font-size: 17px; color: var(--muted); max-width: 560px; }
.banner .wrap { padding-top: 68px; padding-bottom: 60px; gap: 8px; }
.banner h1 { font-size: 38px; line-height: 1.25; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.banner p { font-size: 16px; color: var(--muted); }

@media (max-width: 720px) {
  .emb { width: 280px; right: -110px; }
  .banner .emb { width: 210px; right: -80px; }
  .emb .base { opacity: .11; }
  .banner p { max-width: 74%; }
  .hero .desc { max-width: 82%; }
  .hero .wrap { padding-top: 64px; padding-bottom: 68px; gap: 8px; }
  .hero h1 { font-size: 32px; }
  .hero .en { font-size: 18px; }
  .hero .desc { font-size: 15px; }
  .banner .wrap { padding-top: 40px; padding-bottom: 36px; }
  .banner h1 { font-size: 30px; }
  .banner p { font-size: 15px; }
  .section { padding-top: 48px; padding-bottom: 56px; }
  .stack { gap: 24px; }
}

/* ---------- Section heading ---------- */
.sec-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
  border-bottom: 2px solid var(--navy); padding-bottom: 12px;
}
.sec-head h2 { font-size: 25px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.sec-head .more { font-size: 14px; font-weight: 700; color: var(--teal); white-space: nowrap; }
.sec-head .more:hover { color: var(--navy); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--teal); text-transform: uppercase; }

/* ---------- Buttons / tabs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--teal); color: #fff; font-size: 15px; font-weight: 700; white-space: nowrap;
  border: 0; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--teal-dark); color: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; background: #fff; border: 1.5px solid #D3DCE1; color: var(--navy);
  font-size: 15px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s;
}
.tab .n { font-weight: 500; opacity: .75; font-size: 14px; }
.tab:hover { border-color: var(--teal); color: var(--teal); }
.tab[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (max-width: 720px) {
  .tab { min-height: 40px; padding: 0 14px; font-size: 14px; }
}

/* ---------- Placeholders ---------- */
.ph {
  width: 100%; background: var(--ph); color: #5A6270; font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px;
}
.r43 { aspect-ratio: 4 / 3; }
.r1610 { aspect-ratio: 16 / 10; }
.cover { width: 100%; object-fit: cover; }

/* ---------- Home: research areas ---------- */
.areas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px; }
.area { display: flex; flex-direction: column; gap: 10px; }
.area h3 { margin-top: 6px; font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.area p { font-size: 14.5px; color: var(--muted); line-height: 1.7; }
@media (max-width: 900px) { .areas { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .areas { grid-template-columns: 1fr; gap: 20px; }
  .area { display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 4px 16px; }
  .area > :first-child { grid-row: 1 / 3; align-self: start; font-size: 11px; padding: 6px; }
  .area h3 { margin-top: 0; font-size: 17px; }
  .area p { font-size: 14px; }
}

/* ---------- Home: news ---------- */
.news-home { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 36px; align-items: stretch; }
.news-feature { display: flex; flex-direction: column; gap: 12px; }
.news-feature img { aspect-ratio: 4 / 3; }
.news-feature h3 { font-size: 21px; font-weight: 700; line-height: 1.45; color: var(--navy); }
.news-side { display: flex; flex-direction: column; }
.news-row {
  flex: 1; display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line-2);
}
.news-row:first-child { padding-top: 0; }
.news-row:last-child { border-bottom: 0; padding-bottom: 0; }
.news-row img { aspect-ratio: 4 / 3; }
.news-row h3 { font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--navy); }
.date { font-size: 13px; font-weight: 700; color: var(--teal); letter-spacing: .02em; }
.news-home a:hover h3 { color: var(--teal); }
.news-home a { color: inherit; }
.news-row .txt, .news-feature .txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (max-width: 860px) {
  .news-home { grid-template-columns: 1fr; gap: 24px; }
  .news-feature h3 { font-size: 19px; }
}
@media (max-width: 480px) {
  .news-row { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
  .news-row h3 { font-size: 15px; }
}

/* ---------- Publication list ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 28px; }
.pub-list li:first-child { padding-top: 24px; }
.pub-list .yr { font-size: 22px; font-weight: 700; color: var(--teal); line-height: 1.35; }
.pub-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pub-title { font-size: 16.5px; font-weight: 700; color: var(--navy); line-height: 1.5; }
a.pub-title:hover { color: var(--teal); }
.pub-authors { font-size: 14.5px; color: var(--text); }
.pub-venue { font-size: 14px; color: var(--gray); }
.pub-venue i { font-style: italic; color: var(--teal); font-weight: 500; }
@media (max-width: 600px) {
  .pub-list li { grid-template-columns: 1fr; padding: 18px 0; }
  .pub-list .yr { font-size: 17px; }
  .pub-title { font-size: 15.5px; }
}

/* ---------- Project cards ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.proj {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.proj .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13.5px; color: var(--gray); }
.pill { padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #EAF0FA; color: var(--navy); white-space: nowrap; }
.pill.pi { background: #E3F3F1; color: var(--teal-dark); }
.proj h2, .proj h3 { font-size: 17.5px; font-weight: 700; line-height: 1.5; color: var(--navy); }
.proj .en { font-size: 14px; color: var(--gray); line-height: 1.55; }
.proj .prog { font-size: 13px; color: var(--gray); }
.proj .agency {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: var(--text);
}
.proj .agency img { height: 32px; width: auto; max-width: 104px; object-fit: contain; }
@media (max-width: 480px) { .proj-grid { grid-template-columns: 1fr; } .proj { padding: 22px; } }

/* ---------- Join us ---------- */
.join {
  border: 1.5px solid var(--teal); border-radius: 16px; padding: 40px 44px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
  background: linear-gradient(100deg, #fff 55%, var(--bg-mint));
}
.join .txt { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.join h2 { font-size: 25px; font-weight: 700; color: var(--navy); }
.join p { font-size: 16px; color: var(--text); }
.join p.sub { font-size: 14.5px; color: var(--muted); }
@media (max-width: 600px) { .join { padding: 28px 24px; } .join h2 { font-size: 22px; } .join .btn { width: 100%; } }

/* ---------- About ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px 52px; align-items: center; }
.intro .txt { display: flex; flex-direction: column; gap: 16px; font-size: 16.5px; color: var(--muted); line-height: 1.8; }
.intro img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 4px; }
.pillars { background: var(--bg-mint); border-top: 1px solid #D3E7E3; border-bottom: 1px solid #D3E7E3; }
.pillars .wrap { padding-top: 40px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 40px; }
.pillars .p { display: flex; flex-direction: column; gap: 6px; color: var(--navy); }
.pillars .p span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--teal); }
.pillars .p span:last-child { font-size: 18px; font-weight: 700; }
.area-rows { display: flex; flex-direction: column; gap: 64px; }
.area-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; align-items: center; }
.area-row:nth-child(even) > :first-child { order: 2; }
.area-row .txt { display: flex; flex-direction: column; gap: 10px; }
.area-row h3 { font-size: 25px; font-weight: 700; color: var(--navy); }
.area-row p { font-size: 15.5px; color: var(--muted); line-height: 1.75; }
.area-row .kw { margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--navy); }
@media (max-width: 800px) {
  .intro, .area-row { grid-template-columns: 1fr; }
  .area-row:nth-child(even) > :first-child { order: 0; }
  .area-rows { gap: 44px; }
  .pillars .wrap { grid-template-columns: 1fr; gap: 18px; padding-top: 32px; padding-bottom: 32px; }
  .area-row h3 { font-size: 22px; }
}

/* ---------- Professor ---------- */
.prof { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px 52px; align-items: center; }
.prof img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.prof .info { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.prof .name { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.prof .name small { font-size: 18px; font-weight: 500; color: var(--muted); margin-left: 10px; }
.prof .title { font-size: 17px; font-weight: 700; color: var(--teal); }
.prof .dept { font-size: 15.5px; color: var(--muted); }
.kv { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px 20px; font-size: 15px; line-height: 1.5; }
.kv dt { font-weight: 700; color: var(--navy); }
.kv dd { margin: 0; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 56px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: var(--when, 132px) minmax(0, 1fr); gap: 2px 20px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline li:first-child { border-top: 1px solid var(--line); }
.timeline .when { font-size: 15px; font-weight: 700; color: var(--teal); line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline .what { font-size: 15.5px; font-weight: 700; color: var(--navy); line-height: 1.5; }
.timeline .where { font-size: 14px; color: var(--muted); line-height: 1.55; margin-top: 2px; }
.sub-h { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--teal); margin-bottom: 12px; }
.interest-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.interest { grid-column: span 2; }

.interest:nth-child(n+4) { grid-column: span 3; }
@media (max-width: 900px) { .interest-grid { grid-template-columns: 1fr 1fr; } .interest, .interest:nth-child(n+4) { grid-column: auto; } }
@media (max-width: 560px) { .interest-grid { grid-template-columns: 1fr; } }
.interest { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.interest h3 { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.45; }
.interest p { font-size: 14.5px; color: var(--muted); line-height: 1.65; }
@media (max-width: 800px) {
  .prof { grid-template-columns: 1fr; }
  .prof img { max-width: 240px; }
  .prof .name { font-size: 27px; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .timeline li { grid-template-columns: 1fr; } }

/* ---------- Members ---------- */
.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 36px 40px; }
.mem { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: start; }
.mem img, .mem .ph { width: 150px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.mem .txt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mem .nm { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1.35; }
.mem .nm small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.mem .role { font-size: 14px; font-weight: 700; color: var(--teal); }
.mem dl { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mem dt { font-weight: 700; color: var(--navy); }
.mem dd { margin: 0; color: var(--muted); }
.empty { border: 1px dashed #C5CFD6; border-radius: 12px; padding: 48px 24px; text-align: center; color: var(--gray); font-size: 15px; }
@media (max-width: 560px) {
  .mem-grid { grid-template-columns: 1fr; gap: 28px; }
  .mem { grid-template-columns: 112px minmax(0, 1fr); gap: 18px; }
  .mem img, .mem .ph { width: 112px; }
  .mem .nm { font-size: 19px; }
  .mem .nm small { display: block; margin-left: 0; font-size: 14px; }
}

/* ---------- Publications page ---------- */
.note { font-size: 13px; color: var(--gray); }
.year-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 32px; border-top: 2px solid var(--navy); padding-top: 20px; }
.year-group h2 { font-size: 22px; font-weight: 900; color: var(--navy); line-height: 1.4; }
.year-group ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.year-group li { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.year-group li:last-child { margin-bottom: 8px; border-bottom: 0; }
.groups { display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 640px) {
  .year-group { grid-template-columns: 1fr; gap: 12px; }
  .year-group h2 { font-size: 20px; }
}

/* ---------- News page ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 24px; }
.news-card { display: flex; flex-direction: column; gap: 10px; color: inherit; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.news-card .img { position: relative; overflow: hidden; }
.news-card img { aspect-ratio: 4 / 3; transition: transform .3s; }
.news-card:hover img { transform: scale(1.03); }
.news-card .cnt { position: absolute; right: 10px; bottom: 10px; background: rgba(29, 39, 96, .82); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.news-card .nt { font-size: 16.5px; font-weight: 700; color: var(--navy); line-height: 1.5; }
.news-card:hover .nt { color: var(--teal); }
@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .news-grid { grid-template-columns: 1fr; gap: 28px; } }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12, 16, 40, .92); display: none; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 24px; }
.lightbox.on { display: flex; }
.lightbox figure { margin: 0; max-width: 1100px; width: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.lightbox img { max-height: calc(100vh - 190px); width: auto; max-width: 100%; object-fit: contain; }
.lightbox figcaption { color: #fff; text-align: center; font-size: 16px; font-weight: 700; line-height: 1.5; max-width: 760px; }
.lightbox figcaption .date { display: block; color: #8ED8CF; }
.lightbox .count { color: #C9D2E0; font-size: 13px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.c-card { border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 8px; background: #fff; }
.c-card .ic { width: 64px; height: 64px; margin: 0 0 8px -4px; }
.c-card h3 { font-size: 13px; font-weight: 700; letter-spacing: .05em; color: var(--teal); text-transform: uppercase; }
.c-card p { font-size: 16px; font-weight: 500; color: var(--navy); line-height: 1.6; }
.map-wrap { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.map-img { display: block; overflow: hidden; background: var(--ph); border-bottom: 1px solid var(--line); }
.map-img img { width: 100%; height: auto; transition: transform .4s; }
.map-img:hover img { transform: scale(1.015); }
.bldg { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.bldg b { display: block; color: var(--navy); font-size: 15px; }
.map-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn.ghost { background: #fff; color: var(--teal); border: 1.5px solid #BFDCD8; }
.btn.ghost:hover { background: var(--bg-mint); color: var(--teal-dark); }
.map-info { padding: 28px 32px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; gap: 6px 36px; align-items: start; background: #fff; }
.map-info .eyebrow { grid-column: 1; }
.map-info h3 { grid-column: 1; }
.map-info > p { grid-column: 1; }
.map-info .bldg { grid-column: 2; grid-row: 1 / 4; margin: 0; }
.map-info .map-links { grid-column: 3; grid-row: 1 / 4; flex-direction: column; margin: 0; }
@media (max-width: 900px) {
  .map-info { grid-template-columns: 1fr; padding: 24px 22px; gap: 8px; }
  .map-info .eyebrow, .map-info h3, .map-info > p, .map-info .bldg, .map-info .map-links { grid-column: 1; grid-row: auto; }
  .map-info .bldg { margin-top: 6px; }
  .map-info .map-links { flex-direction: row; margin-top: 8px; }
}
.map-info h3 { font-size: 19px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.map-info p { font-size: 15px; color: var(--muted); }
.map-info .btn { min-height: 40px; font-size: 14px; padding: 0 16px; }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .map-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .contact-grid { grid-template-columns: 1fr; gap: 10px; }
  .c-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 16px; align-items: center; padding: 16px 18px; }
  .c-card .ic { width: 52px; height: 52px; margin: 0; grid-row: 1 / 3; }
  .c-card p { font-size: 15.5px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #D8E3EC; }
.site-footer .wrap { padding-top: 52px; padding-bottom: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: end; font-size: 14px; line-height: 1.8; }
.site-footer .logo { width: 280px; margin-bottom: 22px; }
.site-footer a { color: #D8E3EC; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .links { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 28px; font-size: 14px; }
.site-footer .copy { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid rgba(216, 227, 236, .18); font-size: 12px; color: #AEBBCB; }
@media (max-width: 700px) {
  .site-footer .wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; }
  .site-footer .logo { width: 230px; }
  .site-footer .links { display: none; }
}

/* 데이터를 불러오기 전 자리 표시 */
.loading { min-height: 160px; }
.proj-grid.compact .en, .proj-grid.compact .prog { display: none; }
@media (max-width: 600px) { .proj-grid.compact .proj:nth-child(n+4) { display: none; } }
.nowrap { white-space: nowrap; }

/* ---------- 스크롤 효과 ---------- */
.site-header .bar, .brand img { transition: height .25s ease; }
.site-header { transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 18px rgba(29, 39, 96, .07); }
@media (min-width: 1001px) {
  .site-header.scrolled .bar { height: 58px; }
  .site-header.scrolled .brand img { height: 36px; }
}
.reveal { transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.pre { opacity: 0; transform: translateY(22px); }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal.pre { transition: none; opacity: 1; transform: none; } }

/* ---------- Publications: 검색·연도 그래프 ---------- */
.pub-tools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; }
.search { position: relative; flex: 1 1 280px; max-width: 380px; }
.search input { width: 100%; height: 44px; border: 1.5px solid #D3DCE1; border-radius: 999px; padding: 0 16px 0 42px; font: inherit; font-size: 15px; color: var(--text); background: #fff; }
.search input:focus { outline: none; border-color: var(--teal); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gray); }
.result-note { font-size: 14px; color: var(--gray); }
.chart-wrap { overflow-x: auto; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; border-bottom: 1px solid var(--line); min-width: 300px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; cursor: pointer; background: none; border: 0; padding: 0; }
.chart .bar i { display: block; width: 100%; max-width: 34px; background: #CFE6E3; border-radius: 4px 4px 0 0; transition: background .15s; }
.chart .bar.on i, .chart .bar:hover i { background: var(--teal); }
.chart .bar em { font-style: normal; font-size: 12px; color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-x { display: flex; gap: 6px; padding-top: 6px; min-width: 300px; }
.chart-x span { flex: 1; text-align: center; font-size: 12px; color: var(--gray); font-variant-numeric: tabular-nums; }
.pub-authors b { color: var(--navy); font-weight: 700; }
mark { background: #FFF1B8; color: inherit; padding: 0 1px; }

/* ---------- Research: 타임라인 ---------- */
.tl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.tl-legend i { display: inline-block; width: 22px; height: 10px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }
.tl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 8px; }
.tl-in { min-width: 820px; }
.tl-head, .tl-row { display: grid; grid-template-columns: 290px 1fr; }
.tl-years { display: grid; font-size: 12px; color: var(--gray); font-variant-numeric: tabular-nums; }
.tl-years span { border-left: 1px solid var(--line); padding: 0 0 6px 6px; }
.tl-row { border-top: 1px solid var(--line); }
.tl-row .nm { font-size: 14px; font-weight: 500; color: var(--navy); padding: 10px 16px 10px 0; line-height: 1.45; }
.tl-row .nm small { display: block; font-size: 12px; font-weight: 400; color: var(--gray); }
.tl-track { position: relative; min-height: 56px; }
.tl-bar { position: absolute; top: calc(50% - 8px); height: 16px; border-radius: 999px; background: #C5CEE6; }
.tl-bar.pi { background: var(--teal); }
.tl-now { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #E0795A; }

/* JCR 지표 (시트에 값이 있을 때만 표시) */
.jcr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 13px; }
.jcr b { font-weight: 700; color: var(--teal-dark); background: #E3F3F1; border-radius: 999px; padding: 1px 10px; }
.jcr .at { color: var(--gray); }

/* ---------- 지도: 카카오맵 + 대체 이미지 ---------- */
.map-box { position: relative; background: var(--ph); border-bottom: 1px solid var(--line); min-height: 200px; }
.map-fallback { display: block; }
.map-fallback img { width: 100%; height: auto; display: block; }
.kakao-map { position: absolute; inset: 0; width: 100% !important; overflow: hidden; }
.kakao-map .wrap_controllers, .kakao-map .cont { display: none !important; }
.map-box.live { min-height: 0; }
.map-box.live .map-fallback { visibility: hidden; position: absolute; inset: 0; }
.map-box.live .kakao-map { position: relative; }

/* ---------- 맨 위로 버튼 ---------- */
.to-top {
  position: fixed; z-index: 40;
  right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 999px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; box-shadow: 0 6px 18px rgba(29, 39, 96, .25);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s, transform .25s, background .15s;
}
.to-top svg { width: 22px; height: 22px; }
.to-top.on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--teal); }
.to-top:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
@media (max-width: 600px) { .to-top { width: 44px; height: 44px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

.prof-links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.note a { color: var(--teal); font-weight: 700; }
a.pub-title { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a.pub-title:hover { text-decoration-color: currentColor; }
.ext-ic { font-size: .8em; color: var(--teal); font-weight: 500; white-space: nowrap; }
.timeline.honors li:first-child { border-top: 0; padding-top: 4px; }
.kv a.ext { color: var(--teal); font-weight: 500; }
.kv a.ext:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 같은 줄 카드의 제목·설명 시작선을 맞춤 */
@supports (grid-template-rows: subgrid) {
  .interest-grid > .interest { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 8px; }
}
@media (max-width: 560px) { .interest-grid > .interest { grid-row: auto; display: flex; } }

/* ---------- 마감 다듬기 ---------- */
/* 줄 끝에 한 단어만 남지 않게 */
p, dd, .area-row .kw, .interest p, .area p { text-wrap: pretty; }
h1, h2, .sec-head h2, .interest h3, .area h3 { text-wrap: balance; }
/* 과제 카드: 기관명이 두 줄이어도 구분선 높이를 맞춤 */
.proj .agency { min-height: 64px; }
/* 구성원 사진: 흰 배경 사진도 틀이 보이도록 */
.mem img { border: 1px solid var(--line); background: var(--bg-soft); }
/* 관심 분야 4개: 2×2 */
.interest-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.interest-grid.four > .interest, .interest-grid.four > .interest:nth-child(n+4) { grid-column: auto; }
@media (max-width: 560px) { .interest-grid.four { grid-template-columns: 1fr; } }
/* 연구 방향 띠: 한 줄 설명 */
.pillars .p small { font-size: 14px; font-weight: 400; color: var(--muted); line-height: 1.55; margin-top: 2px; }
.pillars .p span:nth-child(2) { font-size: 18px; font-weight: 700; }

/* 머리 문장·소개문 줄 길이를 고르게, 키워드는 키워드 사이에서만 줄바꿈 */
.banner p, .hero .desc { text-wrap: balance; }
.area-row .kw .nowrap { white-space: nowrap; }
