/* ============================================================================
   Stock the Block — the four process scenes (collect, pack, walk, post)
   Shared by the home page's Our Process stepper and tracking.html. The
   drawings themselves are built by STB.processScene in assets/site.js.
   A scene animates only where --play is set to running on it.
   ============================================================================ */
/* ---------- Our Process: the stage scenes ----------
 One small scene per stage, starring the mascot box (built by
 STB.processScene in site.js; the stepper around them is styled in design.css). Every colour is a theme
 token, so the scenes switch with light / dark / stock. A scene only
 animates while its stage is the current one, and reduced motion shows
 each scene's still frame. */
.scene {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  --play: paused;
}

.sc-table {
  fill: var(--brand-line-mid);
}

.sc-leg,
.sc-ground {
  stroke: var(--brand-line-mid);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
}

.sc-apple circle {
  fill: #D9534F;
  stroke: var(--mascot-stroke);
  stroke-width: 2;
}

.sc-apple .leaf {
  fill: var(--brand);
}

.sc-apple .stem,
.sc-banana .tip {
  stroke: var(--mascot-stroke);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.sc-banana path.fruit {
  fill: #F2C14E;
  stroke: var(--mascot-stroke);
  stroke-width: 2;
  stroke-linejoin: round;
}

.sc-tape,
.sc-spark,
.sc-packet {
  fill: var(--accent);
}

.sc-thermo .tube {
  fill: var(--bg);
  stroke: var(--text-secondary);
  stroke-width: 2;
}

.sc-thermo .bulb,
.sc-thermo .mercury {
  fill: var(--accent);
}

.sc-ice rect {
  fill: var(--ice-soft);
  stroke: var(--ice);
  stroke-width: 2;
}

.sc-ice path,
.sc-flakes path {
  stroke: var(--ice);
  stroke-width: 1.8;
  stroke-linecap: round;
  fill: none;
}

.sc-readout {
  font-family: 'DM Mono', ui-monospace, Menlo, monospace;
  font-size: 8.5px;
  fill: var(--on-brand);
  text-anchor: middle;
}

.sc-scale {
  fill: var(--brand);
}

.sc-walker .limb {
  stroke: var(--mascot-stroke);
  stroke-width: 3.2;
  stroke-linecap: round;
  fill: none;
}

.sc-walker .head {
  fill: var(--bg);
  stroke: var(--mascot-stroke);
  stroke-width: 2.6;
}

.sc-bank .wall {
  fill: var(--bg);
  stroke: var(--mascot-stroke);
  stroke-width: 2;
}

.sc-bank .roof {
  fill: var(--brand);
}

.sc-bank .door {
  fill: var(--brand-line-mid);
}

.sc-bank .heart {
  fill: var(--accent);
}

.sc-check circle {
  fill: var(--brand);
}

.sc-check path {
  stroke: var(--on-brand);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sc-screen .win {
  fill: var(--bg);
  stroke: var(--mascot-stroke);
  stroke-width: 2;
}

.sc-screen .bar {
  stroke: var(--brand-line-mid);
  stroke-width: 1.5;
}

.sc-screen .dot,
.sc-screen .base {
  fill: var(--brand-line-mid);
}

.sc-rows rect {
  fill: var(--line);
}

.sc-row-new .hi {
  fill: color-mix(in srgb, var(--brand) 16%, transparent);
}

.sc-row-new .ln {
  fill: var(--brand-line-mid);
}

.sc-row-new path {
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sc-plus {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 800;
  font-size: 12px;
  fill: var(--accent-text);
}

/* Still frames (the base styles) are what reduced motion shows; the
 keyframes below animate away from and back to them on a loop. */
.sc-tape,
.sc-spark,
.sc-check,
.sc-packet,
.sc-plus {
  opacity: 0;
}

.sc-tape {
  transform-box: fill-box;
  transform-origin: left center;
}

.sc-spark,
.sc-check,
.sc-plus,
.sc-flakes path {
  transform-box: fill-box;
  transform-origin: center;
}

.sc-thermo .mercury {
  transform-box: fill-box;
  transform-origin: center bottom;
}

.sc-walker .leg {
  transform-box: fill-box;
  transform-origin: center top;
}

.sc-collect [data-lid-g] {
  animation: lidCollect 6s ease-in-out infinite;
}

.sc-collect .sc-apple {
  animation: appleIn 6s ease-in-out infinite;
}

.sc-collect .sc-banana {
  animation: bananaIn 6s ease-in-out infinite;
}

.sc-collect .sc-tape {
  animation: tapeOn 6s ease-in-out infinite;
}

.sc-collect .sc-spark {
  animation: sparkPop 6s ease-out infinite;
}

.sc-collect .sc-box {
  animation: boxHop 6s ease-in-out infinite;
}

@keyframes lidCollect {

  0%,
  4% {
    transform: translateY(0) rotate(0deg);
  }

  10%,
  58% {
    transform: translateY(-9px) rotate(-13deg);
  }

  64%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes appleIn {

  0%,
  12% {
    transform: translate(0, 0);
    opacity: 1;
  }

  21% {
    transform: translate(42px, -96px);
  }

  29% {
    transform: translate(84px, -80px);
  }

  35% {
    transform: translate(84px, -30px);
    opacity: 1;
  }

  36%,
  90% {
    transform: translate(84px, -30px);
    opacity: 0;
  }

  91% {
    transform: translate(0, 0);
    opacity: 0;
  }

  97%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}

@keyframes bananaIn {

  0%,
  30% {
    transform: translate(0, 0);
    opacity: 1;
  }

  39% {
    transform: translate(-42px, -96px);
  }

  47% {
    transform: translate(-86px, -78px);
  }

  53% {
    transform: translate(-86px, -30px);
    opacity: 1;
  }

  54%,
  90% {
    transform: translate(-86px, -30px);
    opacity: 0;
  }

  91% {
    transform: translate(0, 0);
    opacity: 0;
  }

  97%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}

@keyframes tapeOn {

  0%,
  64% {
    opacity: 0;
    transform: scaleX(0);
  }

  65% {
    opacity: 1;
    transform: scaleX(0);
  }

  71%,
  90% {
    opacity: 1;
    transform: scaleX(1);
  }

  96%,
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes sparkPop {

  0%,
  70% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
  }

  75% {
    opacity: 1;
    transform: scale(1.1) rotate(20deg);
  }

  86% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }

  92%,
  100% {
    opacity: 0;
    transform: scale(0.6) rotate(60deg);
  }
}

@keyframes boxHop {

  0%,
  70% {
    transform: translateY(0);
  }

  74% {
    transform: translateY(-5px);
  }

  78%,
  100% {
    transform: translateY(0);
  }
}

.sc-pack [data-lid-g] {
  animation: lidPack 6s ease-in-out infinite;
}

.sc-pack .sc-ice {
  animation: iceIn 6s ease-in-out infinite;
}

.sc-pack .sc-thermo .mercury {
  animation: mercuryCool 6s ease-in-out infinite;
}

.sc-pack .sc-thermo .bulb {
  animation: bulbCool 6s ease-in-out infinite;
}

.sc-pack .sc-flakes path {
  animation: flakeTwinkle 6s ease-in-out infinite;
}

.sc-pack .sc-box {
  animation: boxShiver 6s linear infinite;
}

@keyframes lidPack {

  0%,
  6% {
    transform: translateY(0) rotate(0deg);
  }

  12%,
  40% {
    transform: translateY(-9px) rotate(-13deg);
  }

  46%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes iceIn {

  0%,
  14% {
    transform: translate(0, 0);
    opacity: 1;
  }

  23% {
    transform: translate(-44px, -98px);
  }

  31% {
    transform: translate(-88px, -80px);
  }

  37% {
    transform: translate(-88px, -32px);
    opacity: 1;
  }

  38%,
  90% {
    transform: translate(-88px, -32px);
    opacity: 0;
  }

  91% {
    transform: translate(0, 0);
    opacity: 0;
  }

  97%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}

@keyframes mercuryCool {

  0%,
  44% {
    transform: scaleY(1);
    fill: var(--accent);
  }

  60%,
  88% {
    transform: scaleY(0.4);
    fill: var(--ice);
  }

  98%,
  100% {
    transform: scaleY(1);
    fill: var(--accent);
  }
}

@keyframes bulbCool {

  0%,
  44% {
    fill: var(--accent);
  }

  60%,
  88% {
    fill: var(--ice);
  }

  98%,
  100% {
    fill: var(--accent);
  }
}

@keyframes flakeTwinkle {

  0%,
  46% {
    opacity: 0;
    transform: scale(0.3) rotate(0deg);
  }

  54% {
    opacity: 1;
    transform: scale(1.1) rotate(30deg);
  }

  70% {
    opacity: 0.7;
    transform: scale(0.9) rotate(60deg);
  }

  82% {
    opacity: 1;
    transform: scale(1) rotate(90deg);
  }

  92%,
  100% {
    opacity: 0;
    transform: scale(0.4) rotate(120deg);
  }
}

@keyframes boxShiver {

  0%,
  48% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-1.5px);
  }

  52% {
    transform: translateX(1.5px);
  }

  54% {
    transform: translateX(-1.5px);
  }

  56% {
    transform: translateX(1.5px);
  }

  58%,
  100% {
    transform: translateX(0);
  }
}

.sc-walk .sc-walker {
  animation: walkAcross 6s ease-in-out infinite;
}

.sc-walk .leg-a {
  animation: legSwing 0.5s ease-in-out infinite alternate;
}

.sc-walk .leg-b {
  animation: legSwing 0.5s ease-in-out infinite alternate-reverse;
}

.sc-walk .sc-check {
  animation: checkPop 6s ease-out infinite;
}

@keyframes walkAcross {
  0% {
    transform: translateX(0);
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  60%,
  86% {
    transform: translateX(104px);
    opacity: 1;
  }

  92%,
  100% {
    transform: translateX(104px);
    opacity: 0;
  }
}

@keyframes legSwing {
  from {
    transform: rotate(-24deg);
  }

  to {
    transform: rotate(24deg);
  }
}

@keyframes checkPop {

  0%,
  62% {
    opacity: 0;
    transform: scale(0.3);
  }

  68% {
    opacity: 1;
    transform: scale(1.15);
  }

  72%,
  86% {
    opacity: 1;
    transform: scale(1);
  }

  92%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.sc-post .sc-packet {
  animation: packetFly 6s ease-in-out infinite;
}

.sc-post .sc-rows {
  animation: rowsShift 6s ease-in-out infinite;
}

.sc-post .sc-row-new {
  animation: rowIn 6s ease-out infinite;
}

.sc-post .sc-plus {
  animation: plusPop 6s ease-out infinite;
}

.sc-post .sc-box {
  animation: boxCheer 6s ease-in-out infinite;
}

@keyframes packetFly {

  0%,
  6% {
    opacity: 0;
    transform: translate(0, 0);
  }

  10% {
    opacity: 1;
    transform: translate(0, 0);
  }

  22% {
    transform: translate(22px, -28px);
  }

  32% {
    opacity: 1;
    transform: translate(48px, -8px);
  }

  36%,
  100% {
    opacity: 0;
    transform: translate(48px, -8px);
  }
}

@keyframes rowsShift {

  0%,
  32% {
    transform: translateY(-17px);
  }

  40%,
  90% {
    transform: translateY(0);
  }

  97%,
  100% {
    transform: translateY(-17px);
  }
}

@keyframes rowIn {

  0%,
  34% {
    opacity: 0;
  }

  42%,
  90% {
    opacity: 1;
  }

  96%,
  100% {
    opacity: 0;
  }
}

@keyframes plusPop {

  0%,
  42% {
    opacity: 0;
    transform: translateY(4px) scale(0.6);
  }

  48% {
    opacity: 1;
    transform: translateY(-2px) scale(1.1);
  }

  54%,
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  92%,
  100% {
    opacity: 0;
    transform: translateY(-6px) scale(1);
  }
}

@keyframes boxCheer {

  0%,
  44% {
    transform: translateY(0);
  }

  49% {
    transform: translateY(-7px);
  }

  54% {
    transform: translateY(0);
  }

  58% {
    transform: translateY(-4px);
  }

  62%,
  100% {
    transform: translateY(0);
  }
}

/* Every scene animation pauses while its step is off screen. Placed last so
 it wins over the shorthands above. */
.scene * {
  animation-play-state: var(--play) !important;
  animation-delay: var(--d, 0s) !important;
}
