:root {
  /* Terminal palette (Tango, as in GNOME/Ubuntu Terminal) */
  --green: #8ae234;
  --green-tint: rgba(138, 226, 52, 0.12);
  --blue: #729fcf;
  --yellow: #fce94f;
  --yellow-tint: rgba(252, 233, 79, 0.12);
  --text: #d3d7cf;
  --muted: #9da1a8;
  --line: #2a2e36;
  --bg: #111317;
  --bg-alt: #16191e;
  --panel: #1b1e24;
  --bar: #0b0d10;
  --mono: "Ubuntu Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Lato", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

a { color: var(--blue); }
a:hover { color: var(--yellow); }
img { max-width: 100%; display: block; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.35rem;
}
.brand img { width: 34px; height: 34px; }
.brand:hover { color: var(--green); }

.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 1.05rem;
}
.nav a:hover { background: var(--yellow-tint); color: var(--yellow); }
.nav a.active { color: var(--yellow); font-weight: 700; }
.nav a.active::before { content: "> "; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--green);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bar);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
  }
  .nav.open { display: flex; }
}

/* ---------- Hero / page banners ---------- */
.hero {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(rgba(10, 12, 16, 0.86), rgba(10, 12, 16, 0.94)),
    url("../img/hero.jpg") center / cover;
  padding: 72px 16px 80px;
}
.terminal {
  max-width: calc(var(--max) - 40px);
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(22, 24, 29, 0.92);
  border: 1px solid #3a3d44;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  font-family: "Ubuntu Mono", "DejaVu Sans Mono", Consolas, monospace;
  color: #d3d7cf;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #2b2d33;
  border-bottom: 1px solid #3a3d44;
}
.term-bar .dot { width: 12px; height: 12px; border-radius: 50%; background: #ff5f56; }
.term-bar .dot:nth-child(2) { background: #ffbd2e; }
.term-bar .dot:nth-child(3) { background: #27c93f; }
.term-title { flex: 1; text-align: center; margin-right: 52px; font-size: 0.9rem; color: #9da1a8; }
.term-body { padding: 22px 28px 26px; text-align: left; }
.term-body .prompt { margin: 0; font-size: 1.05rem; }
.hero h1 { margin: 22px 0 10px; text-align: center; }
.ascii-art {
  display: inline-block;
  margin: 0;
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(10px, 4.2vw, 30px);
  line-height: 0.92;
  background: linear-gradient(180deg, #b6f36b, #3fd6a5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 6px rgba(110, 230, 120, 0.18));
}
.hero .subtitle {
  margin: 4px 0 22px;
  text-align: center;
  font-size: clamp(0.78rem, 1.9vw, 0.98rem);
  letter-spacing: 0.02em;
  color: #d3d7cf;
}
.term-body .readme { margin: 8px 0 18px; font-size: 1.02rem; line-height: 1.55; color: #d3d7cf; }
.term-body .readme .kw { color: var(--yellow); }
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: #d3d7cf;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
@media (max-width: 560px) { .term-body { padding: 18px 16px 20px; } }

.page-banner {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(rgba(10, 12, 16, 0.88), rgba(10, 12, 16, 0.95)),
    url("../img/hero.jpg") center / cover;
  border-bottom: 1px solid var(--line);
  padding: 48px 0;
  font-family: var(--mono);
}
.page-banner h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.08em;
  color: var(--green);
  text-shadow: 0 0 14px rgba(138, 226, 52, 0.3);
}
.prompt .u { color: var(--green); font-weight: 700; }
.prompt .d { color: var(--blue); font-weight: 700; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--bg-alt); }

h2.section-title {
  color: var(--green);
  font-family: var(--mono);
  font-size: 1.9rem;
  margin: 0 0 24px;
}
h2.section-title::before { content: "## "; color: var(--muted); }
h3 { color: var(--text); }

.lead { font-size: 1.1rem; max-width: 860px; }

.recruit {
  background: var(--yellow);
  color: var(--bg);
  border-radius: 8px;
  padding: 22px 28px 24px;
}
.recruit-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--yellow);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}
.recruit-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #ef2929; animation: blink 1.6s steps(1) infinite; }
.recruit h3 { margin: 0 0 4px; color: var(--bg); font-family: var(--mono); font-size: 1.35rem; }
.recruit p { margin: 0; }
.recruit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.recruit-actions a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 4px;
  border: 1.5px solid var(--bg);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.recruit-actions .btn-solid { background: var(--bg); color: var(--yellow); font-family: var(--mono); font-size: 1.02rem; }
.recruit-actions .btn-solid:hover { background: #2a2e36; color: var(--yellow); }
.recruit-actions .btn-line { color: var(--bg); }
.recruit-actions .btn-line:hover { background: var(--bg); color: var(--yellow); }
@media (max-width: 640px) { .recruit { padding: 20px; } }
section[id] { scroll-margin-top: 64px; }

/* News */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 175px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.news .date { font-family: var(--mono); font-weight: 700; color: var(--blue); }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: 2px; } }
.news.collapsed li:nth-child(n+6) { display: none; }
.news-toggle, .more-btn {
  display: inline-block;
  margin-top: 14px;
  background: none;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  border-radius: 4px;
  padding: 5px 16px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.news-toggle:hover, .more-btn:hover { background: var(--yellow); color: var(--bg); }

/* Research impact (generated by scripts/update_stats.py) */
.impact { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: stretch; }
@media (max-width: 820px) { .impact { grid-template-columns: 1fr; } }
.stats-wrap { display: flex; flex-direction: column; gap: 12px; }
.stats { display: grid; gap: 12px; }
.stats-main, .stats-sub { grid-template-columns: 92px repeat(3, 1fr); align-items: center; }
.stats-group { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding-top: 22px; border-top: 1px dashed var(--line); }
.stats .row-lbl { font-family: var(--mono); font-size: 0.9rem; font-weight: 700; color: var(--muted); }
@media (max-width: 560px) { .stats-main, .stats-sub { grid-template-columns: repeat(3, 1fr); } .stats .row-lbl { grid-column: 1 / -1; } }
.stats-main .stat .num { font-size: 2.6rem; }
.stats-sub .stat { padding: 10px 12px; }
.stats-sub .stat .num { font-size: 1.6rem; color: var(--yellow); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat .num { font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--green); }
.stat .lbl { display: block; margin-bottom: 2px; font-size: 0.85rem; color: var(--muted); }
.cite-chart { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 10px; display: flex; flex-direction: column; }
.cite-chart figcaption { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.bars { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 150px; display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 22px; position: relative; }
.bars .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; }
.bars .b { width: 78%; height: var(--h); background: var(--yellow); border-radius: 4px 4px 0 0; transition: opacity 0.15s; }
.bars .ytd .b { opacity: 0.55; }
.bars .v { font-family: var(--mono); font-size: 0.85rem; color: var(--text); margin-bottom: 2px; }
.bars .y { position: absolute; bottom: -22px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.bars:hover .b { opacity: 0.45; }
.bars .bar:hover .b, .bars .bar:focus .b { opacity: 1; }
.bars .bar:hover::after, .bars .bar:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(var(--h) + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: var(--bar); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); font-size: 0.8rem; padding: 3px 8px; border-radius: 4px; z-index: 2; pointer-events: none;
}

.keywords { margin-top: 28px; }
.keywords h3 { margin: 0 0 12px; font-size: 1rem; color: var(--text); }
.keywords h3 span { margin-left: 8px; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.keywords ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
@media (max-width: 640px) { .keywords ul { grid-template-columns: 1fr; } }
.keywords li { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; }
.keywords li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--green-tint); border-right: 2px solid var(--green); transition: width 1s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0ms); }
.keywords .k, .keywords .c { position: relative; }
.keywords .k { font-size: 0.95rem; }
.keywords .c { font-family: var(--mono); font-weight: 700; color: var(--green); }

