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

:root {
  --navy:       #1b2a3b;
  --blue:       #2563eb;
  --blue-light: #3b82f6;
  --text:       #374151;
  --text-light: #6b7280;
  --bg:         #ffffff;
  --bg-light:   #f8fafc;
  --border:     #e2e8f0;
  --radius:     12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
}

/* ── Navbar ── */
#mainNav {
  background: var(--navy) !important;
  padding: 0.75rem 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  z-index: 1030;
}

#mainNav .navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff !important;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.navbar-tagline {
  font-size: 0.65rem;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#mainNav .nav-link {
  color: rgba(255,255,255,0.75) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem !important;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
}

/* ── Hero Carousel ── */
.hero-wrapper { overflow: hidden; }

.hero-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center;
}

.carousel-caption {
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  padding: 2rem 2.5rem;
  text-align: left;
}

.carousel-caption h5 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.carousel-caption p {
  font-size: 0.9rem;
  opacity: 0.85;
  margin: 0;
}

/* ── Main layout ── */
.main-content {
  padding: 2.5rem 1rem;
}

/* ── Profile card ── */
.profile-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  position: sticky;
  top: 80px;
}

.profile-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--blue);
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(37,99,235,0.18);
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.profile-tagline {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1.1rem;
  line-height: 1.5;
}

.profile-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.profile-info {
  text-align: left;
  font-size: 0.84rem;
  color: var(--text-light);
}

.profile-info p {
  margin-bottom: 0.55rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  line-height: 1.5;
}

.profile-info i {
  color: var(--blue);
  margin-top: 0.18rem;
  flex-shrink: 0;
  width: 14px;
}

.profile-info a {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}

.profile-info a:hover { text-decoration: underline; }

/* ── Section titles ── */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.1rem;
  padding-bottom: 0.45rem;
  border-bottom: 2.5px solid var(--blue);
  display: inline-block;
}

h2.section-title { font-size: 1.2rem; }

/* ── About text ── */
.about-text p {
  font-size: 0.97rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1rem;
}

.about-text a { color: var(--blue); }

/* ── News feed ── */
.news-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
}

.news-sidebar::-webkit-scrollbar { width: 4px; }
.news-sidebar::-webkit-scrollbar-track { background: transparent; }
.news-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.news-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child { border-bottom: none; }

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  gap: 0.5rem;
}

.news-date {
  font-size: 0.73rem;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

.news-tag {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: #eff6ff;
  color: var(--blue);
}

.news-tag.article    { background: #eff6ff; color: #2563eb; }
.news-tag.conference { background: #f0fdf4; color: #16a34a; }
.news-tag.school     { background: #fef9c3; color: #a16207; }
.news-tag.workshop   { background: #fdf4ff; color: #9333ea; }
.news-tag.seminar    { background: #fff7ed; color: #c2410c; }
.news-tag.exam       { background: #fef2f2; color: #dc2626; }

.news-desc {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text);
}

.news-desc a { color: var(--blue); text-decoration: none; }
.news-desc a:hover { text-decoration: underline; }

/* ── Page header (inner pages) ── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2d4a6b 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
  margin-bottom: 0;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

/* ── Inner page content ── */
.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.page-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.page-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.page-content p  { font-size: 0.97rem; line-height: 1.85; }
.page-content li { line-height: 1.75; margin-bottom: 0.3rem; }
.page-content a  { color: var(--blue); }

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Resume button ── */
.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--blue);
  color: #fff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.18s;
  margin-bottom: 1.5rem;
}

.resume-btn:hover { background: #1d4ed8; }

/* ── CV section list ── */
.cv-list { list-style: none; padding: 0; margin: 0 0 0.5rem; }

.cv-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.cv-list li:last-child { border-bottom: none; }

.cv-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 0.55rem;
}

/* ── Publication list ── */
.pub-year {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--blue);
  display: inline-block;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}

.pub-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }

.pub-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text);
}

.pub-item:last-child { border-bottom: none; }
.pub-item i  { font-style: italic; }
.pub-item a  { color: var(--blue); text-decoration: none; }
.pub-item a:hover { text-decoration: underline; }

.pub-links { margin-top: 0.3rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.pub-link:hover { background: var(--blue); color: #fff; }

/* ── Research images ── */
.research-figures {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.research-figures img {
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 100%;
  flex: 1 1 260px;
  height: auto;
}

/* ── Footer ── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
  margin-top: 4rem;
}

/* ── Open Source project cards ── */
.oss-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.oss-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  transition: box-shadow 0.18s, border-color 0.18s;
}

.oss-card:hover {
  border-color: var(--blue-light);
  box-shadow: 0 4px 16px rgba(37,99,235,0.1);
}

.oss-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.oss-icon { color: var(--text-light); font-size: 1rem; }

.oss-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  text-decoration: none;
}

.oss-name:hover { color: var(--blue); text-decoration: underline; }

.oss-desc {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 0.65rem;
}

.oss-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

.oss-meta i { font-size: 0.75rem; margin-right: 0.2rem; }

.oss-card-primary {
  border-color: #bfdbfe;
  background: #f0f7ff;
}

.oss-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
  margin-left: auto;
}

.oss-lang {
  background: #eff6ff;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  margin-left: auto;
}

@media (max-width: 575px) {
  .oss-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .profile-card  { position: static; margin-bottom: 1.5rem; }
  .news-sidebar  { position: static; max-height: none; }
  .hero-img      { height: 280px; }
}

@media (max-width: 575px) {
  .hero-img { height: 200px; }
  .carousel-caption { padding: 1.25rem; }
  .carousel-caption h5 { font-size: 1rem; }
  .section-title { font-size: 1.25rem; }
}
