/* ============================================================
   IBSP Lab — KNU crimson theme
   KNU RED  (C10 M100 Y100 K0)  ≈ #DA2127
   KNU GRAY (C5 M5 Y7 K50)      ≈ #7B7873
   ============================================================ */

:root {
  --red: #da2127;
  --crimson: #9e1424;
  --crimson-deep: #6e0e1a;
  --crimson-ink: #3d0a12;
  --gold: #c8a45c;
  --cream: #faf9f7;
  --paper: #ffffff;
  --ink: #221d1e;
  --muted: #6d6466;
  --line: #ebe5e0;
  --tint: #f6ebe9;
  --shadow-sm: 0 1px 2px rgba(61, 10, 18, 0.06), 0 2px 8px rgba(61, 10, 18, 0.06);
  --shadow-md: 0 2px 4px rgba(61, 10, 18, 0.05), 0 8px 20px rgba(61, 10, 18, 0.08), 0 20px 44px rgba(158, 20, 36, 0.07);
  --shadow-lg: 0 4px 10px rgba(61, 10, 18, 0.07), 0 16px 34px rgba(61, 10, 18, 0.1), 0 36px 80px rgba(158, 20, 36, 0.12);
  --glow: 0 0 0 1px rgba(218, 33, 39, 0.08), 0 10px 34px rgba(218, 33, 39, 0.16);
  --radius: 18px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--crimson); text-decoration: none; }

::selection { background: var(--crimson); color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(218, 33, 39, 0.5); outline-offset: 2px; border-radius: 6px;
}
@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: rgba(158, 20, 36, 0.45) transparent; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--crimson); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.container { width: min(1120px, 92vw); margin: 0 auto; }

