/* The docs on top of ui.css: the page title on the paper band, one reading column with an
   "On this page" list beside it, and the figures (cards) the widgets in docs.js drive. */
.doc-band { padding-bottom: 36px; }
.doc-head { max-width: 1120px; margin: 0 auto; }
.doc-head .display { font-size: clamp(64px, 10vw, 140px); }
.lede { max-width: 760px; margin: 18px 0 0; font-size: clamp(20px, 2.3vw, 30px); line-height: 1.25; letter-spacing: -.025em; color: var(--text-2); text-wrap: pretty; }
.doc-head .tabline { max-width: 560px; margin-top: 30px; }

.doc-wrap { display: grid; grid-template-columns: minmax(0, 720px) 200px; justify-content: space-between; gap: 64px; max-width: 1120px; margin: 0 auto; padding: 24px 24px 0; }
.doc section { padding-top: 48px; scroll-margin-top: 72px; }
.doc h2 { margin: 0 0 14px; font-size: 30px; font-weight: 500; line-height: 1.15; letter-spacing: -.035em; }
.doc p, .doc li, .doc dd { color: var(--text-2); font-size: 16.5px; line-height: 1.7; text-wrap: pretty; }
.doc p { margin: 0 0 16px; }
.doc a:not(.card) { text-decoration: underline; text-decoration-color: rgba(0, 0, 0, .25); text-underline-offset: 3px; }
.doc a:not(.card):hover { text-decoration-color: var(--ink); }
.doc b { font-weight: 500; color: var(--ink); }
.doc kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 var(--line-2); font: 400 12px/1 var(--mono); color: var(--ink); }
.doc figure { margin: 28px 0 8px; }
.list { margin: 0 0 16px; padding-left: 0; list-style: none; counter-reset: n; }
.list li { position: relative; margin: 0; padding: 12px 0 12px 44px; border-top: 1px solid var(--line); counter-increment: n; }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 14px; font: 400 12px/1.5 var(--mono); color: var(--faint); }
.faq { margin: 0; }
.faq > div { padding: 18px 0; border-top: 1px solid var(--line); }
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq dt { margin: 0 0 6px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.faq dd { margin: 0; }

/* ---- on this page */
.toc { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; padding-top: 52px; font-size: 13px; }
.toc p { margin: 0 0 12px; font: 400 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); }
.toc a { position: relative; padding: 6px 0 6px 16px; color: var(--faint); text-decoration: none; border-left: 1px solid var(--line-2); transition: color .2s; }
.toc a::before { content: ''; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); }
.toc a.on::before { transform: scale(1); }

