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

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

:root {
  --font-heading: 'Crimson Text', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --primary-dark: #1a2332;
  --primary: #2c3e50;
  --primary-light: #34495e;
  --accent: #b33a2b;
  --accent-hover: #d4453a;
  --accent-soft: #f2dcd8;
  --bg: #fafaf8;
  --bg-white: #ffffff;
  --bg-alt: #f3f1ee;
  --bg-hero: #1a2332;
  --text: #333333;
  --text-mid: #555555;
  --text-light: #777777;
  --border: #e0ddd8;
  --border-light: #eceae6;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 3px 12px rgba(0,0,0,0.08);
  --radius: 4px;
  --max-width: 1060px;
  --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.35; }

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

img { max-width: 100%; height: auto; }

/* ===== Navigation ===== */
.navbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0;
}

.nav-links a {
  color: var(--text-mid);
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
  border-bottom-color: var(--accent);
}
.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--primary-dark);
  margin: 4px 0;
  border-radius: 1px;
  transition: var(--transition);
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.page-header {
  margin-bottom: 2.25rem;
}
.page-header h1 {
  font-size: 2rem;
  color: var(--primary-dark);
  font-weight: 700;
}
.page-header .page-subtitle {
  color: var(--text-light);
  margin-top: 0.3rem;
  font-size: 0.95rem;
}
.page-header-line {
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.75rem;
  border-radius: 2px;
}

/* ===== Hero (Home) ===== */
.hero {
  background: var(--bg-hero);
  color: #fff;
  padding: 0;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.hero-photo { flex-shrink: 0; }
.hero-photo img {
  width: 190px;
  height: 220px;
  object-fit: cover;
  object-position: top;
  border-radius: 4px;
  border: 3px solid rgba(255,255,255,0.15);
}

.hero-text { padding-top: 0.25rem; }
.hero-text h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  letter-spacing: 0.5px;
  color: #fff;
}
.hero-text .title-line {
  width: 45px;
  height: 3px;
  background: var(--accent);
  margin: 0.6rem 0 0.85rem;
  border-radius: 2px;
}
.hero-text .subtitle {
  font-size: 1rem;
  color: #a8b8cc;
  margin-bottom: 0.35rem;
  font-weight: 400;
  line-height: 1.55;
}
.hero-text .affiliation {
  font-size: 0.9rem;
  color: #7a8fa6;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}
.hero-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.hero-links a {
  color: #c8d6e5;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  transition: color var(--transition), border-color var(--transition);
}
.hero-links a:hover {
  color: #fff;
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.hero-links .sep {
  color: #4a5568;
  user-select: none;
  align-self: center;
}

/* ===== Home - About ===== */
.home-about {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.home-about p {
  font-size: 0.96rem;
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 1rem;
  text-align: justify;
}

.home-about .section-heading {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.home-about .section-heading-line {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 1.25rem;
}

/* ===== Interest Tags ===== */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.tag {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
}

/* ===== Home - Latest News Bar ===== */
.news-bar {
  background: var(--bg-alt);
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}
.news-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.news-bar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.news-bar-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-dark);
}
.news-bar-header a {
  font-size: 0.88rem;
  font-weight: 500;
}

.news-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.news-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.news-card:hover { box-shadow: var(--shadow-md); }

.news-card-img {
  height: 160px;
  overflow: hidden;
}
.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.news-card:hover .news-card-img img { transform: scale(1.03); }

.news-card-body {
  padding: 1rem 1.15rem;
}
.news-card-date {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.news-card-body h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.news-card-body h3 a { color: var(--primary-dark); }
.news-card-body h3 a:hover { color: var(--accent); }
.news-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Tabbed Panels (Banat-style) ===== */
.tabs {
  margin-bottom: 2rem;
}
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.tab-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  background: none;
  border: none;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text);
  background: var(--bg-alt);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-white);
}

.tab-panels {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.tab-panel {
  display: none;
  padding: 1.5rem;
}
.tab-panel.active {
  display: block;
}

.tab-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}
.tab-panel .course-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.tab-panel p {
  font-size: 0.94rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}