/* ---------------- header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 223, 217, 0.85);
}
.site-header::before {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--crimson-deep), var(--red) 30%, var(--gold) 50%, var(--red) 70%, var(--crimson-deep));
  background-size: 200% 100%;
  animation: barshift 9s linear infinite;
}
@keyframes barshift { from { background-position: 0% 0; } to { background-position: -200% 0; } }
.header-inner {
  width: min(1200px, 94vw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark svg { width: 40px; height: 40px; display: block; filter: drop-shadow(0 4px 10px rgba(158, 20, 36, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.06rem; font-weight: 800; color: var(--ink); letter-spacing: 0.01em; }
.brand-text small { font-size: 0.74rem; color: var(--muted); font-weight: 500; }
.brand-knu {
  width: 34px; height: 34px; margin-left: 12px; padding-left: 12px;
  border-left: 1px solid var(--line); box-sizing: content-box;
  opacity: 0.95;
}

.site-nav { display: flex; gap: 2px; align-items: center; }
.nav-link {
  display: inline-flex; align-items: center;
  padding: 9px 13px; border-radius: 10px;
  font-size: 0.94rem; font-weight: 600; color: #4b4345;
  transition: color 0.18s, background 0.18s;
  position: relative; white-space: nowrap;
}
.nav-link:hover { color: var(--crimson); background: var(--tint); }
.nav-link.active { color: var(--crimson); }
.nav-link.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 3px;
  border-radius: 2px; background: linear-gradient(90deg, var(--red), var(--gold));
}

/* Members dropdown */
.nav-drop { position: relative; display: inline-flex; align-items: center; }
.drop-caret { width: 10px; height: 6px; margin-left: 6px; opacity: 0.6; transition: transform 0.2s; }
.drop-menu {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 170px; padding: 8px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.drop-menu::before { content: ""; position: absolute; inset: -10px 0 auto 0; height: 12px; }
.nav-drop:hover .drop-menu, .nav-drop:focus-within .drop-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav-drop:hover .drop-caret { transform: rotate(180deg); }
.drop-menu a {
  padding: 10px 14px; border-radius: 9px; font-weight: 600; font-size: 0.92rem; color: #4b4345;
}
.drop-menu a:hover { background: var(--tint); color: var(--crimson); }
.anchor-target { scroll-margin-top: 96px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span {
  display: block; width: 24px; height: 2.5px; margin: 5px 0; border-radius: 2px;
  background: var(--crimson); transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------------- hero ---------------- */

.hero { position: relative; padding: clamp(48px, 7.5vh, 88px) 0 clamp(36px, 5.5vh, 64px); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(180deg, rgba(250, 249, 247, 0), var(--cream));
}
.hero-grid { position: absolute; inset: 0; mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%); }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.42; }
.hero-glow.g1 {
  width: 560px; height: 560px; top: -220px; right: -120px;
  background: radial-gradient(circle, rgba(218, 33, 39, 0.35), rgba(218, 33, 39, 0) 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
.hero-glow.g2 {
  width: 480px; height: 480px; bottom: -240px; left: -140px;
  background: radial-gradient(circle, rgba(200, 164, 92, 0.4), rgba(200, 164, 92, 0) 70%);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
.hero-glow.g3 {
  width: 360px; height: 360px; top: 24%; left: 8%;
  background: radial-gradient(circle, rgba(218, 33, 39, 0.16), rgba(218, 33, 39, 0) 70%);
  animation: drift 11s ease-in-out 1s infinite alternate;
}
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.12); } }
.hero-knu-mark {
  position: absolute; right: max(-30px, 3vw); top: 50%;
  width: clamp(300px, 30vw, 470px); opacity: 0.11;
  pointer-events: none; user-select: none;
  animation: markfloat 12s ease-in-out infinite;
}
@keyframes markfloat {
  0%, 100% { transform: translateY(-50%) scale(1) rotate(0deg); }
  50% { transform: translateY(-54%) scale(1.045) rotate(1.2deg); }
}

.hero-inner { width: min(880px, 92vw); margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block; padding: 8px 18px; border-radius: 999px;
  background: linear-gradient(120deg, rgba(218, 33, 39, 0.09), rgba(200, 164, 92, 0.12));
  border: 1px solid rgba(218, 33, 39, 0.22);
  color: var(--crimson); font-weight: 700; font-size: 0.86rem; letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  animation: badgeglow 3.6s ease-in-out infinite;
}
@keyframes badgeglow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(218, 33, 39, 0), var(--shadow-sm); }
  50% { box-shadow: 0 0 22px 2px rgba(218, 33, 39, 0.22), var(--shadow-sm); }
}
.hero-title {
  margin: 22px 0 8px;
  font-size: clamp(2.2rem, 5.6vw, 4rem);
  font-weight: 900; letter-spacing: -0.025em; line-height: 1.12;
  background: linear-gradient(120deg, var(--ink) 18%, var(--crimson) 38%, var(--red) 50%, #ef5b68 58%, var(--crimson) 68%, var(--ink) 88%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 8s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
.hero-ecg { width: min(560px, 82vw); height: 52px; margin: 6px auto 2px; display: block; overflow: visible; }
.ecg-base {
  stroke: rgba(218, 33, 39, 0.18); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.ecg-run {
  stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 130 1270; stroke-dashoffset: 1400;
  filter: drop-shadow(0 0 7px rgba(218, 33, 39, 0.6));
  animation: ecgrun 3.4s linear infinite;
}
.ecg-run.slow { animation-duration: 4.6s; }
@keyframes ecgrun { from { stroke-dashoffset: var(--L, 1400); } to { stroke-dashoffset: 0; } }

.hero-subtitle { color: var(--crimson); font-weight: 700; font-size: clamp(0.95rem, 2vw, 1.1rem); letter-spacing: 0.04em; }
.hero-desc { margin: 18px auto 0; max-width: 640px; color: #574e50; font-size: clamp(1rem, 2vw, 1.13rem); }
.hero-actions { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------- affiliation strip ---------------- */

.affil-strip { padding: 6px 0 0; }
.affil-inner {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(120deg, #fff, #fdf8f3);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 24px; box-shadow: var(--shadow-sm);
}
.affil-mark { width: 46px; height: 46px; mix-blend-mode: multiply; flex: none; }
.affil-text { display: flex; flex-direction: column; line-height: 1.4; }
.affil-text strong { font-size: 1rem; font-weight: 800; }
.affil-text span { font-size: 0.85rem; color: var(--muted); }
.affil-link { margin-left: auto; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.affil-link:hover { text-decoration: underline; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 13px; border: 0; cursor: pointer;
  font-family: var(--font); font-size: 1rem; font-weight: 700;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.btn-primary {
  color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--red), var(--crimson) 60%, var(--crimson-deep));
  box-shadow: 0 2px 6px rgba(110, 14, 26, 0.3), 0 10px 26px rgba(218, 33, 39, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: btnpulse 3.2s ease-in-out infinite;
}
.btn-primary::after {
  content: ""; position: absolute; top: -20%; left: -70%; width: 42%; height: 140%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-22deg);
  animation: sheen 4.8s ease-in-out infinite;
}
@keyframes sheen {
  0%, 55% { left: -70%; }
  85%, 100% { left: 140%; }
}
@keyframes btnpulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(110, 14, 26, 0.3), 0 10px 26px rgba(218, 33, 39, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
  50% { box-shadow: 0 2px 6px rgba(110, 14, 26, 0.32), 0 12px 34px rgba(218, 33, 39, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(110, 14, 26, 0.32), 0 16px 38px rgba(218, 33, 39, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost {
  color: var(--crimson); background: var(--paper);
  border: 1.5px solid rgba(158, 20, 36, 0.3); box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--paper); border-color: var(--crimson); box-shadow: var(--glow); }
.btn-light { color: var(--crimson-deep); background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); white-space: nowrap; }
.btn-light:hover { transform: translateY(-2px); }

/* ---------------- sections ---------------- */

.section { padding: clamp(44px, 7vh, 84px) 0; }
.section-tint { background: linear-gradient(180deg, rgba(237, 232, 227, 0.3), rgba(237, 232, 227, 0.6) 40%, rgba(237, 232, 227, 0.25)); }
.section-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); font-weight: 850; letter-spacing: -0.02em; }
.section-link { margin-left: auto; font-weight: 700; font-size: 0.95rem; }
.section-link:hover { text-decoration: underline; }
.eyebrow {
  display: block; width: 100%;
  color: var(--red); font-size: 0.82rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px;
}
.section-head .eyebrow { width: 100%; }

/* ---------------- stats ---------------- */

.stats-section { padding-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-card {
  background: linear-gradient(160deg, var(--paper), #fcfaf8);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; box-shadow: var(--shadow-md);
}
.stat-value {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 900; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--red), var(--crimson-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-weight: 600; font-size: 0.9rem; margin-top: 4px; }

/* ---------------- cards / grids ---------------- */

.area-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.area-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; color: var(--ink); box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.area-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--red), var(--gold));
  opacity: 0; transition: opacity 0.25s;
}
.area-card:hover::before { opacity: 1; }
.area-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%);
  background-size: 240% 100%; background-position: 130% 0; opacity: 0;
}
.area-card:hover::after { opacity: 1; animation: cardsheen 0.85s ease forwards; }
@keyframes cardsheen { from { background-position: 130% 0; } to { background-position: -40% 0; } }
.area-card h3 { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.01em; }
.area-card p { color: #5c5355; font-size: 0.95rem; flex: 1; }
.card-more { color: var(--crimson); font-weight: 700; font-size: 0.9rem; }
.area-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--red), var(--crimson-deep));
  box-shadow: 0 6px 18px rgba(218, 33, 39, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: iconfloat 5.2s ease-in-out infinite;
}
.area-card:nth-child(2) .area-icon, .research-row:nth-child(2) .area-icon { animation-delay: 0.9s; }
.area-card:nth-child(3) .area-icon, .research-row:nth-child(3) .area-icon { animation-delay: 1.8s; }
@keyframes iconfloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.area-icon svg { width: 26px; height: 26px; }
.area-icon.lg { width: 64px; height: 64px; border-radius: 18px; flex: none; }
.area-icon.lg svg { width: 32px; height: 32px; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.news-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-md);
}
.news-card time { color: var(--red); font-weight: 800; font-size: 0.82rem; letter-spacing: 0.05em; }
.news-card h3 { margin: 8px 0 8px; font-size: 1.08rem; font-weight: 800; }
.news-card p { color: #5c5355; font-size: 0.93rem; }

/* ---------------- CTA banner ---------------- */

.cta-banner {
  display: flex; align-items: center; gap: 28px; justify-content: space-between;
  border-radius: 22px; padding: clamp(28px, 4vw, 44px);
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 90% -40%, rgba(255, 255, 255, 0.22), transparent 60%),
    radial-gradient(500px 260px at -10% 140%, rgba(200, 164, 92, 0.35), transparent 60%),
    linear-gradient(135deg, var(--crimson) 0%, var(--crimson-deep) 70%, var(--crimson-ink));
  color: #fff; box-shadow: var(--shadow-lg);
}
.cta-banner::after {
  content: ""; position: absolute; top: -30%; left: -60%; width: 34%; height: 160%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-20deg);
  animation: sheen 6.5s ease-in-out 1.2s infinite;
  pointer-events: none;
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { font-size: clamp(1.3rem, 2.8vw, 1.7rem); font-weight: 850; margin-bottom: 8px; }
.cta-banner p { color: rgba(255, 255, 255, 0.88); max-width: 640px; font-size: 0.98rem; }

/* ---------------- page hero ---------------- */

.page-hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 9vh, 96px) 0 clamp(16px, 3vh, 34px);
  background:
    radial-gradient(700px 300px at 85% -80%, rgba(218, 33, 39, 0.12), transparent 70%),
    radial-gradient(500px 260px at 0% -60%, rgba(200, 164, 92, 0.16), transparent 70%);
}
.page-hero::after {
  content: ""; position: absolute; right: clamp(-60px, 1vw, 40px); top: 50%; transform: translateY(-42%);
  width: clamp(180px, 20vw, 280px); aspect-ratio: 1;
  background: url("/assets/knu-symbol.png") center/contain no-repeat;
  opacity: 0.05; pointer-events: none;
}
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 900; letter-spacing: -0.02em; }
.page-intro { margin-top: 14px; max-width: 980px; color: #574e50; font-size: 1.05rem; }

/* ---------------- research page ---------------- */

.research-list { display: flex; flex-direction: column; gap: 24px; }
.research-row {
  display: flex; gap: 26px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 3.4vw, 36px); box-shadow: var(--shadow-md);
}
.research-row h3 { font-size: 1.3rem; font-weight: 850; }
.research-sub { color: var(--red); font-weight: 700; font-size: 0.9rem; margin: 2px 0 10px; letter-spacing: 0.03em; }
.research-body p { color: #544b4d; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  padding: 5px 13px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  color: var(--crimson); background: var(--tint); border: 1px solid rgba(158, 20, 36, 0.16);
}

