/* =====================================================================
   Paper and Ink · essays/a-schema-change-is-a-change-of-promise.css
   "A Schema Change Is a Change of Promise": 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:
   two printed message slips that look identical, read either as the producer means them
   or as an old consumer reads them (Figure 1), and a writer-by-reader compatibility
   worksheet on graph paper (Figure 2).
   Gold = structural compatibility; blue = meaning compatibility. */

/* ---- 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: two message slips --------------------------------------- */
/* clip sideways overflow so a stamp's starting scale can never widen the page on a phone */
.msgfig {
  display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 40px; align-items: start;
  overflow-x: clip; overflow-clip-margin: 14px; padding: 8px 4px 0;
}
.slips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; align-items: start; }
/* the shared .slip supplies paper, mono type, zigzag edge and tilt; these slips are narrower */
.slip.mslip { font-size: .76rem; padding: 22px 16px 40px; }
.slip.mslip.b { transform: rotate(1.1deg); margin-top: 14px; }
.slip.mslip p { margin: 0; }
.slip.mslip .ln span:last-child { flex: 0 1 auto; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.slip.mslip .hd { letter-spacing: .12em; }
.mslip .vlab { font-family: var(--sans); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin: 2px 0 2px !important; }
.mslip .view + .view { margin-top: 10px !important; }
.mslip .stamp.m1 { color: var(--slip-once); display: table; margin: 12px auto 6px; transform: rotate(-6deg); animation-delay: .7s; }
.mslip .stamp.m2 { color: var(--slip-life); display: table; margin: 14px 0 0 auto; transform: rotate(5deg); animation-delay: 1.6s; font-size: .7rem; }

/* with the script: one reading at a time, switched by the button */
.msgstage.switchable .view.cons { display: none; }
.msgstage.switchable.consumer .view.prod { display: none; }
.msgstage.switchable.consumer .view.cons { display: block; animation: fade .5s ease both; }
.msgstage.switchable .view .vlab { margin-top: 0 !important; }
.turnbar { margin: 20px 0 0; font-family: var(--sans); font-size: .8rem; }
.msgstage:not(.switchable) .turnbar { display: none; }

.cardnotes { display: grid; gap: 70px; padding-top: 40px; }
.cardnotes .mnote p { color: var(--ink); }
.cardnotes .n1 { animation: fade .7s ease 1s both; }
.cardnotes .n2 { animation: fade .7s ease 2s both; }
.cardnotes .n1 .pen path { animation-delay: 1s; }
.cardnotes .n2 .pen path { animation-delay: 2s; }
.cardnotes b.g { color: var(--once); }
.cardnotes b.b { color: var(--life); }
/* the arrows point left, at the slips */
.cardnotes .pen { transform: scaleX(-1); order: -1; }

/* ---- Figure 2: the compatibility worksheet ----------------------------- */
.matrix2 { cursor: pointer; }
.matrix2 .gl { stroke: var(--graphite); }
.matrix2 .hname { font-family: var(--mono); font-size: 13px; fill: var(--slip-ink); font-weight: 500; }
.matrix2 .hnote { font-family: var(--mono); font-size: 11px; fill: var(--graphite); }
.matrix2 .cr { font-family: var(--mono); font-size: 13px; fill: var(--slip-once); }
.matrix2 .cm { font-family: var(--mono); font-size: 13px; fill: var(--slip-life); }
.matrix2 .mark { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.matrix2 .mark.once { stroke: var(--slip-once); }
.matrix2 .mark.life { stroke: var(--slip-life); }
.matrix2 .loop { fill: none; stroke: var(--graphite); stroke-width: 1.5; stroke-linecap: round; }
.matrix2 .pen-g { fill: var(--graphite); }
.matrix2 .lab-once { fill: var(--slip-once); }
.matrix2 .cursor { fill: none; stroke: var(--graphite); stroke-width: 1.2; stroke-dasharray: 5 5; opacity: .75; }
.matrix2 .tagbox { fill: var(--slip); stroke: var(--slip-ink); stroke-width: 1; }
.matrix2 .tag-ink { fill: var(--slip-ink); }
.matrix2 .tag-once { fill: var(--slip-once); }
.matrix2 .tag-life { fill: var(--slip-life); }
/* redraws after the breakpoint changes appear at once, without replaying the load sequence */
.matrix2 .still .ink path, .matrix2 .still .fade { animation: none; }

@media (max-width: 640px) {
  .msgfig { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cardnotes { gap: 12px; padding-top: 0; }
  .cardnotes .pen { display: none; }
}

/* Phone mode: the two slips stack, full width, with the notes underneath; the worksheet is
   redrawn narrower and taller by the page script, with row labels above each row, and its
   labels grow. */
@media (max-width: 560px) {
  .slips { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .slip.mslip { font-size: .8rem; padding: 22px 20px 40px; }
  .slip.mslip.b { margin-top: 0; }
  .sheet.matrix2 { min-width: 0; user-select: none; }
  .sheet-scroll:has(.matrix2) { overflow-x: clip; }
  .matrix2 .hname { font-size: 15px; }
  .matrix2 .hnote { font-size: 13.5px; }
  .matrix2 .cr, .matrix2 .cm { font-size: 15px; }
  .matrix2 .svgnote { font-size: 17px; }
  .matrix2 .svglab { font-size: 18px; }
  .matrix2 .tagtext { font-size: 14px; }
}
