/* ============================================================
   Tu Vu — personal site
   Simple, modern academic theme with a Material-style accent palette
   ============================================================ */

:root {
  --blue: #4285F4;
  --red: #EA4335;
  --yellow: #FBBC04;
  --green: #34A853;

  --bg: #ffffff;
  --bg-soft: #F8F9FA;
  --border: #E8EAED;
  --text: #202124;
  --text-soft: #5F6368;
  --text-faint: #80868B;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(32, 33, 36, 0.06), 0 2px 12px rgba(32, 33, 36, 0.06);
  --shadow-hover: 0 4px 8px rgba(32, 33, 36, 0.08), 0 8px 24px rgba(32, 33, 36, 0.10);
  --max-width: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* -------------------- Page layout with table of contents -------------------- */
.layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: flex-start;
  gap: 56px;
}

.toc {
  width: 172px;
  flex: none;
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 78px;
}

.toc a {
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-faint);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--blue); border-left-color: var(--blue); }

.page-content { flex: 1; min-width: 0; max-width: 760px; }

/* -------------------- Dot mark (a small nod to a Google-ish palette) -------------------- */
.dotmark { display: inline-flex; gap: 4px; align-items: center; }
.dotmark span {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dotmark span:nth-child(1) { background: var(--blue); }
.dotmark span:nth-child(2) { background: var(--red); }
.dotmark span:nth-child(3) { background: var(--yellow); }
.dotmark span:nth-child(4) { background: var(--green); }

/* -------------------- Header -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.site-header nav { display: flex; gap: 28px; }

.site-header nav a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--text);
  text-decoration: none;
}

/* -------------------- Hero -------------------- */
.hero {
  padding: 64px 0 40px;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-text {
  min-width: 0;
}

.avatar {
  flex: none;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  background: conic-gradient(from 200deg, var(--blue), var(--green), var(--yellow), var(--red), var(--blue));
  padding: 4px;
  position: relative;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #6aa1f8);
}

.avatar span { position: relative; z-index: 1; }

.avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero .role {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}

.hero .affiliation {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 15px;
}

.email-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--text-soft);
}

.email-line svg {
  width: 15px;
  height: 15px;
  fill: var(--text-faint);
  flex: none;
}

.email-line a {
  color: var(--text-soft);
}

.email-line a:hover {
  color: var(--blue);
}

.hero .tagline {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(66, 133, 244, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* -------------------- Social links -------------------- */
.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: all 0.15s ease;
}

.social-links a:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  text-decoration: none;
  transform: translateY(-2px);
}

.social-links svg { width: 16px; height: 16px; fill: currentColor; }

/* -------------------- Sections -------------------- */
.section { padding: 36px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 20px;
}

.section .lede {
  font-size: 16px;
  color: var(--text);
}

/* News */
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.news-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.news-date {
  flex: none;
  width: 72px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
}

.news-item:nth-child(4n+2) .news-date { color: var(--red); }
.news-item:nth-child(4n+3) .news-date { color: var(--green); }
.news-item:nth-child(4n+4) .news-date { color: #ea9c05; }

.news-text { flex: 1; font-size: 15px; color: var(--text); }

/* Research experience */
.exp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.exp-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.exp-role { flex: 1; font-weight: 700; font-size: 15.5px; }
.exp-org { color: var(--text-soft); font-weight: 400; }

.exp-period {
  flex: none;
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Publications */
.pub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }

.pub-title { font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--blue); }

.pub-authors { margin-top: 3px; font-size: 14px; color: var(--text-soft); line-height: 1.5; }

.me {
  font-weight: 700;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-underline-offset: 2px;
}

.pub-meta { margin-top: 4px; font-size: 13px; color: var(--text-faint); }

.pub-note { margin-top: 16px; font-size: 13.5px; color: var(--text-faint); }

/* Awards / honours */
.award-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.award-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.award-dot {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.award-item:nth-child(4n+2) .award-dot { background: var(--red); }
.award-item:nth-child(4n+3) .award-dot { background: var(--green); }
.award-item:nth-child(4n+4) .award-dot { background: #ea9c05; }

.award-content {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.award-org { color: var(--text-soft); font-weight: 400; font-size: 14px; }

.award-period {
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
  margin-left: auto;
  padding-left: 12px;
}

/* Cards (posts) */
.card-list { display: flex; flex-direction: column; gap: 14px; }

.card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  color: var(--text);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.card .card-date {
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card .card-title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.section-more { margin-top: 16px; font-size: 14px; font-weight: 600; }

.empty-note {
  color: var(--text-faint);
  font-size: 14.5px;
  font-style: italic;
}

/* -------------------- Footer -------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 60px;
  margin-top: 20px;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.site-footer .copyright {
  font-size: 13px;
  color: var(--text-faint);
}

/* -------------------- Blog post -------------------- */
.post-header { margin-bottom: 20px; }

.post-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.post-meta {
  color: var(--text-faint);
  font-size: 14px;
}

.post-content { font-size: 16px; }
.post-content h2 { font-size: 22px; margin-top: 34px; }
.post-content h3 { font-size: 18px; margin-top: 28px; }
.post-content pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}
.post-content code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}
.post-content pre code { background: none; padding: 0; }

.share-links { margin: 24px 0; }

/* Post prev/next navigation */
hr { border: none; border-top: 1px solid var(--border); margin: 30px 0 20px; }

.post_navi { display: flex; }

.post_navi-label {
  font-size: 0.78em;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post_navi .post_navi-item {
  padding: 0 2.2em;
  width: 50%;
  position: relative;
  color: inherit !important;
}

.post_navi .post_navi-item:hover { text-decoration: none; }
.post_navi .post_navi-item span { color: var(--text); font-weight: 600; }

.post_navi .nav_prev { text-align: left; }
.post_navi .nav_next { text-align: right; }
.post_navi .nav_prev .post_navi-arrow { left: 0; }
.post_navi .nav_next .post_navi-arrow { right: 0; }

.post_navi .post_navi-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.2em;
  opacity: 0.25;
}

/* -------------------- Archive -------------------- */
.archive-group { margin-bottom: 30px; }
.archive-group h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin: 0 0 12px;
}
.archive-group ul { list-style: none; margin: 0; padding: 0; }
.archive-group li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 14px;
  font-size: 15px;
}
.archive-group li .archive-date {
  color: var(--text-faint);
  font-size: 13px;
  flex: none;
  width: 90px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  margin: 40px 0 24px;
}

/* -------------------- Responsive -------------------- */
@media (max-width: 900px) {
  .toc { display: none; }
  .layout { display: block; }
  .page-content { max-width: var(--max-width); }
}

@media (max-width: 600px) {
  .wrap { padding: 0 24px; }
  .layout { padding: 0 24px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-text { width: 100%; }
  .hero h1 { font-size: 28px; }
  .site-header nav { gap: 16px; }
}
