/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F8F7F4;
  --bg-2: #f0efe9;
  --bg-3: #e8e6df;
  --border: #ccc8bf;
  --text: #1c1918;
  --text-2: #4a4744;
  --text-3: #8a8581;
  --accent: #1c1918;
  --accent-light: #e0dcd4;
  --accent-2: #3a3734;
  --tag-bg: #d8d4cc;
  --tag-color: #1c1918;
  --card-bg: #F8F7F4;
  --shadow: 0 2px 12px rgba(28,25,24,0.07);
  --shadow-hover: 0 8px 32px rgba(28,25,24,0.14);
  --radius: 12px;
  --nav-height: 96px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #1a1816;
  --bg-2: #211f1c;
  --bg-3: #282522;
  --border: #3a3734;
  --text: #efebe3;
  --text-2: #b8b4ac;
  --text-3: #7a7672;
  --accent: #efebe3;
  --accent-light: #2a2724;
  --accent-2: #ccc8bf;
  --tag-bg: #2a2724;
  --tag-color: #efebe3;
  --card-bg: #211f1c;
  --shadow: 0 2px 12px rgba(0,0,0,0.35);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.55);
}

html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.nav-logo {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  line-height: 0;
}

.nav-logo-img {
  height: 90px;
  width: auto;
  display: block;
}

.nav-inner {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  gap: 24px;
}

/* Invert logo to white on dark background */
[data-theme="dark"] .nav-logo-img,
[data-theme="dark"] .footer-logo-img {
  filter: invert(1);
}

.footer-logo-img {
  height: 28px;
  width: auto;
  display: block;
  margin-bottom: 8px;
}

.logo-accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover { color: var(--text); opacity: 1; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.theme-toggle:hover { background: var(--bg-2); }

.theme-toggle svg { width: 17px; height: 17px; }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  margin-left: auto;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 10px 0; color: var(--text-2); font-size: 0.95rem; }

/* ── Split Layout ── */
.split-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.col-left {
  overflow-y: auto;
  height: 100%;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.col-right {
  overflow-y: auto;
  height: 100%;
  background: var(--bg-2);
}

.col-section {
  padding: 40px 36px;
}

/* ── Hero Carousel ── */
.hero { width: 100%; overflow: hidden; position: relative; }

.carousel {
  position: relative;
  height: 320px;
  overflow: hidden;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 핵심! */
  display: block;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 32px 40px;
}

.slide-label {
  background: rgba(0,0,0,0.45);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}

.carousel-btn:hover { background: rgba(255,255,255,0.35); }
.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.2s;
}

.dot.active { background: #fff; }

/* ── Mission ── */
.mission {
  background: var(--bg);
}

.mission-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}

.mission-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.mission-lead {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.7;
}

.mission-body {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 24px;
}

.mission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.pi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.pi-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pi-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }

.pi-title { font-size: 0.82rem; color: var(--accent); font-weight: 500; margin-bottom: 2px; }
.pi-affil { font-size: 0.8rem; color: var(--text-3); margin-bottom: 14px; }

.pi-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pi-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 10px;
}
.pi-link:hover { background: var(--accent-light); opacity: 1; }

/* ── Sections common ── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-header .section-title { margin-bottom: 0; }

.see-all {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--accent);
}

/* ── Research Areas ── */
.research-areas {
  background: var(--bg-2);
}

.areas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.area-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.area-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.area-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 16px;
}

.area-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.area-card p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── Updates ── */
.updates {
  background: var(--bg-3);
}

.updates-list { display: flex; flex-direction: column; gap: 0; }

.update-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.update-item:first-child { border-top: 1px solid var(--border); }

.update-date {
  font-size: 0.8rem;
  color: var(--text-3);
  font-weight: 500;
  min-width: 68px;
  padding-top: 3px;
}

.update-content { display: flex; align-items: flex-start; gap: 12px; }

.update-badge {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 3px;
}

.update-badge.accepted { background: var(--text-2); }
.update-badge.news { background: var(--text-3); }