/* ---------------- publications ---------------- */

.pub-toolbar { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 26px; }
.pub-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pub-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--paper); color: #5c5355; font-family: var(--font);
  font-size: 0.93rem; font-weight: 700; cursor: pointer;
  transition: all 0.18s; box-shadow: var(--shadow-sm);
}
.pub-tab:hover { border-color: rgba(158, 20, 36, 0.35); color: var(--crimson); }
.pub-tab.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--red), var(--crimson-deep));
  box-shadow: 0 6px 18px rgba(218, 33, 39, 0.32);
}
.pub-count {
  background: rgba(255, 255, 255, 0.25); border-radius: 999px; padding: 1px 8px; font-size: 0.78rem;
}
.pub-tab:not(.active) .pub-count { background: var(--tint); color: var(--crimson); }

.year-filter { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.year-chip {
  padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--paper); color: #5c5355; font-family: var(--font); font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all 0.16s;
}
.year-chip:hover { border-color: rgba(158, 20, 36, 0.4); color: var(--crimson); }
.year-chip.active { background: var(--crimson); border-color: var(--crimson); color: #fff; box-shadow: 0 4px 14px rgba(158, 20, 36, 0.3); }

.pub-list { list-style: none; display: none; flex-direction: column; gap: 16px; }
.pub-list.active { display: flex; }
.pub-item {
  display: flex; gap: 20px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
}
.pub-item { position: relative; }
.pub-item::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3.5px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--red), var(--gold));
  opacity: 0; transition: opacity 0.2s;
}
.pub-item:hover::before { opacity: 1; }
.pub-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(218, 33, 39, 0.25); }
.pub-item.hidden-by-filter, .pub-item.hidden-by-more { display: none; }
.pub-year {
  flex: none; align-self: flex-start;
  font-weight: 900; color: var(--red); font-size: 0.95rem;
  background: var(--tint); border-radius: 10px; padding: 6px 12px;
}
.pub-title { font-size: 1.02rem; font-weight: 750; line-height: 1.45; letter-spacing: -0.005em; }
.pub-authors { color: #5c5355; font-size: 0.9rem; margin-top: 5px; }
.pub-authors b { color: var(--crimson); font-weight: 800; }
.pub-venue { color: var(--muted); font-size: 0.88rem; margin-top: 3px; }
.pub-link { font-weight: 700; font-size: 0.85rem; margin-left: 8px; white-space: nowrap; }
.pub-link:hover { text-decoration: underline; }
.pub-badge {
  display: inline-block; margin-top: 9px; padding: 4px 11px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.02em;
  color: #7a5716; background: linear-gradient(120deg, #fdf3dd, #f9e7c0); border: 1px solid #ecd9a8;
}
.show-more-wrap { display: flex; justify-content: center; gap: 12px; margin-top: 30px; }

.talk-item {
  display: flex; gap: 20px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px; list-style: none;
}
.head-count {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  background: var(--tint); color: var(--crimson); border-radius: 999px;
  padding: 2px 12px; font-size: 0.85rem; font-weight: 800;
}

/* ---------------- members ---------------- */

.prof-card {
  display: flex; gap: clamp(24px, 4vw, 44px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(26px, 4vw, 42px); box-shadow: var(--shadow-lg); margin-bottom: 34px;
}
.prof-photo { flex: none; width: clamp(150px, 20vw, 210px); }
.prof-photo img, .photo-fallback {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 16px;
  box-shadow: 0 10px 30px rgba(61, 10, 18, 0.2);
}
.photo-fallback {
  display: grid; place-items: center; font-size: 3rem; font-weight: 900; color: #fff;
  background: linear-gradient(150deg, var(--red), var(--crimson-deep));
}
.member-card .photo-fallback { aspect-ratio: 1; border-radius: 50%; font-size: 2rem; }
.prof-body h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 900; }
.prof-ko { color: var(--muted); font-weight: 600; font-size: 0.7em; margin-left: 6px; }
.prof-role { color: var(--red); font-weight: 800; margin: 4px 0 6px; }
.prof-contact { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-bottom: 14px; }
.prof-mail {
  display: inline-block;
  font-weight: 700; font-size: 0.95rem; color: var(--crimson); word-break: break-all;
}
.prof-mail:hover { text-decoration: underline; }
.prof-bio { color: #544b4d; font-size: 0.97rem; text-align: justify; text-justify: inter-word; }
.career-list { list-style: none; margin: 18px 0; display: flex; flex-direction: column; }
.career-list li {
  position: relative; display: flex; align-items: baseline; gap: 14px;
  padding: 0 0 14px 20px; text-align: left;
  border-left: 2.5px solid rgba(218, 33, 39, 0.22);
  font-size: 0.93rem; color: #4b4345;
}
.career-list li:last-child { border-left-color: transparent; padding-bottom: 2px; }
.career-list li::before {
  content: ""; position: absolute; left: -6.5px; top: 3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2.5px solid var(--paper);
  box-shadow: 0 0 0 1.5px rgba(218, 33, 39, 0.35);
}
.career-period {
  flex: none; width: 108px; white-space: nowrap;
  font-weight: 800; color: var(--crimson); font-size: 0.85rem;
}
/* Role and affiliation wrap as whole units: one line when it fits,
   otherwise the affiliation drops to its own line — never a ragged mid-wrap. */
.career-body { flex: 1; min-width: 0; line-height: 1.5; }
.career-role { display: inline-block; font-weight: 750; color: var(--ink); }
.career-org { display: inline-block; color: var(--muted); }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn-chip {
  padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
  color: var(--crimson); background: var(--tint); border: 1px solid rgba(158, 20, 36, 0.2);
  transition: all 0.16s;
}
.btn-chip:hover { background: var(--crimson); color: #fff; box-shadow: 0 6px 16px rgba(158, 20, 36, 0.3); }

.member-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 34px; }
.member-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; box-shadow: var(--shadow-md);
}
.member-photo { width: 96px; margin: 0 auto 14px; }
.member-photo img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; box-shadow: 0 8px 20px rgba(61, 10, 18, 0.18); }
.member-card h3 { font-size: 1.02rem; font-weight: 800; }
.member-role { color: var(--red); font-weight: 700; font-size: 0.84rem; margin: 2px 0 8px; }
.member-int { color: var(--muted); font-size: 0.84rem; }
.member-mail { font-size: 0.82rem; word-break: break-all; }
.empty-note {
  text-align: center; color: var(--muted); font-weight: 600;
  background: var(--paper); border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 34px; margin-bottom: 34px;
}

