/* ==========================================================================
   Buxin Su — personal academic website
   Modern minimal style, deep-teal accent, system fonts, light/dark aware.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --text: #1e293b;
  --text-strong: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #f0fdfa;
  --accent-border: #99f6e4;
  --border: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --text: #cbd5e1;
    --text-strong: #f1f5f9;
    --muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.08);
    --accent-border: rgba(45, 212, 191, 0.25);
    --border: #334155;
    --shadow: none;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

strong {
  color: var(--text-strong);
}

/* ---------- Layout ---------- */

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.container {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* ---------- Top navigation ---------- */

.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.site-nav .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.site-nav .brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.35rem;
  list-style: none;
}

.site-nav ul a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav ul a:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav ul a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Hero (home page header) ---------- */

.hero {
  display: flex;
  align-items: flex-start;
  gap: 2.25rem;
  margin-bottom: 0.85rem;
}

.hero-text {
  flex: 1;
}

.hero h1 {
  font-size: 2.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
}

.hero .tagline {
  color: var(--muted);
  font-size: 1.02rem;
  margin-bottom: 1.1rem;
}

.hero .tagline a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.hero .tagline a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.hero-photo {
  margin-top: 1.2rem; /* ~5mm downward shift */
}

.hero-photo img {
  width: 172px;
  height: 172px;
  object-fit: cover;
  object-position: 50% 35%;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
}

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

.contact-links svg {
  width: 0.9em;
  height: 0.9em;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---------- Sections ---------- */

section {
  margin-bottom: 3rem;
}

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: block;
}

h3 {
  font-size: 1.08rem;
  font-weight: 650;
  color: var(--text-strong);
  margin: 1.75rem 0 0.9rem;
}

.section-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: -0.75rem 0 1.25rem;
}

.bio p + p {
  margin-top: 0.85rem;
}

.bio-wide {
  margin-bottom: 2.75rem;
}

/* ---------- Publication entries ---------- */

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.pub {
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent-border);
}

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

.pub .title {
  font-weight: 650;
  font-size: 1.02rem;
  color: var(--text-strong);
  display: block;
  margin-bottom: 0.15rem;
}

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

.pub .authors {
  font-size: 0.95rem;
  color: var(--text);
}

.pub .authors .me {
  font-weight: 650;
  color: var(--text-strong);
}

.pub .venue {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--muted);
}

.pub .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  font-style: normal;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.08rem 0.6rem;
}

.badge a {
  color: inherit;
}

.pub-links {
  font-size: 0.85rem;
  font-weight: 550;
}

.pub-links a + a {
  margin-left: 0.65rem;
}

/* Featured papers with press-clipping figure */

.pub-featured {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.pub-main {
  flex: 1;
}

.pub-figure {
  flex: 0 0 260px;
  margin: 0;
}

.pub-figure img {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pub-figure a:first-child:hover img {
  border-color: var(--accent);
}

.pub-figure figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 550;
  text-align: center;
}

/* ---------- News & awards feed ---------- */

.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-list li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
}

.news-date {
  flex: 0 0 5.6rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.news-body {
  flex: 1;
}

/* ---------- Simple item lists (talks, service, education) ---------- */

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.item .item-title {
  font-weight: 650;
  color: var(--text-strong);
}

.item .item-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.item .item-date {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Page header (inner pages) ---------- */

.page-header {
  margin-bottom: 2.25rem;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 0.4rem;
}

.page-header p {
  color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .hero {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }

  .hero-photo {
    margin-top: 0;
  }

  .hero-photo img {
    width: 140px;
    height: 140px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .pub-featured {
    flex-direction: column;
    align-items: flex-start;
  }

  .pub-figure {
    flex-basis: auto;
    width: 260px;
  }

  .news-list li {
    flex-direction: column;
    gap: 0.1rem;
  }

  .news-date {
    flex-basis: auto;
  }
}
