:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #ffffff;
  --muted: #d6dce2;
  --soft: #aeb8c2;
  --line: #27313b;
  --line-strong: #46515f;
  --panel: #111418;
  --panel-2: #0b0e11;
  --red: #f05a52;
  --red-dark: #a52b2f;
  --green: #38c172;
  --gold: #f0b35a;
  --cyan: #7cc8d8;
  --link: #f0b35a;
  --btn-bg: #10151b;
  --btn-hover: #171d24;
  --solid-bg: #a52b2f;
  --solid-border: #f05a52;
  --solid-hover: #c83b3b;
  --solid-hover-border: #ff786a;
  --media-bg: #0b0e11;
  --table-bg: #0c1014;
  --table-head-bg: #171b21;
  --frame-line: #25303b;
  --metric-border: #38414c;
  --code-bg: #0b0e11;
  --code-ink: #dce8f8;
  --video-bg: #050607;
  --logo-filter: none;
  --toggle-bg: #20252b;
  --toggle-active: #f0b35a;
  --toggle-thumb: #f6f2ea;
  --toggle-shadow: rgba(0, 0, 0, 0.42);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f8;
  --ink: #101418;
  --muted: #4a5560;
  --soft: #697681;
  --line: #d7e0e4;
  --line-strong: #b7c5cb;
  --panel: #ffffff;
  --panel-2: #eef4f5;
  --red: #c3474b;
  --red-dark: #963137;
  --green: #11825b;
  --gold: #815707;
  --cyan: #006d8f;
  --link: #815707;
  --btn-bg: #ffffff;
  --btn-hover: #f0f7fa;
  --solid-bg: #963137;
  --solid-border: #c3474b;
  --solid-hover: #b53c42;
  --solid-hover-border: #b53c42;
  --media-bg: #ffffff;
  --table-bg: #ffffff;
  --table-head-bg: #eef4f5;
  --frame-line: #d7e0e4;
  --metric-border: #d0dde2;
  --code-bg: #111820;
  --code-ink: #f5f8fb;
  --video-bg: #050607;
  --logo-filter: invert(1);
  --toggle-bg: #e8eef0;
  --toggle-active: #111820;
  --toggle-thumb: #ffffff;
  --toggle-shadow: rgba(15, 23, 28, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.section {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 2.4rem 0;
}

.hero {
  text-align: center;
  padding-top: 6.6rem;
  padding-bottom: 1.8rem;
  position: relative;
}

.theme-toggle {
  position: absolute;
  left: 0;
  top: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0;
  background: var(--toggle-bg);
  color: var(--muted);
  cursor: pointer;
  box-shadow: 0 10px 28px var(--toggle-shadow);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--gold);
}

.theme-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 7.25rem;
  height: 2.25rem;
}

.theme-label {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  color: var(--muted);
  transition: color 160ms ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 0.22rem;
  left: 0.24rem;
  width: calc(50% - 0.32rem);
  height: calc(100% - 0.44rem);
  border-radius: 999px;
  background: var(--toggle-thumb);
  box-shadow: 0 4px 12px var(--toggle-shadow);
  transition: transform 180ms ease, background-color 160ms ease;
}

.theme-toggle[aria-pressed="false"] .theme-label:first-child,
.theme-toggle[aria-pressed="true"] .theme-label:nth-child(2) {
  color: var(--toggle-active);
}

.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
  transform: translateX(calc(100% + 0.2rem));
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: 2.65rem;
  max-width: 34ch;
  margin: 0 auto;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.9rem;
  margin-bottom: 0.9rem;
  text-align: center;
}

h3 {
  font-size: 1.12rem;
}

p {
  margin: 0;
  color: var(--muted);
}

.body {
  color: var(--muted);
  font-size: 1rem;
}

.venue {
  margin-top: 0.95rem;
  font-weight: 700;
  color: var(--green);
}

.authors {
  margin: 1rem auto 0;
  max-width: 85ch;
  color: var(--ink);
  font-size: 1.02rem;
}

.authors a {
  color: var(--gold);
}

