/* ========================================
   GAIA Lab – Shared Stylesheet (2025)
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary:       #0f172a;
  --primary-mid:   #1e3a5f;
  --accent:        #2563eb;
  --accent-dark:   #1d4ed8;
  --accent-light:  #eff6ff;
  --text:          #1e293b;
  --text-sec:      #64748b;
  --bg:            #f8fafc;
  --white:         #ffffff;
  --border:        #e2e8f0;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 12px rgba(0,0,0,.1);
  --radius:        8px;
  --radius-lg:     12px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .25rem; }

/* ── Header & Nav ───────────────────────── */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo { flex-shrink: 0; line-height: 1.25; }
.logo-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .06em;
}
.logo-sub {
  font-size: .65rem;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: .02em;
  white-space: nowrap;
}

nav {
  margin-left: auto;
  display: flex;
  gap: .2rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  color: #94a3b8;
  font-size: .82rem;
  font-weight: 500;
  padding: .38rem .85rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
nav a.active { background: var(--accent); color: #fff; }

/* ── Page Hero Banner ───────────────────── */
.page-hero {
  background: linear-gradient(130deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff;
  padding: 2.75rem 1.5rem 2.5rem;
  text-align: center;
}
.page-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .03em;
  margin-bottom: .35rem;
}
.page-hero p {
  font-size: .9rem;
  color: #94a3b8;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Main Layout ────────────────────────── */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  width: 100%;
}

/* ── Cards ──────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.card:last-child { margin-bottom: 0; }

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Section Heading (inside card) ─────── */
.sec-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.5rem 0 .65rem;
  padding-left: .75rem;
  border-left: 3px solid var(--accent);
}
.sec-title:first-child { margin-top: 0; }

/* ── Badges ─────────────────────────────── */
.badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
}
.badge-blue   { background: var(--accent-light); color: var(--accent); }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-gray   { background: #f1f5f9; color: #64748b; }
.badge-red    { background: #fee2e2; color: #dc2626; }

/* ── Research Topic Cards ───────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}
.topic-item {
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent-dark);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.topic-item::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Grant List ─────────────────────────── */
.grant-list { list-style: none; padding: 0; }
.grant-list li {
  padding: .6rem .75rem;
  border-radius: var(--radius);
  margin-bottom: .4rem;
  font-size: .875rem;
  line-height: 1.6;
  border-left: 3px solid transparent;
}
.grant-list li.ongoing {
  background: #eff6ff;
  border-left-color: var(--accent);
}
.grant-list li.done {
  background: #f8fafc;
  border-left-color: #cbd5e1;
  color: var(--text-sec);
}

/* ── Collab Grid ────────────────────────── */
.collab-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .5rem;
}
.collab-chip {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .35rem 1rem;
  font-size: .82rem;
  color: var(--text);
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
}
.collab-chip:hover {
  background: var(--accent-light);
  border-color: #bfdbfe;
  color: var(--accent-dark);
  text-decoration: none;
}

/* ── Member cards ───────────────────────── */
.prof-card {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.prof-photo {
  width: 140px;
  height: 175px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 3px solid var(--border);
  flex-shrink: 0;
}
.prof-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .25rem;
}
.prof-info .position {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: .8rem;
}
.meta-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: flex-start;
  font-size: .85rem;
  margin-bottom: .3rem;
}
.meta-row .meta-label {
  font-weight: 600;
  color: var(--text-sec);
  min-width: 70px;
  flex-shrink: 0;
}

