/* ==========================================================================
   ConfiG project page — light theme (white background to match paper figures)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --border: #e3e6ea;
  --text: #1f2328;
  --text-soft: #57606a;
  --accent: #1a5fb4;
  --accent-soft: #eaf1fb;
  --max-width: 1000px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

a:hover {
  text-decoration: underline;
}

/* ------------------------------- nav bar ------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
}

.navbar .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.navbar nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 15px;
}

.navbar nav a {
  color: var(--text-soft);
}

.navbar nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* -------------------------------- header ------------------------------- */

header.hero {
  padding: 56px 0 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.venue {
  display: inline-block;
  padding: 4px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1.title {
  margin: 0 0 8px;
  font-size: 38px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1.title .config-name {
  color: var(--accent);
}

.subtitle {
  margin: 0 0 28px;
  color: var(--text-soft);
  font-size: 19px;
}

.authors {
  margin: 0 0 6px;
  font-size: 18px;
}

.authors span.author {
  white-space: nowrap;
  margin: 0 6px;
}

.affiliations {
  margin: 6px 0 4px;
  color: var(--text-soft);
  font-size: 16px;
}

.footnote {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

sup {
  font-size: 0.7em;
}

/* ------------------------------- buttons ------------------------------- */

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.btn .icon {
  font-size: 15px;
  line-height: 1;
}

/* ------------------------------- sections ------------------------------ */

section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
}

h3 {
  margin: 32px 0 10px;
  font-size: 20px;
  font-weight: 700;
}

p {
  margin: 0 0 16px;
}

.lead {
  max-width: 820px;
  margin: 0 auto 16px;
  text-align: justify;
}

/* -------------------------------- figures ------------------------------ */

figure {
  margin: 28px auto;
  max-width: 820px;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: var(--radius);
}

figure.bordered img {
  border: 1px solid var(--border);
  padding: 10px;
}

figcaption {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  text-align: justify;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

figcaption strong {
  color: var(--text);
}

.fig-narrow img {
  max-width: 620px;
}

/* figure floated next to running text */
.side-by-side::after {
  content: "";
  display: table;
  clear: both;
}

.side-by-side .lead {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

figure.fig-side {
  float: right;
  width: 38%;
  margin: 2px 0 14px 30px;
}

figure.fig-side img {
  max-width: 100%;
}

figure.fig-side figcaption {
  font-size: 14px;
  text-align: left;
  margin-top: 10px;
}

/* -------------------------------- video -------------------------------- */

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -------------------------------- tables ------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 auto 10px;
}

table.results {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 15px;
  min-width: 620px;
}

table.results th,
table.results td {
  padding: 7px 14px;
  text-align: center;
  white-space: nowrap;
}

table.results thead tr:last-child th {
  border-bottom: 1.5px solid var(--text);
}

table.results thead tr:first-child th {
  border-top: 1.5px solid var(--text);
  font-weight: 700;
}

table.results tbody tr.rule-top td {
  border-top: 1px solid var(--border);
}

table.results tbody tr:last-child td {
  border-bottom: 1.5px solid var(--text);
}

table.results td:first-child,
table.results th:first-child {
  text-align: left;
}

table.results tr.ours {
  background: var(--accent-soft);
  font-weight: 600;
}

table.results .std {
  color: #98a0a8;
  font-size: 0.78em;
}

.group-head {
  border-bottom: 1px solid var(--text);
}

.table-caption {
  max-width: 860px;
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 15px;
  text-align: justify;
}

/* ------------------------------ highlights ----------------------------- */

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.card h4 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--accent);
}

.card p {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.6;
}

/* ---------------------------- setup summary ---------------------------- */

ul.setup-list {
  max-width: 880px;
  margin: 0 auto 26px;
  padding: 0;
  list-style: none;
}

ul.setup-list li {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15.5px;
  line-height: 1.55;
}

ul.setup-list li:last-child {
  border-bottom: none;
}

ul.setup-list .label {
  flex: 0 0 150px;
  font-weight: 700;
  color: var(--accent);
}

ul.setup-list .value {
  flex: 1;
}

/* ----------------------------- main insight ---------------------------- */

.insight {
  max-width: 880px;
  margin: 30px auto 0;
  padding: 18px 24px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.insight h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.insight p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.6;
}

/* ----------------------------- references ------------------------------ */

ol.references {
  max-width: 880px;
  margin: 0 auto;
  padding-left: 0;
  list-style: none;
  counter-reset: ref;
  font-size: 15px;
  color: var(--text-soft);
}

ol.references li {
  position: relative;
  padding: 7px 0 7px 38px;
  line-height: 1.6;
}

ol.references li::before {
  counter-increment: ref;
  content: "[" counter(ref) "]";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--text);
}

/* -------------------------------- method ------------------------------- */

.equation {
  margin: 10px auto;
  padding: 10px 20px;
  max-width: 220px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  text-align: center;
}

.equation mjx-container[display="true"] {
  margin: 0 !important;
}

/* method subsections use the full container width, like the Motivation block */
#method .lead,
#method .equation,
#method > .container > figure,
#method > .container > figure figcaption {
  max-width: none;
}

ol.steps {
  max-width: 820px;
  margin: 0 auto;
  padding-left: 22px;
}

ol.steps li {
  margin-bottom: 10px;
}

/* --------------------------------- code -------------------------------- */

pre {
  margin: 0 auto;
  padding: 18px 20px;
  max-width: 860px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
  text-align: left;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* -------------------------------- footer ------------------------------- */

footer {
  padding: 36px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
}

footer p {
  margin: 0 0 8px;
}

/* ------------------------------ responsive ----------------------------- */

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  h1.title {
    font-size: 27px;
  }

  h2 {
    font-size: 23px;
  }

  .navbar nav {
    display: none;
  }

  .lead,
  figcaption,
  .table-caption {
    text-align: left;
  }

  figure.fig-side {
    float: none;
    width: 100%;
    margin: 22px 0;
  }

  ul.setup-list li {
    flex-direction: column;
    gap: 4px;
  }

  ul.setup-list .label {
    flex: none;
  }
}