/* ---------------- awards ---------------- */

.award-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.award-item {
  display: flex; gap: 16px; align-items: baseline;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; box-shadow: var(--shadow-sm); font-size: 0.94rem; color: #4b4345;
}
.award-year { flex: none; font-weight: 900; color: var(--red); }

/* ---------------- news page / timeline ---------------- */

.timeline { position: relative; margin-top: 26px; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2.5px;
  background: linear-gradient(180deg, var(--red), rgba(200, 164, 92, 0.6));
  border-radius: 2px;
}
.timeline-item { position: relative; padding: 0 0 30px 12px; }
.timeline-item.hidden-by-filter, .timeline-item.hidden-by-more { display: none; }
.timeline-dot {
  position: absolute; left: -32px; top: 7px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(218, 33, 39, 0.35), 0 0 12px rgba(218, 33, 39, 0.5);
}
.timeline-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(218, 33, 39, 0.45);
  animation: ripple 2.6s ease-out infinite;
}
@keyframes ripple {
  0% { transform: scale(0.55); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
.timeline-item time { color: var(--red); font-weight: 800; font-size: 0.84rem; letter-spacing: 0.04em; }
.timeline-item h3 { font-size: 1.12rem; font-weight: 800; margin: 4px 0 6px; }
.timeline-item p { color: #5c5355; max-width: 760px; }

/* ---------------- contact ---------------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 1120px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-info, .contact-form-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(26px, 3.6vw, 38px); box-shadow: var(--shadow-md);
}
.contact-info h2, .contact-form-card h2 { font-size: 1.15rem; font-weight: 850; margin-bottom: 10px; }
.contact-info h2 + p { margin-bottom: 22px; }
.contact-addr { color: #544b4d; font-size: clamp(0.84rem, 1.05vw, 0.94rem); line-height: 1.8; }
.contact-mail { font-weight: 800; font-size: 1.02rem; }
.contact-deco { margin-top: 30px; opacity: 0.9; }
.contact-deco svg { width: 100%; height: 44px; }
.form-note { color: var(--muted); font-size: 0.88rem; margin-bottom: 18px; }
.form-success {
  background: #eef8ef; border: 1px solid #bfe3c2; color: #1e6b2a;
  border-radius: 12px; padding: 13px 16px; font-weight: 700; font-size: 0.92rem; margin-bottom: 16px;
}
#contactForm { display: flex; flex-direction: column; gap: 14px; }
#contactForm label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.88rem; color: #4b4345; }
#contactForm input, #contactForm textarea {
  font-family: var(--font); font-size: 0.96rem; color: var(--ink);
  padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fcfbf9;
  transition: border-color 0.16s, box-shadow 0.16s;
}
#contactForm input:focus, #contactForm textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3.5px rgba(218, 33, 39, 0.14);
}
#contactForm textarea { resize: vertical; }
#contactForm .btn { align-self: flex-start; margin-top: 4px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------------- footer ---------------- */

.site-footer {
  margin-top: 40px; color: rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(700px 300px at 90% -30%, rgba(218, 33, 39, 0.25), transparent 60%),
    linear-gradient(160deg, #2a1216, var(--crimson-ink) 60%, #200a0e);
}
.footer-inner {
  width: min(1120px, 92vw); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 34px; flex-wrap: wrap;
  padding: 34px 0 26px;
}
.footer-brand { display: flex; gap: 16px; align-items: flex-start; max-width: 560px; }
.footer-brand strong { color: #fff; font-size: 1.04rem; display: block; margin-bottom: 6px; }
.footer-brand p { font-size: 0.88rem; color: rgba(255, 255, 255, 0.6); }
.footer-affil { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-affil img { height: 38px; width: auto; opacity: 0.9; transition: opacity 0.18s; }
.footer-affil a:hover img { opacity: 1; }
.footer-affil p { font-size: 0.84rem; color: rgba(255, 255, 255, 0.55); line-height: 1.5; }
.footer-note {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center; padding: 18px 4vw; font-size: 0.82rem; color: rgba(255, 255, 255, 0.5);
}

/* ---------------- gallery ---------------- */

.gal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.gal-item {
  margin: 0; cursor: zoom-in; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.gal-item img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.65, 0.3, 1);
}
.gal-item:hover img { transform: scale(1.05); }
.gal-item figcaption {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 16px; font-size: 0.88rem; font-weight: 600; color: #4b4345;
}
.gal-item figcaption time { color: var(--red); font-size: 0.78rem; font-weight: 800; white-space: nowrap; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(32, 10, 14, 0.92); backdrop-filter: blur(6px); padding: 4vh 4vw;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw; max-height: 80vh; border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.lb-cap { color: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 0.95rem; text-align: center; }
.lb-close {
  position: absolute; top: 18px; right: 22px;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.1rem;
}
.lb-close:hover { background: rgba(218, 33, 39, 0.8); }

/* ---------------- lift hover (calm alternative to tilt) ---------------- */

.lift { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(218, 33, 39, 0.28); }

/* ---------------- back to top ---------------- */

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--red), var(--crimson-deep));
  box-shadow: 0 6px 20px rgba(158, 20, 36, 0.4);
  opacity: 0.92; transition: transform 0.18s, opacity 0.18s;
}
.to-top:hover { transform: translateY(-3px); opacity: 1; }
.to-top svg { width: 20px; height: 20px; }
.to-top[hidden] { display: none; }

/* ---------------- reveal & tilt ---------------- */

.reveal { opacity: 0; transform: translateY(26px); }
.reveal.shown {
  opacity: 1; transform: none;
  transition: opacity 0.7s cubic-bezier(0.2, 0.65, 0.3, 1) var(--d, 0ms),
              transform 0.7s cubic-bezier(0.2, 0.65, 0.3, 1) var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .ecg-run { animation: none !important; stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  .hero-glow, .hero-knu-mark, .btn-primary, .btn-primary::after, .cta-banner::after,
  .area-icon, .timeline-dot::after, .hero-badge, .hero-title, .site-header::before { animation: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------------- responsive ---------------- */

/* Tablet & below: collapse nav into hamburger before links can overflow */
@media (max-width: 1180px) {
  .site-nav {
    position: fixed; top: 68px; left: 0; right: 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 5vw 20px; max-height: calc(100vh - 68px); overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateY(-130%); visibility: hidden;
    transition: transform 0.28s ease, visibility 0.28s;
  }
  .site-nav.open { transform: none; visibility: visible; }
  .nav-link { justify-content: center; padding: 13px 16px; font-size: 1.02rem; }
  .nav-link.active::after { left: 42%; right: 42%; }
  .nav-toggle { display: block; }
  .nav-drop { display: flex; flex-direction: column; align-items: stretch; }
  .nav-drop .nav-link { width: 100%; }
  .drop-menu,
  .nav-drop:hover .drop-menu,
  .nav-drop:focus-within .drop-menu {
    position: static; transform: none; opacity: 1; visibility: visible;
    border: 0; box-shadow: none; background: transparent; padding: 0 0 6px; min-width: 0;
  }
  .drop-menu::before { display: none; }
  .drop-menu a { text-align: center; font-size: 0.9rem; color: var(--muted); padding: 7px 14px; }
  .drop-caret { display: none; }
}

/* Large tablet / small laptop grids */
@media (max-width: 1024px) {
  .area-grid, .news-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .member-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .prof-card { gap: 26px; }
  .page-hero::after { opacity: 0.035; width: clamp(150px, 22vw, 220px); }
}

/* Tablet portrait & below: stack major layouts */
@media (max-width: 860px) {
  .hero-knu-mark { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .prof-card { flex-direction: column; align-items: center; text-align: center; }
  .prof-photo { width: min(240px, 60vw); }
  .prof-body { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .prof-contact { justify-content: center; }
  .career-list { width: 100%; max-width: 560px; }
  .chip-row { justify-content: center; }
  .award-list { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; gap: 20px; }
  .research-row { flex-direction: column; align-items: center; text-align: center; }
  .tag-row { justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 24px; padding: 32px 0 22px; }
}

/* Phone */
@media (max-width: 600px) {
  .area-grid, .news-grid { grid-template-columns: 1fr; }
  .gal-grid { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .brand-text small { display: none; }
  .brand-knu { margin-left: 10px; padding-left: 10px; width: 30px; height: 30px; }
  .hero { padding-top: 56px; }
  .hero-glow { display: none; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { width: 100%; }
  .hero-knu-mark { width: min(320px, 86vw); opacity: 0.05; }
  .page-hero::after { display: none; }
  .section { padding: 40px 0; }
  .section-head { gap: 10px; margin-bottom: 24px; }
  .section-link { margin-left: 0; }
  .pub-item { flex-direction: column; gap: 10px; padding: 18px; }
  .pub-year { align-self: flex-start; }
  .talk-item { flex-direction: column; gap: 10px; padding: 18px; }
  .pub-tab { padding: 9px 13px; font-size: 0.86rem; }
  .timeline { padding-left: 26px; }
  .timeline-dot { left: -24px; width: 11px; height: 11px; }
  .cta-banner .btn { width: 100%; }
  .empty-note { padding: 24px; }
  .prof-card { padding: 24px 18px; }
  .footer-brand { flex-direction: column; align-items: center; text-align: center; width: 100%; }
  .footer-affil { align-items: center; text-align: center; width: 100%; }
}
