/* =====================================================================
   Paper and Ink · essays/the-cheaper-query-and-the-larger-power-bill.css
   "The Cheaper Query and the Larger Power Bill": the figures only this dispatch uses.
   Loaded after the shared stylesheets; everything shared lives in css/.
   ===================================================================== */

/* Layout: one 64ch reading column on grained paper; two paper objects break out to 860px:
   a job receipt beside a monthly meter sheet (Figure 1)
   and a workload worksheet on taped graph paper with three monthly totals (Figure 2).
   Gold = energy per comparable task; blue = total electricity demand.
   Every rule below is scoped to its figure so none of it can restyle the generated Read next block. */

/* ---- 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; }
.sources li:target { color: var(--ink); background: var(--life-soft); }

/* ---- Figure 1: the receipt and the meter sheet ----------------------------- */
/* clip sideways overflow so a stamp's starting scale can never widen the page on a phone */
.rcfig { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 28px 44px; align-items: start; overflow-x: clip; overflow-clip-margin: 14px; padding-top: 6px; }
.rcfig .pairs { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.rcfig .jr, .rcfig .mr { position: relative; font-family: var(--mono); font-size: .72rem; line-height: 1.6; padding: .9rem .9rem 1rem; }
.rcfig .jr {
  background: var(--noise), var(--slip); color: var(--slip-once); transform: rotate(-1.6deg); padding-bottom: 3.6rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  animation: print 1.6s steps(8, end) .2s both;
}
.rcfig .mr { background: var(--noise), var(--sheet); color: var(--slip-life); transform: rotate(1deg); border-top: 5px solid var(--graphite); margin-top: 1.2rem; animation: fade .6s ease 1.4s both; }
.rcfig .ph { font-family: var(--sans); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; margin: 0; color: var(--slip-ink); opacity: .8; }
.rcfig .pn { font-size: .62rem; opacity: .7; margin: .1rem 0 .6rem; color: var(--slip-ink); }
.rcfig .pl { display: flex; align-items: baseline; gap: 6px; }
.rcfig .pl span { flex: none; }
.rcfig .pl i { flex: 1; min-width: 10px; border-bottom: 1px dotted currentColor; opacity: .45; transform: translateY(-.45em); }
.rcfig .pl b { flex: none; font-weight: 500; }
.rcfig .jr .stamp.s1 { position: absolute; left: .9rem; bottom: 1.2rem; color: var(--slip-once); transform: rotate(-6deg); animation-delay: 1.2s; }
.rcfig .grid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .15rem .8rem; align-items: baseline; }
.rcfig .grid b { font-family: var(--sans); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; text-align: right; color: var(--slip-ink); opacity: .75; }
.rcfig .grid span { color: var(--slip-ink); opacity: .8; }
.rcfig .grid em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.rcfig .grid .tt { border-top: 1.5px solid currentColor; padding-top: .2rem; font-weight: 500; font-size: .8rem; }
.rcfig .grid span.tt { border-color: var(--slip-life); }
.rcfig .mr .stamp.s2 { display: table; margin: .7rem .1rem 0 auto; color: var(--slip-life); transform: rotate(5deg); animation-delay: 2.2s; }
.rcfig .rnotes { display: grid; gap: 110px; padding-top: 50px; }
.rcfig .rnotes .mnote p { color: var(--ink); }
.rcfig .rnotes .n1 { animation: fade .7s ease 1.2s both; }
.rcfig .rnotes .n2 { animation: fade .7s ease 2.4s both; }
.rcfig .rnotes .n1 .pen path { animation-delay: 1.2s; }
.rcfig .rnotes .n2 .pen path { animation-delay: 2.4s; }
.rcfig .rnotes .n1 b { color: var(--once); }
.rcfig .rnotes .n2 b { color: var(--life); }