.tab-panel ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.tab-panel ul li {
  font-size: 0.94rem;
  color: var(--text-mid);
  margin-bottom: 0.3rem;
  line-height: 1.65;
}

/* ===== Cards ===== */
.section { margin-bottom: 2.5rem; }

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.section-title-line {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 1.25rem;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 0.1rem;
}
.card .meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}
.card .meta .location {
  float: right;
  font-style: italic;
  color: var(--text-light);
}
.card ul {
  padding-left: 1.25rem;
  margin-top: 0.4rem;
}
.card ul li {
  margin-bottom: 0.3rem;
  font-size: 0.93rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ===== Publications ===== */
.pub-list { list-style: none; }
.pub-list li {
  padding: 1rem 1.25rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  box-shadow: var(--shadow);
  font-size: 0.93rem;
  line-height: 1.7;
}
.pub-title { font-weight: 600; color: var(--text); }
.pub-venue { color: var(--text-light); font-style: italic; }
.pub-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  margin-left: 0.35rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pub-badge.journal { background: #e8f5e9; color: #2e7d32; }
.pub-badge.conference { background: #e3f2fd; color: #1565c0; }
.pub-badge.review { background: #fff8e1; color: #f57f17; }
.pub-badge.wip { background: #fce4ec; color: #c62828; }
.pub-badge.award { background: #fff8e1; color: #e65100; border: 1px solid #ffcc02; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
.skill-group {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
}
.skill-group h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.skill-group p {
  font-size: 0.9rem;
  color: var(--text-mid);
}

/* ===== Awards ===== */
.awards-list { list-style: none; }
.awards-list li {
  padding: 0.75rem 1.1rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.awards-list .award-year {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.88rem;
  min-width: 62px;
  font-family: var(--font-body);
}
.awards-list .award-text {
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.55;
}
.awards-list .award-text strong { color: var(--text); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ===== News Extended (ACM Blog-style) ===== */
.news-article {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.news-article-img {
  width: 100%;
  height: 220px;
  overflow: hidden;
}
.news-article-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-article-body {
  padding: 1.5rem 1.75rem;
}
.news-article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}
.news-article-body h2 a { color: var(--primary-dark); }
.news-article-body h2 a:hover { color: var(--accent); }
.news-article-meta {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.85rem;
  display: flex;
  gap: 1.25rem;
}
.news-article-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.news-article-excerpt {
  font-size: 0.93rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.4rem 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.read-more:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.read-more .arrow { font-size: 1rem; }

/* News detail (expanded) */
.news-detail {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.93rem;
  color: var(--text-mid);
  line-height: 1.75;
}
.news-detail.open { display: block; }

/* ===== Footer ===== */
.footer {
  background: var(--primary-dark);
  color: #7a8fa6;
  padding: 1.75rem 2rem;
  text-align: center;
  font-size: 0.83rem;
  margin-top: 0;
}
.footer a { color: #a8b8cc; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.65rem;
}
.footer-links a {
  font-size: 0.84rem;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
}
.footer-links a:hover { border-bottom-color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.6rem 2rem;
    border-bottom: none;
  }

  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }
  .hero-text h1 { font-size: 1.9rem; }
  .hero-text .title-line { margin: 0.6rem auto 0.85rem; }
  .hero-links { justify-content: center; }

  .news-cards { grid-template-columns: 1fr; }

  .tab-nav { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { font-size: 0.8rem; padding: 0.6rem 0.85rem; }

  .card .meta .location { float: none; display: block; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .awards-list li { flex-direction: column; gap: 0.15rem; }

  .news-article-img { height: 180px; }
}

@media (max-width: 480px) {
  .hero-photo img { width: 150px; height: 175px; }
  .hero-text h1 { font-size: 1.6rem; }
  .container { padding: 1.5rem 1.25rem; }
  .page-header h1 { font-size: 1.6rem; }
  .news-card-img { height: 130px; }
  .news-article-img { height: 140px; }
}
