:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --mist: #f8fafc;
  --teal: #2563eb;
  --teal-dark: #1d4ed8;
  --mint: #eff6ff;
  --coral: #0ea5e9;
  --night: #1e293b;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  color: white;
  background: var(--night);
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.container {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
}

.content-narrow { width: min(820px, calc(100% - 3rem)); }

.hero {
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.hero::before,
.hero::after {
  display: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem 0 3.25rem;
  text-align: center;
}

.site-bar {
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-bar-inner {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.lab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 0.55rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.lab-link:hover {
  border-color: var(--line);
  color: var(--teal-dark);
  background: var(--mist);
}

.lab-logo {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.venue,
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.venue {
  display: inline-block;
  align-self: center;
  margin: 0 0 0.75rem;
  padding: 0.55rem 1.05rem;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: #f1f5f9;
  box-shadow: none;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.venue:hover {
  color: var(--teal-dark);
  background: #e2e8f0;
  transform: translateY(-1px);
}

h1 {
  max-width: 980px;
  margin: 0.65rem auto 1.8rem;
  font-size: clamp(2.25rem, 5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

h1 span { color: var(--teal); }
h2 { margin: 0; font-size: 2rem; line-height: 1.2; letter-spacing: -0.025em; }
h3 { margin: 0; line-height: 1.3; }

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  max-width: 900px;
  margin: 0 auto 0.8rem;
  font-size: 1.04rem;
  font-weight: 650;
}

.authors a { color: var(--teal-dark); text-decoration: none; }
.authors a:hover { text-decoration: underline; text-underline-offset: 4px; }
sup { font-size: 0.65em; vertical-align: super; }

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.2rem;
  max-width: 900px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.resource-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.65rem 1.05rem;
  border: 1px solid var(--night);
  border-radius: 999px;
  color: white;
  background: var(--night);
  text-decoration: none;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.resource-button:hover {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  transform: translateY(-2px);
}

.resource-button:focus-visible,
.copy-button:focus-visible,
.scroll-top:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.button-icon {
  display: inline-flex;
  width: 1.1rem;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.resource-button small {
  margin-left: 0.25rem;
  color: #cbd5e1;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section { padding: 6.5rem 0; }
.section-tinted { background: var(--mist); border-bottom: 1px solid var(--line); }
.section-tinted p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; text-align: justify; }
.section-tinted p:first-of-type:not(.eyebrow) { margin-top: 2rem; }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: 3rem;
  margin-bottom: 3rem;
}

.section-heading > p { margin: 0; color: var(--muted); }

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.method-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.method-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.step-number {
  align-self: flex-start;
  margin-bottom: 1.1rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  color: var(--teal-dark);
  background: var(--mint);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.method-card h3 { font-size: 1.4rem; }
.method-card p { color: var(--muted); }
.method-card img {
  width: 100%;
  height: 235px;
  margin-top: auto;
  padding-top: 1rem;
  object-fit: contain;
  border-top: 1px solid var(--line);
}

.method-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.method-summary div { padding: 1.4rem; background: var(--mist); }
.method-summary strong,
.method-summary span { display: block; }
.method-summary span { margin-top: 0.2rem; color: var(--muted); font-size: 0.88rem; }

.section-dark {
  color: var(--ink);
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading-light > p { color: var(--muted); }
.section-dark .eyebrow { color: var(--teal); }

.result-takeaway {
  margin: 1.5rem 0 0;
  padding: 1rem 1.2rem;
  border: 1px solid #dbeafe;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  color: #334155;
  background: #eff6ff;
  line-height: 1.65;
}

.result-takeaway strong { color: var(--teal-dark); }

.results-figure {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.results-figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0.35rem;
}

.results-figure-grid img {
  display: block;
  width: 100%;
  height: auto;
}

.results-figure figcaption {
  max-width: 920px;
  margin: 1.2rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  text-align: center;
}

.bibtex-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.6rem; }

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.68rem 0.95rem;
  border: 0;
  border-radius: 9px;
  color: white;
  background: var(--teal);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:hover { background: var(--teal-dark); }
.copy-button.is-copied { background: #15803d; }

pre {
  margin: 0;
  padding: 1.6rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #f1f5f9;
  box-shadow: var(--shadow);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.79rem;
  line-height: 1.65;
}

footer { padding: 2.6rem 0; border-top: 1px solid var(--line); color: var(--muted); background: var(--mist); font-size: 0.86rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; }
.footer-inner p { margin: 0; }

.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  box-shadow: 0 8px 24px rgba(16, 42, 43, 0.28);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 820px) {
  .hero { min-height: auto; }
  .hero-inner { padding-top: 1.5rem; }
  .section { padding: 4.5rem 0; }
  .section-heading { grid-template-columns: 1fr; gap: 1rem; }
  .method-grid,
  .results-figure-grid { grid-template-columns: 1fr; gap: 1rem; }
  .method-summary { grid-template-columns: 1fr; }
  .method-card img { height: auto; max-height: 260px; }
  .footer-inner { flex-direction: column; gap: 0.45rem; }
}

@media (max-width: 520px) {
  .container,
  .content-narrow { width: min(100% - 2rem, 1120px); }
  .site-bar-inner { min-height: 56px; }
  .lab-link { padding: 0.25rem; }
  .lab-link span { display: none; }
  h1 { font-size: 2rem; }
  .hero-inner { padding-bottom: 2.5rem; }
  .authors { font-size: 0.96rem; }
  .affiliations { display: block; }
  .affiliations span { display: block; }
  .publication-links { display: grid; grid-template-columns: repeat(2, 1fr); }
  .resource-button { justify-content: center; padding-inline: 0.75rem; }
  .section { padding: 3.6rem 0; }
  .section-tinted p:not(.eyebrow) { text-align: left; }
  .method-card { padding: 1.35rem; }
  .bibtex-heading { align-items: center; }
  pre { margin-inline: -0.25rem; padding: 1rem; font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