.affiliations {
  margin-top: 0.5rem;
  font-size: 0.96rem;
}

.aff-line {
  display: block;
}

.hero-logos {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.85rem;
}

.hero-logos a {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  transition: opacity 160ms ease, transform 160ms ease;
}

.hero-logos a:hover {
  opacity: 1;
  transform: translateY(-1px);
  text-decoration: none;
}

.hero-logos img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  max-width: min(18vw, 170px);
  filter: var(--logo-filter);
  transition: filter 160ms ease;
}

.actions {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.54rem 0.9rem;
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--btn-bg);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: var(--btn-hover);
  text-decoration: none;
}

.btn-solid {
  background: var(--solid-bg);
  border-color: var(--solid-border);
  color: #fff;
}

.btn-solid:hover {
  background: var(--solid-hover);
  border-color: var(--solid-hover-border);
  color: #fff;
}

.lead {
  margin: 1.2rem auto 0;
  max-width: 86ch;
  color: var(--muted);
}

.abstract {
  max-width: 92ch;
  margin: 0 auto;
  text-align: justify;
}

.subtle {
  color: var(--soft);
  font-size: 0.92rem;
}

.bullets {
  margin: 0.85rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.bullets li {
  margin: 0.4rem 0;
}

.two-col {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 0.82fr 1.18fr;
  align-items: start;
  margin-top: 0.6rem;
}

.cards {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0.95rem;
}

.card-title {
  margin: 0 0 0.45rem;
  text-align: left;
}

.metric-card {
  border-color: var(--metric-border);
}

.metric {
  color: var(--green);
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.figure {
  margin: 0.9rem 0 0;
}

.wide-figure {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.media {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--media-bg);
  color: var(--soft);
  overflow: hidden;
}

.figure-media {
  min-height: 0;
  padding: 0.35rem;
}

.figure-media img {
  width: 100%;
  height: auto;
  max-height: 820px;
  object-fit: contain;
  display: block;
}

figcaption {
  margin-top: 0.45rem;
  color: var(--soft);
  font-size: 0.92rem;
  text-align: center;
}

.table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--table-bg);
}

.results-table th,
.results-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--muted);
}

.results-table th {
  background: var(--table-head-bg);
  color: var(--ink);
  font-weight: 700;
}

.results-table tr:last-child td {
  border-bottom: 0;
}

.video-grid,
.figure-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

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

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

.video-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0.6rem;
}

.media-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--frame-line);
  background: var(--panel-2);
}

.media-wrap img,
.media-wrap video,
.media-wrap iframe {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--video-bg);
}

.media-wrap img,
.media-wrap video {
  height: auto;
}

.media-wrap iframe {
  height: 100%;
  border: 0;
}

.summary-video-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.summary-video-wrap iframe {
  aspect-ratio: 16 / 9;
}

.video-card p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

pre {
  margin: 0 auto;
  max-width: 940px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  padding: 0.95rem;
  overflow-x: auto;
  color: var(--code-ink);
  line-height: 1.45;
}

#copyBibtex {
  display: block;
  margin: 0.75rem auto 0;
  cursor: pointer;
}

.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding-top: 1.4rem;
  padding-bottom: 2.4rem;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .two-col,
  .cards.three,
  .figure-grid {
    grid-template-columns: 1fr;
  }

  .figure-grid .figure {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 820px) {
  h1 {
    font-size: 2.05rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .video-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .section {
    padding: 1.8rem 0;
  }

  .hero {
    padding-top: 2.2rem;
  }

  .theme-toggle {
    position: static;
    margin: 0 auto 1rem;
  }

  .theme-toggle-track {
    width: 6.6rem;
    height: 2.15rem;
  }

  h1 {
    font-size: 1.62rem;
  }

  .hero-logos {
    position: static;
    margin-top: 0.9rem;
    flex-direction: row;
    justify-content: center;
    gap: 0.75rem;
  }

  .hero-logos img {
    height: 30px;
    max-width: min(38vw, 150px);
  }

  .btn {
    flex: 1 1 7rem;
  }
}

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

  .reveal {
    transition: none;
  }
}
