/* css/pages/learn.css: the Learn page (protocol and trust), owned by the learn page agent.
   Built on css/base.css (DESIGN.md): chapters, prose, panels, ledgers, steps, faq. Colours only through tokens.
   Layout: a long-form column of nine numbered chapters; from 1120px a sticky contents column sits beside it. */

/* ================================================================== the long-form grid */
.learn { display: grid; grid-template-columns: minmax(0, 1fr); }
.learn > * { min-width: 0; }
@media (min-width: 1120px) {
  .learn { grid-template-columns: 200px minmax(0, 1fr); column-gap: 64px; align-items: start; }
}

/* ================================================================== contents */
/* no slab behind the contents: the ink rule above it and the hairline rail beside it are its edges */
.toc { margin-top: 36px; padding: 14px 0 6px; border-top: 1px solid var(--ink); }
.toc-t { margin-bottom: 6px; font: italic 400 18px/1.2 var(--serif); color: var(--orange-ink); }
.toc-rail { position: relative; }
.toc ol { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) and (max-width: 1119px) {
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column; column-gap: 32px; }
}
.toc li { border-bottom: 1px solid var(--rule-2); }
.toc a { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; font: 400 18px/1.25 var(--serif); color: var(--ink-2); transition: color .2s var(--ease); }
.toc a .n { flex: none; min-width: 1em; font: italic 400 16px/1 var(--serif); color: var(--muted); transition: color .2s var(--ease); }
.toc a:hover { color: var(--ink); }
.toc a:hover .n, .toc a[aria-current] .n { color: var(--orange-ink); }
.toc a[aria-current] { color: var(--ink); }
.toc-mark, .toc-foot { display: none; }

@media (min-width: 1120px) {
  .toc { position: sticky; top: calc(var(--nav-h) + 30px); margin-top: 72px; padding: 14px 0 16px; max-height: calc(100vh - var(--nav-h) - 60px); overflow-y: auto; scrollbar-width: none; }
  .toc::-webkit-scrollbar { display: none; }
  .toc-t { margin-bottom: 14px; }
  .toc ol { border-left: 1px solid var(--rule); }
  .toc li { border-bottom: 0; }
  .toc a { padding: 7px 0 7px 16px; font-size: 17px; }
  .toc a .n { font-size: 15px; }
  /* the orange rail mark slides to the chapter in view (learn.js sets --y and --h) */
  .toc-mark { display: block; position: absolute; left: -.5px; top: 0; width: 2px; height: var(--h, 0); background: var(--orange); transform: translateY(var(--y, 0)); transition: transform .45s var(--ease), height .45s var(--ease); pointer-events: none; }
  .toc-foot { display: block; margin-top: 18px; padding-left: 17px; }
}

/* ================================================================== chapters in the reading column */
@media (min-width: 1120px) {
  /* the contents column takes the place of the chapter number column: the number sits on the rule above the title */
  .lc .chead { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 40px; }
  .lc .chead .no { font-size: 20px; }
  .lc .chead h2 { border-top: 0; padding-top: 16px; }
}
.lc .chead .tags { margin-top: 16px; }

/* a sub-heading inside a chapter */
.lsub { margin: 56px 0 22px; max-width: 44em; }
.lsub .h3 { margin-bottom: 8px; }
.lsub p { font: 400 18px/1.55 var(--serif); color: var(--ink-2); }
.lp { margin: 0 0 16px; max-width: 34em; font: 400 17px/1.55 var(--serif); color: var(--ink-2); }
.h3.lh { margin-bottom: 14px; }
.lfine { margin-top: 12px; max-width: 36em; }
.lnote { margin-top: 36px; }
.yieldrow, .twin, .datarow { margin-top: 48px; }
.twin + .twin { margin-top: 56px; }
@media (min-width: 900px) { .yieldrow, .twin, .datarow { gap: 40px; } }
.lc .prose { max-width: 42em; }
.lc .prose h3:first-child { margin-top: 0; }
.lc .prose pre.code { margin-block: 16px; font-size: 12.5px; }

