/* What arrives as it is scrolled to (js/reveal.js marks it "shown"), in the manner of the Planet of Lana
   site: a frame is painted in, a rough blot spreading from its middle; a scene's words grow into place
   and the mark under the heading draws itself. Each plays once. Without JavaScript, and with reduced
   motion, everything is simply there. */

/* ---- a frame painted in: sixteen steps of one sheet (tool/make_blot.py), used as a mask ---- */
@keyframes paint-in { 0.0% { -webkit-mask-position: 0.0% 0.0%; mask-position: 0.0% 0.0%; } 6.67% { -webkit-mask-position: 33.33% 0.0%; mask-position: 33.33% 0.0%; } 13.33% { -webkit-mask-position: 66.67% 0.0%; mask-position: 66.67% 0.0%; } 20.0% { -webkit-mask-position: 100.0% 0.0%; mask-position: 100.0% 0.0%; } 26.67% { -webkit-mask-position: 0.0% 33.33%; mask-position: 0.0% 33.33%; } 33.33% { -webkit-mask-position: 33.33% 33.33%; mask-position: 33.33% 33.33%; } 40.0% { -webkit-mask-position: 66.67% 33.33%; mask-position: 66.67% 33.33%; } 46.67% { -webkit-mask-position: 100.0% 33.33%; mask-position: 100.0% 33.33%; } 53.33% { -webkit-mask-position: 0.0% 66.67%; mask-position: 0.0% 66.67%; } 60.0% { -webkit-mask-position: 33.33% 66.67%; mask-position: 33.33% 66.67%; } 66.67% { -webkit-mask-position: 66.67% 66.67%; mask-position: 66.67% 66.67%; } 73.33% { -webkit-mask-position: 100.0% 66.67%; mask-position: 100.0% 66.67%; } 80.0% { -webkit-mask-position: 0.0% 100.0%; mask-position: 0.0% 100.0%; } 86.67% { -webkit-mask-position: 33.33% 100.0%; mask-position: 33.33% 100.0%; } 93.33% { -webkit-mask-position: 66.67% 100.0%; mask-position: 66.67% 100.0%; } 100.0% { -webkit-mask-position: 100.0% 100.0%; mask-position: 100.0% 100.0%; } }
html.js .painting[data-reveal], html.js .hill[data-reveal] { -webkit-mask: url("../assets/img/edge/blot.webp") 0% 0% / 400% 400% no-repeat; mask: url("../assets/img/edge/blot.webp") 0% 0% / 400% 400% no-repeat; }
html.js .painting[data-reveal].shown, html.js .hill[data-reveal].shown { animation: paint-in var(--paint-in) steps(1, end) forwards; }
/* once it is painted in, the mask is put away */
html.js .painting[data-reveal].settled, html.js .hill[data-reveal].settled { -webkit-mask: none; mask: none; animation: none; }

/* ---- a scene's words ---- */
@keyframes mark-in { from { transform: scaleX(0); opacity: 0; } }
@keyframes grow-in { from { transform: scale(0.86); opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
html.js .words[data-reveal]:not(.shown) > *, html.js .bench[data-reveal]:not(.shown), html.js .finds[data-reveal]:not(.shown) > * { opacity: 0; }
html.js .words[data-reveal].shown h2 { animation: grow-in var(--words-in) cubic-bezier(0.16, 1, 0.3, 1) both; }
html.js .words[data-reveal].shown h2::after { animation: mark-in var(--words-in) cubic-bezier(0.16, 1, 0.3, 1) 200ms both; }
html.js .words[data-reveal].shown p { animation: rise var(--words-in) cubic-bezier(0.16, 1, 0.3, 1) 260ms both; }
html.js .words[data-reveal].shown p + p { animation-delay: 420ms; }
html.js .bench[data-reveal].shown { animation: rise var(--words-in) cubic-bezier(0.16, 1, 0.3, 1) 300ms both; }
html.js .finds[data-reveal].shown > * { animation: rise var(--words-in) cubic-bezier(0.16, 1, 0.3, 1) both; }
html.js .finds[data-reveal].shown > :nth-child(2) { animation-delay: 140ms; }
html.js .finds[data-reveal].shown > :nth-child(3) { animation-delay: 280ms; }

/* what was already passed when the page loaded, or is shown because a script failed, is simply there */
html.js .words[data-reveal].settled > *, html.js .words[data-reveal].settled h2::after, html.js .bench[data-reveal].settled, html.js .finds[data-reveal].settled > * { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  html.js .painting[data-reveal], html.js .hill[data-reveal] { -webkit-mask: none; mask: none; animation: none !important; }
  html.js .words[data-reveal] > *, html.js .bench[data-reveal], html.js .finds[data-reveal] > * { opacity: 1 !important; animation: none !important; }
  html.js .words[data-reveal] h2::after { animation: none !important; }
}
