@font-face{
  font-family:"Leftover Yomogi";src:url(yomogi-leftover.woff2) format("woff2");
  font-weight:400;font-display:swap;
}
@font-face{
  font-family:"Leftover Tachibana";src:url(tachibana-leftover.woff2) format("woff2");
  font-weight:400;font-display:swap;
}
.sheet[data-scenario="leftover"] .handwriting{font-family:"Leftover Yomogi","Yomogi",cursive}
.sheet[data-scenario="leftover"][data-note-font="tachibana"] .handwriting{
  font-family:"Leftover Tachibana","Calendar Handwriting","Yomogi",cursive;
}

.handwriting-crossed::after{
  content:"";position:absolute;top:.54em;left:-.12em;right:-.13em;
  border-top:max(1px,.08em) solid currentColor;opacity:.7;transform:rotate(1deg);
  pointer-events:none;
}
.handwriting-returning i{display:inline-block;font:inherit;letter-spacing:inherit}
.handwriting-returning > span{
  transform-origin:left bottom;
  text-shadow:.65px .45px #30384e63;
}

@media(prefers-reduced-motion:no-preference){
  .book > .sheet .handwriting-returning > span{
    animation:returning-ink-twitch 4.6s linear 2.85s infinite;
  }
  .book > .resumed-sheet .handwriting-returning > span{animation-delay:1.15s}
  .book > .sheet:not(.resumed-sheet) .handwriting-returning i{
    animation:note-kanji-strokes .46s linear .62s both;
  }
  .book > .sheet:not(.resumed-sheet) .handwriting-returning i:nth-child(2){
    animation:note-kana-strokes .31s linear 1.06s both;
  }
  .book > .sheet:not(.resumed-sheet) .handwriting-returning i:nth-child(3){
    animation-delay:1.36s;animation-duration:.51s;
  }
  .book > .sheet:not(.resumed-sheet) .handwriting-returning i:nth-child(4){
    animation:note-kana-strokes .36s linear 1.84s both;
  }
  /* A new sheet waits until it can be used. An outgoing sheet holds the current strokes. */
  .book.changing-paper > .sheet .handwriting-returning :is(span,i){
    animation-play-state:paused;
  }
  @keyframes returning-ink-twitch{
    0%,19%,100%{transform:none}
    4.5%{transform:scale(1.34,1.44)}
    6.5%{transform:translateX(.85px) rotate(-2deg) scale(1.38,1.46)}
    8.5%{transform:translateX(-.7px) rotate(2deg) scale(1.34,1.43)}
    10.5%{transform:translateX(.64px) rotate(-1.6deg) scale(1.36,1.44)}
    13%{transform:scale(1.20,1.24)}
  }
  @keyframes note-kanji-strokes{
    0%{clip-path:polygon(-10% -12%,-10% -12%,-10% -12%,-10% -12%)}
    26%{clip-path:polygon(-10% -12%,64% -12%,106% 24%,-10% 29%)}
    59%{clip-path:polygon(-10% -12%,110% -12%,110% 57%,-10% 67%)}
    100%{clip-path:polygon(-10% -12%,110% -12%,110% 116%,-10% 116%)}
  }
  @keyframes note-kana-strokes{
    0%{clip-path:polygon(-10% -12%,-10% -12%,-10% -12%,-10% -12%)}
    36%{clip-path:polygon(-10% -12%,110% -12%,77% 38%,-10% 38%)}
    69%{clip-path:polygon(-10% -12%,110% -12%,110% 62%,-10% 82%)}
    100%{clip-path:polygon(-10% -12%,110% -12%,110% 116%,-10% 116%)}
  }
}

@media(prefers-reduced-motion:reduce){
  .handwriting-returning > span{transform:scale(1.23,1.3);text-shadow:.85px .5px #30384e80}
}
