/* Mountain Standard's own preloader, the pig (pieces/ms-pig.js). Colours, sizes, curves and timings are the restaurant's own
   (Mountain Standard/preloader/preloader-template.txt); only the wrapper differs: it fills the case page's curtain instead of
   the whole window, starts when the page says so (.is-run), and rests finished (.is-static) for reduced motion and for a
   visitor who arrives at a part by a link. Left out: the loop that runs while a slow page loads. */
.sbx .mspl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #141312; }
.sbx .mspl::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(60% 55% at 50% 52%, rgba(184, 89, 41, .13) 0%, rgba(184, 89, 41, 0) 70%); }
.sbx .mspl-stage { position: relative; display: flex; align-items: center; justify-content: center; will-change: transform; }
.sbx .mspl-pig { display: block; position: relative; width: min(360px, 64vw); height: auto; overflow: visible; }

/* before it starts: nothing drawn yet */
.sbx .mspl-o path { fill: #f3ede4; fill-opacity: 0; stroke: #f3ede4; stroke-width: .32; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.sbx .mspl-c path { fill: #d2814a; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.15); }
.sbx .mspl-n path { fill: #f3ede4; opacity: 0; transform: translateY(1.4px); }

/* 1. the engraver draws the outline, then the line art fills. 2. the cuts are scored, dash by dash. 3. the cut numbers land. */
.sbx .mspl.is-run::before { animation: msplWarm 1.1s ease .1s forwards; }
.sbx .mspl.is-run .mspl-o path { animation: msplDraw .65s cubic-bezier(.45, 0, .2, 1) .05s forwards, msplFill .3s ease .5s forwards; }
.sbx .mspl.is-run .mspl-c path { animation: msplScore .22s cubic-bezier(.2, .8, .2, 1) var(--d) forwards; }
.sbx .mspl.is-run .mspl-n path { animation: msplNum .3s cubic-bezier(.2, .8, .2, 1) var(--d) forwards; }
@keyframes msplWarm { to { opacity: 1; } }
@keyframes msplDraw { to { stroke-dashoffset: 0; } }
@keyframes msplFill { to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes msplScore { 0% { opacity: 0; transform: scale(.15); fill: #ffd2a8; } 60% { opacity: 1; fill: #f0a46a; } 100% { opacity: 1; transform: none; fill: #d2814a; } }
@keyframes msplNum { to { opacity: .88; transform: none; } }

/* finished and still */
.sbx .mspl.is-static::before { opacity: 1; }
.sbx .mspl.is-static .mspl-o path { stroke: none; fill-opacity: 1; }
.sbx .mspl.is-static .mspl-c path { opacity: 1; transform: none; }
.sbx .mspl.is-static .mspl-n path { opacity: .88; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .sbx .mspl::before { animation: none !important; opacity: 1; }
  .sbx .mspl .mspl-o path, .sbx .mspl .mspl-c path, .sbx .mspl .mspl-n path { animation: none !important; }
  .sbx .mspl .mspl-o path { stroke: none; fill-opacity: 1; }
  .sbx .mspl .mspl-c path { opacity: 1; transform: none; }
  .sbx .mspl .mspl-n path { opacity: .88; transform: none; }
}
