/* Method, part 2: the models and their schematics, the glossary, the library and the closing line. Mobile first;
   desktop from 900 px. */

/* ---------- 5. the models: a catalogue on the deeper stock ---------- */
.md { background: var(--paper-2); padding: var(--sec) 0; }
.md .tu-ch--light { --c-bg: var(--paper-2); }
.md-head { display: grid; gap: 14px; }
.md-head .lead { max-width: 30ch; }
.md-list { margin-top: clamp(48px, 6vw, 96px); }
.md-item { display: grid; gap: 22px; padding: 18px 0 clamp(44px, 5vw, 80px); border-top: 1px solid var(--ink); }
.md-item:last-child { padding-bottom: 0; }
.md-name { display: grid; gap: 10px; align-content: start; }
.md-n { font-size: 12px; color: var(--ink-mute); }
.md-name h3 { font-size: clamp(26px, 2.5vw, 36px); font-weight: 500; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.md-vis { aspect-ratio: 360 / 220; }
.md-facts > div { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding: 12px 0 13px; border-bottom: 1px solid var(--rule-2); }
.md-facts > div:first-child { padding-top: 0; }
.md-facts dt { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-mute); }
.md-facts dd { font-size: 15px; line-height: 1.45; letter-spacing: -.01em; }
/* stop and targets carry the schematics' colours */
.md-facts div:nth-child(2) dt::after, .md-facts div:nth-child(3) dt::after { content: ""; flex: none; width: 14px; border-top: 1.5px dashed var(--loss); transform: translateY(-4px); }
.md-facts div:nth-child(3) dt::after { border-top-color: var(--gain); }
.md-ex { display: grid; gap: 12px; }
.md-ex-ch { height: min(120vw, 500px); }
.md-ex-cap { max-width: 40ch; font-size: clamp(18px, 1.5vw, 21px); font-weight: 500; line-height: 1.32; letter-spacing: -.02em; text-wrap: pretty; }
@media (min-width: 900px) {
  .md-head { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); }
  .md-head .h2 { grid-column: 1 / span 6; }
  .md-head .lead { grid-column: 1 / span 5; }
  .md-item { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: start; padding-top: 22px; }
  .md-name { grid-column: 1 / span 4; padding-right: 24px; }
  .md-vis { grid-column: 5 / span 4; }
  .md-facts { grid-column: 9 / span 4; }
  .md-facts dd { font-size: 15.5px; }
  /* the real example breaks the row: the chart takes the width, name and facts stack beside it */
  .md-item--smt { grid-template-rows: auto auto 1fr; row-gap: 28px; }
  .md-item--smt .md-name { grid-row: 1; }
  .md-item--smt .md-ex-cap { grid-column: 1 / span 4; grid-row: 2; padding-right: 24px; }
  .md-item--smt .md-facts { grid-column: 1 / span 4; grid-row: 3; align-self: end; padding-right: 24px; }
  .md-item--smt .md-ex { grid-column: 5 / span 8; grid-row: 1 / span 3; gap: 14px; }
  .md-ex-ch { height: clamp(420px, 36vw, 560px); }
}

