/* Research articles: a reading column with a table of contents beside it, charts drawn as inline SVG */

.art { padding-top: clamp(28px, 4vw, 44px); padding-bottom: clamp(56px, 7vw, 96px); }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: clamp(32px, 5vw, 80px); align-items: start; }
.art-body { max-width: 46em; min-width: 0; }
.art-body h2, .phero .h1 { text-wrap: balance; word-break: keep-all; }
.art-side { position: sticky; top: calc(var(--head-h) + 28px); display: grid; gap: 28px; }
.art-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.art-meta b { color: var(--text-2); font-weight: 620; }

/* table of contents */
.toc h2, .art-side h2 { font-size: 13px; font-weight: 650; color: var(--text-3); margin: 0 0 10px; letter-spacing: 0; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: grid; gap: 2px; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px; padding: 6px 0; font-size: 14px; line-height: 1.45; color: var(--text-2); text-decoration: none; word-break: keep-all; }
.toc a::before { content: counter(toc); font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 12.5px; padding-top: 1px; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--text); }
.toc a[aria-current="true"]::before { color: var(--accent-ink); font-weight: 700; }
html[data-theme="dark"] .toc a[aria-current="true"]::before { color: var(--amber); }
.toc-m { display: none; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 28px; }
.toc-m summary { cursor: pointer; padding: 12px 16px; font-size: 14.5px; font-weight: 620; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary svg { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s var(--ease); }
.toc-m[open] summary svg { transform: rotate(45deg); }
.toc-m ol { padding: 0 16px 12px; }

.art-side .rel-grid { grid-template-columns: minmax(0, 1fr); margin-top: 0; }

/* summary box at the top of the body */
.art-sum { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); padding: 18px 22px 20px; font-size: 16px; line-height: 1.75; }
.art-sum h2 { font-size: 14px !important; font-weight: 650; color: var(--text-3); margin: 0 0 8px !important; padding: 0 !important; border: 0 !important; }
.art-sum p + p { margin-top: .55em; }

/* numbers in running text and tables */
.prose .num, .prose td.r, .prose th.r { font-variant-numeric: tabular-nums; }
.prose td.r, .prose th.r { text-align: right; white-space: nowrap; }
.prose td.hi { font-weight: 680; color: var(--text); }
.prose .tw caption { caption-side: bottom; text-align: left; font-size: 13.5px; color: var(--text-3); padding: 10px 14px 12px; line-height: 1.55; }
.prose .formula { font-family: var(--font); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 16px; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; word-break: keep-all; text-wrap: balance; }

