/* KyberSwap article — Wikipedia-inspired, clean white layout */

:root {
  --text: #202122;
  --muted: #54595d;
  --link: #3366cc;
  --link-visited: #6b4ba1;
  --border: #c8ccd1;
  --rule: #a2a9b1;
  --infobox-bg: #f8f9fa;
  --infobox-head: #cfe2ff;
  --toc-active: #eaf0ff;
  --content-max: 960px;
  --toc-width: 260px;
  --serif: "Georgia", "Times New Roman", "Liberation Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Top site bar ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  font-family: var(--sans);
}
.site-header .brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* ---- Layout ---- */
.layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

/* ---- Sticky left Table of Contents ---- */
.toc {
  position: sticky;
  top: 16px;
  flex: 0 0 var(--toc-width);
  width: var(--toc-width);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  font-family: var(--sans);
  font-size: 13.5px;
  background: var(--infobox-bg);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 2px;
}
.toc h2 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
  border: 0;
  padding: 0;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.toc > ol { counter-reset: toc; }
.toc li { margin: 2px 0; }
.toc > ol > li { counter-increment: toc; }
.toc > ol > li > a::before {
  content: counter(toc) ". ";
  color: var(--muted);
}
.toc ol ol {
  counter-reset: subtoc;
  padding-left: 14px;
}
.toc ol ol > li { counter-increment: subtoc; }
.toc ol ol > li > a::before {
  content: counter(toc) "." counter(subtoc) " ";
  color: var(--muted);
}
.toc a {
  display: block;
  padding: 3px 6px;
  border-radius: 2px;
  line-height: 1.35;
}
.toc a.active {
  background: var(--toc-active);
  font-weight: 600;
}

/* ---- Main article column ---- */
.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--content-max);
}

.article-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.content h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  margin: 30px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 16px;
}
.content h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin: 20px 0 6px;
  scroll-margin-top: 16px;
}
.content p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 14px; padding-left: 26px; }
.content li { margin: 4px 0; }

.lead { font-size: 16px; }
.lead .term { font-weight: 700; }

/* ---- Infobox (right of lead) ---- */
.infobox {
  float: right;
  width: 300px;
  margin: 4px 0 16px 24px;
  border: 1px solid var(--border);
  background: var(--infobox-bg);
  font-family: var(--sans);
  font-size: 13.5px;
  border-collapse: collapse;
}
.infobox caption {
  background: var(--infobox-head);
  font-weight: 700;
  padding: 8px;
  font-size: 15px;
}
.infobox th, .infobox td {
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.infobox th {
  width: 38%;
  font-weight: 700;
  color: var(--text);
}
.infobox .infobox-logo {
  text-align: center;
  padding: 12px;
}
.infobox .infobox-logo img { max-width: 90%; height: auto; }

/* ---- FAQ ---- */
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; padding: 0; }

/* ---- Footer ---- */
.site-footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 24px 40px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .layout { flex-direction: column; gap: 16px; }
  .toc {
    position: static;
    width: 100%;
    flex-basis: auto;
    max-height: none;
  }
  .infobox { float: none; width: 100%; margin: 0 0 16px; }
}