/* Student table */
.student-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.student-table th {
  background: var(--primary);
  color: #fff;
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .04em;
}
.student-table th:first-child { border-radius: 6px 0 0 0; }
.student-table th:last-child  { border-radius: 0 6px 0 0; }
.student-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.student-table tr:last-child td { border-bottom: none; }
.student-table tr:hover td { background: #f8fafc; }

/* Alumni table */
.alumni-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.alumni-table th {
  background: #f1f5f9;
  color: var(--text);
  padding: .5rem .9rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.alumni-table td {
  padding: .45rem .9rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-sec);
}
.alumni-table tr:last-child td { border-bottom: none; }

/* ── Course Table ───────────────────────── */
.course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.course-table th {
  background: var(--primary);
  color: #fff;
  padding: .65rem 1.25rem;
  text-align: center;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .04em;
}
.course-table th:first-child { border-radius: 8px 0 0 0; text-align: left; }
.course-table th:last-child  { border-radius: 0 8px 0 0; }
.course-table td {
  padding: .55rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.course-table td:first-child {
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  background: #f8fafc;
  width: 80px;
}
.course-table tr:last-child td { border-bottom: none; }
.course-tag {
  display: block;
  background: #f1f5f9;
  border-radius: 4px;
  padding: .15rem .5rem;
  font-size: .8rem;
  margin: .1rem 0;
  color: var(--text);
}
.course-tag.grad {
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* ── Publication List ───────────────────── */
.pub-section { margin-bottom: 2.5rem; }
.pub-year-group { margin-bottom: 1.5rem; }
.pub-year {
  font-size: .82rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .08em;
  border-bottom: 1px solid #dbeafe;
  padding-bottom: .3rem;
  margin-bottom: .75rem;
}
.pub-list { list-style: none; padding: 0; }
.pub-list li {
  padding: .65rem .75rem .65rem 1rem;
  border-left: 3px solid #e2e8f0;
  margin-bottom: .65rem;
  font-size: .865rem;
  line-height: 1.65;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--white);
}
.pub-list li:hover { border-left-color: var(--accent); background: var(--accent-light); }
.pub-author { color: var(--text-sec); }
.pub-title { font-weight: 600; color: var(--text); }
.pub-venue { color: var(--text-sec); font-style: italic; }
.pub-venue strong { font-style: normal; color: var(--accent-dark); font-weight: 600; }
.pub-award {
  display: inline-block;
  margin-left: .4rem;
  background: #fef3c7;
  color: #b45309;
  border-radius: 4px;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ── Index Page ─────────────────────────── */
.hero-section {
  background: linear-gradient(130deg, var(--primary) 0%, #1e3a5f 60%, #164e8e 100%);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}
.hero-section .hero-sub {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.welcome-text { font-size: .9rem; line-height: 1.8; }
.welcome-text p + p { margin-top: .85rem; }
.welcome-text .ko { color: var(--text-sec); font-size: .85rem; }

.contact-box {
  background: var(--primary);
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  font-size: .855rem;
  line-height: 2;
}
.contact-box strong { color: #fff; }
.contact-box a { color: #93c5fd; }

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .75rem;
  margin-top: .75rem;
}
.highlight-item {
  display: block;
  text-decoration: none;
  border-radius: 6px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
}
.highlight-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.highlight-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.highlight-caption {
  padding: .45rem .55rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}
.highlight-caption span {
  font-weight: 400;
  color: var(--text-sec);
  font-size: .72rem;
}

.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .85rem;
  margin-top: .75rem;
}
.area-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
  transition: transform .15s, box-shadow .15s;
}
.area-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Featured Papers ────────────────────── */
.paper-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  transition: box-shadow .15s, border-color .15s;
}
.paper-card:last-child { margin-bottom: 0; }
.paper-card:hover { box-shadow: var(--shadow-md); border-color: #bfdbfe; }

.paper-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f1f5f9;
}
.paper-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
  font-size: .8rem;
  font-style: italic;
}

.paper-body {}
.paper-venue {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.paper-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.45;
  margin-bottom: .45rem;
}
.paper-authors {
  font-size: .83rem;
  color: var(--text-sec);
  margin-bottom: .75rem;
}
.paper-authors strong { color: var(--text); font-weight: 600; }
.paper-abstract {
  font-size: .845rem;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: .9rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.paper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .85rem;
}
.paper-tag {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .2rem .7rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-sec);
}
.paper-links {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.paper-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .32rem .85rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
}
.paper-link:hover { text-decoration: none; }
.paper-link-pdf {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.paper-link-pdf:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.paper-link-doi {
  background: var(--white);
  color: var(--accent);
  border-color: var(--accent);
}
.paper-link-doi:hover { background: var(--accent-light); color: var(--accent-dark); }
.paper-link-code {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #1e293b;
}
.paper-link-code:hover { background: #0f172a; color: #fff; }

@media (max-width: 768px) {
  .paper-card { grid-template-columns: 1fr; }
  .paper-thumb, .paper-thumb-placeholder { max-width: 100%; aspect-ratio: 16/9; }
}

/* ── Footer ─────────────────────────────── */
footer {
  background: var(--primary);
  color: #64748b;
  text-align: center;
  padding: 1.6rem 1.5rem;
  font-size: .78rem;
  line-height: 1.8;
  margin-top: auto;
}
footer strong { color: #94a3b8; }
footer a { color: #93c5fd; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .prof-card { flex-direction: column; align-items: center; }
  .prof-photo { width: 120px; height: 150px; }
  .hero-section h1 { font-size: 1.75rem; }
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .highlight-grid { grid-template-columns: repeat(3, 1fr); }
  .areas-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .header-inner { height: auto; padding: .75rem 1rem; flex-wrap: wrap; gap: .5rem; }
  nav a { font-size: .75rem; padding: .3rem .55rem; }
  .logo-name { font-size: 1.1rem; }
  main { padding: 1.25rem .9rem 2rem; }
  .card { padding: 1.25rem; }
  .highlight-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid, .areas-grid { grid-template-columns: 1fr; }
  .course-table td:first-child { width: 55px; font-size: .8rem; }
}