/* ---- the tree: code card, wires, four cards */
.tree { margin-top: 36px !important; }
.code { width: min(420px, 100%); margin: 0 auto; }
.code pre { margin: 0; padding: 18px 18px 20px; font: 400 13px/1.85 var(--mono); color: var(--ink); overflow-x: auto; }
.code .k { color: #d6336c; }
.code .s { color: #2b8a3e; }
.code .f { color: #7048e8; }
.joins { position: relative; height: 72px; }
.joins .stem { position: absolute; left: 50%; top: 0; height: 36px; width: 1px; background: var(--line-2); }
.joins .wire { position: absolute; left: 12.5%; right: 12.5%; top: 36px; --paper: var(--bg); }
.joins .wire i:nth-child(1) { left: 0 !important; } .joins .wire i:nth-child(2) { left: 33.333% !important; } .joins .wire i:nth-child(3) { left: 66.666% !important; } .joins .wire i:nth-child(4) { left: 100% !important; }
.joins .drop { position: absolute; top: 36px; height: 36px; width: 1px; background: var(--line-2); }
.leaves { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.leaf { text-decoration: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.leaf:hover { transform: translateY(-3px); }
.leaf > header { font-size: 9px; letter-spacing: .12em; padding: 0 10px; }
.leaf .tile { aspect-ratio: 16 / 10; background: #000 center / cover no-repeat; }
.leaf .term { aspect-ratio: 16 / 10; min-height: 0; padding: 10px; font-size: 10.5px; line-height: 1.8; }

/* ---- leverage tiers */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 8px; }
.tier b { display: block; padding: 22px 16px 0; font: 400 64px/.9 var(--display); letter-spacing: -.01em; }
.tier small { display: block; padding: 10px 16px 18px; color: var(--soft); font-size: 13px; }

/* ---- live tiny caps */
.live-rows a { display: grid; grid-template-columns: minmax(0, 1fr) 92px 76px 44px; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; animation: line-in .4s ease both; transition: background .15s; }
.live-rows a:last-child { border-bottom: 0; }
.live-rows a:hover { background: var(--hover); }
.live-rows .coin { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-rows img, .live-rows i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--chip); object-fit: cover; }
.live-rows b { display: block; font-weight: 500; }
.live-rows small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-rows .num { font: 400 13px/1 var(--mono); text-align: right; }
.live-rows .lev { font: 400 18px/1 var(--display); text-align: right; }
.live-rows svg { width: 92px; height: 26px; }
.live-rows p { margin: 0; padding: 18px 14px; color: var(--soft); }
.skel { height: 53px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, var(--skel), transparent) 0 0 / 40% 100% no-repeat; animation: scan 1.4s ease-in-out infinite; }
@keyframes scan { from { background-position: -100% 0; } to { background-position: 200% 0; } }

/* ---- the position calculator */
.calc-in { display: grid; grid-template-columns: 1fr 1fr; }
.calc-controls { padding: 18px 20px 22px; border-right: 1px solid var(--line); }
.calc-side { margin: 0 0 18px; font-size: 18px; letter-spacing: -.02em; }
.calc-side [data-side="long"][aria-selected="true"] { color: var(--long); }
.calc-side [data-side="short"][aria-selected="true"] { color: var(--short); }
.lbl { display: flex; justify-content: space-between; margin-top: 16px; font: 400 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .16em; color: var(--soft); }
.lbl b { font-weight: 400; color: var(--ink); letter-spacing: 0; text-transform: none; font-size: 13px; }
.calc .range { margin-top: 6px; }
.calc-result { display: flex; flex-direction: column; justify-content: center; padding: 22px 22px; background: var(--sub); }
.calc-result > .lbl { margin: 0; }
.calc-big { margin-top: 14px; font: 400 clamp(44px, 5vw, 64px)/.9 var(--display); letter-spacing: -.01em; transition: color .3s; }
.calc-roi { margin-top: 10px; font-size: 13px; color: var(--soft); }
.calc-result dl { margin: 22px 0 0; font-size: 12px; }
.calc-result dl > div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); }
.calc-result dt { color: var(--soft); font-family: Geist, system-ui, sans-serif; font-size: 13px; }
.calc-result dd { margin: 0; }

/* ---- the liquidation figure */
.liqfig svg { display: block; width: 100%; height: 260px; }
.liqfig .grid { stroke: var(--line); stroke-width: 1; }
.liqfig .entry { stroke: var(--ink); stroke-width: 1.5; }
.liqfig .liq { stroke: var(--short); stroke-width: 1.5; stroke-dasharray: 5 4; transition: all .35s cubic-bezier(.2, .8, .2, 1); }
.liqfig .zone { fill: rgba(229, 72, 77, .06); transition: all .35s cubic-bezier(.2, .8, .2, 1); }
.liq-labels { position: relative; height: 0; }
.liq-labels span { position: absolute; right: 14px; transform: translateY(-50%); padding: 3px 7px; border-radius: 5px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); font-size: 11px; transition: top .35s cubic-bezier(.2, .8, .2, 1); }
.liq-labels .entry-l { top: -220px; }
.liq-labels .liq-l { color: var(--short); top: -160px; }
.liq-labels b { font-weight: 500; }
.liq-ctl { padding: 14px 18px 16px; border-top: 1px solid var(--line); }
.liq-ctl .ticks { display: flex; justify-content: space-between; margin-top: 2px; font-size: 11px; color: var(--faint); }
.table { margin: 16px 0 8px; }
.table .rows > div { display: flex; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.table .rows > div:first-child { border-top: 0; }

.closefig .term { min-height: 150px; padding: 18px; font-size: 13px; }

/* ---- pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1120px; margin: 96px auto 0; padding: 0 24px; }
.pager .card { text-decoration: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.pager .card:hover { transform: translateY(-3px); }
.pager b { display: block; padding: 22px 16px 24px; font: 400 clamp(40px, 5vw, 64px)/.9 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.pager .next { text-align: right; }
.pager .next header { justify-content: flex-end; }

@media (max-width: 960px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .calc-in { grid-template-columns: 1fr; }
  .calc-controls { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .doc-wrap { padding: 8px 16px 0; }
  .doc section { padding-top: 40px; }
  .doc h2 { font-size: 26px; }
  .leaves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .joins { display: none; }
  .code { margin-bottom: 16px; }
  .tiers { grid-template-columns: 1fr; }
  .tier b { font-size: 52px; }
  .live-rows a { grid-template-columns: minmax(0, 1fr) 70px 40px; }
  .live-rows svg { display: none; }
  .pager { padding: 0 16px; margin-top: 64px; }
}
.liq-labels .entry-l { right: auto; left: 14px; }
/* terminal lines are not reading text */
.doc .term p { margin: 0; font-size: inherit; line-height: inherit; white-space: nowrap; }
.doc .term .cmd { color: var(--ink); }
