/* Site theme — warm academic, easy to tweak via variables */
:root {
  --font-body: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --color-bg: #f7f6f3;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-heading: #0f172a;
  --color-link: #0369a1;
  --color-link-hover: #0c4a6e;
  --color-accent: #0d9488;
  --color-nav-border: #e2e8f0;
  --color-btn-arxiv: #dc2626;
  --color-btn-project: #d97706;
  --color-btn-code: #334155;
  --color-btn-primary: #0369a1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --max-content: 1000px;
}

html {
  scroll-behavior: smooth;
}

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

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

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

p {
  line-height: 1.7;
}

h1, h2, h3, h4 {
  color: var(--color-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h2.page-title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h3.section-title {
  font-size: 1.6rem;
  padding-bottom: 0.4rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
  display: block;
  width: fit-content;
  clear: both;
}

.page-section {
  margin-top: 1.5rem;
}

.page-section:first-of-type {
  margin-top: 0.5rem;
}

main.container {
  max-width: var(--max-content);
  padding: 0 20px 3rem;
}

/* Navigation */
.nav-container {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-nav-border);
  padding: 0.85rem 0;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 20px;
  gap: 0.25rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--color-heading);
  background-color: #f1f5f9;
  text-decoration: none;
}

.nav-links a.nav-brand {
  color: var(--color-heading);
  font-weight: 600;
  font-size: 1.1rem;
  padding-left: 0;
  margin-right: 0.5rem;
}

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

.nav-links a.nav-active {
  color: var(--color-link);
  background-color: #e0f2fe;
}

/* Header / profile */
.header-section {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-nav-border);
}

.header-text {
  flex: 0 0 72%;
}

.profile-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  margin-left: 5%;
  border-radius: 50%;
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-nav-border);
}

.social-links {
  text-align: center;
  margin-top: 0.5rem;
}

.social-links a {
  font-weight: 500;
}

/* News */
#news li {
  margin-bottom: 0.75rem;
  padding-left: 0.85rem;
  border-left: 3px solid #cbd5e1;
  transition: border-color 0.15s ease;
}

#news li:hover {
  border-left-color: var(--color-accent);
}

#loadMore {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  background-color: var(--color-btn-primary);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

#loadMore:hover {
  background-color: var(--color-link-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Publications (index) */
.publication-item {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-nav-border);
  transition: box-shadow 0.2s ease;
}

.publication-item:hover {
  box-shadow: var(--shadow-md);
}

.publication-media {
  width: 160px;
  height: 90px;
  margin-right: 14px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.publication-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.publication-text {
  flex: 1;
  line-height: 1.55;
}

.publication-title {
  font-weight: 600;
  font-size: 1rem;
}

.publication-title a {
  color: var(--color-heading);
}

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

.p-conference {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Action buttons */
.btn-custom {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  margin-right: 0.35rem;
  margin-top: 0.35rem;
  display: inline-block;
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-custom:hover {
  opacity: 0.92;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-orange { background-color: var(--color-btn-project); }
.btn-red { background-color: var(--color-btn-arxiv); }
.btn-dark { background-color: var(--color-btn-code); }

/* Legacy / shared */
span.p-title { font-size: 19px; }
span.p-authors { font-style: normal; }
.p-bibtex {
  font-size: 12px;
  margin-bottom: 0;
  max-width: 650px;
  text-align: left;
}
img.p-teaser { width: 160px; }
img.p-project {
  width: 320px;
  border-radius: 12px;
  border: 1px solid var(--color-nav-border);
}

/* Publications page */
.pub-page-header {
  margin-bottom: 1.5rem;
}

.pub-page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.pub-toc {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-toc li {
  list-style: none;
}

.pub-toc a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-nav-border);
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.9rem;
}

.pub-toc a:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  text-decoration: none;
}

.pub-content {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 20px 3rem;
}

.pub-section h2 {
  font-size: 1.35rem;
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--color-accent);
}

.pub-section hr {
  border: none;
  margin: 0.5rem 0 1rem;
}

.pub-section ol {
  padding-left: 1.25rem;
}

.pub-section ol li {
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.pub-section em {
  color: var(--color-text-muted);
}

.award-note {
  color: #dc2626;
  font-weight: 600;
}

.bibtex.noshow {
  display: none;
}

.bibtex pre {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  border: 1px solid var(--color-nav-border);
}

@media (max-width: 768px) {
  main.container,
  .pub-content {
    padding: 0 15px 2rem;
  }

  .header-section {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }

  .header-text {
    flex: none;
    margin-bottom: 1.25rem;
  }

  .profile-img {
    margin-left: 0;
    width: 160px;
    height: 160px;
  }

  .publication-item {
    flex-direction: column;
    padding: 0.85rem;
  }

  .publication-media {
    width: 100%;
    height: 200px;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .publication-media video {
    height: 200px;
  }

  .publication-media[style*="position: relative"] {
    height: 250px !important;
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 10px;
  }

  .publication-media[style*="position: relative"] video {
    height: 250px !important;
    width: 50% !important;
    position: absolute;
    top: 0;
    object-fit: cover;
  }

  .publication-media[style*="position: relative"] video:first-child {
    left: 0;
  }

  .publication-media[style*="position: relative"] video:last-child {
    right: 0;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 0.35rem 0.65rem;
  }

  .pub-toc {
    flex-direction: column;
  }
}