.update-content p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── Projects ── */
.projects {
  background: var(--bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.project-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb-label {
  color: rgba(255,255,255,0.9);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.project-info { padding: 20px; }

.project-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.project-info p {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.ptag {
  background: var(--bg-3);
  color: var(--text-3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── People Preview ── */
.people-preview {
  background: var(--bg-3);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.person-card {
  text-align: center;
  padding: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
}

.person-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.person-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-card-body {
  padding: 10px 8px 12px;
}

.person-card h4 { font-size: 0.80rem; font-weight: 600; margin-bottom: 3px; }
.person-card p { font-size: 0.70rem; color: var(--text-3); }

.join-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.join-card .join-icon {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  background: var(--bg-3);
  border-bottom: 2px dashed var(--border);
  color: var(--accent);
  font-size: 2rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.join-card h4 { color: var(--accent); font-size: 0.88rem; font-weight: 600; margin-bottom: 4px; }

/* ── Join Section (main page) ── */
.join-section-inline {
  padding: 0 36px 40px;
}

.join-box {
  background: var(--accent-light);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  padding: 36px 40px;
  text-align: center;
}

.join-box h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; }
.join-box p { font-size: 0.9rem; color: var(--text-2); max-width: 560px; margin: 0 auto 24px; line-height: 1.7; }

.join-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.join-btn:hover { opacity: 0.85; }

/* ── Publications Preview (right column) ── */
.publications-preview {
  background: var(--bg);
}

.pub-card {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.pub-thumb {
  width: 200px;
  height: 130px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  color: var(--text-3);
  font-size: 0.8rem;
}

.pub-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.45;
}

.pub-authors {
  font-size: 0.83rem;
  color: var(--text-2);
  margin-bottom: 3px;
}

.pub-venue {
  font-size: 0.83rem;
  color: var(--text-3);
  margin-bottom: 10px;
}

.pub-legend {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 12px;
}

.pub-legend-symbol {
  color: var(--accent);
  font-weight: 700;
}

.pub-meta {
  font-size: 0.80rem;
  color: #e53e3e;
  margin-left: 4px;
}

.pub-links { display: flex; gap: 8px; }

.pub-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 10px;
  transition: background 0.15s;
}

.pub-link:hover { background: var(--accent-light); opacity: 1; }

/* ── Inline col-footer (split view) ── */
.col-footer {
  padding: 24px 36px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.col-footer p {
  font-size: 0.78rem;
  color: var(--text-3);
}

.col-footer-social {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.col-footer-social a {
  color: var(--text-3);
  transition: color 0.15s;
}

.col-footer-social a:hover {
  color: var(--accent);
  opacity: 1;
}

/* ── Footer ── */
.footer {
  display: none; /* hidden in split-screen desktop mode */
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}

.footer-inner {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.footer-brand .nav-logo {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: auto;
}

.footer-links a { font-size: 0.85rem; color: var(--text-2); }

.footer-social { display: flex; gap: 16px; align-items: center; }

.social-link { color: var(--text-3); transition: color 0.15s; }
.social-link:hover { color: var(--accent); opacity: 1; }

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  /* Collapse split layout to single column */
  body { height: auto; overflow: auto; }
  .footer { display: block; }
  .split-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .col-left, .col-right {
    display: contents;
  }
  /* Mobile section order: about → updates → publications → people */
  .hero               { order: 1; }
  .mission            { order: 2; }
  .updates            { order: 3; border-top: 1px solid var(--border); }
  .publications-preview { order: 4; border-top: 1px solid var(--border); }
  .people-preview     { order: 5; border-top: 1px solid var(--border); }
  .col-footer         { order: 6; border-top: 1px solid var(--border); }
  .areas-grid { grid-template-columns: repeat(3, 1fr); }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .carousel { height: 220px; }
  .mission-title { font-size: 1.5rem; }
  .col-section { padding: 28px 20px; }
  .areas-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; gap: 24px; }
  .footer-links { margin-left: 0; flex-direction: row; flex-wrap: wrap; gap: 12px; }
}
