/* Shared OMEGA project-page styles. This file comes from the project-page template in
   OMEGA-HKUSTGZ/.github (templates/project-page) and is the same in every page repository:
   change it there and refresh pages with `new-page.mjs --update`. Page-specific styles go
   in page.css. Design tokens mirror omega-lab-site/src/styles/global.css. */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Space Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('../fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('../fonts/source-serif-4-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --brand: #8a5f5c;
  --rose: #a37774;
  --coral: #e88873;
  --peach: #e0ac9d;
  --canvas: #faf8f6;
  --surface: #f1ece8;
  --accent-soft: #f0e2dd;
  --ink: #484a47;
  --text: #5c6d70;
  --line: #ded8d2;
  --white: #fff;
  --wordmark: 'Source Serif 4 Variable', 'Songti SC', 'SimSun', serif;
  --heading: 'Space Grotesk Variable', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --body: 'Inter Variable', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --content: 1240px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 18px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--brand);
}
a:focus-visible,
button:focus-visible,
video:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 5px;
}
img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}
p {
  margin: 0 0 1em;
}
h1,
h2,
h3 {
  font-family: var(--heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.045em;
}
h2 {
  font-size: clamp(30px, 3.5vw, 45px);
}
h3 {
  font-size: 21px;
  letter-spacing: -0.03em;
}
::selection {
  background: var(--peach);
  color: var(--ink);
}
.container {
  width: min(var(--content), calc(100% - 96px));
  margin-inline: auto;
}
.section {
  padding-block: 96px;
}
.section-tint {
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.eyebrow {
  font: 600 12px/1.6 var(--heading);
  letter-spacing: 0.15em;
  color: var(--text);
  margin-bottom: 20px;
}
.eyebrow-rule {
  display: inline-block;
  width: 23px;
  height: 2px;
  background: var(--brand);
  vertical-align: middle;
  margin-right: 12px;
}
.skip-link {
  position: fixed;
  top: -90px;
  left: 20px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--white);
  border: 1px solid var(--ink);
}
.skip-link:focus {
  top: 12px;
}

/* Header — same structure as the lab site */
.site-header {
  height: 91px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}
.omega-glyph {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand-name {
  font: 500 23px/1.1 var(--wordmark);
  letter-spacing: 0.035em;
}
.brand-lab {
  font-size: 15px;
  letter-spacing: 0.1em;
  margin-left: 9px;
}
.brand-expansion {
  display: flex;
  flex-direction: column;
  font: 400 12px/1.4 var(--body);
  letter-spacing: 0.01em;
  color: var(--text);
}
.header-divider {
  height: 30px;
  width: 1px;
  background: var(--line);
}
.header-context {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.main-nav {
  display: flex;
  margin-left: auto;
  gap: 28px;
  font-size: 15px;
}
.main-nav a {
  padding-block: 12px;
}

/* Breadcrumb */
.crumbs {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}
.crumbs-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 52px;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.crumbs li + li::before {
  content: '/';
  margin-right: 10px;
  color: var(--line);
}
.crumbs [aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
}
.crumbs-back {
  white-space: nowrap;
  font-weight: 600;
}

/* Hero */
.hero {
  padding-block: 72px 48px;
}
.hero h1 {
  font-size: clamp(64px, 9vw, 116px);
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--brand);
}
.subtitle {
  font: 550 clamp(22px, 2.6vw, 32px)/1.3 var(--heading);
  letter-spacing: -0.03em;
  max-width: 820px;
  margin: 18px 0 30px;
}
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 550;
}
.authors sup,
.affiliations sup {
  color: var(--brand);
  font-size: 0.7em;
  margin-left: 2px;
}
.affiliations {
  list-style: none;
  padding: 0;
  margin: 0 0 34px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
  padding: 12px 20px;
  font-size: 15px;
  min-height: 48px;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
}
.button:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}
.button-light {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.button-light:hover {
  background: var(--accent-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-block: 4px;
}

/* Media */
.media-frame {
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(10px, 2vw, 24px);
}
.media-frame img {
  width: 100%;
  object-fit: contain;
}
.media-frame figcaption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text);
}
.video-frame {
  padding: 0;
}
.intro-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--white);
}

/* Section headings — same two-column rhythm as the lab site */
.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: end;
  margin-bottom: 44px;
}
.section-heading > p {
  color: var(--text);
  margin: 0;
}


