/* Paper and ink (layer/particles/090), INV-02 Love Letters stage 2 (A2324). Every "before" state is under html.pa090-on, so
   the page without the script is the finished page. Everything ends at no transform, so nothing rests on its own layer on an
   iPhone (AG-T347), and CSS transitions leave nothing behind (AG-T332). */
.pa090 { display: none; }
html.pa090-on { --pa090-part: 1600ms; --pa090-ease: cubic-bezier(.45, .05, .35, 1); }

/* A photo: two sheets of the page cover it, their torn edges together across the middle, then they slide apart and the picture
   settles behind them (A2372). Only transforms move, so the phone's graphics chip runs it and the page's script can't stall it.
   A photo's own tear is its sheet's edge and lands where it rests; an edge with no tear of its own gets a sheet that leaves. */
html.pa090-on .pa090-ph { background: transparent; --pa090-t: calc(var(--k-ll-strip) * .145); }
html.pa090-on .pa090-ph > img { transition: transform 2100ms cubic-bezier(.22, .6, .2, 1); }
html.pa090-on .pa090-ph:not(.is-in) > img { transform: scale(1.05); }
html.pa090-on .pa090-ph > .k-ll-tear { transition: transform var(--pa090-part) var(--pa090-ease); }
html.pa090-on .pa090-ph:not(.is-in) > .k-ll-tear--dn { transform: translateY(calc(var(--pa090-h) / 2 - calc(var(--k-ll-s) * .145) * .55)); }
html.pa090-on .pa090-ph:not(.is-in) > .k-ll-tear--up { transform: translateY(calc(var(--pa090-h) / -2 + calc(var(--k-ll-s) * .145) * .55)); }
html.pa090-on .pa090-ph > .k-ll-tear::before { content: ""; position: absolute; left: 0; right: 0; height: calc(var(--pa090-h) * .6); background: var(--k-paper); }
html.pa090-on .pa090-ph > .k-ll-tear--dn::before { bottom: calc(100% - 1px); }
html.pa090-on .pa090-ph > .k-ll-tear--up::before { top: calc(100% - 1px); }
html.pa090-on .pa090-ph.is-in > .k-ll-tear::before { visibility: hidden; transition: visibility 0s linear var(--pa090-part); }
html.pa090-on .pa090-ph:not(:has(> .k-ll-tear--dn))::before, html.pa090-on .pa090-ph:not(:has(> .k-ll-tear--up))::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0;
  height: calc(var(--pa090-h) / 2 + var(--pa090-t) * .45); pointer-events: none; transition: transform var(--pa090-part) var(--pa090-ease), visibility 0s linear var(--pa090-part); }
html.pa090-on .pa090-ph:not(:has(> .k-ll-tear--dn))::before { top: 0; background: linear-gradient(var(--k-paper) 0 0) top / 100% calc(100% - var(--pa090-t) + 1px) no-repeat,
  var(--k-ll-dn) 30% bottom / max(var(--k-ll-strip), 100%) var(--pa090-t) no-repeat; }
html.pa090-on .pa090-ph:not(:has(> .k-ll-tear--up))::after { bottom: 0; background: linear-gradient(var(--k-paper) 0 0) bottom / 100% calc(100% - var(--pa090-t) + 1px) no-repeat,
  var(--k-ll-up) 62% top / max(var(--k-ll-strip), 100%) var(--pa090-t) no-repeat; }
html.pa090-on .pa090-ph.is-in::before { transform: translateY(-101%); visibility: hidden; }
html.pa090-on .pa090-ph.is-in::after { transform: translateY(101%); visibility: hidden; }

/* A title: the big word settles; the script word is written, left to right, once it has landed. */
html.pa090-on .k-ll-ttl .k-ll-big { transition: opacity .8s ease, transform 1s var(--k-ease); }
html.pa090-on .k-ll-ttl:not(.is-in) .k-ll-big { opacity: 0; transform: translateY(16px); }
html.pa090-on .k-ll-ttl .k-ll-scr, html.pa090-on .cd090__t .cd090__s { clip-path: inset(-40% -8% -40% -8%); transition: clip-path .95s cubic-bezier(.45, 0, .3, 1) .28s; }
html.pa090-on .k-ll-ttl:not(.is-in) .k-ll-scr, html.pa090-on .cd090__t:not(.is-in) .cd090__s { clip-path: inset(-40% 108% -40% -8%); }

