:root {
  --ink: #18202a;
  --muted: #596471;
  --faint: #798492;
  --line: #e4e8ef;
  --accent: #506aea;
  --accent-dark: #3549b5;
  --paper: #fff;
  --soft: #f7f8fc;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-dark); text-decoration-color: #acb8f5; text-underline-offset: .16em; }
a:hover { color: #263b9e; text-decoration-color: currentColor; }
a:focus-visible, .table-scroll:focus-visible { outline: 3px solid #9daeff; outline-offset: 3px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 30; background: #fff; padding: 8px 12px; }
.skip-link:focus { left: 12px; }

.paper-nav {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.paper-nav-inner {
  max-width: 1280px;
  min-height: 64px;
  margin: auto;
  padding: 10px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.paper-brand { color: var(--ink); font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.paper-brand img { width: 33px; height: 33px; object-fit: contain; mix-blend-mode: multiply; }
.paper-brand:hover { color: var(--ink); text-decoration: none; }
.paper-nav-actions { display: flex; gap: 25px; align-items: center; white-space: nowrap; }
.paper-nav-actions a { font-size: .87rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.paper-nav-actions a:hover { color: var(--accent-dark); }

.paper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 780px) minmax(0, 1fr);
  gap: 0;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 38px;
}
.paper-outline { grid-column: 1; align-self: stretch; min-width: 0; }
.paper-outline > p {
  position: sticky;
  top: 105px;
  margin: 0 0 10px;
  padding-top: 38px;
  color: var(--faint);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.paper-outline nav {
  position: sticky;
  top: 150px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: calc(100vh - 176px);
  overflow-y: auto;
  padding: 0 24px 30px 0;
  scrollbar-width: thin;
}
.paper-outline a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  font-size: .77rem;
  line-height: 1.35;
  text-decoration: none;
}
.paper-outline a:hover { color: var(--accent-dark); }
.paper-outline .toc-sub { padding-left: 13px; color: var(--faint); }
.paper-main { grid-column: 2; min-width: 0; padding: 68px 0 100px; }
.paper-social { grid-column: 3; min-width: 0; }
.paper-social-inner { position: sticky; top: 108px; width: min(170px, calc(100% - 28px)); margin: 68px 0 0 38px; }
.share-heading { display: block; color: var(--faint); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.share-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.share-action {
  display: inline-flex; align-items: center; gap: 9px; width: 100%; min-height: 39px;
  border: 1px solid transparent; border-radius: 8px; padding: 6px 8px;
  background: transparent; color: var(--muted); font: 600 .83rem var(--font);
  text-align: left; text-decoration: none; cursor: pointer;
}
.share-action:hover { color: var(--accent-dark); background: var(--soft); border-color: var(--line); text-decoration: none; }
.share-icon {
  display: inline-grid; place-items: center; flex: none; width: 25px; height: 25px;
  border-radius: 6px; background: #eef1f9; color: var(--accent-dark);
  font-size: .91rem; font-weight: 750; line-height: 1;
}
.share-status { display: block; min-height: 1.5em; padding: 5px 8px; color: var(--accent-dark); font-size: .75rem; }
.paper-mobile-share { display: none; }

.paper-header { padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.paper-kicker { margin: 0 0 17px; color: var(--accent); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.paper-header h1 { max-width: 20ch; margin: 0; font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1.12; letter-spacing: -.045em; font-weight: 790; }
.paper-authors { display: flex; flex-wrap: wrap; gap: 17px 26px; list-style: none; padding: 0; margin: 30px 0 0; }
.paper-authors li { display: flex; flex-direction: column; font-size: .83rem; line-height: 1.4; }
.paper-authors strong { font-weight: 690; }
.paper-authors span { color: var(--muted); }

.paper-abstract { margin: 40px 0 62px; padding: 26px 30px 28px; background: var(--soft); border-left: 3px solid var(--accent); }
.paper-abstract h2 { margin: 0 0 9px; font-size: .81rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-dark); }
.paper-abstract p { margin: 0; font-size: 1.05rem; line-height: 1.76; }

.paper-article { font-size: 1.075rem; line-height: 1.77; }
.paper-article > h2, .paper-references > h2 {
  scroll-margin-top: 90px;
  margin: 66px 0 22px;
  padding-top: 8px;
  font-size: 1.94rem;
  line-height: 1.24;
  letter-spacing: -.028em;
  font-weight: 760;
}
.paper-article > h2:first-child { margin-top: 0; }
.paper-article > h3 { scroll-margin-top: 90px; margin: 45px 0 14px; font-size: 1.35rem; line-height: 1.34; letter-spacing: -.02em; }
.paper-article > h4 { scroll-margin-top: 90px; margin: 31px 0 7px; font-size: 1.04rem; font-weight: 740; line-height: 1.5; }
.section-number { color: var(--accent); margin-right: .18em; font-variant-numeric: tabular-nums; }
.paper-article p { margin: 0 0 21px; }
.paper-article ul { padding-left: 1.35em; margin: 12px 0 26px; }
.paper-article li { padding-left: .2em; margin: 0 0 8px; }
.paper-article code { font-family: var(--mono); font-size: .84em; background: #f1f3f7; padding: .12em .3em; border-radius: 3px; overflow-wrap: anywhere; }
.paper-article .smallcaps, .paper-abstract .smallcaps { font-variant: small-caps; letter-spacing: .025em; }
.paper-citation { font-size: .95em; }
.paper-citation a { color: var(--muted); text-decoration-color: #cdd5ef; }
.paper-citation a:hover { color: var(--accent-dark); }
.paper-article math { font-family: serif; font-size: 1.02em; }

.paper-article figure { margin: 38px 0 44px; }
.paper-article figure > img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; }
.paper-article figcaption { margin-top: 13px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.paper-article figcaption strong { color: var(--ink); }
.paper-table { min-width: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; scrollbar-width: thin; }
.paper-table table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: .78rem; line-height: 1.42; font-variant-numeric: tabular-nums; }
.paper-table th, .paper-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.paper-table thead th { background: #f6f7fb; color: #3b4654; font-weight: 730; white-space: normal; min-width: 80px; border-bottom-color: #cbd3e1; }
.paper-table tbody tr:last-child td { border-bottom: 0; }
.paper-table tbody tr:nth-child(even) { background: #fbfcfe; }
.paper-table th:first-child, .paper-table td:first-child { min-width: 158px; }
.paper-table td:not(:first-child) { white-space: nowrap; }
.paper-table td p { margin: 0; }
.paper-table figcaption { margin-top: 12px; }

.paper-references { border-top: 1px solid var(--line); margin-top: 68px; }
.paper-references > h2 { margin-top: 33px; }
.reference-list { list-style: none; margin: 0; padding: 0; counter-reset: reference; }
.reference-list li { scroll-margin-top: 90px; position: relative; padding-left: 35px; margin-bottom: 16px; color: #3b4654; font-size: .89rem; line-height: 1.57; overflow-wrap: anywhere; counter-increment: reference; }
.reference-list li::before { content: counter(reference) "."; position: absolute; left: 0; color: var(--faint); }
.reference-list li:target { background: #f3f5ff; border-radius: 4px; }
.reference-list em { color: var(--ink); }
.footnotes { margin-top: 48px; font-size: .86rem; color: var(--muted); }
.footnotes hr { border: 0; border-top: 1px solid var(--line); }
.footnotes ol { padding-left: 25px; }
.footnotes li { margin-bottom: 7px; }
.footnotes li p { margin: 0; }
.footnote-ref, .footnote-back { font-size: .72em; }
.paper-end { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; padding-top: 25px; border-top: 1px solid var(--line); font-size: .86rem; font-weight: 620; }

@media (max-width: 1120px) {
  .paper-layout { display: block; max-width: 856px; padding: 0 30px; }
  .paper-outline, .paper-social { display: none; }
  .paper-main { padding-top: 55px; }
  .paper-mobile-share { display: block; margin: 23px 0 0; }
  .paper-mobile-share .share-actions { flex-direction: row; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
  .paper-mobile-share .share-action { width: auto; padding: 6px 9px; }
  .paper-mobile-share .share-status { padding-left: 9px; }
}
@media (max-width: 650px) {
  .paper-nav-inner { min-height: 58px; padding: 8px 18px; }
  .paper-nav-actions { gap: 14px; }
  .paper-nav-actions a { font-size: .79rem; }
  .paper-layout { padding: 0 20px; }
  .paper-main { padding-top: 38px; }
  .paper-header h1 { font-size: clamp(2.1rem, 8vw, 2.7rem); }
  .paper-authors { gap: 12px 16px; }
  .paper-authors li { width: calc(50% - 8px); }
  .paper-abstract { padding: 21px 22px; margin: 32px 0 50px; }
  .paper-abstract p, .paper-article { font-size: 1rem; }
  .paper-article > h2, .paper-references > h2 { font-size: 1.6rem; }
  .paper-article > h3 { font-size: 1.2rem; }
  .paper-end { flex-direction: column; }
}
@media print {
  .paper-nav, .paper-outline, .paper-social, .paper-mobile-share, .paper-end { display: none; }
  .paper-layout { display: block; padding: 0; }
  .paper-main { padding: 0; }
}