/* Highlights: a row of short claims under the overview */
.capabilities {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  list-style: none;
  padding: 0;
  margin: 0 0 44px;
  border-top: 1px solid var(--line);
}
.capabilities li {
  padding: 28px 24px 8px 0;
}
.capabilities li + li {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.cap-index {
  display: block;
  font: 600 12px var(--heading);
  letter-spacing: 0.15em;
  color: var(--brand);
  margin-bottom: 14px;
}
.capabilities h3 {
  margin-bottom: 10px;
}
.capabilities p {
  font-size: 15px;
  color: var(--text);
}

/* Chapter links under the intro video */
.chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.chapters a {
  font: 500 14px var(--body);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 9px 14px;
}
.chapters a:hover {
  border-color: var(--brand);
  color: var(--brand);
}


/* Results */
.stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0 0 40px;
  border-block: 1px solid var(--line);
}
.stats div {
  padding: 22px 0 24px;
}
.stats div + div {
  padding-right: 0;
}
.stats div:not(:last-child) {
  padding-right: 24px;
}
.stats div + div {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.stats dt {
  font: 600 12px var(--heading);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
}
.stats dd {
  margin: 6px 0 0;
  font: 600 44px/1 var(--heading);
  letter-spacing: -0.04em;
  color: var(--brand);
}
.stats dd.stat-note {
  margin-top: 14px;
  font: 400 14.5px/1.55 var(--body);
  letter-spacing: 0;
  color: var(--text);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.zoomable-image {
  cursor: zoom-in;
}

/* Full-screen image viewer (ported from the original page) */
body.lightbox-open {
  overflow: hidden;
}
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(72, 74, 71, 0.94);
  color: var(--white);
}
.image-lightbox.open {
  display: flex;
}
.image-lightbox-viewport {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  overflow: hidden;
  touch-action: none;
}
.image-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  background: var(--white);
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}
.image-lightbox-img.is-zoomed {
  cursor: grab;
}
.image-lightbox-img.is-dragging {
  cursor: grabbing;
  transition: none;
}
.image-lightbox-close,
.image-lightbox-control {
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font: 600 16px/1 var(--body);
  cursor: pointer;
}
.image-lightbox-close:hover,
.image-lightbox-control:hover {
  background: var(--brand);
  border-color: var(--brand);
}
.image-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10002;
  width: 42px;
  font-size: 22px;
}
.image-lightbox-toolbar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10002;
  display: flex;
  gap: 8px;
}
.image-lightbox-control {
  min-width: 42px;
  padding: 0 12px;
}

/* Citation */
.bibtex {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
}
.bibtex pre {
  margin: 0;
  padding: 26px 28px;
  overflow-x: auto;
  font: 14px/1.7 ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color: var(--ink);
}
.copy {
  position: absolute;
  top: 12px;
  right: 12px;
  font: 600 13px var(--body);
  background: var(--canvas);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 12px;
  cursor: pointer;
}
.copy:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-block: 36px;
}
.footer-inner p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  flex: 1;
}
.wordmark.small {
  font: 500 19px/1 var(--wordmark);
  letter-spacing: 0.035em;
}
.wordmark.small .omega-glyph {
  width: 36px;
  height: 36px;
}
.wordmark.small .brand-lab {
  font-size: 12px;
  margin-left: 7px;
}

/* Long titles: add class="title-long" to the h1 when the name is a phrase, not a word */
.hero h1.title-long {
  font-size: clamp(40px, 6.2vw, 80px);
  letter-spacing: -0.05em;
  line-height: 1.04;
  max-width: 16ch;
}

/* Inside an upper-cased label, keeps a symbol or unit as written: <span class="keep-case">π</span> */
.keep-case {
  text-transform: none;
}

/* Figures */
.figure-stack {
  display: grid;
  gap: 20px;
}
.media-frame video {
  width: 100%;
  background: var(--ink);
}
.video-frame figcaption {
  margin: 0;
  padding: 14px clamp(12px, 2vw, 20px) 16px;
}
.figure-source {
  color: var(--text);
  opacity: 0.85;
}

