/* Animated footer scene (gap C4). Markup: components/footer_scene.html. Behaviour: js/footer-scene.js.
   Default (no class) = the finished still picture. .sc-armed = JS will animate; .sc-pending = before arrival;
   .sc-go = arrival running/done; .sc-off = off screen; .sc-paused = visitor pressed Pause. */
.sc-wrap{position:relative;display:flex;flex-direction:column}
.sc-scene{position:relative;height:clamp(130px,13vw,220px);overflow:hidden;line-height:0;
  background:linear-gradient(#1A1A1A,#1A1A1A)}
.sc-scene svg{display:block;width:100%;height:100%}

.sc-rail{stroke:#C4A574;stroke-opacity:.55;stroke-width:1.2}
.sc-cord{stroke:#C4A574;stroke-opacity:.7;stroke-width:1}
.sc-plate{fill:url(#sc-gold);stroke:#F6E3B8;stroke-opacity:.55;stroke-width:1.2}
.sc-cut{stroke:#1A1A1A;stroke-width:3.2;stroke-linecap:round;fill:#1A1A1A}
path.sc-cut,.sc-cut[fill=none]{fill:none}
.sc-notch{stroke:#1A1A1A;stroke-width:3;stroke-linecap:round;fill:none}
.sc-knob{stroke:#fff;stroke-opacity:.35;stroke-width:1}
.sc-knob-pink{fill:#E86A9E}.sc-knob-teal{fill:#3BA7A0}.sc-knob-plum{fill:#9A3F8A}
.sc-glint{fill:url(#sc-glint);opacity:0}
.sc-flecks path{fill:#E9C98B;opacity:.55}
.sc-rays path{fill:url(#sc-gold-ray)}
.sc-disc{fill:#1A1A1A;stroke:url(#sc-gold-ray);stroke-width:3}
.sc-ring{fill:none;stroke:#E0A060;stroke-width:1.5}
.sc-s{fill:#E8B072;font-family:var(--font-heading,'Playfair Display'),Georgia,serif;font-size:52px;font-weight:700}

/* transform targets: SVG CSS transforms work in the user space of the group */
.sc-drop,.sc-swing,.sc-rays,.sc-medal{transform-box:fill-box}
.sc-swing{transform-origin:50% 0}
.sc-rays{transform-origin:50% 50%}
.sc-medal{transform-origin:50% 50%}

/* ---- arrival (about 2 s), only once JS armed the scene ---- */
.sc-armed.sc-pending .sc-drop{transform:translate(var(--sc-sx,0),-170px);opacity:0}
.sc-armed.sc-pending .sc-rays{transform:scale(.35) rotate(-40deg);opacity:0}
.sc-armed.sc-pending .sc-disc,.sc-armed.sc-pending .sc-ring,.sc-armed.sc-pending .sc-s{opacity:0}
.sc-armed.sc-pending .sc-rail{stroke-dasharray:1320;stroke-dashoffset:1320}
.sc-armed.sc-pending .sc-flecks{opacity:0}

.sc-armed.sc-go .sc-rail{stroke-dasharray:1320;stroke-dashoffset:0;transition:stroke-dashoffset .7s cubic-bezier(.3,.6,.2,1)}
.sc-armed.sc-go .sc-drop{transition:transform 1.15s cubic-bezier(.2,.9,.25,1.12) calc(.25s + var(--sc-d,0s)),opacity .4s ease-out calc(.25s + var(--sc-d,0s))}
.sc-armed.sc-go .sc-rays{transition:transform 1.1s cubic-bezier(.2,.8,.2,1) .55s,opacity .5s ease-out .55s}
.sc-armed.sc-go .sc-disc,.sc-armed.sc-go .sc-ring{transition:opacity .5s ease-out 1.1s}
.sc-armed.sc-go .sc-s{transition:opacity .5s ease-out 1.35s}
.sc-armed.sc-go .sc-flecks{transition:opacity .8s ease-out 1.2s}
.sc-armed.sc-go .sc-medal-glint{animation:sc-glint .8s ease-in-out 1.75s 1 both}

/* ---- irregular life after arrival (classes added by the scheduler) ---- */
.sc-armed.sc-live .sc-rays{animation:sc-turn 90s linear infinite}
.sc-armed.sc-live .sc-flecks path{animation:sc-tw var(--sc-t,5s) ease-in-out var(--sc-o,0s) infinite}
.sc-piece.sc-do-glint .sc-glint{animation:sc-glint .9s ease-in-out 1 both}
.sc-piece.sc-do-swing .sc-swing{animation:sc-swing 2.4s ease-in-out 1}
.sc-medal.sc-do-glint .sc-medal-glint{animation:sc-glint .9s ease-in-out 1 both}
.sc-medal.sc-do-pulse{animation:sc-pulse 1.6s ease-in-out 1}

@keyframes sc-glint{0%{opacity:0;transform:translateX(0) skewX(-20deg)}20%{opacity:.9}80%{opacity:.9}100%{opacity:0;transform:translateX(120px) skewX(-20deg)}}
@keyframes sc-swing{0%,100%{transform:rotate(0)}20%{transform:rotate(4deg)}45%{transform:rotate(-3deg)}70%{transform:rotate(1.5deg)}}
@keyframes sc-turn{to{transform:rotate(360deg)}}
@keyframes sc-tw{0%,100%{opacity:.25}50%{opacity:.95}}
@keyframes sc-pulse{0%,100%{transform:scale(1)}40%{transform:scale(1.045)}}

/* paused by the visitor, or off screen: everything holds where it is */
.sc-paused *,.sc-off *,.sc-paused,.sc-off{animation-play-state:paused!important}

/* Pause control: outside the aria-hidden scene, 44px target, visible focus */
.sc-pause{align-self:flex-end;margin:.5rem max(1rem,env(safe-area-inset-right)) 0 0;display:inline-flex;align-items:center;gap:.4rem;
  min-height:44px;min-width:44px;padding:.45rem .8rem;border-radius:9999px;border:1px solid rgba(196,165,116,.6);
  background:rgba(26,26,26,.82);color:#E9D3A6;font:500 .8125rem/1 var(--font-body,Inter),system-ui,sans-serif;cursor:pointer}
.sc-pause:hover{border-color:#C4A574;color:#fff}
.sc-pause:focus-visible{outline:2px solid #F0D49A;outline-offset:2px}
.sc-pause[hidden]{display:none}
.sc-pause-icon path{fill:currentColor}
.sc-pause .sc-i-play{display:none}
.sc-pause[aria-pressed=true] .sc-i-pause{display:none}
.sc-pause[aria-pressed=true] .sc-i-play{display:inline}

@media (prefers-reduced-motion:reduce){
  .sc-scene *{animation:none!important;transition:none!important}
  .sc-pause{display:none}
}
