/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #ffffff;
  --surface:    #f8fafc;
  --border:     #e2e8f0;
  --text:       #1a202c;
  --text-2:     #4a5568;
  --text-3:     #a0aec0;
  --accent:     #0d9488;
  --accent-bg:  #f0fdfa;
  --accent-dim: #ccfbf1;
  --c-swarm:    #0d9488;
  --c-control:  #4338ca;
  --c-formal:   #7c3aed;
  --c-bio:      #059669;
  --radius:     7px;
  --max-w:      820px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT SHELL
   ============================================================ */
.site {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: flex;
  gap: 2.25rem;
  align-items: flex-start;
  padding: 3.5rem 0 2rem;
}

.hero__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.hero__body { flex: 1; }

.hero__name {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.hero__role {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 0.85rem;
}

.hero__tagline {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 560px;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
}

.hero__link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}
.hero__link:hover { color: var(--accent); text-decoration: none; }
.hero__link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ============================================================
   TAB NAVIGATION
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  gap: 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.tab {
  padding: 0.65rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================
   TAB PANELS
   ============================================================ */
.tab-panel {
  display: none;
  padding: 2.75rem 0 5rem;
  animation: panelIn 0.18s ease;
}
.tab-panel.active { display: block; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ABOUT TAB
   ============================================================ */
.about__vision {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 680px;
  margin-bottom: 0.5rem;
}

.about__bio {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 680px;
  margin-bottom: 0.9rem;
}

/* ── RESEARCH CONSTELLATION ── */
.constellation-wrap {
  margin: 2rem 0 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-x: auto;
}

.constellation-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.9rem;
}

.constellation-wrap svg {
  width: 100%;
  min-width: 560px;
  height: auto;
  display: block;
}

/* SVG constellation interaction */
.cnode { cursor: pointer; }
.cnode circle  { transition: opacity 0.2s, transform 0.2s; transform-origin: center; transform-box: fill-box; }
.cnode text    { pointer-events: none; user-select: none; }
.cnode:hover circle { filter: brightness(1.1); }

.cnode.dimmed  circle { opacity: 0.15; }
.cnode.dimmed  text   { opacity: 0.15; }
.cnode.lit     circle { opacity: 1; }

.cedge { transition: opacity 0.2s, stroke-width 0.2s; }
.cedge.dimmed      { opacity: 0.06; }
.cedge.lit         { opacity: 1; stroke-width: 1.8 !important; }

/* Legend */
.constellation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.9rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-2);
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   RESEARCH TAB
   ============================================================ */
.vision-block {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  padding: 1rem 1.35rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2.5rem;
}
.vision-block p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.vision-block p:last-child { margin-bottom: 0; }

.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.project-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.project-item:first-child { padding-top: 0; }
.project-item:last-child  { border-bottom: none; }

.project-item__media {
  width: 155px;
  flex-shrink: 0;
}

.project-item__media img,
.project-item__media video {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.project-item__body { flex: 1; min-width: 0; }

.project-item__tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
  margin-bottom: 0.35rem;
}

.project-item__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.35rem;
  display: block;
  text-decoration: none;
}
.project-item__title:hover { color: var(--accent); text-decoration: none; }

.project-item__synopsis {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 0.55rem;
}

.project-item__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.plink {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.plink:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.plink--primary { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-bg); }
.plink--primary:hover { background: var(--accent-dim); }

/* ============================================================
   PUBLICATIONS TAB
   ============================================================ */
.pub-year-group { margin-bottom: 2.5rem; }

.pub-year-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.pub-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }

.pub-item__title {
  font-size: 0.91rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.2rem;
}

.pub-item__authors {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 0.15rem;
}
.pub-item__authors strong { color: var(--text); font-weight: 600; }

.pub-item__venue {
  font-size: 0.8rem;
  color: var(--text-2);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.pub-item__links { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.pub-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 1px 8px;
  border-radius: 3px;
  border: 1px solid var(--accent-dim);
  background: var(--accent-bg);
  transition: background 0.15s;
}
.pub-link:hover { background: var(--accent-dim); text-decoration: none; }

/* ============================================================
   CV TAB
   ============================================================ */
.cv-intro {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 1.75rem;
  line-height: 1.7;
}

.cv-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cv-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.1rem 1.35rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cv-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); text-decoration: none; }

.cv-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 1.1rem;
}
.cv-card__title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.1rem; }
.cv-card__sub   { font-size: 0.78rem; color: var(--text-2); }

/* ============================================================
   PROJECT DETAIL
   ============================================================ */
.proj-back {
  padding: 1.5rem 0 0;
  font-size: 0.8rem;
}
.proj-back a { color: var(--text-2); text-decoration: none; }
.proj-back a:hover { color: var(--accent); }

.proj { padding: 1.5rem 0 4rem; }

.proj__header { margin-bottom: 1.25rem; }

.proj__tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
  margin-bottom: 0.5rem;
}

.proj__title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.proj__meta { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.proj__gallery { margin-bottom: 1.5rem; }

.proj__gallery--single img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.proj__gallery--multi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.proj__gallery--multi img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.proj__video { margin-bottom: 1.5rem; }

.proj__content p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 0.9rem;
}
.proj__content p:last-child { margin-bottom: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .site { padding: 0 1.25rem; }

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 0 1.5rem;
  }
  .hero__links { justify-content: center; }

  .project-item { flex-direction: column; gap: 1rem; }
  .project-item__media { width: 100%; }
  .project-item__media img,
  .project-item__media video { height: 175px; }
}