/* ---- Figure 2: the workload worksheet --------------------------------------- */
.ws {
  position: relative; max-width: 640px; padding: 1.5rem 1.4rem 1.3rem; transform: rotate(-.4deg); color: var(--slip-ink);
  background:
    var(--noise),
    linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 60px 60px,
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 60px 60px,
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 12px 12px,
    var(--sheet);
}
.ws::before, .ws::after { content: ""; position: absolute; top: -11px; width: 84px; height: 24px; background: var(--noise), var(--tape); }
.ws::before { left: 22px; transform: rotate(-5deg); }
.ws::after { right: 22px; transform: rotate(4deg); }
.ws .pick { border: 0; margin: 0 0 .8rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.ws .pick label { font-family: var(--sans); font-size: .85rem; color: var(--graphite); cursor: pointer; padding: .2rem 0; border-bottom: 2px solid transparent; }
.ws .pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ws .pick label:has(input:checked) { color: var(--slip-ink); border-bottom-color: var(--slip-ink); }
.ws .pick label:has(input:focus-visible) { outline: 2px solid var(--life); outline-offset: 3px; }
.ws .ledger { background: var(--noise), var(--slip); padding: .7rem .9rem .6rem; box-shadow: 0 1px 1px var(--shadow); font-family: var(--mono); font-size: .76rem; transform: rotate(.3deg); }
.ws .lrow { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: .14rem 0; line-height: 1.45; }
.ws .lrow span { flex: none; }
.ws .lrow em { flex: none; font-style: normal; opacity: .7; font-size: .7rem; }
.ws .lrow i { flex: 1; min-width: 12px; border-bottom: 1px dotted currentColor; opacity: .4; transform: translateY(-.45em); }
.ws .lrow b { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }
.ws .lrow.once { color: var(--slip-once); }
.ws .lrow.life { color: var(--slip-life); }
.ws .lrow.gr { color: var(--graphite); }
.ws .lrow.sum { border-top: 1.5px solid currentColor; margin-top: .3rem; padding-top: .35rem; font-size: .84rem; }
.ws .bars { margin-top: 1.2rem; font-family: var(--mono); font-size: .7rem; }
.ws .bh { font-family: var(--sans); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); margin: 0 0 .4rem; }
.ws .bar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.6rem; gap: .7rem; align-items: center; padding: .2rem 0; color: var(--slip-life); opacity: .55; }
.ws .bar.on { opacity: 1; }
.ws .bar.on span { font-weight: 500; }
.ws .bar i { display: block; height: 12px; }
/* each bar is drawn to scale, 600 units filling the track, and inks in from the left */
.ws .bar s { display: block; height: 100%; background: var(--slip-life); animation: wipe 1.2s ease both; }
.ws + .narr { margin-top: 1.5rem; }
.ws .bar.b0 s { width: 33.33%; animation-delay: .4s; }
.ws .bar.b1 s { width: 50%; animation-delay: .8s; }
.ws .bar.b2 s { width: 100%; animation-delay: 1.2s; }
.ws .bar b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 680px) {
  .rcfig { grid-template-columns: minmax(0, 1fr); }
  .rcfig .rnotes { gap: .9rem; padding-top: 0; }
  .rcfig .rnotes .pen { display: none; }
}

/* Phone mode: the receipt and meter sheet keep their side-by-side pairing at a smaller size, the notes
   tuck underneath, and the worksheet's arithmetic and bar labels move onto their own lines. */
@media (max-width: 560px) {
  .rcfig .pairs { gap: 12px; }
  .rcfig .jr, .rcfig .mr { font-size: .66rem; padding: .8rem .7rem .9rem; }
  .rcfig .jr { padding-bottom: 3.4rem; }
  .rcfig .grid { gap: .15rem .5rem; }
  .ws { padding: 1.4rem .9rem 1.1rem; }
  .ws .pick { display: grid; grid-template-columns: 1fr; gap: .1rem; }
  .ws .ledger { font-size: .72rem; padding: .6rem .7rem .5rem; }
  .ws .lrow { flex-wrap: wrap; row-gap: 0; }
  .ws .lrow em { order: 4; flex-basis: 100%; }
  .ws .bar { grid-template-columns: minmax(0, 1fr) 2.6rem; gap: .2rem .6rem; }
  .ws .bar span { grid-column: 1 / -1; }
}

/* Narrow phones: the receipt and the meter sheet stack, so neither has to squeeze its rows. */
@media (max-width: 420px) {
  .rcfig .pairs { grid-template-columns: minmax(0, 1fr); }
  .rcfig .jr { width: 78%; }
  .rcfig .mr { margin-top: .4rem; }
}