/* charts */
.fig .chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); padding: 14px 10px 6px; }
.fig svg.chart { display: block; width: 100%; min-width: 460px; height: auto; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .lb { fill: var(--text-2); font-size: 12.5px; font-weight: 620; }
.chart .vl { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dt { stroke: var(--bg); stroke-width: 1.5; }
.chart .ld { fill: none; stroke-width: 1.2; }
/* one amber ramp for the four time windows: the longer the window, the deeper the colour */
.chart { --h1: #e4c58e; --h7: #e8a43a; --h30: #c46f00; --h90: #6f3d00; --lg: #d98a10; --sh: #6a5a86; --btc: #d98a10; --eth: #6a5a86; }
html[data-theme="dark"] .chart { --h1: #6b5634; --h7: #a8782c; --h30: #f0a52e; --h90: #ffd88f; --lg: #f0a52e; --sh: #a493c4; --btc: #f0a52e; --eth: #a493c4; }
.chart .h1 { stroke: var(--h1); fill: var(--h1); } .chart .h7 { stroke: var(--h7); fill: var(--h7); }
.chart .h30 { stroke: var(--h30); fill: var(--h30); } .chart .h90 { stroke: var(--h90); fill: var(--h90); }
.chart .ln.h1, .chart .ln.h7, .chart .ln.h30, .chart .ln.h90 { fill: none; }
.chart text.lb { fill: var(--text-2); stroke: none; }
.chart .bar { stroke: none; }
.chart .bar.lg { fill: var(--lg); } .chart .bar.sh { fill: var(--sh); }
.chart .bar.btc { fill: var(--btc); } .chart .bar.eth { fill: var(--eth); }
.chart .zl { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .kl { fill: none; stroke: var(--lg); stroke-width: 1.6; stroke-linejoin: round; }
.chart .kd { fill: var(--lg); stroke: var(--bg); stroke-width: 1.5; }
.chart .bar.pos { fill: var(--lg); } .chart .bar.neg { fill: var(--sh); }
.chart .bar.base { fill: var(--h90); }
.chart .bar.fee { fill: var(--sh); }
.chart .cell.hp { fill: var(--lg); } .chart .cell.hn { fill: var(--sh); }
.chart .cv { fill: var(--text-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .cv.st { fill: #1b1406; }
/* fear and greed: plum for fear, grey for neutral, amber for greed */
.chart { --f0: #5a4777; --f1: #9c8bbd; --f2: #c9c3d3; --f3: #f0b552; --f4: #c46f00; }
html[data-theme="dark"] .chart { --f0: #7d68a8; --f1: #a493c4; --f2: #a7a2b0; --f3: #9c6f2a; --f4: #ffb93f; }
.chart .fg.f0 { fill: var(--f0); } .chart .fg.f1 { fill: var(--f1); } .chart .fg.f2 { fill: var(--f2); }
.chart .fg.f3 { fill: var(--f3); } .chart .fg.f4 { fill: var(--f4); }
.chart .cv.sv { fill: #fff; }
.chart .cv.t-f2, .chart .cv.t-f3 { fill: #1b1406; }
html[data-theme="dark"] .chart .cv.t-f1, html[data-theme="dark"] .chart .cv.t-f2, html[data-theme="dark"] .chart .cv.t-f4 { fill: #1b1406; }
html[data-theme="dark"] .chart .cv.t-f3 { fill: #fff; }
.chart .hv { font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .hv.t-a30 { fill: #1b1406; } .chart .hv.t-a365 { fill: #fff; }
html[data-theme="dark"] .chart .hv.t-a365 { fill: #1b1406; }
.chart .hb.a30 { fill: var(--lg); } .chart .hb.a365 { fill: var(--sh); }
.chart .hv-l { stroke: var(--sh); stroke-width: 1.2; } .chart .hv-l.nx { stroke-dasharray: 4 3; }
.chart .ref { stroke-width: 1.5; stroke-dasharray: 4 3; } .chart .ref.a30 { stroke: var(--lg); } .chart .ref.a365 { stroke: var(--sh); }

/* sources and the method note */
.src-list { font-size: 14.5px; line-height: 1.7; color: var(--text-2); padding-left: 1.4em; }
.src-list li + li { margin-top: .45em; }
.src-list a { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.src-list .src-host { color: var(--text-3); font-size: 13px; }
.art-note { font-size: 14px; color: var(--text-3); line-height: 1.7; margin-top: 28px; }

/* hub */
.rs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rs-card { display: grid; gap: 8px; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); color: inherit; text-decoration: none; transition: border-color .16s var(--ease); }
.rs-card:hover { border-color: var(--line-strong); }
.rs-thumb { height: 168px; margin: -6px -6px 8px; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 8px 6px 0; pointer-events: none; }
.rs-thumb svg.chart { width: 100%; height: 100%; min-width: 0; }
.rs-card small { font-size: 13px; color: var(--text-3); }
.rs-card b { font-size: 19px; line-height: 1.4; font-weight: 680; letter-spacing: -.015em; word-break: keep-all; text-wrap: balance; }
.rs-card span { font-size: 14.5px; line-height: 1.6; color: var(--text-2); word-break: keep-all; }

@media (max-width: 1100px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); }
  .art-side { position: static; }
  .art-side .toc { display: none; }
  .toc-m { display: block; }
  .art-side .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rs-list { grid-template-columns: minmax(0, 1fr); }
  .art-side .rel-grid { grid-template-columns: minmax(0, 1fr); }
  .art-sum { padding: 16px 18px; font-size: 15.5px; }
}
