/* =====================================================================
   Paper and Ink · essays/the-exception-is-the-business.css
   "The Exception Is the Business": 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 paper objects break out to 860px:
   an invoice lying across its purchase order and receiving record with a note taped on (Figure 1),
   and a taped sheet of graph paper with two panels, cases and minutes (Figure 2).
   Gold = the routine path; blue = exception work; neutral totals and sampling are 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; }
.sources li:target { color: var(--ink); background: var(--life-soft); }

/* ---- Figure 1: the invoice and the unfinished trail ---------------------- */
/* clip sideways overflow so the starting scale of a stamp or note can never widen the page on a phone */
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; padding: 14px 4px 0; overflow-x: clip; overflow-clip-margin: 14px; }
.doc {
  position: relative; padding: 1rem 1.05rem 1.1rem; font-family: var(--mono); font-size: .74rem; line-height: 1.55;
  animation: fade .6s ease both;
}
.doc.po { background: var(--noise), var(--slip); transform: rotate(-1.6deg); z-index: 1; margin-top: 18px; animation-delay: .1s; }
.doc.inv { background: var(--noise), var(--sheet); transform: rotate(.6deg); z-index: 3; margin-inline: -14px; animation-delay: .4s; }
.doc.rcv { background: var(--noise), var(--slip); transform: rotate(1.8deg); z-index: 2; margin-top: 30px; animation-delay: .9s; }
.dh { font-family: var(--sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .15rem; opacity: .8; }
.dn { font-size: .68rem; opacity: .65; margin: 0 0 .6rem; }
.drow { display: flex; justify-content: space-between; gap: .7rem; border-bottom: 1px solid color-mix(in srgb, var(--slip-ink) 22%, transparent); padding: .2rem 0; }
.drow span { opacity: .75; }
.drow b { font-weight: 500; text-align: right; }
.drow.total { border-bottom: 1.5px solid var(--slip-ink); }
.drow.total b { font-family: var(--serif); font-size: 1.3rem; font-weight: 400; line-height: 1.1; }
/* the matching fields are marked in gold; the highlighter lands as each document arrives */
.doc .c-once { padding: 0 2px; }
.po .c-once { animation-delay: .9s; }
.inv .c-once { animation-delay: 1.3s; }
/* the received quantity is circled in blue ink */
.circ { position: relative; display: inline-block; color: var(--slip-life); font-family: var(--serif); font-size: 1.3rem; font-weight: 400; line-height: 1.1; }
.circ svg { position: absolute; left: -16px; top: -11px; width: calc(100% + 32px); height: calc(100% + 22px); overflow: visible; }
.circ path { fill: none; stroke: var(--slip-life); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 0; animation: circ .8s ease-out 2s both; }
@keyframes circ { from { stroke-dashoffset: 160; } }
/* the note taped to the receiving record: a lead, not proof */
.tnote {
  position: relative; margin: 1.9rem -.4rem 0 .6rem; padding: .9rem .8rem .7rem; background: var(--noise), var(--sheet);
  font-family: var(--serif); font-style: italic; font-size: 1.08rem; line-height: 1.3; color: var(--slip-ink);
  transform: rotate(-3deg); box-shadow: 0 1px 1px var(--shadow), 0 6px 12px -8px var(--shadow-deep);
  animation: press .45s cubic-bezier(.3, 1.6, .5, 1) 2.6s both;
}
/* a gentler thump than a stamp's: the note is wide, so it starts only slightly larger */
@keyframes press { from { scale: 1.12; opacity: 0; } }
.tnote::before { content: ""; position: absolute; top: -10px; left: 50%; width: 70px; height: 20px; margin-left: -35px; background: var(--noise), var(--tape); transform: rotate(4deg); }
.inv .stamp { display: table; margin: .8rem 0 0 auto; color: var(--slip-life); transform: rotate(-6deg); font-size: .66rem; animation-delay: 3.2s; }
/* the three quantities, side by side, under the documents */
.recon {
  display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: 1.6rem 0 0; font-family: var(--mono); font-size: .8rem; color: var(--slip-ink);
  animation: fade .7s ease 3.4s both;
}
.recon span { color: var(--muted); }
.recon b { font-weight: 500; color: var(--ink); }
.recon .gap b { color: var(--life); }
.inotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 40px; margin-top: 1.2rem; }
.inotes .mnote p { color: var(--ink); }
.inotes .n1 { animation: fade .7s ease 1.6s both; }
.inotes .n2 { animation: fade .7s ease 3.6s both; }
.inotes .n1 .pen path { animation-delay: 1.6s; }
.inotes .n2 .pen path { animation-delay: 3.6s; }
.inotes .n2 b { color: var(--life); }
.again { margin-top: 1rem; }

