:root {
  --fg: #1a1a1a;
  --muted: #555;
  --line: #e5e5e5;
  --accent: #2a5298;
  --bg-soft: #fafafa;
  --code-bg: #f6f8fa;
  --page-bg: #f4f6f9;
  --max-w: 1280px;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--page-bg);
  line-height: 1.6;
}

/* Card-like content column sits on the soft page background */
main.container {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem 2rem;
  margin-top: -2rem;       /* tuck the card slightly under the hero edge */
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(180deg, #f5f7fa 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero .title {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  margin: 0 0 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hero .authors,
.hero .affiliations,
.hero .links {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.1rem;
}

.hero .authors li { font-weight: 500; }
.hero .authors sup,
.hero .affiliations sup { font-size: 0.7em; vertical-align: super; }
.hero .affiliations { color: var(--muted); font-size: 0.92rem; gap: 0.25rem 1.5rem; }
.hero .venue {
  margin: 0.75rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.92rem;
  background: #fff;
  transition: background 0.15s, color 0.15s;
}
.btn:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ===== Sections ===== */
main section {
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
}
main section:last-of-type { border-bottom: none; }

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.005em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.6rem;
}

p { margin: 0.6rem 0; }
ul { padding-left: 1.2rem; }
li { margin: 0.35rem 0; }

/* ===== Figures ===== */
figure {
  margin: 1.25rem 0;
  text-align: center;
}
figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
}
figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}

/* Teaser figure under the hero */
figure.teaser {
  margin: 1rem auto 1.75rem;
  max-width: 560px;
}
figure.teaser img {
  background: #fff;
  border-color: #e8e8e8;
}
figure.teaser figcaption {
  text-align: center;
  font-size: 0.92rem;
}

/* Method-section diagrams: cap their visual footprint so portrait diagrams
   don't dominate the page. .method-fig is centered with a max-width; the
   --wide modifier gives the landscape Graph diagram a bit more room. */
figure.method-fig {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
figure.method-fig--wide {
  max-width: 680px;
}
figure.method-fig img {
  background: #fff;
}

.figgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}
.figgrid figure { margin: 0; }
@media (max-width: 700px) {
  .figgrid { grid-template-columns: 1fr; }
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0 0.5rem;
}
th, td {
  padding: 0.55rem 0.6rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
th:first-child, td:first-child,
th:nth-child(2), td:nth-child(2) {
  text-align: left;
}
thead th {
  background: var(--bg-soft);
  border-bottom: 2px solid var(--line);
  font-weight: 600;
}
tbody tr:hover { background: #fcfcfc; }

.note {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.5rem;
}

/* ===== BibTeX ===== */
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ===== Footer ===== */
footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
footer .small { font-size: 0.8rem; margin-top: 0.5rem; }

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .hero { padding: 2rem 0 1.5rem; }
  table { font-size: 0.78rem; }
  th, td { padding: 0.4rem 0.4rem; }
}
