:root {
  --ink: #1a1a1a;
  --ink-2: #444444;
  --ink-3: #767676;
  --link: #1a4f8b;
  --border: #d9d9d9;
  --border-light: #e8e8e8;
  --bg-light: #f7f7f7;
  --font: "Noto Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: #ffffff;
  line-height: 1.65;
  font-size: 16px;
}

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

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-light);
  border-radius: 3px;
  padding: 0.08em 0.35em;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}
h3 { font-size: 17px; font-weight: 700; }
.subhead { margin: 34px 0 12px; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin-left: auto; margin-right: auto; }
.justified { text-align: justify; hyphens: auto; }
.footnote { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 24px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.header { text-align: center; padding: 56px 0 8px; }
.title {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 700; line-height: 1.25; letter-spacing: -0.01em;
  max-width: 900px; margin: 0 auto 26px;
}
.authors { font-size: 17px; max-width: 800px; margin: 0 auto 6px; }
.authors span { white-space: nowrap; }
.authors sup { font-size: 11px; }
.affiliations { font-size: 15px; color: var(--ink-2); margin-bottom: 28px; }

.link-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #222222; color: #ffffff;
  border-radius: 999px; padding: 8px 20px;
  font-size: 14.5px; font-weight: 600;
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { background: #000000; text-decoration: none; }

/* ── Sections ──────────────────────────────────────────────────────────── */
.section { padding: 44px 0; }
.section-tight { padding: 30px 0 0; }
.section + .section { border-top: 1px solid var(--border-light); }

/* ── Figures ───────────────────────────────────────────────────────────── */
.figure { margin: 34px auto 6px; max-width: 960px; }
.figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border-light);
}
.figure figcaption {
  font-size: 14px; color: var(--ink-2);
  margin-top: 12px; text-align: center;
  max-width: 860px; margin-left: auto; margin-right: auto;
}
.figure-demo { max-width: 520px; margin-top: 4px; }

/* ── News ──────────────────────────────────────────────────────────────── */
.news { display: grid; grid-template-columns: 110px 1fr; row-gap: 16px; column-gap: 18px; }
.news dt { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.news dd { font-size: 15.5px; color: var(--ink-2); }

/* ── Cards (concept / architecture / findings) ─────────────────────────── */
.three-col {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 30px;
}
.plain-card {
  border: 1px solid var(--border-light);
  padding: 20px 22px;
  background: #ffffff;
}
.plain-card h3 { margin-bottom: 8px; }
.plain-card p { font-size: 14.5px; color: var(--ink-2); }

.principles { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--ink-2); }

.findings-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 8px;
}

/* ── Tools gallery ─────────────────────────────────────────────────────── */
.tools-controls {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  margin: 26px 0 24px;
}
.tool-search {
  width: min(400px, 100%);
  font-family: var(--font); font-size: 14.5px;
  padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 4px;
  outline: none; color: var(--ink); background: #fff;
}
.tool-search:focus { border-color: var(--link); }
.tool-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--ink-2); background: #ffffff;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; cursor: pointer;
}
.chip:hover { border-color: var(--ink-3); }
.chip.active { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip-count { font-size: 11.5px; font-weight: 400; opacity: 0.65; }

.tool-gallery {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.tool-cell {
  display: flex; align-items: center; gap: 9px;
  text-align: left;
  font-family: var(--font);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.tool-cell:hover { border-color: var(--link); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08); }
.tool-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tool-cell-name {
  font-size: 12.5px; font-weight: 500;
  background: none; border: none; padding: 0;
  color: var(--ink);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Tool modal ────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 20, 20, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  background: #ffffff;
  max-width: 520px; width: 100%;
  padding: 28px 30px 26px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--ink-3);
}
.modal-close:hover { color: var(--ink); }
.modal-category {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}
.modal-name {
  font-family: var(--mono); font-size: 19px; font-weight: 600;
  color: var(--link); margin: 6px 0 12px; word-break: break-all;
}
.modal-desc { font-size: 15px; color: var(--ink); margin-bottom: 16px; }
.modal-params h4 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.param-list { list-style: none; max-height: 300px; overflow-y: auto; }
.param-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-light);
  font-size: 13.5px;
}
.param-list li:last-child { border-bottom: none; }
.param-name { white-space: nowrap; color: var(--link); }
.param-note { color: var(--ink-2); flex: 1 1 220px; }
.param-none { font-size: 13.5px; color: var(--ink-3); }
.modal-foot {
  font-size: 12.5px; color: var(--ink-3);
  border-top: 1px solid var(--border-light);
  padding-top: 12px; margin-top: 16px;
}

/* ── Results (experiments) ─────────────────────────────────────────────── */
.experiment {
  border: 1px solid var(--border-light);
  background: #ffffff;
  padding: 24px 28px 22px;
  margin-bottom: 24px;
}
.exp-title {
  font-size: 17px; font-weight: 700;
  padding-bottom: 12px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}
.exp-cols {
  display: grid; grid-template-columns: 320px 1fr; gap: 34px;
  align-items: start;
}
.exp-setup h4, .exp-results h4 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.exp-setup ul {
  padding-left: 18px;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; color: var(--ink-2);
}
.exp-figure { margin: 0; max-width: none; }
.exp-figure figcaption { text-align: left; margin-left: 0; }

.paper-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.paper-table th, .paper-table td { padding: 6px 10px; text-align: left; }
.paper-table thead th { border-bottom: 1px solid var(--ink); font-weight: 700; }
.paper-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.paper-table .rule-above td { border-top: 1px solid var(--border); }
.table-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

/* bar chart */
.chart { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; }
.chart-model { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.bar-head, .bar-row {
  display: grid; grid-template-columns: 82px 1fr 56px 48px; gap: 10px; align-items: center;
  margin-bottom: 7px;
}
.bar-head {
  margin-bottom: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-3); text-align: right;
}
.bar-tok { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.bar-name { font-size: 13px; color: var(--ink-2); }
.bar-track { background: var(--bg-light); height: 16px; position: relative; }
.bar-fill { display: block; height: 100%; }
.bar-muted { background: #c3c9d1; }
.bar-mid { background: #7c9cc4; }
.bar-strong { background: #1a4f8b; }
.bar-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-light);
  padding: 40px 0 36px;
  text-align: center; font-size: 14.5px; color: var(--ink-2);
}
.footer-heading { font-size: 17px; margin-bottom: 10px; }
.footer-fine { font-size: 13px; color: var(--ink-3); margin-top: 14px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .three-col { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: repeat(2, 1fr); }
  .exp-cols { grid-template-columns: 1fr; gap: 20px; }
  .tool-gallery { grid-template-columns: repeat(3, 1fr); }
  .chart { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .tool-gallery { grid-template-columns: repeat(2, 1fr); }
  .findings-grid { grid-template-columns: 1fr; }
  .news { grid-template-columns: 1fr; row-gap: 4px; }
  .news dd { margin-bottom: 12px; }
  .authors span { white-space: normal; }
}
@media (max-width: 460px) {
  .tool-gallery { grid-template-columns: 1fr; }
}
