/* VAE Rhythm project page. Written from scratch for this project; no third-party code or fonts. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light dark;

  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f2135;
  --ink-2: #2f455c;
  --muted: #5a6e82;
  --rule: #dde5ee;
  --rule-strong: #c3d0de;
  --link: #1f5f9e;
  --link-hover: #123e6b;
  --btn-bg: #13283f;
  --btn-ink: #ffffff;
  --focus: #2a6db0;

  /* data colours: palette of the paper's figures (teal = real, orange = generated) */
  --real: #287e85;
  --real-soft: rgba(40, 126, 133, 0.12);
  --gen: #ce6a3d;
  --gen-soft: rgba(206, 106, 61, 0.12);
  --ours-bg: #f3f8fd;
  --ours-best-bg: #eaf3fc;
  --ours-accent: #2a6db0;

  --plate: #ffffff;
  --img-filter: none;
  --shadow-card: 0 1px 2px rgba(15, 33, 53, 0.04), 0 8px 24px rgba(15, 33, 53, 0.035);
  --shadow-btn: 0 1px 2px rgba(15, 33, 53, 0.05);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --container: 68rem;
  --gutter: 1.125rem;
  --radius: 0.5rem;
  --radius-lg: 0.875rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1520;
    --surface: #121f2e;
    --surface-soft: #172738;
    --ink: #e8eef4;
    --ink-2: #c2ceda;
    --muted: #8fa2b5;
    --rule: #223447;
    --rule-strong: #324a62;
    --link: #87c0f4;
    --link-hover: #beddf9;
    --btn-bg: #e8eef4;
    --btn-ink: #0d1722;
    --focus: #87c0f4;

    --real: #38aeb6;
    --real-soft: rgba(56, 174, 182, 0.18);
    --gen: #e07b4f;
    --gen-soft: rgba(224, 123, 79, 0.18);
    --ours-bg: rgba(68, 138, 208, 0.1);
    --ours-best-bg: rgba(68, 138, 208, 0.18);
    --ours-accent: #6cb0f0;

    --plate: #f8fafc;
    --img-filter: brightness(0.95) contrast(1.01);
    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.28), 0 12px 28px rgba(0, 0, 0, 0.22);
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

@media (min-width: 48rem) {
  :root { --gutter: 1.75rem; }
}
@media (min-width: 68rem) {
  :root { --gutter: 2.25rem; }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.66 var(--sans);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
@media (min-width: 60rem) {
  body { font-size: 1.03125rem; }
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 0.95em; color: var(--ink-2); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

strong { font-weight: 600; color: var(--ink); }
sup { line-height: 0; font-size: 0.72em; }

img { display: block; max-width: 100%; height: auto; }

code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 30;
  padding: 0.5rem 0.85rem;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 500 0.875rem/1 var(--sans);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; color: var(--btn-ink); }

/* ------------------------------------------------------------------ layout */
.page {
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------------ site bar */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-bar-inner {
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 3.25rem;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 600 1.02rem/1 var(--serif);
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.site-name:hover { color: var(--ink); text-decoration: none; }
.brand-mark { display: block; border-radius: 5px; flex-shrink: 0; }

.site-nav {
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  font: 500 0.84rem/1 var(--sans);
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-soft);
  text-decoration: none;
}
.site-nav a[aria-current="true"] {
  color: var(--ink);
  background: var(--surface-soft);
  font-weight: 600;
}
@media (max-width: 38rem) {
  .site-nav { display: none; }
}

/* ------------------------------------------------------------------ hero */
.hero {
  text-align: center;
  padding: 2.75rem 0 2rem;
  max-width: 54rem;
  margin: 0 auto;
}
@media (min-width: 48rem) {
  .hero { padding: 3.75rem 0 2.5rem; }
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-btn);
  font: 500 0.8125rem/1.2 var(--sans);
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.pill-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gen);
}

.title {
  margin: 0 auto;
}
.title-name {
  display: block;
  font-size: clamp(2.5rem, 1.8rem + 3.4vw, 4rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.nowrap { white-space: nowrap; }
.title-sub {
  display: block;
  margin-top: 0.5rem;
  font-size: clamp(1.22rem, 0.98rem + 1.15vw, 1.78rem);
  font-weight: 500;
  line-height: 1.26;
  color: var(--ink-2);
  max-width: 44rem;
  margin-inline: auto;
}

.authors {
  margin: 1.4rem 0 0;
  font: 500 1.05rem/1.6 var(--sans);
  color: var(--ink);
}
.authors .author { white-space: nowrap; }
.author-sep {
  margin: 0 0.45rem;
  color: var(--rule-strong);
}

.affiliations {
  margin: 0.3rem 0 0;
  font: 400 0.92rem/1.5 var(--sans);
  color: var(--muted);
}
.affil-sep { margin: 0 0.5rem; color: var(--rule-strong); }
@media (max-width: 34rem) {
  .affil-sep { display: none; }
  .affiliations span.nowrap { display: block; }
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 2.6rem;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  font: 500 0.9rem/1.1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover {
  color: var(--ink);
  border-color: var(--ink-2);
  background: var(--surface-soft);
  text-decoration: none;
}
.btn svg { width: 1.02rem; height: 1.02rem; flex: none; }
.btn-primary {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-ink);
}
.btn-primary:hover {
  color: var(--btn-ink);
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  opacity: 0.9;
}
.btn .soon { display: none; font-size: 0.76rem; font-weight: 400; color: var(--muted); }
.btn.is-pending {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  cursor: default;
}
.btn.is-pending:hover {
  border-color: var(--rule-strong);
  background: transparent;
}
.btn.is-pending .soon { display: inline; }
@media (max-width: 30rem) {
  .links { gap: 0.45rem; }
  .btn { padding: 0.5rem 0.85rem; gap: 0.38rem; font-size: 0.85rem; }
  .btn.is-pending svg { display: none; }
}

/* ------------------------------------------------------------------ cards & figures */
.media-card,
.figure-card,
.abstract-card,
.table-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

figure { margin: 0; }

.video {
  margin: 0;
}
.video-frame {
  background: #000;
}
.video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--plate);
}