/* Big words and the sheet with the formal words: a quiet settle. */
html.pa090-on :is(.dt090__big, .cl090__big, .rs090__title, .st090__q, .vn090-card__name, .dc090-card__who, .rs090__s) { transition: opacity .8s ease, transform 1s var(--k-ease); }
html.pa090-on :is(.dt090__big, .cl090__big, .rs090__title, .st090__q, .vn090-card__name, .dc090-card__who, .rs090__s):not(.is-in) { opacity: 0; transform: translateY(16px); }
html.pa090-on .iv090__note { transition: opacity .9s ease .1s, transform 1.1s var(--k-ease) .1s; }
html.pa090-on .iv090__note:not(.is-in) { opacity: 0; transform: translateY(26px); }

/* The thread draws itself to each stop, once; the dot lands, then the words arrive. It never undraws. */
html.pa090-on .ev090-ev .ev090-ev__line { transition: transform .8s cubic-bezier(.45, 0, .3, 1); }
html.pa090-on .ev090-ev:not(.is-in) .ev090-ev__line { transform: scaleY(0); }
html.pa090-on .ev090-ev .ev090-ev__dot { transition: transform .5s cubic-bezier(.3, 1.5, .5, 1) .55s; }
html.pa090-on .ev090-ev:not(.is-in) .ev090-ev__dot { transform: scale(0); }
html.pa090-on .ev090-ev > :is(p, div) { transition: opacity .8s ease .55s, transform 1s var(--k-ease) .55s; }
html.pa090-on .ev090-ev:not(.is-in) > :is(p, div) { opacity: 0; transform: translateY(14px); }
html.pa090-on :is(.ev090-gap, .ev090-rip__w) { clip-path: inset(-40% -8% -40% -8%); transition: clip-path .85s cubic-bezier(.45, 0, .3, 1) .3s; }
html.pa090-on .ev090-ev:not(.is-in) .ev090-gap, html.pa090-on .ev090-rip:not(.is-in) + .ev090-rip__w { clip-path: inset(-40% 108% -40% -8%); }

/* Between two days the page is whole, then it tears open from the middle, once; the words follow. */
html.pa090-on .ev090-rip__slit { clip-path: inset(0); transition: clip-path var(--pa090-part) var(--pa090-ease); } /* a named end: "none" can't be eased to */
html.pa090-on .ev090-rip:not(.is-in) .ev090-rip__slit { clip-path: inset(50% 0); }
html.pa090-on .ev090-rip__w { transition-delay: .7s; }
@media (min-width: 980px) {
  html.pa090-on .ev090-ev:not(.is-in) .ev090-ev__line { transform: scaleX(0); }
}

/* The countdown starts as dashes; the real numbers arrive once, and never shuffle. */
html.pa090-on .cd090__timer:not(.is-in) .kjy-unit__n { position: relative; color: transparent; }
html.pa090-on .cd090__timer:not(.is-in) .kjy-unit__n::after { content: "–"; position: absolute; inset: 0; text-align: center; color: var(--k-ghost); }
html.pa090-on .cd090__timer.is-in .kjy-unit__n { animation: pa090-num .65s ease-out backwards; }
html.pa090-on .cd090__timer.is-in .kjy-unit:nth-child(2) .kjy-unit__n { animation-delay: .1s; }
html.pa090-on .cd090__timer.is-in .kjy-unit:nth-child(3) .kjy-unit__n { animation-delay: .2s; }
html.pa090-on .cd090__timer.is-in .kjy-unit:nth-child(4) .kjy-unit__n { animation-delay: .3s; }
@keyframes pa090-num { from { opacity: 0; transform: translateY(.14em); } }
