:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-alt: #edf6f4;
  --ink: #18222b;
  --muted: #5d6d7a;
  --line: #d8e4ea;
  --blue: #315f9f;
  --cyan: #16a9bd;
  --orange: #e98a35;
  --green: #4c9b63;
  --shadow: 0 18px 55px rgba(25, 34, 43, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(247, 249, 251, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar nav a {
  text-decoration: none;
}

.topbar nav a:hover,
.topbar nav a:focus {
  color: var(--ink);
}

.hero {
  padding: 56px 0 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  text-align: center;
}

.venue,
.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 1040px;
  margin: 0 auto 24px;
  font-size: 2.75rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.authors {
  max-width: 960px;
  margin: 0 auto 8px;
  color: #344553;
  font-size: 1.02rem;
}

.affiliations {
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.button:hover,
.button:focus {
  border-color: var(--cyan);
  color: var(--cyan);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.button.primary:hover,
.button.primary:focus {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.tldr {
  max-width: 860px;
  margin: 0 auto;
  color: #40515e;
  font-size: 1.08rem;
}

.hero-visual {
  margin-top: 30px;
}

.hero-visual figcaption {
  max-width: 760px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.hero-visual img,
.figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.section {
  padding: 60px 0;
  background: var(--bg);
}

.section.alt {
  background: var(--surface-alt);
}

.section-lead {
  max-width: 820px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 1.05rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 46px;
  align-items: center;
}

.two-col.reversed {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
}

.method-copy {
  max-width: 820px;
}

.wide-figure {
  margin-top: 26px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.step-grid article {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.step-grid span {
  display: block;
  margin-bottom: 26px;
  color: var(--cyan);
  font-weight: 850;
}

.step-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.figure {
  margin: 0;
}

.figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.figure-pair {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  align-items: start;
}

.takeaway-list,
.evidence-grid {
  display: grid;
  gap: 12px;
}

.takeaway-list article,
.evidence-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.takeaway-list article:nth-child(1) {
  border-top: 4px solid var(--orange);
}

.takeaway-list article:nth-child(2) {
  border-top: 4px solid var(--cyan);
}

.takeaway-list article:nth-child(3) {
  border-top: 4px solid var(--green);
}

.takeaway-list p,
.evidence-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.evidence-grid article {
  padding: 28px;
}

.code-panel,
.citation {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111923;
  color: #edf6f4;
}

.code-panel pre,
.citation {
  margin: 0;
  padding: 22px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 980px) {
  .step-grid,
  .figure-pair,
  .two-col,
  .two-col.reversed,
  .evidence-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    gap: 12px;
    min-height: auto;
    padding: 18px 20px;
  }

  .topbar,
  .topbar nav {
    flex-direction: column;
  }

  .topbar nav {
    gap: 8px;
  }

  .wrap {
    width: min(100% - 28px, 1120px);
  }

  .hero {
    padding-top: 38px;
  }

  h1 {
    font-size: 2.05rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .section {
    padding: 44px 0;
  }

  .actions {
    justify-content: stretch;
  }

  .button {
    flex: 1 1 100%;
  }

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