/* ---- Figure 2: fewer cases, different work ------------------------------- */
#sheet2 { -webkit-user-select: none; user-select: none; }
.wchart text { fill: var(--slip-ink); }
.wchart .rowlab { font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; fill: var(--graphite); }
.wchart .svgnote.sm { font-size: 13px; }
.wchart .cell { stroke-width: 1.2; }
.wchart .cell.man { fill: var(--slip-once); stroke: var(--slip-once); opacity: .9; }
.wchart .cell.auto { fill: url(#hatchA); stroke: var(--slip-once); }
.wchart .cell.exc { fill: var(--slip-life); stroke: var(--slip-life); opacity: .9; }
.wchart .seg { stroke-width: 1.4; }
.wchart .seg.r { fill: var(--slip-once); stroke: var(--slip-once); opacity: .9; }
.wchart .seg.e { fill: var(--slip-life); stroke: var(--slip-life); opacity: .9; }
.wchart .seg.s { fill: url(#hatchS); stroke: var(--graphite); }
.wchart .was { fill: none; stroke: var(--graphite); stroke-width: 1.4; stroke-dasharray: 2 5; stroke-linecap: round; }
.wchart .brace { fill: none; stroke: var(--graphite); stroke-width: 1.2; stroke-linecap: round; }
.wchart .tk { stroke: var(--slip-ink); stroke-width: 1; opacity: .55; }
.wchart .tk.major { opacity: .9; stroke-width: 1.3; }
.wchart .divide { stroke: var(--graphite); stroke-width: 1; stroke-dasharray: 1 5; stroke-linecap: round; }
.wchart .ptr { fill: var(--slip-ink); }
.wchart .tagbox { fill: var(--slip); stroke: var(--slip-ink); stroke-width: 1; }
.wchart .cells { animation: fade .7s ease both; }
.wchart .bars { animation: wipe 1.2s ease both; }
.ctable { border-collapse: collapse; margin: 1rem 0 0; font-family: var(--mono); font-size: .74rem; color: var(--muted); width: 100%; }
.ctable caption { text-align: left; font-family: var(--sans); font-size: .82rem; color: var(--muted); padding-bottom: .3rem; }
.ctable caption b { color: var(--ink); font-weight: 600; }
.ctable th, .ctable td { text-align: right; padding: .2rem .5rem; border-bottom: 1px solid var(--rule); font-weight: 400; }
.ctable th:first-child, .ctable td:first-child { text-align: left; padding-left: 0; }
.ctable thead th { font-family: var(--sans); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; vertical-align: bottom; }
.ctable td:last-child { color: var(--ink); }

@media (max-width: 640px) {
  .docs { grid-template-columns: minmax(0, 1fr); padding-inline: 8px; }
  .doc.po, .doc.inv, .doc.rcv { margin: 0; }
  .doc.inv { margin-top: -6px; }
  .doc.rcv { margin-top: -4px; }
  .inotes { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .inotes .pen { display: none; }
}

/* Phone mode: Figure 1's documents stack. Figure 2 is redrawn by the page script as a narrower, taller sheet
   (viewBox 400 x 620), so it fits the column with no sideways scroll, and its SVG text is raised so labels
   render at 11px or more. The checked-values table tightens. */
@media (max-width: 560px) {
  .sheet-scroll { overflow-x: clip; }
  .sheet { min-width: 0; padding: 24px 8px 10px; }
  .wchart .svgnote { font-size: 16px; }
  .wchart .svgnote.sm { font-size: 15px; }
  .wchart .svglab { font-size: 18px; }
  .wchart .tick { font-size: 14px; }
  .wchart .rowlab { font-size: 13px; }
  .wchart .tagtext { font-size: 15px; }
  .ctable { font-size: .66rem; }
  .ctable th, .ctable td { padding: .2rem .25rem; }
  .ctable thead th { font-size: .56rem; letter-spacing: .02em; }
}
