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

/* ── Design tokens ── */
:root {
  --nav-h:       56px;
  --sidebar-w:   270px;
  --max-w:       1280px;
  --accent:      #4a7fcb;
  --accent-dark: #2c5f9e;
  --accent-bg:   #eef3fb;
  --accent-border: #cdddf4;
  --text:        #333;
  --text-light:  #666;
  --bg:          #fff;
  --bg-sidebar:  #f4f4f4;
  --bg-card:     #fafafa;
  --border:      #ddd;
  --radius:      6px;
  --font:        "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-serif:  "Lora", Georgia, serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

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

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

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

/* ══════════════════════════════
   Navigation
══════════════════════════════ */
#nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  background: #2c2c2c;
  border-bottom: 1px solid #1a1a1a;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-brand:hover {
  color: #fff;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2px;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  font-weight: 400;
  padding: 7px 14px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════
   Page Layout
══════════════════════════════ */
.page-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: var(--nav-h);
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--nav-h));
}

/* ══════════════════════════════
   Sidebar
══════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 36px 24px 40px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #d0d8e8;
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  flex-shrink: 0;
  overflow: hidden;
  font-family: var(--font);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  line-height: 1.35;
  margin-bottom: 6px;
}

.profile-title {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.profile-dept {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 2px;
}

.profile-uni {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 24px;
}

.profile-links {
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.8rem;
  text-decoration: none;
  text-align: left;
}

.profile-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.profile-links a span {
  word-break: break-all;
}

.profile-links i {
  color: var(--accent);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

/* ══════════════════════════════
   Main Content
══════════════════════════════ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 44px 52px;
}

section {
  margin-bottom: 60px;
}

section h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: #222;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 22px 0 10px;
}

section p {
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.8;
}

/* ══════════════════════════════
   About — Research Interests
══════════════════════════════ */
.interest-list {
  list-style: disc;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.85;
}

.interest-list li {
  margin-bottom: 3px;
}

/* ── Education ── */
.education-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.education-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.edu-degree {
  font-weight: 600;
  color: #222;
  font-size: 0.95rem;
}

.edu-inst {
  font-size: 0.875rem;
  color: var(--text-light);
}

.edu-year {
  color: var(--accent);
  font-weight: 600;
}

.edu-sub {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ══════════════════════════════
   News
══════════════════════════════ */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.news-list li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  font-size: 0.9rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

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

.news-date {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  width: 68px;
  padding-top: 2px;
  letter-spacing: 0.02em;
}

/* ══════════════════════════════
   Publications
══════════════════════════════ */
.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  counter-reset: pub;
}

.pub-item {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.pub-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(74, 127, 203, 0.1);
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  line-height: 1.5;
}

.pub-title a {
  color: #222;
}

.pub-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.pub-venue {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

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

.pub-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.pub-badge:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-color: var(--accent);
}

/* ══════════════════════════════
   Portfolio
══════════════════════════════ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.port-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.port-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(74, 127, 203, 0.1);
}

.port-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.port-card-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.port-card-header h3 a {
  color: #222;
}

.port-card-header h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.port-card-header > a {
  color: var(--text-light);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
  text-decoration: none;
}

.port-card-header > a:hover {
  color: var(--accent);
  text-decoration: none;
}

.port-card p {
  font-size: 0.83rem;
  color: var(--text-light);
  margin: 0;
  flex: 1;
  line-height: 1.6;
}

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

.port-tags span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 3px;
  padding: 2px 8px;
}

/* ══════════════════════════════
   CV
══════════════════════════════ */
#cv p {
  color: var(--text-light);
  margin-bottom: 20px;
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-cv:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

/* ══════════════════════════════
   Footer
══════════════════════════════ */
footer {
  background: #2c2c2c;
  color: rgba(255, 255, 255, 0.6);
  padding: 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-inner p {
  font-size: 0.85rem;
}

.footer-inner a {
  color: rgba(255, 255, 255, 0.75);
}

.footer-inner a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-links-row {
  display: flex;
  gap: 18px;
  align-items: center;
}

.footer-links-row a {
  font-size: 1.1rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.15s;
}

.footer-links-row a:hover {
  color: #fff;
  text-decoration: none;
}

/* ══════════════════════════════
   Responsive — tablet
══════════════════════════════ */
@media (max-width: 900px) {
  .page-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 28px 24px;
  }

  .profile-avatar {
    width: 110px;
    height: 110px;
    font-size: 2rem;
  }

  .main-content {
    padding: 32px 28px;
  }
}

/* ══════════════════════════════
   Responsive — mobile
══════════════════════════════ */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: #2c2c2c;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px 20px;
    gap: 2px;
    border-bottom: 1px solid #444;
    z-index: 190;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 10px 14px;
    width: 100%;
  }

  .main-content {
    padding: 28px 20px;
  }
}

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

  section h2 {
    font-size: 1.45rem;
  }
}
