/* =====================================================================
   Paper and Ink · essays/the-average-can-hide-the-damage.css
   "The Average Can Hide the Damage": the figures only this essay uses.
   Loaded after the shared stylesheets; everything shared lives in css/.
   ===================================================================== */

/* Layout: one 64ch reading column on grained paper; three figures break out to 860px:
   a folded pilot report with its cover and two inside sheets (Figure 1), an evidence
   ledger of the trial's dated findings (Figure 2), and a mix model on graph paper where
   the reader changes the share of users in each group (Figure 3).
   Gold = overall average effect; blue = effects across relevant groups. */

/* ---- 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 folded pilot report ---------------------------------- */
/* clip sideways overflow so a stamp's starting scale can never widen the page on a phone */
.foldfig { overflow-x: clip; overflow-clip-margin: 14px; padding: 6px 4px 0; }
.fold { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
.cover, .leaf {
  position: relative; box-sizing: border-box; padding: 22px 22px 24px;
  background: var(--noise), var(--slip); font-family: var(--mono); font-size: .8rem; line-height: 1.7;
}
.cover { min-height: 300px; transform: rotate(-1.2deg); }
/* the fold: a faint crease down the cover's right edge */
.cover::after { content: ""; position: absolute; top: 0; bottom: 0; right: 10px; border-right: 1px solid var(--rule); opacity: .6; }
.inside { position: relative; display: grid; gap: 18px; }
.leaf { animation: fade .6s ease both; }
.leaf.l1 { transform: rotate(.9deg); animation-delay: 1.3s; }
.leaf.l2 { transform: rotate(-.6deg); margin-left: 14px; animation-delay: 1.8s; }
.ch { margin: 0; text-align: center; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; }
.cs { margin: 0; text-align: center; font-size: .7rem; letter-spacing: .1em; opacity: .7; }
.cr { border-top: 1px dashed currentColor; opacity: .45; margin: 8px 0 12px; }
.fold .ln { display: flex; gap: 6px; margin: 0; }
.fold .ln span { flex: none; }
.fold .ln i { flex: 1; min-width: 12px; border-bottom: 1px dotted currentColor; opacity: .4; transform: translateY(-.45em); }
.fold .ln.once { color: var(--slip-once); }
.fold .ln.life { color: var(--slip-life); font-size: .95rem; }
.cq { margin: 14px 0 0; color: var(--slip-ink); }
.stamp.st1 { color: var(--slip-once); display: table; margin: 18px auto 0; transform: rotate(-7deg); animation-delay: .7s; }
.stamp.st2 { color: var(--slip-life); display: table; margin: 14px 0 0 auto; transform: rotate(5deg); animation-delay: 2.6s; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-top: 1.1rem; }
.notes .mnote p { color: var(--ink); }
.notes .n1 { animation: fade .7s ease 1s both; }
.notes .n2 { animation: fade .7s ease 3s both; }
.notes .n1 .pen path { animation-delay: 1s; }
.notes .n2 .pen path { animation-delay: 3s; }
.notes b.g { color: var(--once); }
.notes b.b { color: var(--life); }

/* ---- Figure 2: the evidence ledger -------------------------------------- */
.ledgerpad {
  box-sizing: border-box; padding: 1.1rem 1.3rem 1rem; transform: rotate(.3deg);
  background: var(--noise), var(--slip); font-family: var(--mono); font-size: .76rem; line-height: 1.5;
}
.lp-h { margin: 0; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.lp-s { margin: 0 0 .7rem; font-size: .68rem; opacity: .7; }
.ledgerpad .lrow {
  display: grid; grid-template-columns: 13rem minmax(0, 1fr) 6.6rem; gap: .9rem; padding: .32rem 0;
  border-top: 1px dotted color-mix(in srgb, currentColor 35%, transparent); animation: fade .5s ease both;
}
.ledgerpad .lrow b { font-weight: 500; }
.ledgerpad .lrow.once b { color: var(--slip-once); }
.ledgerpad .lrow.life b { color: var(--slip-life); }
.ledgerpad .lrow > span:last-child { text-align: right; opacity: .75; }
.ledgerpad .lrow.hd { font-family: var(--sans); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; border-top: 0; border-bottom: 1px dashed currentColor; padding-bottom: .4rem; }
.ledgerpad .lrow:nth-of-type(2) { animation-delay: .3s; }
.ledgerpad .lrow:nth-of-type(3) { animation-delay: .45s; }
.ledgerpad .lrow:nth-of-type(4) { animation-delay: .6s; }
.ledgerpad .lrow:nth-of-type(5) { animation-delay: .75s; }
.ledgerpad .lrow:nth-of-type(6) { animation-delay: .9s; }
.ledgerpad .lrow:nth-of-type(7) { animation-delay: 1.05s; }
.ledgerpad .lrow:nth-of-type(8) { animation-delay: 1.2s; }
.ledgerpad .lrow:nth-of-type(9) { animation-delay: 1.35s; }

/* ---- Figure 3: the mix model -------------------------------------------- */
.mix3 { cursor: crosshair; }
.mix3 .gl { stroke: var(--slip-life); }
.mix3 .al { stroke: var(--slip-once); }
.mix3 .lab-life { fill: var(--slip-life); }
.mix3 .lab-once { fill: var(--slip-once); }
.mix3 .pen-g { fill: var(--graphite); }
.mix3 .pencil { fill: none; stroke: var(--graphite); stroke-width: 1.6; stroke-dasharray: 2 6; stroke-linecap: round; }
.mix3 .loop { fill: none; stroke: var(--graphite); stroke-width: 1.5; stroke-linecap: round; }
.mix3 .pdot { fill: var(--slip-once); }
.mix3 .tk { stroke: var(--slip-ink); stroke-width: 1; opacity: .55; }
.mix3 .tk.major { opacity: .9; stroke-width: 1.3; }
.mix3 .rowlab { font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; fill: var(--graphite); }
.mix3 .cursor { stroke: var(--graphite); stroke-width: 1.2; stroke-dasharray: 5 5; opacity: .7; }
.mix3 .rdot { fill: var(--slip); stroke-width: 2.4; }
.mix3 .rdot.life { stroke: var(--slip-life); }
.mix3 .rdot.once { stroke: var(--slip-once); }
.mix3 .tagbox { fill: var(--slip); stroke: var(--slip-ink); stroke-width: 1; }
.mix3 .tag-life { fill: var(--slip-life); }
.mix3 .tag-once { fill: var(--slip-once); font-weight: 500; }
/* redraws after the breakpoint changes appear at once, without replaying the load sequence */
.mix3 .still .ink path, .mix3 .still .fade { animation: none; }

@media (max-width: 640px) {
  .notes .pen { display: none; }
}

/* Phone mode: the cover stacks above its inside sheets, each note under its object;
   the ledger rows stack their columns; the mix chart is redrawn narrower and taller
   by the page script and its labels grow. */
@media (max-width: 560px) {
  .fold { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cover { min-height: 0; padding: 20px 18px 22px; }
  .leaf { padding: 18px 18px 20px; }
  .leaf.l2 { margin-left: 8px; }
  .notes { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ledgerpad { padding: .9rem .9rem .8rem; font-size: .74rem; }
  .ledgerpad .lrow { grid-template-columns: minmax(0, 1fr); gap: .05rem; }
  .ledgerpad .lrow > span:last-child { text-align: left; font-size: .68rem; }
  .ledgerpad .lrow > span:last-child::before { content: "Source "; }
  .ledgerpad .lrow.hd { display: none; }
  .sheet.mix3 { min-width: 0; user-select: none; }
  .sheet-scroll:has(.mix3) { overflow-x: clip; }
  .mix3 .svgnote { font-size: 17px; }
  .mix3 .svglab { font-size: 19px; }
  .mix3 .tick { font-size: 15px; }
  .mix3 .tagtext { font-size: 13.5px; }
  .mix3 .rowlab { font-size: 13px; }
}
