/* The signature: a paint line down the page and the bomb that rolls along it. Built by src/trail.js. */
.trail { position: absolute; left: 0; top: 0; width: 100%; z-index: 1; pointer-events: none; overflow: hidden; }
.trail__piece { position: absolute; left: 0; display: block; }
.trail__ruler { position: absolute; visibility: hidden; }
.trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trail__guide { stroke: rgb(255 255 255 / .38); stroke-width: 5; stroke-dasharray: 2 18; }
.trail__paint { stroke: var(--accent); stroke-width: 13; }

.roller { --size: 120px; position: fixed; left: 0; top: 0; z-index: 3; width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2); pointer-events: none; will-change: transform; }
.roller--still { position: absolute; }
.roller svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.roller__bomb { transform-origin: 50% 56.7%; }
.roller__burst { opacity: 0; transform: scale(.4); }
/* after the bang the bomb is gone and nothing is left behind, so the footer's address stays readable */
.roller--gone .roller__bomb { opacity: 0; }

/* the bang itself, comic-book style: three stacked bursts, the word, smoke puffs and a spray of bits */
.boomsky { position: absolute; left: 0; top: 0; width: 100%; z-index: 4; overflow: clip; pointer-events: none; }
.boom { --u: 1; position: absolute; width: 0; height: 0; pointer-events: none; }
.boom > * { position: absolute; display: block; opacity: 0; }
.boom__star { --d: calc(760px * var(--u)); left: calc(var(--d) / -2); top: calc(var(--d) / -2); width: var(--d); height: var(--d); overflow: visible; animation: star 1500ms cubic-bezier(.34, 1.56, .64, 1) var(--wait) both; }
.boom__star polygon { stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.boom__star--red polygon { fill: var(--red); }
.boom__star--orange { --d: calc(560px * var(--u)); }
.boom__star--orange polygon { fill: var(--orange); stroke-width: 4; }
.boom__star--white { --d: calc(340px * var(--u)); }
.boom__star--white polygon { fill: var(--light); stroke-width: 6; }
.boom__puff { --s: calc(var(--size) * var(--u)); left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s); border-radius: 50%; background: var(--paper); border: calc(5px * var(--u) + 1px) solid var(--ink); animation: puff 1300ms var(--ease-out) var(--wait) both; }
.boom__bit { left: -14px; top: -14px; width: calc(28px * var(--u)); height: calc(28px * var(--u)); background: var(--accent); border: 4px solid var(--ink); animation: bit 1250ms var(--ease-out) both; }
.boom__bit--1 { background: var(--orange); border-radius: 50%; }
.boom__bit--2 { background: var(--light); }
.boom__bit--3 { background: var(--red); width: calc(44px * var(--u)); height: calc(18px * var(--u)); }
.boom__word { left: var(--shift); top: var(--lift); translate: -50% -50%; font: 600 calc(10.5rem * var(--u))/1 var(--font); letter-spacing: -0.04em; text-transform: uppercase; white-space: nowrap; color: var(--accent); -webkit-text-stroke: calc(22px * var(--u)) var(--ink); paint-order: stroke fill; animation: word 1500ms cubic-bezier(.34, 1.56, .64, 1) 90ms both; }
.boom__word::before { content: "BOOM!"; }
@keyframes star { 0% { opacity: 1; transform: scale(.15) rotate(calc(var(--turn) - 40deg)); } 22% { opacity: 1; transform: scale(1.08) rotate(var(--turn)); } 30%, 70% { opacity: 1; transform: scale(1) rotate(var(--turn)); } 100% { opacity: 0; transform: scale(1.25) rotate(calc(var(--turn) + 12deg)); } }
@keyframes word { 0% { opacity: 1; transform: scale(.2) rotate(-24deg); } 20% { opacity: 1; transform: scale(1.15) rotate(-7deg); } 28%, 74% { opacity: 1; transform: scale(1) rotate(-7deg); } 100% { opacity: 0; transform: scale(1.5) rotate(-4deg); } }
@keyframes puff { 0% { opacity: 1; transform: translate(0, 0) scale(.3); } 35% { opacity: 1; transform: translate(calc(var(--dx) * var(--u) * .8), calc(var(--dy) * var(--u) * .8)) scale(1.1); } 100% { opacity: 0; transform: translate(calc(var(--dx) * var(--u)), calc(var(--dy) * var(--u) - 70px)) scale(1.5); } }
@keyframes bit { 0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1.3); } 65% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--dx) * var(--u)), calc(var(--dy) * var(--u) + 160px)) rotate(var(--spin)) scale(.6); } }

/* and the whole screen jolts */
html { overflow-x: clip; }   /* the jolt and the flying bits must not widen the page */
body.shake { animation: shake 820ms linear; }
@keyframes shake {
  0% { transform: translate(0, 0); } 6% { transform: translate(-30px, 20px) rotate(-1.1deg); } 14% { transform: translate(28px, -24px) rotate(1deg); }
  23% { transform: translate(-24px, -14px) rotate(-.8deg); } 32% { transform: translate(22px, 18px) rotate(.7deg); } 42% { transform: translate(-17px, 12px) rotate(-.5deg); }
  53% { transform: translate(13px, -10px) rotate(.3deg); } 65% { transform: translate(-9px, 6px); } 77% { transform: translate(6px, -4px); } 89% { transform: translate(-3px, 2px); } 100% { transform: translate(0, 0); }
}

.roller__burst polygon { fill: var(--orange); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.roller .ball { fill: #1d1d1f; stroke: var(--ink); stroke-width: 6; }
.roller .cap { fill: #2c2c2f; stroke: var(--ink); stroke-width: 5; }
.roller .shine { fill: var(--light); }
/* a sticker edge, so the black bomb reads on the black sections too */
.roller .halo { fill: var(--light); }
.roller .halo--line { fill: none; stroke: var(--light); stroke-width: 19; stroke-linecap: round; }
.roller .fuse { fill: none; stroke-linecap: round; }
.roller .fuse--edge { stroke: var(--ink); stroke-width: 11; }
.roller .fuse--rope { stroke: #efe6cf; stroke-width: 5.5; }
.roller .flame path { fill: var(--orange); stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; transform-origin: 0 4px; animation: flick 420ms steps(2, end) infinite; }
@keyframes flick { 50% { transform: scale(1.25, .85) rotate(8deg); } }

/* content rides above the line; the bomb rides above the content */
.hero__text > *, .ticker__run, .panel__row, .rackwall > *, .shack > *, .deal > *, .end > * { position: relative; z-index: 2; }
.panel__tag, .coupon { z-index: 2; }

/* section headings: each one gets a swipe of paint when the bomb reaches it */
.stop { position: relative; display: inline-block; isolation: isolate; }
.stop::after { content: ""; position: absolute; z-index: -1; left: -.14em; right: -.14em; bottom: .04em; height: .44em; background: var(--paint, var(--accent)); rotate: -1.2deg; transform-origin: 0 50%; transition: transform 520ms var(--ease-out); }
.trail-on .stop:not(.lit)::after { transform: scaleX(0); }
.rackwall .stop { --paint: var(--red); }
.deal .stop, .coupon .stop { --paint: var(--light); }

@media (max-width: 900px) {
  .roller { --size: 54px; }
  .boom { --u: .46; }
  .trail__paint { stroke-width: 8; }
  .trail__guide { stroke-width: 4; }
}
@media (prefers-reduced-motion: reduce) {
  .roller .flame path { animation: none; }
  body.shake, .boom > * { animation: none; }
  .stop::after { transition: none; }
}
