/* Whitepaper page: a long-form reading layout. Builds on site.css. */

.wp-intro { padding: clamp(150px, 18vh, 200px) 0 clamp(56px, 7vw, 88px); border-bottom: 1px solid var(--red-line); }
.wp-title { max-width: 1040px; font-size: clamp(34px, 4.6vw, 68px); font-weight: 200; line-height: 1.08; letter-spacing: -.01em; }
.wp-by { margin-top: 24px; font: 13px/1.5 var(--mono); letter-spacing: .06em; color: var(--mute); }
.wp-dl { margin-top: 32px; }

.wp-layout { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: clamp(40px, 6vw, 112px); padding: clamp(56px, 7vw, 96px) 0 clamp(96px, 10vw, 140px); }

/* Contents */
.wp-toc details { position: sticky; top: 104px; }
.wp-toc summary { list-style: none; margin-bottom: 18px; font: 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red); cursor: default; }
.wp-toc summary::-webkit-details-marker { display: none; }
.wp-toc ol { list-style: none; border-left: 1px solid var(--red-faint); }
.wp-toc a { display: block; margin-left: -1px; padding: 7px 0 7px 16px; border-left: 1px solid transparent; font-size: 14px; line-height: 1.4; color: var(--mute); transition: color .25s, border-color .25s; }
.wp-toc a:hover { color: var(--fg); }
.wp-toc a.on { color: var(--fg); border-left-color: var(--red); }

/* Body */
.wp-doc { font-size: 17px; line-height: 1.75; color: var(--text); }
.wp-sec { scroll-margin-top: 96px; }
.wp-sec + .wp-sec { margin-top: clamp(56px, 6vw, 80px); padding-top: clamp(48px, 5vw, 64px); border-top: 1px solid var(--red-faint); }
.wp-doc h2 { margin-bottom: 24px; font-size: clamp(28px, 2.8vw, 38px); font-weight: 200; line-height: 1.15; color: var(--fg); }
.wp-doc h3 { scroll-margin-top: 96px; margin: 40px 0 14px; font-size: 20px; font-weight: 400; line-height: 1.35; color: var(--fg); }
.wp-doc p + p, .wp-doc p + ul, .wp-doc p + ol, .wp-doc ul + p, .wp-doc ol + p { margin-top: 18px; }
.wp-doc strong { font-weight: 500; color: var(--fg); }
.wp-doc .it { font-style: italic; }
.wp-doc a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--red-line); text-underline-offset: 3px; transition: text-decoration-color .25s; }
.wp-doc a:hover { text-decoration-color: var(--red); }
.wp-doc ul li, .wp-doc ol li { position: relative; padding-left: 26px; }
.wp-doc li + li { margin-top: 10px; }
.wp-doc ul li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; background: var(--red); }
.wp-doc ol { counter-reset: wp; }
.wp-doc ol li { counter-increment: wp; }
.wp-doc ol li::before { content: counter(wp) "."; position: absolute; left: 0; font: 14px/1.9 var(--mono); color: var(--red); }

/* The abstract reads as a lede. */
#abstract p:first-of-type { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.6; color: var(--fg); }

.wp-tbl { margin: 28px 0; overflow-x: auto; border: 1px solid var(--red-line); }
.wp-tbl table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.wp-tbl th, .wp-tbl td { padding: 12px 18px; text-align: left; vertical-align: top; }
.wp-tbl th { font: 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--red); font-weight: 400; border-bottom: 1px solid var(--red-line); }
.wp-tbl td { border-top: 1px solid var(--red-faint); }
.wp-tbl tr:first-child td { border-top: 0; }
.wp-tbl .r { text-align: right; }

.wp-math { display: flex; flex-wrap: wrap; gap: 8px 40px; margin: 28px 0; padding: 22px 24px; border-left: 2px solid var(--red); background: var(--red-faint); font: 15px/1.6 var(--mono); color: var(--fg); overflow-x: auto; }
.wp-doc pre { margin: 28px 0; padding: 20px; overflow-x: auto; border: 1px solid var(--red-line); }

@media (max-width: 1080px) {
  .wp-layout { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .wp-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; }
  .wp-toc details { position: static; border: 1px solid var(--red-line); padding: 18px 20px; }
  .wp-toc summary { margin: 0; cursor: pointer; }
  .wp-toc summary::after { content: "+"; float: right; color: var(--mute); }
  .wp-toc details[open] summary { margin-bottom: 14px; }
  .wp-toc details[open] summary::after { content: "−"; }
}

@media (max-width: 560px) {
  .wp-doc { font-size: 16px; }
  .wp-tbl th, .wp-tbl td { padding: 10px 12px; font-size: 14px; }
  .wp-tbl th { font-size: 11px; }
}
