/* =====================================================================
   Paper and Ink · essays/who-pays-for-the-empty-capacity.css
   "Who Pays for the Empty Capacity?": the figures only this essay uses.
   Loaded after the shared stylesheets; everything shared lives in css/.
   ===================================================================== */

/* Layout: one 64ch reading column on grained paper; two figures break out to 860px:
   a capacity invoice with two worksheets that allocate it (Figure 1), and the
   denominator ruler on graph paper (Figure 2).
   Gold = capacity supplied; blue = capacity consumed; unused capacity is graphite. */

/* ---- footnote markers -------------------------------------------------- */
sup.ref { font-family: var(--sans); font-size: .62em; line-height: 0; margin-left: 1px; }
sup.ref a { text-decoration: none; color: var(--life); padding: 0 1px; }
sup.ref a:hover { text-decoration: underline; }
sup.ref + sup.ref { margin-left: 3px; }
.sources li:target { color: var(--ink); background: var(--life-soft); }

/* ---- Figure 1: the invoice and its two worksheets ---------------------- */
/* clip sideways overflow so a stamp's starting scale can never widen the page on a phone */
.capfig {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 40px; align-items: start;
  overflow-x: clip; overflow-clip-margin: 14px; padding: 8px 4px 0;
}
/* the shared .slip supplies paper, mono type, zigzag edge and tilt */
.slip.inv { font-size: .78rem; padding: 24px 20px 44px; }
.slip.inv p { margin: 0; }
.slip.inv .isub { text-align: center; font-size: .7rem; letter-spacing: .08em; margin-bottom: 10px; }
.slip.inv .tot { font-weight: 600; }
.slip.inv .stamp.i1 { color: var(--slip-once); display: table; margin: 18px auto 0; transform: rotate(-6deg); animation-delay: .7s; }

.wsheets { display: grid; gap: 26px; }
.ws {
  position: relative; box-sizing: border-box; padding: 16px 18px 20px;
  background: var(--noise), var(--slip);
  font-family: var(--mono); font-size: .76rem; line-height: 1.75;
}
.ws.wa { transform: rotate(.8deg); }
.ws.wb { transform: rotate(-.6deg); }
.ws p { position: relative; margin: 0; }
.ws .wh { letter-spacing: .14em; text-transform: uppercase; font-weight: 500; font-size: .7rem; }
.ws .rule { border-top: 1px dashed currentColor; opacity: .45; margin: 6px 0 8px; }
.ws .ln { display: flex; gap: 6px; }
.ws .ln > span { flex: none; }
.ws .ln > span:last-child { flex: 0 1 auto; min-width: 0; text-align: right; }
.ws .ln i { flex: 1; min-width: 10px; border-bottom: 1px dotted currentColor; opacity: .4; transform: translateY(-.45em); }
.ws .ln.once { color: var(--slip-once); }
.ws .ln.life { color: var(--slip-life); }
.ws .ln.gr { color: var(--graphite); }
.ws .ln.big { font-size: .9rem; font-weight: 600; margin-top: 2px; }
.ws .own { margin-top: 8px; color: var(--graphite); font-size: 1.02rem; }
.ws .own .blank { display: inline-block; width: 7em; height: 1em; vertical-align: -.2em; border-bottom: 1.5px solid currentColor; }
.ws .stamp { color: var(--slip-once); position: absolute; right: 14px; top: 12px; font-size: .66rem; }
.ws.wa .stamp { transform: rotate(-5deg); animation-delay: 1.2s; }
.ws.wb .stamp { transform: rotate(4deg); animation-delay: 1.6s; }
.ws .v { display: inline-block; }
.ws .v.flip { animation: fade .5s ease both; }

/* the button appears only when the script can run it */
.capbar { display: none; margin: 22px 0 0; }
.capbar.on { display: block; }

/* ---- Figure 2: the denominator ruler ----------------------------------- */
.ruler2 .full { stroke: var(--slip-ink); }
.ruler2 .once { stroke: var(--slip-once); }
.ruler2 .hl { stroke: var(--graphite); stroke-width: 1; }
.ruler2 .yt, .ruler2 .rt, .ruler2 .rl { stroke: var(--slip-ink); stroke-width: 1.2; }
.ruler2 .lab-ink { fill: var(--slip-ink); }
.ruler2 .lab-once { fill: var(--slip-once); }
.ruler2 .pen-g { fill: var(--graphite); }
.ruler2 .arrow { fill: none; stroke: var(--graphite); stroke-width: 1.4; stroke-linecap: round; }
.ruler2 .loop { fill: none; stroke: var(--graphite); stroke-width: 1.5; stroke-linecap: round; }
.ruler2 .rowlab { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; fill: var(--slip-ink); }
.ruler2 .billbox { fill: none; stroke: var(--slip-once); stroke-width: 2; }
.ruler2 .usedfill { fill: var(--slip-life); }
.ruler2 .cursor { stroke: var(--graphite); stroke-width: 1.2; stroke-dasharray: 5 5; }
.ruler2 .dot-ink { fill: var(--slip-ink); }
.ruler2 .dot-once { fill: var(--slip-once); }
.ruler2 .tagbox { fill: var(--slip); stroke: var(--slip-ink); stroke-width: 1; }
.ruler2 .tag-ink { fill: var(--slip-ink); }
.ruler2 .tag-once { fill: var(--slip-once); }
.ruler2 .tag-life { fill: var(--slip-life); }
.ruler2 .tag-gr { fill: var(--graphite); }
.ruler2 .tagtext { white-space: pre; }
/* redraws after the breakpoint changes appear at once, without replaying the load sequence */
.ruler2 .still .ink path, .ruler2 .still .fade, .ruler2 .still .hatch { animation: none; }

@media (max-width: 640px) {
  .capfig { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .slip.inv { max-width: 340px; }
}

/* Phone mode: the invoice and worksheets stack full width; the ruler is redrawn narrower
   and taller by the page script with its paper tag above the plot, and its labels grow. */
@media (max-width: 560px) {
  .slip.inv { max-width: none; font-size: .8rem; }
  .ws { font-size: .78rem; padding: 16px 14px 18px; }
  .ws .stamp { position: static; display: table; margin: 10px 0 0 auto; }
  .sheet.ruler2 { min-width: 0; user-select: none; }
  .sheet-scroll:has(.ruler2) { overflow-x: clip; }
  .ruler2 .tick { font-size: 13px; }
  .ruler2 .svgnote { font-size: 16px; }
  .ruler2 .svglab { font-size: 16px; }
  .ruler2 .rowlab { font-size: 12px; }
  .ruler2 .tagtext { font-size: 14px; }
}
