@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,600;1,400&display=swap');

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

:root {
  --blue: #0076df;
  --blue-dark: #005bb5;
  --orange: #e06c00;
  --grey: #828282;
  --grey-light: #f5f5f5;
  --text: #1c1c1d;
  --max-width: 820px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
}

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

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

/* ============================================================
   Navbar
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  z-index: 100;
  border-bottom: 1px solid #efefef;
}

nav .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 52px;
  gap: 1.6rem;
}

nav a {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

nav a:hover,
nav a.active {
  border-bottom-color: var(--blue);
  text-decoration: none;
}

/* ============================================================
   Profile section
   ============================================================ */
#about {
  padding: 3rem 0 1rem;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.profile-card {
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
}

.profile-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.profile-info {
  padding-top: 0;
}

.profile-info h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.profile-info h1 .prev-name {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--grey);
  letter-spacing: 0;
}

.profile-info .subtitle {
  color: var(--grey);
  font-size: 1rem;
  margin-bottom: 0;
}

/* ============================================================
   Bio
   ============================================================ */
.bio {
  margin-bottom: 2.5rem;
}

.bio p { margin-bottom: 0.9rem; text-align: justify; }

section p { text-align: justify; }

details summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 0.92rem;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▶"; font-size: 0.6rem; }
details[open] summary::before { content: "▼"; }

details[open] summary { margin-bottom: 0.8rem; }
details p { margin-bottom: 0.9rem; }

/* ============================================================
   Sections
   ============================================================ */
section { padding: 2rem 0; border-top: 1px solid #efefef; }
section:first-of-type { border-top: none; }

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

/* ============================================================
   Social icons
   ============================================================ */
.social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}

.social-icons a img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  transition: opacity 0.15s, transform 0.15s;
}

.social-icons a:hover img {
  opacity: 0.8;
  transform: scale(1.08);
}

.contact-note {
  font-size: 0.95rem;
  color: var(--grey);
  margin-top: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.contact-note strong { color: var(--text); }

/* ============================================================
   News
   ============================================================ */
.news-table {
  width: 100%;
  border-collapse: collapse;
}

.news-table tr td {
  padding: 0.5rem 0;
  vertical-align: top;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.news-table tr:last-child td { border-bottom: none; }

.news-table .news-date {
  width: 110px;
  min-width: 110px;
  color: var(--grey);
  padding-right: 1.5rem;
  white-space: nowrap;
}

/* ============================================================
   Publications
   ============================================================ */
.paper {
  display: flex;
  flex-direction: row-reverse;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.paper:last-child { border-bottom: none; }

.paper-thumb {
  flex-shrink: 0;
  width: 160px;
}

.paper-thumb img {
  width: 160px;
  height: 115px;
  object-fit: contain;
  object-position: center;
}

.paper-info { flex: 1; min-width: 0; max-width: 520px; }

.paper-title {
  font-weight: 600;
  font-size: 0.97rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.paper-authors {
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.paper-authors .self { font-weight: 600; }
.paper-equal { font-size: 0.8rem; color: var(--grey); margin-bottom: 0.2rem; }

.paper-venue {
  font-style: italic;
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 0.25rem;
}

.paper-award {
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.paper-links { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.paper-links a,
.paper-links .bib-toggle {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  color: var(--text);
  background: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.paper-links a:hover,
.paper-links .bib-toggle:hover,
.paper-links .bib-toggle.active {
  background: var(--grey-light);
  border-color: #aaa;
  text-decoration: none;
}

.bib-block {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--grey-light);
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.55;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre;
  overflow-x: auto;
  color: #333;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid #efefef;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--grey);
}

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 760px) {
  .paper-info { max-width: none; }
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 540px) {
  .container { padding: 0 1rem; }

  /* Profile: stack image above name */
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    gap: 1rem;
  }

  .profile-info h1 { font-size: 1.4rem; }

  /* No justification on narrow screens — avoids ugly gaps */
  .bio p,
  section p { text-align: left; }

  /* Icons already centered */

  /* Publications: stack thumb below text */
  .paper { flex-direction: column-reverse; }
  .paper-thumb { width: 100%; }
  .paper-thumb img { width: 100%; height: 160px; }

  /* News: smaller date column */
  .news-table .news-date {
    width: 80px;
    min-width: 80px;
    font-size: 0.8rem;
    padding-right: 0.75rem;
  }
}
