/* The figures in "The AI Boom Has a Second Contract Problem". Ink is what is signed and fixed; red is what is
   uncertain or unsigned. Everything is readable without JS: second-contract.js adds .armed and the interaction. */

.sc { container-type: inline-size; margin: 40px 0 44px; padding-top: 14px; border-top: 1px solid var(--hair); }
.sc-kicker { font: 500 12px/1.35 var(--mono); letter-spacing: .02em; color: var(--muted); }
.sc-title { margin-top: 8px; font: 600 21px/1.25 var(--serif); letter-spacing: -.01em; max-width: 30em; }
.sc.sc p + p { margin-top: 0; }
.sc figcaption { margin-top: 16px; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 40em; }
.sc button { font: 500 13px/1 var(--mono); color: var(--ink); background: var(--sheet); border: 0; border-radius: 8px; padding: 10px 12px; min-height: 40px; cursor: pointer; box-shadow: inset 0 0 0 1px var(--hair); }
.sc button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.sc button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sc button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }

/* 1 · follow the money */
.sc-flow { display: grid; gap: 16px; margin-top: 18px; }
.sc-map { width: 100%; max-width: 440px; height: auto; margin-inline: auto; display: block; overflow: visible; }
.sc-node rect { fill: var(--sheet); stroke: var(--hair); stroke-width: 1; }
.sc-node text { font: 600 14px/1 var(--sans); fill: var(--ink); text-anchor: middle; }
.sc-node text.sub { font: 400 11.5px/1 var(--mono); fill: var(--muted); }
.sc-edge { fill: none; stroke: var(--ink); stroke-width: 1.5; transition: opacity .25s, stroke .25s; }
.sc-edge.promise { stroke: var(--red); stroke-dasharray: 5 5; }
.sc-tag { font: 500 11.5px/1 var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; transition: opacity .25s; }
.sc-tag.promise { fill: var(--red-ink); }
.sc-dot { fill: var(--ink); opacity: 0; }
.sc-dot.promise { fill: var(--red); }
.sc-node { transition: opacity .25s; }
.sc-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.sc-steps b { display: block; font-weight: 600; font-size: 16.5px; line-height: 1.3; }
.sc-steps span { display: block; margin-top: 4px; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.sc-steps li::before { content: attr(data-n); font: 500 12px/1 var(--mono); color: var(--red-ink); }
.sc-nav { display: none; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sc-nav .next { margin-left: auto; }
.armed .sc-nav { display: flex; }
.armed .sc-steps { gap: 0; }
.armed .sc-steps li { grid-area: 1 / 1; visibility: hidden; }
.armed .sc-steps li.on { visibility: visible; }
.armed .sc-edge, .armed .sc-tag { opacity: .16; }
.armed .sc-edge.on, .armed .sc-tag.on { opacity: 1; }
.sc-map.gap .sc-edge.pay { stroke: var(--red); stroke-dasharray: 5 5; }
.sc-map.gap .sc-node.customer rect { stroke: var(--red); stroke-dasharray: 4 4; }
@container (min-width: 620px) {
  .sc-flow { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; }
}

/* 2 · the loan outlasts the contracts */
.sc-time { margin-top: 20px; }
.sc-row { margin-top: 14px; }
.sc-row-name { font-size: 14.5px; font-weight: 560; }
.sc-lane { position: relative; height: 34px; margin-top: 6px; background: linear-gradient(var(--hair), var(--hair)) center / 100% 1px no-repeat; }
.sc-bar { position: absolute; top: 3px; bottom: 3px; display: flex; align-items: center; padding: 0 8px; border-radius: 4px; font: 500 12px/1 var(--mono); white-space: nowrap; overflow: hidden; color: var(--paper); background: var(--ink); transition: background .25s, color .25s, box-shadow .25s; }
.sc-bar.open { color: var(--red-ink); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--red); background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(224, 48, 30, .1) 6px 8px); }
.sc-time[data-show="yes"] .sc-bar.open { color: var(--paper); background: var(--ink); box-shadow: none; }
.sc-time[data-show="no"] .sc-bar.open { color: #fff; background: var(--red-ink); box-shadow: none; }
.sc-axis { position: relative; height: 22px; margin-top: 10px; border-top: 1px solid var(--dash); }
.sc-axis span { position: absolute; top: 6px; transform: translateX(-50%); font: 400 11.5px/1 var(--mono); color: var(--muted); }
.sc-choice { display: none; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.armed .sc-choice { display: flex; }
.sc-out { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.sc-out b { font-weight: 600; }
.sc-out li { font-size: 15.5px; line-height: 1.5; }
.armed .sc-out { gap: 0; }
.armed .sc-out li { grid-area: 1 / 1; visibility: hidden; }
.sc-time[data-show="none"] .sc-out li[data-for="none"], .sc-time[data-show="yes"] .sc-out li[data-for="yes"], .sc-time[data-show="no"] .sc-out li[data-for="no"] { visibility: visible; }

/* 3 · the waterfall */
.sc-control { display: none; margin-top: 18px; }
.armed .sc-control { display: block; }
.sc-control label { display: flex; justify-content: space-between; font: 500 12px/1.3 var(--mono); color: var(--muted); }
.sc-control input { width: 100%; height: 32px; margin: 4px 0 0; accent-color: var(--red); cursor: pointer; }
.sc-fall { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; counter-reset: fall; }
.sc-fall li { counter-increment: fall; display: grid; grid-template-columns: 1.4em minmax(0, 1fr) minmax(0, 1.05fr); gap: 8px; align-items: center; font-size: 14.5px; line-height: 1.3; }
.sc-fall li::before { content: counter(fall); font: 500 12px/1 var(--mono); color: var(--muted); }
.sc-fall i { display: block; height: 14px; border-radius: 3px; background: rgba(18, 20, 24, .07); overflow: hidden; }
.sc-fall i::after { content: ""; display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(var(--f, 1)); transform-origin: left; }
.sc-fall li.short i::after { background: var(--red); }
.sc-fall li.parent { font-weight: 600; }
.sc-read { display: none; margin-top: 12px; min-height: 3em; font-size: 15.5px; line-height: 1.5; }
.armed .sc-read { display: block; }
@container (min-width: 620px) { .sc-fall li { grid-template-columns: 1.4em minmax(0, 1fr) minmax(0, 1.5fr); } }

/* 4 · Nvidia's promises */
.sc-book { position: relative; margin: 18px 0 0; padding: 26px 0 0; list-style: none; display: grid; gap: 18px; }
.sc-book li.sc-ref { position: absolute; top: 0; bottom: 0; left: calc(69.9 / 110 * 100%); border-left: 1px dashed var(--dash); pointer-events: none; }
.sc-book li.sc-ref span { position: absolute; top: 0; right: 7px; width: max-content; font: 400 11.5px/1.2 var(--mono); color: var(--muted); }
.sc-book .sc-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 15px; font-weight: 560; }
.sc-book .sc-n { font: 500 15px/1 var(--mono); }
.sc-book .sc-b { display: block; height: 12px; margin-top: 6px; border-radius: 3px; width: calc(var(--v) / 110 * 100%); min-width: 4px; background: var(--ink); transform-origin: left; transition: transform .7s var(--ease); }
.sc-book .sc-b.cond { background: repeating-linear-gradient(135deg, var(--ink) 0 5px, #63686F 5px 8px); }
.sc-book .sc-b.later { background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(18, 20, 24, .3) 5px 7px); box-shadow: inset 0 0 0 1.5px var(--ink); }
.sc-book .sc-b.talks { width: 16%; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(224, 48, 30, .14) 6px 8px); box-shadow: inset 0 0 0 1.5px var(--red); -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent); mask-image: linear-gradient(90deg, #000 40%, transparent); }
.sc-book .sc-h, .sc-book .sc-c { position: relative; background: var(--paper); }
.sc-book .sc-c { display: block; margin-top: 5px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.sc-book .sc-s { font: 500 12px/1.2 var(--mono); color: var(--ink); }
.sc-book .sc-s.red { color: var(--red-ink); }
.armed .sc-book:not(.on) .sc-b { transform: scaleX(0); }

/* references: one quiet closed line under the essay */
.sc-refs { max-width: 34em; margin-top: 2em; padding-top: 12px; border-top: 1px solid var(--hair); font: 400 15px/1.5 var(--sans); }
.sc-refs summary { cursor: pointer; font: 500 13px/1.4 var(--mono); color: var(--muted); min-height: 32px; }
.sc-refs summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sc-refs .sc-refs-h { margin-top: 1em; font: 500 12px/1.3 var(--mono); color: var(--muted); }
.sc-refs ul { margin-top: .4em; padding-left: 1.1em; list-style: disc; display: grid; gap: .3em; }

@media (prefers-reduced-motion: reduce) { .sc *, .sc *::after { transition: none !important; } }
@media (forced-colors: active) { .sc-fall i::after, .sc-bar, .sc-book .sc-b { background: CanvasText; } }