/* Method parts: one column per component */
.method-parts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  border-top: 1px solid var(--line);
}
.method-parts li {
  padding: 24px 24px 0 0;
}
.method-parts li + li {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.method-parts h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.method-parts p {
  font-size: 15px;
  color: var(--text);
  margin: 0;
}

/* Result tables: real tables, scrolled sideways on narrow screens */
.result-block {
  margin-top: 56px;
}
.result-block > h3 {
  margin-bottom: 8px;
}
.result-block > p {
  color: var(--text);
  font-size: 16px;
  max-width: 820px;
}
.result-block > .table-caption,
.table-caption {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  max-width: 980px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
.table-wrap:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.data-table th,
.data-table td {
  padding: 10px 14px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data-table tbody th,
.data-table thead th[rowspan],
.data-table thead tr:only-child th:first-child {
  text-align: left;
}
/* The row label stays in view while a wide table scrolls sideways. */
.data-table tbody th[scope='row'],
.data-table thead tr:first-child th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}
.data-table tbody th[scope='row'] {
  background: var(--white);
}
.data-table thead th {
  font: 600 12.5px/1.35 var(--heading);
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--canvas);
  vertical-align: bottom;
}
.data-table thead th[colspan] {
  text-align: center;
  border-left: 1px solid var(--line);
}
.data-table tbody th {
  font-weight: 500;
  color: var(--ink);
}
.data-table tbody tr:last-child > * {
  border-bottom: 0;
}
.data-table .group-row th {
  font: 500 12.5px var(--body);
  font-style: italic;
  color: var(--text);
  background: var(--canvas);
  white-space: normal;
}
.data-table tr.is-ours > *,
.data-table tr.is-ours > th[scope='row'] {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.data-table .best {
  font-weight: 700;
  color: var(--brand);
}
.data-table .delta {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.table-note {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  max-width: 980px;
}

/* Demonstrations: every clip or photo says what kind of evidence it is */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.demo-grid > .wide {
  grid-column: 1 / -1;
}
.evidence-tag {
  display: inline-block;
  margin-right: 10px;
  padding: 3px 9px;
  font: 600 11.5px/1.5 var(--heading);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--text);
  vertical-align: 1px;
}
[data-evidence='hil'] .evidence-tag {
  background: var(--brand);
}
[data-evidence='real-world'] .evidence-tag {
  background: var(--ink);
}
[data-evidence='animation'] .evidence-tag {
  background: var(--white);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.availability {
  margin: 24px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--brand);
  background: var(--white);
  font-size: 15px;
  color: var(--text);
}

@media (max-width: 1000px) {
  .header-divider,
  .header-context,
  .brand-expansion {
    display: none;
  }
  .section-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .capabilities,
  .method-parts,
  .stats {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
  }
  .capabilities li:nth-child(odd),
  .method-parts li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .method-parts li {
    padding-bottom: 24px;
  }
  .stats div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .stats div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* The lab site's six links beside the wordmark: tighter below 1000px, and below 760px they no
   longer fit, so the wordmark and the breadcrumb lead back to the lab site. */
@media (max-width: 1000px) {
  .main-nav {
    gap: 18px;
    font-size: 14px;
  }
}
@media (max-width: 760px) {
  .main-nav {
    display: none;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 17px;
  }
  .container {
    width: calc(100% - 32px);
  }
  .site-header {
    height: 72px;
  }
  .omega-glyph {
    width: 40px;
    height: 40px;
  }
  .main-nav {
    display: none;
  }
  .crumbs ol {
    display: none;
  }
  .section {
    padding-block: 64px;
  }
  .hero {
    padding-block: 48px 36px;
  }
  .hero h1 {
    font-size: clamp(48px, 15vw, 64px);
  }
  .hero h1.title-long {
    font-size: clamp(36px, 10.5vw, 48px);
  }
  .capabilities,
  .method-parts,
  .pair,
  .stats,
  .demo-grid {
    grid-template-columns: 1fr;
  }
  .capabilities li,
  .capabilities li + li,
  .method-parts li,
  .method-parts li + li {
    padding: 22px 0 4px;
    border-left: 0;
  }
  .method-parts li,
  .method-parts li + li {
    padding-bottom: 20px;
  }
  .capabilities li + li,
  .method-parts li + li {
    border-top: 1px solid var(--line);
  }
  .stats div + div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .stats dd {
    font-size: 38px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .button {
    min-height: 44px;
    padding: 10px 16px;
  }
  .result-block {
    margin-top: 44px;
  }
  .data-table {
    font-size: 13.5px;
  }
  .data-table th,
  .data-table td {
    padding: 9px 11px;
  }
  .data-table tbody th[scope='row'] {
    white-space: normal;
    min-width: 116px;
    max-width: 150px;
  }
  .bibtex pre {
    padding: 52px 16px 20px;
    font-size: 12.5px;
  }
  .image-lightbox-viewport {
    padding: 18px;
  }
  .image-lightbox-close {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
  }
  .image-lightbox-toolbar {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

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