/* No. 1: what is live and what is a snapshot */
.ticks { list-style: none; margin-bottom: 14px; }
.ticks li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px dotted var(--rule); color: var(--ink-2); font-size: 15px; }
.ticks li:first-child { border-top: 0; padding-top: 0; }
.ticks li::before { content: ""; flex: none; width: 6px; height: 6px; transform: translateY(-2px); background: var(--muted); }
.kinds .panel:first-child .ticks li::before { background: var(--orange); }
.kinds .panel:last-child .ticks li::before { background: transparent; border: 1px solid var(--muted); }

/* ================================================================== No. 2: the price to yield calculator */
.calc .panel-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.calc .seg { display: flex; width: 100%; }
.calc .seg button { flex: 1 1 0; padding-block: 10px; }
.calc-out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-top: 18px; border-top: 1px solid var(--rule); }
.calc-v { font: 400 clamp(54px, 6vw, 76px)/.95 var(--serif); letter-spacing: -.025em; color: var(--orange-display); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.calc-v .u { margin-left: 4px; font-size: .42em; letter-spacing: 0; color: var(--muted); }
.calc-s { font: italic 400 17px/1.4 var(--serif); color: var(--muted); }
.calc-f { margin-top: -6px; font: 12.5px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }

/* ================================================================== No. 2: the lifecycle diagram */
.lifecycle { margin: 0; padding: 22px 16px 14px; background: var(--panel); border: 1px solid var(--rule); border-top-color: var(--ink); }
@media (min-width: 640px) { .lifecycle { padding: 30px 26px 16px; } }
.lifecycle svg { display: block; width: 100%; height: auto; overflow: visible; }
.lc-wide { display: none !important; }
.lc-tall { max-width: 380px; margin: 0 auto; }
@media (min-width: 900px) { .lc-wide { display: block !important; } .lc-tall { display: none !important; } }
.lifecycle figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--rule); font: italic 400 16px/1.4 var(--serif); color: var(--muted); }
.lifecycle figcaption b { font: normal 500 14px/1.4 var(--sans); color: var(--orange-ink); white-space: nowrap; }

.lifecycle .st { cursor: default; transition: opacity .25s var(--ease); }
.lifecycle .st > rect:not(.sq) { fill: var(--paper); stroke: var(--rule); stroke-width: 1; transition: stroke .25s var(--ease), fill .25s var(--ease); }
.lifecycle .st .sq { fill: var(--muted); }
.lifecycle .st[data-st="sale"] .sq { fill: var(--orange); }
.lifecycle .st[data-st="active"] .sq { fill: var(--ink-2); }
.lifecycle .st[data-st="repaid"] .sq { fill: var(--up); }
.lifecycle .st[data-st="grace"] .sq { fill: var(--warn); }
.lifecycle .st[data-st="defaulted"] .sq { fill: var(--down); }
.lifecycle .st[data-st="settled"] .sq { fill: none; stroke: var(--muted); stroke-width: 1; }
.lifecycle .st .nm { font: 400 21px var(--serif); fill: var(--ink); }
.lifecycle .st .cap { font: 400 13px var(--sans); fill: var(--muted); }
.lifecycle .arc { transition: opacity .25s var(--ease); }
.lifecycle .arc path { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 0;
  transition: stroke .25s var(--ease), stroke-dashoffset .9s var(--ease) calc(var(--d, 0) * 130ms + 120ms); }
