html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  color: #222;
  background: white;
  line-height: 1.45;
}

header {
  max-width: 950px;
  margin: 0 auto;
  text-align: center;
  padding: 24px 20px 8px;
}

h1 {
  font-size: 46px;
  margin: 0 0 6px;
}

/* Title: matches the main figure's style (bold name, regular subtitle) */
.project-title {
  color: #000;
  font-size: 38px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin: 8px 0 12px;
}

.title-main {
  font-weight: 700;
}

.title-sub {
  font-weight: 400;
}

.jump-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 16px;
  flex-wrap: wrap;
}

.jump-links a,
.jump-links .jump-soon {
  min-width: 72px;
  padding: 8px 14px;
  color: #4d7195;
  background: #f5faff;
  border: 1px solid #dcecf8;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}

.jump-links a:hover,
.jump-links a:focus-visible {
  background: #ebf6ff;
  border-color: #bedcf2;
}

.jump-links .jump-soon {
  color: #888;
  background: #f5f5f5;
  border-color: #e6e6e6;
  cursor: default;
}

h2 {
  font-size: 24px;
  text-align: center;
  margin: 0 0 12px;
}

h3 {
  font-size: 22px;
  text-align: center;
  margin: 24px 0 8px;
}

section {
  max-width: 950px;
  margin: 0 auto;
  padding: 18px 20px;
}

p {
  font-size: 0.95rem;
  margin: 0 0 10px;
}

sup {
  vertical-align: super;
  font-size: 0.75em;
}

.content-media {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 10px auto 6px;
  border-radius: 8px;
}

.figure-link {
  display: block;
  cursor: zoom-in;
}

.figure-note {
  text-align: center;
  color: #888;
  font-size: 0.8rem;
  max-width: 850px;
  margin: 0 auto;
}

.pub-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 20px auto 0;
  max-width: 900px;
}

.pub-box {
  flex: 1 1 320px;
  max-width: 520px;
  border: 1px solid #e0e6ec;
  border-radius: 10px;
  padding: 18px 20px;
  text-align: center;
  background: #fafcfe;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.pub-authors {
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 8px;
}

.pub-authors a {
  color: inherit;
  text-decoration: none;
}

.pub-authors a:visited {
  color: inherit;
}

.pub-authors a:hover {
  color: inherit;
  text-decoration: underline;
}

.pub-affiliations {
  font-size: 0.8rem;
  color: #777;
  margin: 0 0 10px;
}

.affiliation-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  margin: 10px auto 12px;
  flex-wrap: wrap;
}

.affiliation-logos img {
  height: 17px;
  width: auto;
  display: block;
  object-fit: contain;
}

.affiliation-logos a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.affiliation-logos a:hover {
  opacity: 0.8;
}

.pub-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1f5a99;
  background: #e3edf8;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 0 0 4px;
}

.pub-tag-soon {
  color: #777;
  background: #eee;
}

.pub-link {
  display: inline-block;
  margin: 4px;
  padding: 8px 15px;
  background: #164a7a;
  color: white;
  text-decoration: none;
  border-radius: 7px;
  font-weight: 600;
}

.pub-link:hover {
  background: #0f3558;
}

/* Introduction */
#introduction {
  margin-top: 22px;
  padding-top: 34px;
  border-top: 2px dashed #bedcf2;
}

#introduction p {
  max-width: 880px;
  margin: 0 auto 10px;
  font-size: 1rem;
  line-height: 1.65;
  text-align: justify;
  hyphens: auto;
  color: #333;
}

/* Video gallery */
.media-gallery {
  padding-top: 24px;
  padding-bottom: 24px;
}

.section-subtitle {
  text-align: center;
  color: #666;
  font-size: 1.05rem;
  margin-top: -6px;
  margin-bottom: 22px;
}

.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 18px auto 20px;
  flex-wrap: wrap;
}

.gallery-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: #f1f4f8;
  color: #333;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.gallery-btn:hover {
  background: #dfeaf8;
  transform: translateY(-2px);
}

.gallery-btn.active {
  background: #1f5a99;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.media-gallery-item {
  width: 100%;
  max-width: 680px;
  margin: 8px auto 28px;
  text-align: center;
}

/* Near-square videos (~1.12:1): keep the whole video visible on laptop screens */
.media-gallery-item.fit-screen {
  max-width: min(100%, 720px, calc((100vh - 140px) * 1.12));
}

.media-gallery-item h3 {
  margin-top: 12px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #4f6b86;
}

.media-gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* BibTeX */
pre {
  background: #f4f4f4;
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
}

#bibtex {
  padding-bottom: 48px;
}

/* Side navigation */
.side-nav {
  position: fixed;
  left: 16px;
  top: 50%;
  width: 175px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dcecf8;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
  z-index: 1000;
}

.side-nav a {
  color: #164a7a;
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.3;
  padding: 7px 9px;
  border-left: 3px solid transparent;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  background: #f0f5fa;
  border-left: 3px solid #164a7a;
  border-radius: 4px;
}

.side-nav a:focus-visible {
  outline: 2px solid #bedcf2;
  outline-offset: 1px;
}

#introduction,
#video-gallery,
#bibtex {
  scroll-margin-top: 24px;
}

@media (max-width: 1320px) {
  .side-nav {
    display: none;
  }
}

@media (max-width: 700px) {
  .project-title {
    font-size: 22px;
  }

  .title-break {
    display: none;
  }

  #introduction p {
    text-align: left;
  }
}
