:root {
  --text: #1a1a1a;
  --muted: #656565;
  --accent: #2b5d8f;
  --accent-soft: #ecf2f8;
  --border: #e6e6e6;
  --imagine: #3a73b5;
  --narrate: #e0702c;
  --serif: "Crimson Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; background: #fff; color: var(--text); font: 16px/1.75 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: #d8e5f1; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button { font: inherit; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 8px 16px; background: #fff; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.reading-progress { position: fixed; top: 0; left: 0; z-index: 9; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.wrap { max-width: 860px; margin: auto; padding: 0 24px; }

/* Hero */
.hero { padding: 77px 0 12px; text-align: center; }
h1, h2, h3 { font-family: var(--serif); color: var(--text); }
h1 { margin: 0 0 25px; font-size: 43px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
.authors { display: flex; justify-content: center; flex-wrap: wrap; column-gap: 15px; row-gap: 3px; font-size: 14px; }
.authors span, .affiliations span { white-space: nowrap; }
.authors a { text-decoration: none; border-bottom: 1px solid var(--border); }
.authors a:hover { border-bottom-color: var(--accent); }
sup { font-size: .67em; line-height: 0; vertical-align: super; margin-left: 2px; }
.affiliations { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 17px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.venue { margin: 10px 0 0; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.resource-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 19px; border: 1px solid #dcdcdc; border-radius: 5px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
.button:hover { background: var(--text); border-color: var(--text); color: #fff; }
.button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button-detail { font-size: 10px; opacity: .6; }
.button[aria-disabled="true"] { color: #8a8a8a; border-style: dashed; cursor: default; }
.button[aria-disabled="true"]:hover { background: none; border-color: #dcdcdc; color: #8a8a8a; }

/* Table of contents */
.side-toc { position: fixed; top: 81px; left: max(16px, calc(50% - 650px)); width: 200px; max-height: calc(100dvh - 110px); overflow-y: auto; font-size: 12px; line-height: 1.6; }
.toc-title { color: #939393; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding-bottom: 10px; margin-bottom: 11px; border-bottom: 1px solid var(--border); }
.side-toc ol { padding-left: 17px; margin: 0; color: var(--muted); }
.side-toc ol > li { margin-bottom: 10px; }
.side-toc ul { list-style: none; margin: 4px 0; padding-left: 9px; }
.side-toc a { display: block; padding: 4px 7px; text-decoration: none; border-radius: 4px; }
.side-toc a:hover, .side-toc a[aria-current="location"] { color: var(--accent); background: var(--accent-soft); }
.side-toc a[aria-current="location"] { font-weight: 600; }
.mobile-toc { display: none; }

/* Sections */
.section { padding: 29px 0 8px; }
h2 { margin: 0 0 15px; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
h3 { margin: 35px 0 11px; font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.section p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.85; }
.section p strong { color: #414141; font-weight: 600; }
.highlight { background: var(--accent-soft); border-radius: 3px; padding: 2px 5px; white-space: nowrap; }
.term-narrate, .term-imagine { font-weight: 600; }
.term-narrate { color: #a8501c; }
.term-imagine { color: var(--accent); }
var { font-family: "STIX Two Text", "Cambria Math", "Times New Roman", serif; font-size: 1.08em; }

/* Figures */
figure { margin: 30px 0; }
.figure-link { display: block; }
figure img, figure video { display: block; width: 100%; height: auto; }
figcaption { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.65; }
figcaption strong { font-weight: 600; color: #383838; }
.figure-narrow { max-width: 640px; margin-right: auto; margin-left: auto; }
.animation iframe { display: block; width: 100%; height: 640px; border: 0; }
.animation.episode iframe { height: 720px; }

/* Results table */
.table-wrap { overflow-x: auto; margin: 26px 0 30px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.result-table caption { caption-side: bottom; text-align: left; margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.result-table caption strong { font-weight: 600; color: #383838; }
.result-table th, .result-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.result-table th:first-child, .result-table td:first-child { text-align: left; }
.result-table thead th { color: #414141; font-weight: 600; border-bottom: 1px solid #cfcfcf; }
.result-table tbody th { font-weight: 500; color: #414141; }
.result-table td { color: var(--muted); }
.result-table .ours th, .result-table .ours td { color: var(--text); font-weight: 600; background: var(--accent-soft); }
.result-table .infeasible { color: #a8501c; font-weight: 500; }

/* Worked example callout */
.callout { margin: 26px 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: #f7f9fb; border-radius: 0 6px 6px 0; }
.callout h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: #333; }
.callout h4 span { font-weight: 400; color: #777; }
.section .callout p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.8; }
.section .callout p:last-child { margin-bottom: 0; }
.chip { display: inline-block; padding: 0 7px; border-radius: 4px; background: #e9eef3; color: #34495e; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; line-height: 1.7; }

/* References & BibTeX */
.references p { font-size: 13px; line-height: 1.7; }
.bib-section { position: relative; border-top: 1px solid var(--border); padding: 30px 0 22px; margin-top: 35px; }
.bib-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bib-heading h2 { font-family: var(--sans); font-size: 14px; font-weight: 600; margin: 0; letter-spacing: 0; }
.copy-button { background: #fff; border: 1px solid #d8d8d8; border-radius: 4px; padding: 4px 12px; color: var(--muted); font-size: 11px; cursor: pointer; }
.copy-button:hover { border-color: var(--accent); color: var(--accent); }
pre { margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 6px; background: #f7f7f7; overflow-x: auto; font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.copy-status { display: block; min-height: 22px; margin-top: 5px; font-size: 11px; color: var(--accent); }
footer { padding: 0 0 35px; text-align: center; font-size: 11px; color: #858585; }
footer p { margin: 5px 0; }
footer a { text-decoration-color: #d5d5d5; }

@media (max-width: 1340px) {
  .side-toc { display: none; }
  .mobile-toc { display: block; margin-top: 27px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
  .mobile-toc summary { padding: 9px 0; cursor: pointer; }
  .mobile-toc nav { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0 0 13px; }
  .mobile-toc a { text-decoration: none; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 18px; }
  .wrap { padding: 0 20px; }
  .hero { padding-top: 72px; }
  h1 { font-size: 33px; line-height: 1.13; margin-bottom: 23px; }
  .desktop-break { display: none; }
  .authors { font-size: 13px; column-gap: 12px; row-gap: 5px; }
  .affiliations { gap: 3px 12px; font-size: 11px; }
  .resource-links { gap: 8px; margin-top: 22px; }
  .button { padding: 7px 14px; font-size: 12px; }
  .section { padding-top: 25px; }
  h2 { font-size: 28px; }
  h3 { font-size: 23px; margin-top: 30px; }
  .section p { font-size: 14px; line-height: 1.8; }
  figure { margin: 25px 0; }
  figcaption, .result-table caption { font-size: 11px; }
  .result-table { font-size: 12px; }
  .result-table th, .result-table td { padding: 7px 8px; }
  pre { padding: 15px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
