/* 03 · The diagnosis sheet in motion (Wave B, items 05 and 06). mid-result.js
   marks the sheet .mr when it runs; without it (no JavaScript) none of this
   applies and sections.css draws the sheet fully marked. Tokens: motion.css.

   Paper: the sheet is laid on the desk (a small turn, its shadow settling),
   then the pen grades it; on a fine pointer it tilts a little after the
   cursor with a faint sheen. (The recede of Wave B was cut in Wave C.) */

/* The sheet's soft shadow is its own layer, so that it can be lifted and
   settled (and shifted against the tilt) by transform and opacity alone. At
   rest it is the shadow sections.css gives the sheet. */
.mr.marked {isolation:isolate;box-shadow:0 0 0 1px #14171c0f}
.mr.marked::before {content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  box-shadow:0 2px 6px #14171c0d,calc(10px * var(--sun-c,1) - 18px * var(--sun-s,0)) calc(10px * var(--sun-s,0) + 18px * var(--sun-c,1)) 34px -14px #14171c29;
  translate:var(--shx,0px) var(--shy,0px)}
/* (Wave D, item 16) --sun-c / --sun-s turn that shadow a little down the page, as if the sun moved
   round (mid-light.js); without them it is the shadow above exactly. */

/* Waiting to be laid down (armed only while the sheet is below the window). */
.mr.mr-lay {transform:translateY(22px) rotate(1.1deg) scale(1.022);opacity:0}
.mr.mr-lay::before {transform:translate(10px,24px) scale(1.05);opacity:.38}

/* The pen: every mark waits on its item (.mr-b) until the pen reaches it. */
.mr .pen path,.mr .marked-rows em {transition:none}
/* A dash of 1 and a gap of 2: at offset 1 nothing of the stroke is left, not even a round cap's dot. */
.mr .pen path {stroke-dasharray:1 2}
.mr .mr-b .pen path {stroke-dashoffset:1}
.mr .mr-b em .mr-ink,.mr .mr-nb em .mr-ink {visibility:hidden}
.mr .marked-sum.mr-b strong {opacity:0}
/* The score's digits are cut at their own ink: no neighbour peeks in while they turn. */
.mr .marked-sum .roll-d {clip-path:inset(.16em -.08em .1em)}
/* The oval in the stroke's own units (non-scaling strokes broke pathLength and the nib's place). */
.mr .marked-sum .pen path {vector-effect:none;stroke-width:1.45}
.mr .marked-sum .roll-d i {transition-duration:320ms;transition-delay:0s;transition-timing-function:var(--ease-mech)}
/* A note is written left to right behind the nib (as the word trap's note). */
.mr .marked-rows em {position:relative}
.mr .mr-ink {display:inline-block}
/* (Wave J) The note keeps the room of its whole letters while it is written (the mask cuts at the box). */
.mr .mr-ink.writing {padding:.45em .35em;margin:-.45em -.35em}
.mr .mr-ink.writing {-webkit-mask:linear-gradient(90deg,#000 calc(100% - 14px),#0000) 0 0/calc(100% + 16px) 100% no-repeat;mask:linear-gradient(90deg,#000 calc(100% - 14px),#0000) 0 0/calc(100% + 16px) 100% no-repeat}
.mr em .mr-nib {position:absolute;left:0;top:60%;width:3px;height:3px;margin:-1.5px 0 0 -1.5px;border-radius:50%;background:var(--blue);opacity:0;pointer-events:none}
/* The nib on a drawn stroke: a dot of the pen's blue riding the stroke's end. */
.mr svg .mr-nib {fill:var(--blue);stroke:none;opacity:0}

/* A cause points at the tasks it came from: the others fade back, its own
   rows and their pen marks come forward. */
.mr .mr-cause {margin:-9px 0;padding:9px 0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
.mr .mr-cause:focus-visible {outline:2px solid var(--blue);outline-offset:3px}
.mr .marked-rows li,.mr .marked-causes li {transition:opacity var(--dur-micro) var(--ease-paper)}
.mr .marked-rows .pen path {transition:stroke-width var(--dur-micro) var(--ease-paper)}
.mr.mr-pick .marked-rows li:not(.mr-hit) {opacity:.42}
.mr.mr-pick .marked-rows li.mr-hit .pen path {stroke-width:2.7}
.mr.mr-pick .marked-causes li:not(.mr-hit) {opacity:.55}
.mr.mr-pick .marked-causes li.mr-hit b {color:var(--blue)}
.mr.mr-pick .marked-causes li.mr-hit .tally path {stroke-width:2.4}
/* (Wave E, fix 6) At rest each cause carries the pen's faint dotted line (as the glossable words of the
   squared sheet do): it can be pressed. Pointed at, the line darkens; pinned, it is drawn solid. */
.mr .mr-cause {text-decoration:underline dotted #1f43a666;text-decoration-thickness:1.5px;text-underline-offset:.22em;transition:text-decoration-color var(--dur-micro) var(--ease-ink)}
@media (hover:hover) {.mr .mr-cause:hover {text-decoration-color:#1f43a6b3}}
.mr .mr-cause[aria-pressed=true] {text-decoration:underline 1.5px;text-underline-offset:.22em}
/* (Wave F, fix 5) A cause no row has is plain text, a little quieter: nothing to press. */
.mr .marked-causes li.mr-none b {color:var(--muted)}

/* The sheen: a faint band of light across the paper that moves with the tilt.
   Its inner strip is moved by transform only. */
.mr .mr-sheen {position:absolute;inset:0;overflow:hidden;pointer-events:none;opacity:0}
.mr .mr-sheen i {position:absolute;inset:0;background:linear-gradient(108deg,#ffffff00 30%,#ffffff38 50%,#ffffff00 70%)}

@media (prefers-reduced-motion:reduce) {
  .mr.mr-lay,.mr.mr-lay::before {transform:none;opacity:1}
  .mr .marked-rows li,.mr .marked-causes li,.mr .marked-rows .pen path {transition:none}
}