.plate {
  display: block;
  background: var(--plate);
  padding: 1.15rem 1.25rem;
}
.plate img {
  width: 100%;
  filter: var(--img-filter);
}
a.plate {
  cursor: zoom-in;
  text-decoration: none;
}
a.plate:focus-visible { outline-offset: -3px; }

.card-caption {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--rule);
  background: var(--surface-soft);
  font: 400 0.875rem/1.55 var(--sans);
  color: var(--ink-2);
}
.card-caption strong {
  color: var(--ink);
  font-weight: 600;
}

.video-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.caption-meta {
  font: 500 0.78rem/1 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ sections */
.section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
}
@media (min-width: 56rem) {
  .section {
    margin-top: 3.75rem;
    padding-top: 3.75rem;
  }
}

.kicker {
  font: 600 0.78rem/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gen);
  margin: 0 0 0.65rem;
}

.section-title {
  font-size: clamp(1.6rem, 1.35rem + 0.9vw, 2.05rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
}

.lead {
  font-size: 1.08rem;
  line-height: 1.62;
  color: var(--ink);
}
@media (min-width: 60rem) {
  .lead { font-size: 1.125rem; }
}

/* ------------------------------------------------------------------ 5:7 aligned split sections */
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}
@media (min-width: 60rem) {
  .split-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2.25rem;
    align-items: stretch;
  }
}

.split-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  min-width: 0;
}

.split-grid > .figure-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.split-grid > .figure-card .plate {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

/* Panel-by-panel correspondence cards in Overview */
.panel-guide {
  display: grid;
  gap: 0.7rem;
}
.guide-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.52;
  color: var(--ink-2);
}
.guide-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin-top: 0.08rem;
  border-radius: 0.35rem;
  background: var(--surface-soft);
  border: 1px solid var(--rule-strong);
  font: 700 0.8rem/1 var(--serif);
  color: var(--ink);
}

