/* fig-dpdemo: distortion and perception on an image and on a graph. Colours are tokens from assets/style.css only;
   the photo's grey pixels are painted on a canvas by dpdemo.js. */
#fig-dpdemo .dpdemo-grid { display: grid; row-gap: 8px; align-items: start; font-variant-numeric: tabular-nums; }
#fig-dpdemo .dpdemo-cell { min-width: 0; }
#fig-dpdemo .dpdemo-cell svg { display: block; overflow: visible; }

/* column headings: bottom-aligned, so the pictures under them line up whatever the heading's line count */
#fig-dpdemo .dpdemo-head { align-self: end; line-height: 1.3; padding-bottom: 2px; }
#fig-dpdemo .dpdemo-h1 { font-size: 13.5px; font-weight: 600; color: var(--fg); }
#fig-dpdemo .dpdemo-h2 { font-size: 12.5px; color: var(--muted); }

#fig-dpdemo .dpdemo-rowlab { align-self: center; font-size: 13.5px; font-weight: 600; color: var(--fg); }
#fig-dpdemo .dpdemo-second { margin-top: 22px; }

/* readouts under the two restoration columns: the term in muted text, the value in ink when this estimate wins it */
#fig-dpdemo .dpdemo-rd { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
#fig-dpdemo .dpdemo-k { font-size: 11.5px; letter-spacing: 0.02em; }
/* the two criteria are two separate blocks: a hairline and space before "Perception", so a distortion note such as
   "double" cannot be read on into the next term */
#fig-dpdemo .dpdemo-v + .dpdemo-k { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--rule); }
#fig-dpdemo .dpdemo-v strong { font-weight: 600; }
#fig-dpdemo .dpdemo-v.dpdemo-win { color: var(--fg); }

/* the photo: literal grey pixels on a canvas painted at n x n and scaled by CSS to the column.
   The observation keeps its blocks crisp; the others scale smoothly. A hairline in the rule token
   keeps the edge of the light fur from dissolving into the light page ground. */
#fig-dpdemo .dpdemo-photo { display: block; box-shadow: 0 0 0 1px var(--rule); }
#fig-dpdemo .dpdemo-blocky { image-rendering: crisp-edges; image-rendering: pixelated; }

/* the square */
#fig-dpdemo .pf-edge.dpdemo-e { stroke-width: 2.4; }
#fig-dpdemo .pf-edge.dpdemo-hdiag { stroke-width: 9; stroke-linecap: butt; fill: none; }
#fig-dpdemo .pf-edge.dpdemo-hdiag-n { stroke-width: 7; }
#fig-dpdemo .dpdemo-val { font-size: 12.5px; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 7px; stroke-linejoin: round; }
#fig-dpdemo .dpdemo-val-n { font-size: 11.5px; stroke-width: 6px; }

/* legend */
#fig-dpdemo .dpdemo-key-cell { stroke: var(--rule); stroke-width: 1; }

/* phone: the row label sits above its row, across all four columns */
#fig-dpdemo .dpdemo-narrow { row-gap: 6px; }
#fig-dpdemo .dpdemo-narrow .dpdemo-rowlab-n { grid-column: 1 / -1; margin-top: 6px; }
#fig-dpdemo .dpdemo-narrow .dpdemo-rowlab-n.dpdemo-second { margin-top: 18px; }
#fig-dpdemo .dpdemo-narrow .dpdemo-h1 { font-size: 12.5px; }
#fig-dpdemo .dpdemo-narrow .dpdemo-h2 { font-size: 11.5px; }
#fig-dpdemo .dpdemo-narrow .dpdemo-rd { font-size: 12px; }
#fig-dpdemo .dpdemo-narrow .dpdemo-k { font-size: 11px; letter-spacing: 0; }

/* the polite announcement for screen readers only */
#fig-dpdemo .dpdemo-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* a short fade on the two sample cells after "New sample" */
@keyframes dpdemo-in { from { opacity: 0.1; } to { opacity: 1; } }
#fig-dpdemo .dpdemo-fresh { animation: dpdemo-in 280ms ease-out; }
@media (prefers-reduced-motion: reduce) { #fig-dpdemo .dpdemo-fresh { animation: none; } }