/* schematics (js/method/schematic.js): the kit chart's light palette, candles first, then the marks */
.sc { display: block; width: 100%; height: 100%; overflow: visible; }
.sc text { font: 500 12px var(--sans); letter-spacing: -.01em; fill: var(--ink); }
.sc-sess rect { fill: rgba(11, 11, 12, .04); }
.sc-sess text { font-size: 11px; fill: var(--ink-mute); }
.sc-c rect { fill: #16181b; }
.sc-c.is-dn rect { fill: #a3a8af; }
.sc-m line { fill: none; stroke-width: 1.5; transform-box: fill-box; transform-origin: 0 50%; }
.sc-lvl line { stroke: var(--ink-mute); stroke-width: 1.25; stroke-dasharray: 5 4; }
.sc-mss line { stroke: var(--ink); }
.sc-stop line { stroke: var(--loss); stroke-dasharray: 5 4; }
.sc-tp line { stroke: var(--gain); stroke-dasharray: 5 4; }
.sc-box rect { fill: rgba(11, 11, 12, .06); stroke: rgba(11, 11, 12, .32); stroke-width: 1; stroke-dasharray: 3 2; }
.sc-range rect { fill: rgba(11, 11, 12, .035); stroke: rgba(11, 11, 12, .26); stroke-width: 1; }
.sc-ring circle { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.sc-dot circle { stroke: var(--paper-2); stroke-width: 2; }
.sc-dot--short circle { fill: var(--loss); }
.sc-dot--long circle { fill: var(--gain); }
.js .md-vis .sc-c, .js .md-vis .sc-m { opacity: 0; }
.md-vis.is-in .sc-c { animation: scIn .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.md-vis.is-in .sc-m { animation: scIn .5s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 180ms); }
.md-vis.is-in .sc-m line { animation: scLine .7s var(--ease) both; animation-delay: calc(var(--i) * 45ms + 180ms); }
@keyframes scIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes scLine { from { transform: scaleX(0); } to { transform: none; } }
.rm .md-vis .sc-c, .rm .md-vis .sc-m { opacity: 1; animation: none !important; }
.rm .md-vis .sc-m line { animation: none !important; }

/* ---------- 6. glossary, collapsed ---------- */
.gl { padding: clamp(64px, 8vw, 128px) 0; }
.gl-d { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.gl-d summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; cursor: pointer; }
.gl-d summary::-webkit-details-marker { display: none; }
.gl-h { font-size: clamp(26px, 2.6vw, 38px); font-weight: 500; line-height: 1.1; letter-spacing: -.03em; }
.gl-ic { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--rule); transition: box-shadow .25s var(--ease), transform .45s var(--ease); }
.gl-ic::before, .gl-ic::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; margin: -.75px 0 0 -7px; background: var(--ink); }
.gl-ic::after { transform: rotate(90deg); }
.gl-d summary:hover .gl-ic { box-shadow: inset 0 0 0 1px var(--ink); }
.gl-d[open] .gl-ic { transform: rotate(45deg); }
.gl-list { padding-bottom: 28px; }
.gl-list div { display: grid; grid-template-columns: 116px 1fr; gap: 14px; padding: 13px 0; border-top: 1px solid var(--rule-2); font-size: 15px; line-height: 1.45; }
.gl-list dt { font: 500 13px/1.65 var(--mono); }
.gl-list dd { color: var(--ink-soft); }
.js .gl-d[open] .gl-list { animation: glIn .6s var(--ease) both; }
@keyframes glIn { from { opacity: 0; transform: translateY(6px); } }
.rm .gl-d[open] .gl-list { animation: none; }
@media (min-width: 900px) {
  .gl-d summary { padding: 30px 0; }
  .gl-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); padding-bottom: 40px; }
  .gl-list div { grid-template-columns: 170px 1fr; padding: 15px 0; font-size: 16px; }
}

/* ---------- 7. the library: a contents page on ink, the cat as the end mark ---------- */
.lb { background: var(--ink); color: var(--on-ink); padding: var(--sec) 0; }
.lb-grid { display: grid; }
.lb-head .lead { margin-top: 14px; max-width: 26ch; color: var(--on-ink-soft); }
.lb-toc { margin-top: 44px; border-top: 1px solid var(--on-ink); }
.lb-toc li { display: grid; grid-template-columns: 36px 1fr; gap: 3px 10px; padding: 15px 0 16px; border-bottom: 1px solid var(--rule-ink); }
.lb-n { grid-row: span 2; font-size: 12px; line-height: 1.9; color: var(--on-ink-mute); }
.lb-toc h3 { font-size: 18px; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; }
.lb-toc p { font-size: 14px; line-height: 1.45; color: var(--on-ink-soft); }
.lb-end { display: block; width: 16px; height: 30px; margin-top: 36px; color: var(--on-ink); }
.lb-end svg { width: 100%; height: 100%; }
.js .lb-toc li { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 40ms); }
.js .lb-toc.is-in li { opacity: 1; transform: none; }
.rm .lb-toc li { opacity: 1 !important; transform: none !important; transition: none !important; }
@media (min-width: 900px) {
  .lb-grid { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: start; }
  .lb-head { grid-column: 1 / span 4; grid-row: 1 / span 2; position: sticky; top: calc(var(--hdr) + 48px); }
  .lb-toc { grid-column: 6 / span 7; margin: 0; }
  .lb-toc li { grid-template-columns: 56px minmax(0, 6fr) minmax(0, 5fr); align-items: baseline; gap: 16px; padding: 17px 0 18px; }
  .lb-n { grid-row: auto; }
  .lb-toc h3 { font-size: var(--t-h3); }
  .lb-toc p { font-size: 15px; }
  .lb-end { grid-column: 6; width: 18px; height: 34px; margin-top: 44px; }
}

/* ---------- 8. closing line ---------- */
.mcl { padding: var(--sec) 0; }
.mcl-in { display: grid; gap: 32px; }
.mcl-l { max-width: 13ch; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.6vw, 84px); line-height: .98; letter-spacing: -.014em; }
.mcl-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
@media (min-width: 900px) {
  .mcl-in { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); align-items: end; }
  .mcl-l { grid-column: 1 / span 8; }
  .mcl-cta { grid-column: 9 / span 4; padding-bottom: .5em; }
}