.lifecycle .arc.fork path { stroke: var(--faint); }
.lifecycle .arc .tip { fill: var(--muted); transition: fill .25s var(--ease), opacity .3s ease calc(var(--d, 0) * 130ms + 820ms); }
.lifecycle .arc .al { font: 400 13px var(--sans); fill: var(--faint); transition: fill .25s var(--ease), opacity .4s ease calc(var(--d, 0) * 130ms + 640ms); }
/* first view: the arrows draw themselves once, in the order a bond lives (no loop) */
.reveal-ready .lifecycle:not(.in) .arc path { stroke-dashoffset: 1; }
.reveal-ready .lifecycle:not(.in) .arc .tip, .reveal-ready .lifecycle:not(.in) .arc .al { opacity: 0; }
/* a state under the pointer (in the diagram or the list below) lights its box and its arrows */
.lifecycle.has-on .st:not(.on) { opacity: .42; }
.lifecycle.has-on .arc:not(.on) { opacity: .28; }
.lifecycle .st.on > rect:not(.sq) { stroke: var(--orange); fill: var(--paper-2); }
.lifecycle .arc.on path { stroke: var(--orange); }
.lifecycle .arc.on .tip { fill: var(--orange); }
.lifecycle .arc.on .al { fill: var(--orange-ink); }

