:root {
  --ink: #0f0f0f;
  --text: #2a2a2a;
  --muted: #6b6b6b;
  --faint: #9b9b9b;
  --rule: #e4e4e4;
  --panel: #fafafa;
  --affine: #c0392b;
  --state: #2b6cb0;
  --measure: 780px;
  --wide: 1080px;
  --gutter: 24px;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: underline; text-decoration-color: #c9c9c9; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { color: var(--ink); font-weight: 500; margin: 0; }
h2 { font-size: 40px; line-height: 1.15; letter-spacing: -0.022em; margin: 0 0 22px; }
h3 { font-size: 21px; line-height: 1.35; letter-spacing: -0.01em; font-weight: 600; margin: 40px 0 12px; }
p { margin: 0 0 18px; }
strong { color: var(--ink); font-weight: 600; }

.skip-link { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip-link:focus { top: 12px; }

.noscript { max-width: var(--measure); margin: 16px auto; padding: 12px 16px; border: 1px solid var(--rule); font-size: 15px; }

.prose { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wide { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 96px 0 8px; }
.section + .section { border-top: 1px solid var(--rule); }
.subsection { padding-top: 72px; }

.hero { padding: 88px var(--gutter) 40px; text-align: center; }
.venue { font-size: 15px; letter-spacing: 0.02em; color: var(--muted); margin: 0 0 18px; }
.hero h1 { font-size: 52px; line-height: 1.1; letter-spacing: -0.028em; max-width: 960px; margin: 0 auto; }
.authors { font-size: 18px; color: var(--ink); margin: 30px 0 4px; }
.authors a { text-decoration-color: #d4d4d4; }
.affil { font-size: 15px; color: var(--muted); margin: 0; }
.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid #cfcfcf; border-radius: 2px;
  font-size: 15px; line-height: 1.4; color: var(--ink); text-decoration: none; background: #fff;
}
.link-btn:hover { border-color: var(--ink); }
.link-btn svg { width: 15px; height: 15px; flex: none; }
.link-btn .ext { width: 10px; height: 10px; }

figure { margin: 0; }
.figure-band { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-top: 28px; padding-bottom: 22px; margin-top: 32px; margin-bottom: 32px; }
.teaser { margin-top: 16px; }
.figure-img { display: block; width: 100%; height: auto; }
.figure-img.is-half { max-width: 560px; margin: 0 auto; }
.fig-scroll { position: relative; overflow-x: auto; }
figcaption { font-size: 14.5px; line-height: 1.6; color: var(--muted); max-width: var(--measure); margin: 16px auto 0; }
figcaption strong { color: var(--text); }

.summary { padding-top: 40px; }
.lead { font-size: 20px; line-height: 1.6; color: var(--ink); letter-spacing: -0.005em; }
.lead + .lead { margin-top: 0.9em; }
details.abstract { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 28px 0 0; }
details.abstract summary {
  cursor: pointer; list-style: none; padding: 12px 0; font-size: 15px; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::after { content: "+"; font-size: 18px; color: var(--muted); }
details.abstract[open] summary::after { content: "−"; }
details.abstract p { font-size: 16px; color: var(--text); }

.section-nav {
  position: sticky; top: 0; z-index: 20;
  background: #ffffff;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-top: 64px;
}
.section-nav ul {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; justify-content: center; gap: 28px;
  overflow-x: auto; scrollbar-width: none;
}
.section-nav ul::-webkit-scrollbar { display: none; }
.section-nav a {
  display: block; padding: 12px 0 10px; font-size: 15px; color: var(--muted);
  text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent;
}
.section-nav a:hover { color: var(--ink); }
.section-nav a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.katex { font-size: 1.04em; }
.katex-display { position: relative; overflow-x: auto; overflow-y: hidden; padding: 4px 0; margin: 20px 0; }
.statement { border-left: 2px solid var(--ink); padding: 2px 0 2px 20px; margin: 28px 0; }
.statement .label { color: var(--ink); font-weight: 600; }
.statement p:last-child { margin-bottom: 0; }

.c-affine { color: var(--affine); }
.c-state { color: var(--state); }

.table-scroll { position: relative; overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 15px; }
table.data th { font-weight: 500; color: var(--muted); font-size: 13.5px; text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
table.data th.l, table.data td.l { text-align: left; }
table.data td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data td.l { font-variant-numeric: normal; }
table.data td.name { color: var(--ink); }
table.data tbody tr.group-start td { border-top: 1px solid var(--ink); }
table.data thead tr:first-child th { border-bottom: none; padding-bottom: 0; }
table.data th.group { text-align: center; color: var(--ink); }
table.data td.fail { color: var(--faint); }
table.data td.max { color: var(--ink); font-weight: 600; }
.table-main { min-width: 640px; }

.widget { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-top: 24px; padding-bottom: 20px; margin-top: 36px; margin-bottom: 36px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--ink); margin-bottom: 8px; }
.panel-head .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; transform: translateY(-1px); }
.panel-head .sub { color: var(--muted); font-size: 14px; }
.widget canvas { display: block; width: 100%; border: 1px solid var(--rule); background: #fff; touch-action: none; }
.widget canvas.is-plot { border: none; }

.transport { display: flex; align-items: center; gap: 0; margin: 16px 0 0; border: 1px solid var(--rule); }
.transport .icon-btn { border: none; border-right: 1px solid var(--rule); }
.transport .scrub { flex: 1; padding: 0 14px; }
.transport .scrub input { width: 100%; }
.transport .tread { font-size: 14px; color: var(--ink); padding: 0 14px; border-left: 1px solid var(--rule); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 96px; text-align: right; line-height: 38px; }
.icon-btn {
  width: 40px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--rule); color: var(--ink); cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { background: var(--panel); }
.icon-btn svg { width: 14px; height: 14px; }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 20px; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: #cfcfcf; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); margin-top: -5.5px; border: none; }
input[type=range]::-moz-range-track { height: 2px; background: #cfcfcf; }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: none; }
input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

figcaption .caption-list { margin: 0; padding-left: 18px; }
figcaption .caption-list li { margin: 0 0 4px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .line { width: 16px; height: 2px; display: inline-block; }
.legend .line + .line { margin-left: -3px; }
.panel-head.is-stacked { margin-top: 16px; }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend .dot + .dot { margin-left: -3px; }
.legend .node { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1.5px solid var(--ink); background: #fff; }
.legend .node.is-current { background: var(--ink); }
.legend .node.is-start { border: 1px dashed #9b9b9b; }

.widget figcaption { max-width: none; margin-top: 14px; }
.widget-instruction { font-size: 15px; color: var(--text); margin: 0 0 16px; max-width: none; }
.panel-note { font-size: 14.5px; line-height: 1.55; color: var(--text); margin: 10px 0 0; }
.impl-details { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 12px; font-size: 14px; color: var(--muted); }
.impl-details summary { cursor: pointer; color: var(--text); font-size: 14px; }
.impl-details .caption-list { margin: 10px 0 0; padding-left: 18px; }
.impl-details .caption-list li { margin: 0 0 4px; }

.chart { position: relative; }
.chart canvas { display: block; width: 100%; }
.chart-tip {
  position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--ink);
  padding: 6px 9px; font-size: 13px; line-height: 1.45; color: var(--ink); white-space: nowrap;
  font-variant-numeric: tabular-nums; z-index: 5;
}
.chart-tip[hidden] { display: none; }
.chart-error { border: 1px solid var(--affine); color: var(--affine); padding: 12px 14px; font-size: 14px; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 14px; }
.chart-narrow { max-width: 680px; margin: 0 auto; }
.chart-tip .muted, .toggle .muted { color: var(--muted); }
.hint { font-size: 13.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--ink); width: 15px; height: 15px; margin: 0; }
.toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px;
  padding: 5px 12px; background: #fff; color: var(--faint); border: 1px solid var(--rule); cursor: pointer;
}
.toggle .line { width: 16px; height: 2px; display: inline-block; opacity: 0.35; }
.toggle.is-on { color: var(--ink); border-color: #cfcfcf; }
.toggle.is-on .line { opacity: 1; }
.model-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.model-pick .toggle { font-size: 13.5px; padding: 4px 10px; }
.chart canvas { touch-action: pan-y; }

.cite-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.cite-head h2 { margin: 0; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px;
  padding: 7px 14px; background: #fff; color: var(--ink); border: 1px solid #cfcfcf; border-radius: 2px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--ink); }
.copy-btn svg { width: 14px; height: 14px; }
pre.bibtex {
  margin: 0; padding: 20px 22px; border: 1px solid var(--rule); background: var(--panel);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}

footer { border-top: 1px solid var(--rule); margin-top: 88px; padding: 22px 0 40px; font-size: 13.5px; color: var(--muted); }
footer .wide { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .cmp-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding-top: 56px; }
  .hero h1 { font-size: 32px; letter-spacing: -0.02em; }
  .authors { font-size: 16px; }
  h2 { font-size: 28px; }
  h3 { font-size: 19px; }
  .lead { font-size: 18px; }
  .section { padding-top: 64px; }
  .subsection { padding-top: 52px; }
  .section-nav ul { justify-content: flex-start; gap: 20px; }
  .section-nav a { font-size: 14px; }
  .fig-scroll .figure-img { min-width: 760px; }
  .transport { flex-wrap: wrap; }
  .transport .tread { min-width: 0; margin-left: auto; border-left: none; }
  .transport .scrub { order: 1; flex: 1 0 100%; padding: 8px 14px; border-top: 1px solid var(--rule); }
}