/* Research impact animation (main.js toggles .pre until the block scrolls into view) */
.bars .b { transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s; }
.pre .bars .b { height: 0; }
.pre .bars .v { opacity: 0; }
.bars .v { transition: opacity 0.4s 0.9s; }
.pre.keywords li::before { width: 0; }
.stat, .keywords li { transition: transform 0.5s ease, opacity 0.5s ease; }
.pre .stat, .pre.keywords li { opacity: 0; transform: translateY(8px); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card .body { padding: 18px 20px 22px; }
.card h3 { margin: 0 0 8px; color: var(--yellow); font-family: var(--mono); font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pubs .venue { font-family: var(--mono); font-weight: 700; color: var(--blue); margin-right: 8px; }
.pubs .title { font-weight: 700; color: #eeeeec; }
.pubs.selected .title { font-weight: 400; }
.pubs .where { font-style: italic; color: var(--muted); }
.pubs .authors { color: var(--text); }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: 0 1px 4px var(--glow);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.tag.bk { background: linear-gradient(135deg, #1e88e5, #1565c0); --glow: rgba(21, 101, 192, 0.28); }
.tag.kiise { background: linear-gradient(135deg, #8e24aa, #6a1b9a); --glow: rgba(106, 27, 154, 0.28); }
.tag.top { background: linear-gradient(135deg, #fb8c00, #e65100); --glow: rgba(230, 81, 0, 0.28); }
.tag.sci { background: linear-gradient(135deg, #43a047, #2e7d32); --glow: rgba(46, 125, 50, 0.28); }
.pubs.review li { padding: 10px 0; }
.pubs .id { font-family: var(--mono); font-weight: 700; color: var(--blue); margin-right: 6px; }
.note { color: var(--muted); font-size: 0.9rem; }

/* Professor */
.profile { display: grid; grid-template-columns: 200px 1fr; gap: 36px; align-items: start; }
.profile img.photo { border-radius: 8px; border: 1px solid var(--line); }
.profile h2 { margin: 0 0 12px; color: var(--green); font-family: var(--mono); font-size: 1.9rem; }
.social { display: flex; gap: 12px; margin-top: 16px; }
.social img { width: 36px; height: 36px; border-radius: 6px; }
@media (max-width: 700px) { .profile { grid-template-columns: 1fr; } .profile img.photo { max-width: 200px; } }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 190px 1fr; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .sponsor { color: var(--muted); }
.timeline .when { font-family: var(--mono); font-weight: 700; color: var(--blue); }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 0; } }

/* Members */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 16px; margin-bottom: 40px; }
.member { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-align: center; }
.member img {
  width: 148px;
  max-width: 80%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 20px auto 0;
  border-radius: 16px;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--line);
}
.member .body { padding: 14px 16px 18px; }
.member h3 { margin: 0 0 2px; color: var(--yellow); font-family: var(--mono); font-size: 1.25rem; }
.member .email { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.member .interests { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
@media (max-width: 560px) { .members { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.member .interests span { background: var(--yellow-tint); color: var(--yellow); font-size: 0.8rem; padding: 3px 10px; border-radius: 12px; }

.alumni-level { margin: 0 0 8px; color: var(--yellow); font-family: var(--mono); font-size: 1.2rem; }
.alumni-log { list-style: none; padding: 0; margin: 0 0 28px; font-family: var(--mono); font-size: 1.05rem; }
.alumni-log li { display: grid; grid-template-columns: 90px 160px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.alumni-log .when { color: var(--blue); }
.alumni-log .who { color: #eeeeec; font-weight: 700; }
.alumni-log .what { color: var(--muted); }
@media (max-width: 560px) { .alumni-log li { grid-template-columns: 80px 1fr; row-gap: 0; } .alumni-log .what { grid-column: 2; } }

/* Research */
.areas { display: grid; gap: 18px; }
.areas p { margin: 0; }
.areas strong { color: var(--yellow); font-family: var(--mono); font-size: 1.1rem; }
.project { display: grid; gap: 24px; padding: 40px 0; border-bottom: 1px solid var(--line); }
.project:last-child { border-bottom: 0; }
.project h3 { margin: 0; font-size: 1.45rem; color: var(--green); font-family: var(--mono); }
.project img { width: 100%; max-width: 820px; margin: 0 auto; }

.paper-link { text-decoration: none; font-size: 1.1em; display: inline-block; transition: transform 0.15s; }
.paper-link:hover { transform: scale(1.2); }

.news-icon { text-decoration: none; display: inline-block; transition: transform 0.15s; }
.news-icon:hover { transform: scale(1.25); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { padding: 12px 16px 14px; font-size: 0.95rem; }
.gallery figcaption .date { display: block; font-family: var(--mono); color: var(--yellow); }
.gallery-empty { font-family: var(--mono); font-size: 1.05rem; color: var(--muted); }
.gallery-empty .u { color: var(--green); font-weight: 700; }
.gallery-empty .d { color: var(--blue); font-weight: 700; }
.gallery:not(:empty) + .gallery-empty { display: none; }
.section-title.year-past { margin-top: 48px; }
.gallery-fold.collapsed { display: none; }
.gallery-fold-toggle { margin-top: 0; }
.gallery-fold:not(.collapsed) + .gallery-fold-toggle { margin-top: 20px; }

.gallery figure a img { transition: opacity 0.15s; }
.gallery figure a:hover img { opacity: 0.85; }
.gallery figcaption a { color: var(--text); font-weight: 700; text-decoration: none; }
.gallery figcaption a:hover { color: var(--yellow); }
.event-photos { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.event-photos figure { background: none; }
.back-link { margin: 0 0 18px; font-family: var(--mono); }
.event-meta .date { font-family: var(--mono); color: var(--yellow); }
.event-video { margin: 24px 0; }
.event-video video { width: 100%; max-width: 900px; display: block; border-radius: 8px; border: 1px solid var(--line); background: #000; }

/* Contact */
.contact-list { list-style: none; padding: 0; font-size: 1.1rem; }
.contact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-list strong { display: inline-block; width: 160px; color: var(--yellow); font-family: var(--mono); }
.join { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.join-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px 26px 24px; }
.join-card h3 { margin: 0 0 10px; color: var(--yellow); font-family: var(--mono); font-size: 1.25rem; }
.join-card[lang="ko"] h3 { font-family: "Lato", sans-serif; font-size: 1.12rem; }
.join-card ul { list-style: none; padding: 0; margin: 0 0 22px; }
.join-card ul:last-child { margin-bottom: 0; }
.join-card li { padding: 5px 0 5px 22px; position: relative; }
.join-card li::before { content: ">"; position: absolute; left: 0; color: var(--green); font-family: var(--mono); font-weight: 700; }
.join-cta { margin: 24px 0 0; font-size: 1.05rem; }
.contact-list .ko-note { color: var(--muted); }
@media (max-width: 560px) { .contact-list strong { display: block; width: auto; } }
.campus-photo { margin: 24px 0 0; }
.campus-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); transition: opacity 0.15s; }
.campus-photo a:hover img { opacity: 0.85; }
.campus-photo + .lab-photos { margin-top: 12px; }
.lab-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
@media (max-width: 560px) { .lab-photos { grid-template-columns: repeat(2, 1fr); } }
.lab-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); transition: opacity 0.15s; }
.lab-photos a:hover img { opacity: 0.85; }
.map { width: 100%; height: 380px; border: 0; border-radius: 8px; margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bar);
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.site-footer a { color: var(--blue); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Media protection & photo viewer ---------- */
img, video { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; cursor: default; pointer-events: none; }
.lightbox-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; }