.states { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; margin: 0; padding-top: 6px; }
@media (min-width: 640px) { .states { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .states { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* no slab behind the states: hairlines in the column carry the grid; the state under the pointer brightens its text */
.states li { padding: 14px 0 16px; border-bottom: 1px solid var(--rule-2); }
.states li p { margin-top: 7px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.states li.on p { color: var(--ink); }
.tag.settled { color: var(--muted); }
.tag.settled::before { background: transparent; border: 1px solid currentColor; }

/* ================================================================== No. 2: fees and powers */
.twin .terms b { font-size: 19px; }
.powers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 16px; border-top: 1px solid var(--ink); background: var(--panel); }
.pw ul { list-style: none; margin-top: 8px; }
.pw li { padding: 8px 0; border-top: 1px dotted var(--rule); font-size: 15px; color: var(--ink-2); }
.pw li:first-child { border-top: 0; }
.pw-k .tag { font-size: 13px; }

/* ================================================================== No. 3: the shield */
.shieldrow { margin-top: 4px; }
.lsteps { padding: 4px 0; }
.lsteps b { color: var(--ink); }
.lsteps .sub { color: var(--ink-2); opacity: .9; }
.shieldcode { margin-top: 28px; font-size: 12.5px; }

/* ================================================================== No. 4: the assets ledger */
.assets td.wrapcell { min-width: 150px; max-width: 220px; font-size: 14px; line-height: 1.4; }
.assets td.px { font-size: 15px; color: var(--ink); }
.assets .txlink { font-size: 12.5px; }
.assets .fee { color: var(--muted); margin-right: 8px; }
.lnote2 { margin-top: 22px; max-width: 46em; }

/* ================================================================== No. 5: data and method */
.books th, .books td { padding-inline: 18px; }
.books th:first-child, .books td:first-child { padding-left: 18px; }
.books th:last-child, .books td:last-child { padding-right: 18px; }
.datarow .panel-b.flush { overflow-x: auto; }
.books td:first-child { white-space: normal; }
.books .nm { font-size: 17px; }
.books tbody tr[data-href]:hover .nm { color: var(--orange-ink); }
.books .sub2 { display: block; margin-top: 2px; font: 400 12px var(--sans); color: var(--muted); }
abbr.est { font: 500 12.5px var(--sans); color: var(--muted); text-decoration: underline dotted 1px; text-underline-offset: 3px; }
.method { margin-top: 56px; }
.method p { font-size: 17px; }
.booknotes { margin-top: 28px; }
.booknotes .faq, .sources { max-width: 52em; background: var(--panel); }
.booknotes .faq { border-top: 1px solid var(--ink); }
.booknotes dl { margin: 0; }
.booknotes dt { margin-top: 12px; font: 500 14px var(--sans); color: var(--ink); }
.booknotes dt:first-child { margin-top: 0; }
.booknotes dd { margin: 4px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.sources summary .n { font: 400 13px var(--mono); color: var(--faint); }
.sources > div { max-width: none; }
.srclist { margin: 0; padding-left: 2.4em; font-size: 14px; line-height: 1.45; }
@media (min-width: 900px) { .srclist { columns: 2; column-gap: 44px; } }
.srclist li { break-inside: avoid; padding: 4px 0; color: var(--muted); }
.srclist li::marker { font: 12px var(--mono); color: var(--faint); }
.srclist a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; overflow-wrap: anywhere; }
.srclist a:hover { color: var(--orange-ink); text-decoration-color: currentColor; }

/* ================================================================== No. 6: risks */
.risks { list-style: none; counter-reset: risk; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); background: var(--panel); }
@media (min-width: 900px) { .risks { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; } }
.risks li { counter-increment: risk; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-content: start; padding: 20px 0 22px; border-bottom: 1px solid var(--rule); }
.risks li::before { content: counter(risk); grid-row: 1 / span 2; font: italic 400 26px/1 var(--serif); color: var(--orange-display); }
.risks h3 { font: 500 20px/1.25 var(--serif); color: var(--ink); }
.risks p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* ================================================================== No. 7: contracts */
.ctr td { white-space: normal; vertical-align: top; padding-block: 13px; }
.ctr td:first-child { width: 44%; padding-right: 18px; }
.ctr .nm { font-size: 18px; }
.ctr .nm-s { font-size: 13px; line-height: 1.4; }
.ctr .ck { margin-left: auto; }
.ctr .ck .tag { font-size: 12px; }
.ctr code.addr { display: block; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.ctr .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; }
.ctr .acts .btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; margin-left: -10px; }
.ctr .acts .link.sm { font-size: 13px; }
.ctr .pending .fine { margin-top: 6px; max-width: 30em; }
.ctr tr.grp th { position: static; padding: 26px 0 8px; font: italic 400 18px/1.2 var(--serif); color: var(--orange-ink); text-align: left; background: transparent; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.ctr tbody tr.grp:first-child th { padding-top: 14px; }
.ctr tbody tr.grp:hover th { background: transparent; }
.ctr tbody tr:last-child td { border-bottom: 0; }
/* phones: each contract reads as a block, its name above its address */
@media (max-width: 639px) {
  .ctr thead { display: none; }
  .ctr, .ctr tbody, .ctr tr, .ctr td, .ctr th { display: block; }
  .ctr td:first-child { width: auto; padding: 14px 0 6px; border-bottom: 0; }
  .ctr td + td { padding: 0 0 14px; }
  .ctr tr.grp th { padding-top: 30px; }
}
#contracts .twin [data-ca] .ca { max-width: none; }
#net > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
#net dt { font-size: 13px; }
#net dd { text-align: left; overflow-wrap: anywhere; }
#net dd.mono { font-size: 13px; }
#net-note { flex: 1 1 14em; }

/* ================================================================== No. 8: questions */
.faqs { max-width: 52em; border-top: 1px solid var(--ink); background: var(--panel); }
.faqs .faq > div p { font-size: 15.5px; line-height: 1.6; }
.faqs .faq > div a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--field-edge); }

/* ================================================================== No. 5, Strategy's bitcoin credit */
.lmstr { margin-top: 14px; max-width: 46em; }
.sxl { margin-top: 8px; }
.sxl-list { margin: 0; border-top: 1px solid var(--ink); background: var(--panel); }
.sxl-list > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 13px 0; border-bottom: 1px solid var(--rule-2); }
.sxl-list > div:last-child { border-bottom: 0; }
.sxl-list dt { display: flex; align-items: center; gap: 10px; }
.sxl-list dt .cc { min-width: 52px; }
.sxl-nm { font: italic 400 17px/1.2 var(--serif); color: var(--ink); }
.sxl-list dd { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.sxl-prose { max-width: none; }
.sxl-prose h3:first-child { margin-top: 0; }
.bc-own { margin-top: 18px; max-width: 60em; }
.sxl-risks li b { font-weight: 500; }
.sxl-risks .est { margin-left: 4px; font: 500 12px var(--sans); color: var(--muted); }
