:root {
  --ink: #18212a;
  --muted: #5b6873;
  --soft: #f0f3f5;
  --line: #dce2e6;
  --panel: #ffffff;
  --blue: #225f89;
  --blue-dark: #174a6f;
  --green: #2f7d49;
  --red: #b43b36;
  --amber: #92651f;
  --page: #ffffff;
  --shadow: 0 8px 24px rgba(20, 30, 38, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 54px;
  padding: 10px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(220, 226, 230, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 750;
  text-decoration: none;
  letter-spacing: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

nav a,
.authors a,
.site-footer a {
  text-decoration: none;
}

nav a:hover,
.authors a:hover,
.site-footer a:hover {
  color: var(--blue-dark);
}

.section-wrap {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0;
  scroll-margin-top: 70px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 30px;
  text-align: center;
}

.venue,
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .venue {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 1px solid rgba(23, 74, 111, 0.22);
  border-radius: 999px;
  background: #eef6fb;
  color: var(--blue-dark);
  font-size: 18px;
  letter-spacing: 0.12em;
  box-shadow: 0 4px 12px rgba(34, 95, 137, 0.08);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1160px;
  margin-bottom: 14px;
  font-size: clamp(32px, 3.55vw, 44px);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.authors {
  max-width: 1040px;
  margin-bottom: 8px;
  color: #23313c;
  font-size: 17px;
  font-weight: 650;
}

.authors sup,
.affiliations sup {
  margin-left: 1px;
  font-size: 0.72em;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 16px;
}

.logo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: min(700px, 100%);
  margin-bottom: 16px;
}

.logo-strip img {
  object-fit: contain;
}

.logo-strip .hku-logo {
  width: auto;
  height: 64px;
  max-width: min(380px, 58%);
}

.logo-strip .transcengram-logo {
  width: auto;
  height: 42px;
  max-width: min(230px, 34%);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(20, 30, 38, 0.04);
}

.button.primary {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: white;
}

.button.disabled {
  color: #8b959d;
  cursor: default;
}

.teaser-figure,
.plot-card,
.evidence-panel figure {
  margin: 0;
}

.teaser-figure {
  width: min(760px, 100%);
}

.teaser-figure img {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.text-section {
  max-width: 900px;
  padding-top: 18px;
}

.text-section h2 {
  text-align: center;
}

.text-section p {
  margin-bottom: 12px;
  color: #35434d;
  font-size: 16px;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 18px;
}

.section-heading.compact-heading {
  max-width: 900px;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: #35434d;
  font-size: 16px;
}

.math {
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.principle-grid,
.video-grid,
.evidence-grid,
.result-grid {
  display: grid;
  gap: 14px;
}

.principle-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  margin-bottom: 16px;
}

.robot-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.evidence-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.video-grid.hardware {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.principle-card,
.video-card,
.evidence-panel,
.result-panel,
.plot-card,
.citation-section pre {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 7px 18px rgba(20, 30, 38, 0.045);
}

.principle-card,
.result-panel,
.evidence-panel {
  padding: 16px;
}

.principle-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(220, 226, 230, 0.88);
}

.principle-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
}

.principle-card.metric-card {
  background: #f5f9fc;
}

.principle-card.metric-card::before {
  background: #2b719f;
}

.principle-card.mastery-card {
  background: #f7f7fb;
}

.principle-card.mastery-card::before {
  background: #6d6fa8;
}

.principle-card.help-card {
  background: #f3faf4;
}

.principle-card.help-card::before {
  background: #3c8c55;
}

.principle-card.hurt-card {
  background: #fff8ee;
}

.principle-card.hurt-card::before {
  background: #b87928;
}

.principle-card.metric-card .tag {
  background: #e4f1f8;
  color: #1f628b;
}

.principle-card.mastery-card .tag {
  background: #ececf7;
  color: #55578f;
}

.principle-card.help-card .tag {
  background: #e1f3e5;
  color: var(--green);
}

.principle-card.hurt-card .tag {
  background: #f5ead8;
  color: var(--amber);
}

.principle-card p,
.panel-copy p,
.video-copy p,
.evidence-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: #35434c;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.video-card.fail .status {
  background: #f8e7e6;
  color: var(--red);
}

.video-card.success .status {
  background: #e3f1e6;
  color: var(--green);
}

.status b {
  margin: 0 4px;
  font-weight: 800;
}

.panel-copy {
  margin-bottom: 12px;
}

.plot-card {
  overflow: hidden;
  padding: 12px;
}

.plot-card img {
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  border: 1px solid var(--soft);
  border-radius: 6px;
  background: white;
}

.plot-card.wide img {
  max-height: 520px;
}

.video-card {
  overflow: hidden;
}

.video-card video {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #e8ecef;
}

.video-grid.hardware .video-card video {
  height: 125px;
  aspect-ratio: 16 / 9;
}

.video-copy {
  padding: 12px;
}

.video-copy h3:last-child,
.video-copy p:last-child {
  margin-bottom: 0;
}

.evidence-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.evidence-panel figure {
  align-self: end;
}

.citation-section pre {
  overflow-x: auto;
  margin: 0;
  padding: 16px;
  color: #26343d;
  font-size: 13px;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 750;
}

@media (max-width: 980px) {
  .principle-grid.four,
  .video-grid.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid,
  .robot-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .video-grid.hardware {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .section-wrap {
    width: min(100% - 24px, 1080px);
    padding: 28px 0;
  }

  .hero {
    padding-top: 26px;
  }

  .hero .venue {
    min-height: 30px;
    font-size: 15px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 23px;
  }

  .authors,
  .affiliations,
  .text-section p,
  .section-heading p:last-child {
    font-size: 15px;
  }

  .logo-strip {
    gap: 16px;
  }

  .logo-strip .hku-logo {
    width: auto;
    height: 48px;
    max-width: 60%;
  }

  .logo-strip .transcengram-logo {
    width: auto;
    height: 32px;
    max-width: 34%;
  }

  .principle-grid.four,
  .video-grid.five,
  .video-grid.hardware {
    grid-template-columns: 1fr;
  }

  .video-card video,
  .video-grid.hardware .video-card video {
    height: 210px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
