/* ===================== Base ===================== */
:root {
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #1772d0;
  --accent-hover: #f09228;
  --rule: #e5e5e5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: #ffffff;
}

.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 48px 28px;
}

/* ===================== Top Nav ===================== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.topnav-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}

.nav-name {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
  overflow-x: auto;
}

.nav-links a {
  color: #444;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
}

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

a:hover {
  color: var(--accent-hover);
}

/* ===================== Intro ===================== */
.intro {
  display: flex;
  align-items: stretch;
  gap: 44px;
  margin-bottom: 72px;
}

.intro-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.intro-text h1 {
  font-size: 2.9rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.intro-text p {
  margin-bottom: 12px;
  color: #333;
}

.intro-text .links {
  margin-top: auto;
  padding-top: 24px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.intro-text .links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid #d5d9de;
  border-radius: 6px;
  color: #333;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.intro-text .links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f5f9fd;
}

.intro-text .links i {
  font-size: 0.95em;
  color: #555;
}

.intro-text .links a:hover i {
  color: var(--accent);
}

.intro-photo {
  position: relative;
  flex: 0 0 310px;
  width: 310px;
  height: 340px;
  align-self: center;
}

.intro-photo img {
  object-fit: cover;
  display: block;
}

.profile-main {
  width: 290px;
  height: 340px;
  object-position: center 15%;
  border-radius: 8px;
}

.profile-secondary {
  position: absolute;
  width: 104px;
  height: 136px;
  right: 0;
  bottom: 16px;
  object-position: center 18%;
  border: 4px solid #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

/* ===================== Sections ===================== */
section {
  margin-bottom: 72px;
  scroll-margin-top: 64px;
}

h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}

.date {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ===================== News ===================== */
.news {
  list-style: none;
}

.news li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 8px;
}

.news .date {
  flex: 0 0 80px;
  font-weight: 700;
}

/* ===================== Publications ===================== */
.pub {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
}

.pub-thumb img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.pub-text .venue-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: #eaf2fc;
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.pub-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.45;
}

.pub-text .authors {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.pub-text .note {
  color: var(--muted);
  font-size: 0.85rem;
}

.pub-text .tldr {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 10px;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
}

.pub-links a {
  padding: 3px 12px;
  border: 1px solid #d5d9de;
  border-radius: 5px;
  color: #444;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}

.pub-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===================== Entries (Experience / Education) ===================== */
.entries {
  list-style: none;
}

.entries li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.entry-logo {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: #fff;
  padding: 4px;
  margin-top: 2px;
}

.entry-content {
  flex: 1;
  min-width: 0;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.entry-title {
  font-weight: 700;
  font-size: 1rem;
}

.entry-org {
  font-weight: 400;
  color: var(--muted);
}

.entry-sub {
  color: var(--accent);
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.entry-advisor {
  color: var(--muted);
}

.entry-title a {
  color: inherit;
}

.entry-title a:hover {
  color: var(--accent);
}

.entries li p {
  color: #444;
  font-size: 0.92rem;
  margin-top: 2px;
}

.entry-right {
  color: #444;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ===================== Projects ===================== */
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.proj-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}

.proj-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.proj-card > a {
  display: block;
  background: #f7f9fb;
}

.proj-card > a img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  display: block;
  padding: 8px;
  box-sizing: border-box;
}

.proj-body {
  padding: 14px 16px 16px;
}

.proj-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proj-title .badge {
  flex: 0 0 auto;
  min-width: 0;
  padding: 1px 9px;
}

.proj-body p {
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 10px;
}

.proj-link {
  font-size: 0.85rem;
}

.proj-link + .proj-link {
  margin-left: 12px;
}

/* ===================== Awards ===================== */
.awards {
  list-style: none;
}

.awards li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.awards .date {
  flex: 0 0 62px;
}

.award-body {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.award-body .award-org {
  margin-left: auto;
}

.award-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #555;
  border: 1px solid #d5d9de;
  border-radius: 5px;
  padding: 0 8px;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.award-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.award-org {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.badge {
  flex: 0 0 60px;
  display: inline-block;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 0;
  border-radius: 10px;
  line-height: 1.5;
}

.badge.gold {
  background: #fdf3d7;
  color: #9a7118;
}

.badge.silver {
  background: #eef1f4;
  color: #5f6b76;
}

.badge.bronze {
  background: #f6e8dd;
  color: #96603a;
}

.badge.plain {
  background: #f2f2f2;
  color: #777;
}

.badge.honor {
  background: #e7f0fb;
  color: #2a6cb5;
}

/* ===================== Footer ===================== */
footer {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ===================== Responsive ===================== */
@media (max-width: 640px) {
  .topnav-inner {
    padding: 10px 16px;
    gap: 14px;
  }

  .nav-links {
    gap: 12px;
    font-size: 0.85rem;
  }

  .award-body {
    flex-wrap: wrap;
  }

  .award-body .award-org {
    margin-left: 0;
    flex-basis: 100%;
  }

  .intro {
    flex-direction: column-reverse;
    align-items: center;
    text-align: left;
    gap: 24px;
  }

  .intro-photo {
    width: 260px;
    height: 300px;
    flex: none;
  }

  .profile-main {
    width: 230px;
    height: 300px;
  }

  .profile-secondary {
    width: 90px;
    height: 118px;
    right: 0;
    bottom: 14px;
    border-width: 3px;
  }

  .pub {
    grid-template-columns: 1fr;
  }

  .entry-head {
    flex-wrap: wrap;
    gap: 0 16px;
  }

  .proj-grid {
    grid-template-columns: 1fr;
  }

  .awards li {
    flex-wrap: wrap;
  }

  .award-org {
    white-space: normal;
  }
}
