:root {
  --ink: #111111;
  --muted: #666666;
  --line: #e5e5e5;
  --panel: #f7f7f7;
  --accent: #000000;
  --page-width: 1100px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 0 max(24px, calc((100% - var(--page-width)) / 2));
  border-bottom: 1px solid #eeeeec;
  background: #ffffff;
}

.wordmark,
.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}

.wordmark {
  gap: 9px;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.wordmark img {
  display: block;
  width: 30px;
  height: 30px;
}

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

.header-link {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 160ms ease;
}

.header-link:hover,
.header-link:focus-visible {
  color: var(--accent);
}

main {
  width: min(calc(100% - 40px), var(--page-width));
  margin: 0 auto;
}

.hero {
  padding: clamp(20px, 3vh, 36px) 0 48px;
  text-align: center;
}

h1 {
  max-width: 100%;
  margin: 0 auto;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.authors {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.6;
}

.authors span,
.affiliations span {
  white-space: nowrap;
}

.authors sup,
.affiliations sup {
  font-size: 0.65em;
  line-height: 0;
  margin-left: 2px;
}

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

.authors a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.affiliations {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.author-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.affiliation-logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  column-gap: clamp(16px, 4.5vw, 64px);
  width: min(100%, 1100px);
  margin: 12px auto 0;
}

.affiliation-logos a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 64px;
}

.institution-logo {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Equal-width columns keep Sharpa centered. Optical sizing balances Sydney's
   dense shield, Sharpa's bold wordmark, and HKU's longer bilingual lockup. */
.institution-logo--sydney { width: min(180px, 75%); }
.institution-logo--sharpa { width: min(190px, 79.166667%); }
.institution-logo--hku { width: 240px; }

.project-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  width: min(100%, 636px);
  gap: 12px;
  margin: 16px auto 20px;
}

.project-links a,
.project-links button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.project-links a:hover {
  background: var(--panel);
  border-color: var(--muted);
}

.project-links .project-link--unavailable {
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  padding-bottom: 6px;
  color: var(--muted);
  background: var(--panel);
  cursor: default;
  opacity: 1;
}

.project-link-status {
  font-size: 0.65rem;
  line-height: 1.2;
}

.overview-video {
  width: 100%;
  margin: 0 auto;
}

.overview-video video {
  border: 1px solid #222222;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 7%);
}

/* Keep the complete film in view on desktop, rather than cropping it at the
   fold. Smaller screens retain a readable full-width player and normal scroll. */
@media (min-width: 960px) and (min-height: 640px) {
  .overview-video {
    width: min(100%, calc((100vh - 420px) * 16 / 9));
    width: min(100%, calc((100svh - 420px) * 16 / 9));
  }
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #111111;
  border-radius: 2px;
}

.section {
  padding: 56px 0 64px;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 32px;
  font-size: clamp(1.45rem, 2.7vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.section-number {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

#abstract {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 56px;
  padding-top: 64px;
  padding-bottom: 72px;
}

#abstract h2 {
  margin: 0;
  font-size: 1.5rem;
}

.abstract-card {
  min-width: 0;
}

.experiment + .experiment {
  margin-top: 44px;
}

.experiment h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.video-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.video-pair figure {
  min-width: 0;
  margin: 0;
}

.video-pair--simulation video {
  aspect-ratio: 8 / 5;
}

.video-pair figcaption {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

a:focus-visible,
button:focus-visible,
video:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.abstract-card p {
  margin: 0;
  color: #252525;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 1.6vw, 1.12rem);
  line-height: 1.85;
}

footer {
  padding: 32px 20px 36px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

footer p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.75;
}

footer p + p {
  margin-top: 8px;
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}

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

@media (max-width: 959px) {
  #abstract {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .abstract-card {
    max-width: 780px;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 0 16px;
  }

  main {
    width: min(calc(100% - 28px), var(--page-width));
  }

  .hero {
    padding-top: 30px;
    padding-bottom: 40px;
  }

  .authors {
    gap: 6px 14px;
  }

  .project-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 360px);
    gap: 8px;
  }

  .affiliation-logos {
    margin-top: 12px;
  }

  .affiliation-logos a {
    min-height: 52px;
  }

  .wordmark {
    gap: 5px;
    font-size: 0.9rem;
  }

  .wordmark img {
    width: 26px;
    height: 26px;
  }

  .project-links a,
  .project-links button {
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.8rem;
  }

  .site-header nav {
    gap: 10px;
  }

  .header-link {
    font-size: 0.72rem;
  }

  .section-heading {
    gap: 12px;
  }

  .video-pair {
    gap: 8px;
  }

  .video-pair figcaption {
    font-size: 0.75rem;
  }

  .section,
  #abstract {
    padding-top: 36px;
    padding-bottom: 44px;
  }

  .experiment + .experiment {
    margin-top: 32px;
  }

  .experiment h3 {
    font-size: 0.95rem;
  }
}

@media (max-width: 767px) {
  h1 {
    font-size: 1.9rem;
    white-space: normal;
    text-wrap: balance;
  }
}

@media (max-width: 600px) and (max-height: 740px) {
  .hero {
    padding-top: 22px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .authors {
    margin-top: 14px;
    font-size: 0.84rem;
  }

  .affiliations {
    font-size: 0.78rem;
  }

  .project-links {
    margin-top: 16px;
    margin-bottom: 20px;
  }
}

@media (max-width: 359px) {
  .site-header {
    padding: 0 12px;
  }

  .wordmark {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  .wordmark img {
    width: 22px;
    height: 22px;
  }

  .site-header nav {
    gap: 8px;
  }

  .header-link {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .header-link,
  .project-links a,
  .project-links button {
    transition: none;
  }
}
