/* 01 · The task in motion (Wave C, items 08 and 09). mid-task.js marks #task
   .mt when it runs; without it (no JavaScript) none of this applies. This sheet
   is marked data-page, so the copies of the first screen on the photographed
   sheet never load it: nothing here may change the task as it stands with no
   hint opened and nothing answered (the opening's seam). Tokens: motion.css.

   Solving comes first: everything here moves only in answer to what the
   student does (a hint opened, an answer checked, the next task). */

/* The marker over the German key phrases. Two layers: the marker band (as
   look.css draws it, its colour a registered property so a phrase can be lit
   deeper), and a fine blue underline drawn under the phrase while its gloss is
   pointed at. With the phrase unlit the second layer has no width: the marked
   sentence is exactly look.css's. A phrase that breaks over two lines is one
   background strip (box-decoration-break: slice), so the sweep and the
   underline run along the first line and on into the second. */
@property --mt-mk {syntax:'<color>';inherits:true;initial-value:#f8e7a0}
@property --mt-ul {syntax:'<percentage>';inherits:true;initial-value:0%}
.mt .dg-op {--mt-mk:var(--marker);transition:--mt-mk var(--dur-micro) var(--ease-ink),--mt-ul var(--dur-micro) var(--ease-ink);
  /* (Wave J, owner) The marker covers the whole height of the letters (the inline box runs from above the ascenders
     to below the descenders), with a soft, slightly uneven top and foot; it was the lower half only. */
  background-image:linear-gradient(to top,#0000 0,var(--mt-mk) 4%,var(--mt-mk) 93%,#0000 100%),linear-gradient(var(--blue),var(--blue));
  background-position:left bottom,left bottom;background-repeat:no-repeat;background-size:0% 100%,0% 1.5px}
.mt .l1 .dg-op {background-size:100% 100%,var(--mt-ul) 1.5px}
.mt .l1 .dg-op.mt-on {--mt-mk:#f2d76c;--mt-ul:100%}

/* The glosses: each line is written in once its phrase is marked (the German
   printed, the Russian in pen behind a nib). Pointing at one lights its phrase. */
.mt .dg-gloss li {position:relative;border-radius:2px}
/* (Wave C review, fix 5) The gloss's own marker has the phrase's chisel slant at its leading edge. */
.mt .dg-gloss li b {background:linear-gradient(100deg,var(--mt-mk) calc(100% - 9px),#0000 calc(100% - 2px)) 0 50%/calc(var(--mt-gl,0%) * 1.12) 96% no-repeat;
  --mt-mk:var(--marker);transition:--mt-gl var(--dur-micro) var(--ease-ink)}
@property --mt-gl {syntax:'<percentage>';inherits:false;initial-value:0%}
.mt .l1 .dg-gloss li.mt-on b {--mt-gl:100%}
/* Only once hint "а" is open does the sentence answer to the pointer. (Wave F, fix 5) Then the glosses
   show it: the pointer's hand over them and the phrases, and a faint dotted line in the pen's blue under
   each gloss's German, as under the squared sheet's glossable words. */
@media (hover:hover) {.mt .l1 .dg-op,.mt .l1 .dg-gloss li {cursor:pointer}}
.mt .l1 .dg-gloss li b {text-decoration:underline dotted #1f43a64d;text-decoration-thickness:1.5px;text-underline-offset:.22em}
/* (Wave F, fix 5) The answer field focused: no box round it, its own baseline drawn in the pen's blue and a
   little heavier, for the keyboard as for the finger. */
.mt .dg-ans input:focus-visible,.mt .dg-ans input:focus {outline:none;border-bottom-color:var(--blue);box-shadow:0 1px 0 0 var(--blue)}
/* The nib that writes a gloss, at the start of its Russian line (motion.css i.m-dot). */
.mt .dg-gloss i.m-dot {left:var(--nx,0px);top:var(--ny,0px)}

/* Opening a part: its box grows from nothing while its content comes in. */
.mt .mt-unfold {overflow:hidden}

/* The ladder's dot fills with the marker from its centre. At rest it is the
   dot look.css draws (the marker is a layer of the same size behind the letter). */
.mt .dg-ladder i {position:relative;isolation:isolate}
.mt .dg-ladder i.on {background:transparent}
.mt .dg-ladder i.on::before {content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background:var(--marker)}

/* The answer. Right: a tick in pen beside the number. Wrong: the field shakes a
   little, a graphite squiggle is drawn under the number, and the verdict is
   quiet text beside a pencil line, not a coloured box. */
.mt #exercise {position:relative}
.mt .dg-ans {position:relative}
.mt .dg-ans svg.mt-mark {position:absolute;overflow:visible;fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.mt .dg-ans svg.mt-mark path {stroke-dasharray:1 2}
.mt .dg-ans .mt-tick {stroke:var(--blue);stroke-width:2.2}
.mt .dg-ans .mt-squiggle {stroke:#5f6670;stroke-width:1.5}
.mt .dg-fb.bad {background:none;border-left:1.5px solid #9a9fa6;border-radius:0;padding-block:4px;color:var(--ink-soft)}
.mt .dg-fb.bad .cost-plot {border-top-color:#c9cac2}
/* The cost bar runs up from the left (it turns at the limit when it passes it). */
.mt .cost-track::before {transform-origin:0 50%}

/* Moving on: the old sheet leaves to the left under the new one. */
.mt .mt-leaf {position:absolute;left:0;top:0;width:100%;pointer-events:none;z-index:1;background:var(--paper) var(--grain)}
/* While the box eases from one sheet's height to the other's, it clips what is past its foot. */
/* (Wave I, item 10) Clipped only at its moving foot, not at its sides: the new sheet comes in from 20 px to the
   right, and overflow:hidden cut the timer's last digit while it did. */
.mt #exercise.mt-turning {clip-path:inset(-4px -48px 0 -48px)}
/* (Wave E, fix 5) No ring round the whole task when it is focused after "next" (by mouse or by key):
   the controls inside it keep their own rings for the keyboard. */
.mt #exercise:focus {outline:none}

@media (prefers-reduced-motion:reduce) {
  .mt .dg-op,.mt .dg-gloss li b {transition:none}
}

/* (Wave F, fix 7) On a phone, with all three hints open, the answer field and "Проверить" stay on the screen
   with the task's head: the structure and the translation are set a little smaller and closer. Only the
   hints (the task's print, which the opening film lands on, is not touched). */
@media (max-width:820px) {
  .mt .dg-given,.mt .dg-ru {font-size:15px;line-height:1.44}
  .mt .dg-gloss {row-gap:2px}
}

/* (Wave H) A finished task's leftover controls are folded away (mid-task.js). */
.mt .dg.mt-done .dg-actions {display:none}

/* (Wave I, item 11) "Next" focused after a mouse or touch answer: no ring until a key is pressed (mid-task.js). */
.mt .dg-next.mt-quiet:focus,.mt .dg-next.mt-quiet:focus-visible {outline:none}

/* (Wave J, the owner: the hand-over dims in several steps with a jump) One fade at the camera's landing. In the page
   state the print's extras stay at full opacity as a group, and each of their parts makes one move of one property,
   with one duration and one easing, starting at the moment #task loses .print: the letterhead and the sheet's footer
   go (also settles M 2: they were hidden only under .mt-more, and came back for 0.4 s when the first hint opened),
   and the next tasks go to their resting faintness under the untouched first task on a wide screen (wave I, item 9)
   or to nothing. Their mask (they fade out before the foot of the first screen) closes in the same move through
   --more-k (1: no mask, 0: the resting mask), instead of appearing at once. Before, four things stacked: the group's
   own 0.38 s fade, the faint tasks' 0.5 s fade after a 0.25 s delay, the mask switched on at once (the jump), and the
   letterhead's 0.18 s. The page's heading and its line rise once the letterhead has gone (0.3 s and 0.36 s).
   The print state (the opening and its seam) is as scene.css draws it. */
@property --more-k {syntax:'<number>';inherits:true;initial-value:1}
.js #task.mt:not(.print) .extras {opacity:1}
.js #task.mt .extras>.lh {transition:opacity .34s cubic-bezier(.3,0,.2,1),transform .5s cubic-bezier(.4,0,.7,.4)}
.js #task.mt .extras>.foot,.js #task.mt .extras .more {transition:opacity .34s cubic-bezier(.3,0,.2,1),--more-k .34s cubic-bezier(.3,0,.2,1)}
.js #task.mt:not(.print) .extras>.lh,.js #task.mt:not(.print) .extras>.foot,.js #task.mt:not(.print) .extras .more {opacity:0}
.js #task.mt .practice-intro h2 {--after:.3s}
.js #task.mt .practice-intro>p:not(.eyebrow) {--after:.36s}
@media (min-width:821px) {
  .js #task.mt-more:not(.print) .extras .more {opacity:.15}
  /* The mask stays (closed) whenever the page is the page, so a touch on the task fades the tasks out without their
     masked foot showing for a moment. */
  .js #task.mt:not(.print) .extras .more {--more-k:0;
    -webkit-mask-image:linear-gradient(#000 calc(var(--more-room,200px) - 70px + var(--more-k) * 4000px),#0000 calc(var(--more-room,200px) - 12px + var(--more-k) * 4000px));
    mask-image:linear-gradient(#000 calc(var(--more-room,200px) - 70px + var(--more-k) * 4000px),#0000 calc(var(--more-room,200px) - 12px + var(--more-k) * 4000px))}
}
@media (prefers-reduced-motion:reduce) {.js #task.mt .extras>.lh,.js #task.mt .extras>.foot,.js #task.mt .extras .more {transition:none}}

/* (Wave J, owner) The three glosses as a small table on the sheet: the German in one column, its Russian written
   beside it in a second, with air above (after the question) and below (before the answer field). */
.mt .l1 .dg-gloss {grid-template-columns:max-content minmax(0,1fr);column-gap:22px;row-gap:9px;margin:30px 0 34px}
.mt .l1 .dg-gloss li {display:grid;grid-column:1/-1;grid-template-columns:subgrid;align-items:baseline}
.mt .l1 .dg-gloss li b,.mt .l1 .dg-gloss li span {justify-self:start}
@media (max-width:820px) {.mt .l1 .dg-gloss {column-gap:14px;row-gap:6px;margin:22px 0 24px}}

/* (Wave J, owner) The row of controls as one family: the filled button, then the next hint as a plain underlined link,
   then the three steps all the same size and outline: the open one filled with the marker's yellow, the next one
   ringed in the pen's blue, the later one quiet. */
.mt .dg-ladder i {box-sizing:border-box;width:30px;height:30px;border:1px solid #14171c26;background:transparent;color:var(--muted);font:400 15px/28px var(--sans);box-shadow:none}
.mt .dg-ladder i.on {border-color:#d9c77a;color:var(--ink)}
.mt .dg-ladder i:first-of-type:not(.on),.mt .dg-ladder .on+i:not(.on) {border-color:var(--blue);background:transparent;color:var(--blue);box-shadow:none}
@media (hover:hover) {.mt .dg-ladder:hover i:first-of-type:not(.on),.mt .dg-ladder:hover .on+i:not(.on) {background:#f8e7a066;border-color:var(--blue);color:var(--ink);box-shadow:none}}
.mt .dg-hint,.mt .dg-show {padding:6px 0;border:0;background:none;color:var(--blue);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:6px}

/* (Wave J, owner) No focus ring after a mouse or touch press on any control of the task (the hint link, the steps,
   the check button, the glosses, "next"); the keyboard gets the page's ring. mid-task.js sets .mt-ptr on the task
   on a pointer press and takes it off on the first key. The answer field keeps its own underline. */
.mt.mt-ptr :is(button,a,[tabindex]):focus,.mt.mt-ptr :is(button,a,[tabindex]):focus-visible {outline:none}

/* (Wave J, owner) Under the task, once it is being worked (or from the second task on), the sheet's own ruled lines
   for working stand in the space below it, faint, ending before the foot of the first screen (mid-task.js places
   them and sets --lines-h). Never in the print (the opening). */
.mt-lines {position:absolute;z-index:0;pointer-events:none;opacity:0;transition:opacity .6s cubic-bezier(.2,.7,.2,1);
  background:repeating-linear-gradient(#0000 0 39px,#14171c1a 39px 40px);
  -webkit-mask-image:linear-gradient(#000 calc(100% - 80px),#0000);mask-image:linear-gradient(#000 calc(100% - 80px),#0000)}
.js #task.mt-work:not(.print) ~ .booklet .mt-lines {opacity:1}
#task.print ~ .booklet .mt-lines {display:none}
@media (prefers-reduced-motion:reduce) {.mt-lines {transition:none}}