/* Three-metric summary strip aligned to bottom of Overview left column */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-cell {
  padding: 0.7rem 0.75rem;
  border-right: 1px solid var(--rule);
}
.stat-cell:last-child { border-right: 0; }
.stat-cell dt {
  font: 500 0.72rem/1.2 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.stat-cell dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.stat-cell dd strong {
  font: 700 1.05rem/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-cell dd span {
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--muted);
}
@media (max-width: 30rem) {
  .stat-strip { grid-template-columns: 1fr; }
  .stat-cell {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .stat-cell dd { flex-direction: row; gap: 0.4rem; align-items: baseline; }
  .stat-cell:last-child { border-bottom: 0; }
}

/* Cohort legend list in VAE Rhythm section */
.cohort-guide {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.cohort-guide li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.88rem;
  line-height: 1.48;
}
.cohort-guide li:last-child { border-bottom: 0; }
.cohort-guide li p {
  margin: 0.15rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.cohort-models {
  font-size: 0.82rem;
  color: var(--muted);
}
.swatch {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  margin-top: 0.38rem;
}
.swatch-real {
  background: var(--real);
  box-shadow: 0 0 0 3px var(--real-soft);
}
.swatch-gen {
  background: var(--gen);
  box-shadow: 0 0 0 3px var(--gen-soft);
}

/* ------------------------------------------------------------------ 3:9 Swiss sections (Abstract, BibTeX) */
.swiss-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
@media (min-width: 52rem) {
  .swiss-row {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: 2.25rem;
    align-items: start;
  }
}

.swiss-head .section-title { margin-bottom: 0.45rem; }
.swiss-note {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

.abstract-card {
  padding: 1.35rem 1.45rem;
}
@media (min-width: 52rem) {
  .abstract-card {
    padding: 1.65rem 1.9rem;
  }
}
.abstract-card p {
  margin: 0;
  line-height: 1.72;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ Full-width section header (Method, Results) */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 52rem) {
  .section-head {
    grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
    gap: 2.25rem;
    align-items: baseline;
    margin-bottom: 1.75rem;
  }
  .section-head .section-title { margin-bottom: 0; }
}
.section-desc {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.62;
}

/* Method 3-column caption grid matching panels (a), (b), (c) */
.method-card .plate {
  padding: 1rem 1.1rem;
}
.method-captions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
  background: var(--surface-soft);
}
@media (min-width: 56rem) {
  .method-captions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.method-col {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.865rem;
  line-height: 1.52;
}
.method-col:last-child { border-bottom: 0; }
@media (min-width: 56rem) {
  .method-col {
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
  .method-col:last-child { border-right: 0; }
}
.method-tag {
  display: block;
  font: 600 0.85rem/1.3 var(--sans);
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.method-col p {
  margin: 0;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ Results table */
.scroll-hint {
  display: none;
  padding: 0.5rem 1rem 0;
  margin: 0;
  font: 0.8rem/1.4 var(--sans);
  color: var(--muted);
}
@media (max-width: 42rem) {
  .scroll-hint { display: block; }
}

.table-wrap {
  overflow-x: auto;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font: 0.89rem/1.38 var(--sans);
  font-variant-numeric: tabular-nums;
}

table.results th,
table.results td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  white-space: nowrap;
}

table.results thead {
  background: var(--surface-soft);
}

table.results thead th {
  font-weight: 600;
  color: var(--ink);
  vertical-align: bottom;
}

table.results thead tr:first-child th.col-method {
  text-align: left;
  padding-left: 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--rule-strong);
}

table.results thead tr:first-child th.col-group {
  text-align: center;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-top: 0.65rem;
  padding-bottom: 0.45rem;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

table.results thead tr:nth-child(2) th {
  border-bottom: 1px solid var(--rule-strong);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ink-2);
  padding-top: 0.4rem;
  padding-bottom: 0.5rem;
  width: 12.4%;
}

table.results .col-sep {
  border-left: 1px solid var(--rule);
}

table.results th[scope="row"] {
  text-align: left;
  padding-left: 1.25rem;
  white-space: normal;
  font-weight: 400;
  color: var(--ink);
  width: 38%;
  min-width: 11rem;
}

table.results th.group {
  text-align: left;
  padding: 0.42rem 1.25rem;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-soft);
}

table.results tbody tr:hover td,
table.results tbody tr:hover th[scope="row"] {
  background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
}

table.results .row-ours th[scope="row"],
table.results .row-ours td {
  background: var(--ours-bg);
}
table.results .row-ours th[scope="row"] {
  font-weight: 600;
}

table.results .row-best th[scope="row"],
table.results .row-best td {
  background: var(--ours-best-bg);
}
table.results .row-best th[scope="row"] {
  box-shadow: inset 3px 0 0 var(--ours-accent);
}

table.results td strong {
  font-weight: 700;
  color: var(--ink);
}

table.results .sd {
  display: inline-block;
  width: 2.85em;
  text-align: left;
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 400;
  margin-left: 0.15em;
}

/* Keep decimals vertically aligned in the two AIGVDBench columns that mix mean±sd and plain means */
@media (min-width: 42.0625rem) {
  table.results tbody td:nth-child(2):not(:has(.sd))::after,
  table.results tbody td:nth-child(3):not(:has(.sd))::after {
    content: "";
    display: inline-block;
    width: calc(2.85em * 0.78 + 0.15em);
  }
}

@media (max-width: 42rem) {
  table.results { font-size: 0.8125rem; }
  table.results th, table.results td { padding: 0.45rem 0.45rem; }
  table.results th[scope="row"],
  table.results thead tr:first-child th.col-method,
  table.results th.group { padding-left: 0.85rem; min-width: 8.5rem; }
  table.results .sd { display: block; width: auto; margin-left: 0; text-align: center; }
}

.is-compact .row-extra { display: none; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface-soft);
}
@media (max-width: 44rem) {
  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 0.95rem;
  }
}

.table-note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.text-btn {
  flex-shrink: 0;
  font: 500 0.84rem/1.2 var(--sans);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  min-height: 2.2rem;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.text-btn:hover {
  border-color: var(--ink-2);
  background: var(--bg);
}

/* ------------------------------------------------------------------ code + bibtex */
.code-block {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.code-block pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  background: transparent;
  overflow-x: auto;
  line-height: 1.62;
  color: var(--ink);
  font-size: 0.825rem;
}
.code-block pre code { font-size: inherit; }

.copy-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  font: 500 0.8rem/1 var(--sans);
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  min-height: 1.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.copy-btn:hover {
  border-color: var(--ink-2);
  background: var(--bg);
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  margin-top: 3.75rem;
  padding: 1.75rem 0 2.75rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 2rem;
  font: 0.84rem/1.55 var(--sans);
  color: var(--muted);
}
.site-footer p {
  margin: 0;
  color: var(--muted);
}
.footer-lab {
  font-weight: 500;
  color: var(--ink-2) !important;
}

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ------------------------------------------------------------------ print */
@media print {
  body { background: #fff; }
  .site-bar, .links, .copy-btn, .text-btn, .skip-link { display: none !important; }
  .media-card, .figure-card, .abstract-card, .table-card, .code-block { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}
