/* GDV Underground — "the forge" (2026-10-30, Jimmy Thomas: "pages with steps to light up, the boxes, the steps").
   Loaded AFTER polish.css. Every step and every box starts as cold steel; as it scrolls into view it is struck:
   white-hot flash, a charge bar runs across the top, sparks fly, then it cools to a lit ice-blue glow and a
   current keeps travelling through the sequence. Armed only when forge.js runs (html.fg-js); without it nothing dims. */

:root{--fg-hot:255,150,90;--fg-ice:143,211,255}

/* ───────── cold steel until struck ───────── */
.fg-js .fg-item{position:relative;transition:filter .7s ease,border-color .5s,box-shadow .6s,transform .35s cubic-bezier(.2,.8,.2,1)}
.fg-js .fg-item:not(.fg-on){filter:brightness(.74) saturate(.7)}

/* ───────── the metal plate: brushed grain, bevel, rivets ───────── */
.fg-skin{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;border-radius:inherit;
  background:radial-gradient(120% 90% at 50% 0%,rgba(var(--fg-hot),0),transparent 70%)}
.fg-skin::after{content:"";position:absolute;inset:0;
  background:
    radial-gradient(circle at 10px 10px,rgba(255,255,255,.6) 0 1.2px,rgba(0,0,0,.55) 1.8px 3.4px,transparent 4px) 0 0/20px 20px no-repeat,
    radial-gradient(circle at 10px 10px,rgba(255,255,255,.6) 0 1.2px,rgba(0,0,0,.55) 1.8px 3.4px,transparent 4px) 100% 0/20px 20px no-repeat,
    radial-gradient(circle at 10px 10px,rgba(255,255,255,.6) 0 1.2px,rgba(0,0,0,.55) 1.8px 3.4px,transparent 4px) 0 100%/20px 20px no-repeat,
    radial-gradient(circle at 10px 10px,rgba(255,255,255,.6) 0 1.2px,rgba(0,0,0,.55) 1.8px 3.4px,transparent 4px) 100% 100%/20px 20px no-repeat,
    repeating-linear-gradient(90deg,rgba(255,255,255,.038) 0 1px,rgba(0,0,0,.035) 1px 3px),
    linear-gradient(118deg,rgba(255,255,255,.1),transparent 28%,transparent 72%,rgba(255,255,255,.05));
  opacity:.9}
/* charge bar: runs left to right when the piece is struck, hot at the leading edge, ice behind it */
.fg-skin::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;z-index:1;
  background:linear-gradient(90deg,rgba(var(--fg-ice),.9),#fff 70%,rgb(var(--fg-hot)));
  box-shadow:0 0 12px rgba(var(--fg-hot),.85);transform:scaleX(0);transform-origin:left;
  transition:transform .95s cubic-bezier(.2,.8,.2,1)}
.fg-on .fg-skin::before{transform:scaleX(1);background:linear-gradient(90deg,rgba(var(--fg-hot),.9),#fff 35%,rgb(var(--fg-ice)));box-shadow:0 0 12px rgba(var(--fg-ice),.7)}

/* ───────── struck: the settled lit state ───────── */
.fg-js .fg-item.fg-on{border-color:rgba(var(--fg-ice),.62);
  box-shadow:0 12px 30px rgba(0,0,0,.28),0 0 28px rgba(var(--fg-ice),.38),inset 0 1px 0 rgba(255,255,255,.18),inset 0 0 28px rgba(var(--fg-ice),.1);
  animation:fgforge 1.15s cubic-bezier(.2,.7,.2,1) 1}
.fg-js .fg-item.fg-on .fg-skin{background:linear-gradient(100deg,rgba(var(--fg-ice),.14),transparent 62%);animation:fgglow 1.15s ease-out 1}
@keyframes fgforge{
  0%{border-color:rgba(var(--fg-hot),0);box-shadow:0 0 0 0 rgba(var(--fg-hot),0);transform:none}
  16%{border-color:#ffd8b4;box-shadow:0 0 52px 6px rgba(var(--fg-hot),.78),0 0 110px rgba(255,110,50,.35),inset 0 0 34px rgba(255,200,150,.4);transform:translateY(-5px) scale(1.014)}
  55%{border-color:rgba(var(--fg-ice),.9);box-shadow:0 0 38px rgba(var(--fg-ice),.5),inset 0 0 26px rgba(var(--fg-ice),.14)}
  100%{transform:none}
}
@keyframes fgglow{0%{background:radial-gradient(120% 90% at 50% 0%,rgba(var(--fg-hot),.55),transparent 70%)}100%{background:linear-gradient(100deg,rgba(var(--fg-ice),.14),transparent 62%)}}

/* step numbers / stage tags ignite with the box */
.fg-js .steps .fg-on::before,.fg-js .ladder .fg-on::before{color:#fff;text-shadow:0 0 14px rgba(var(--fg-ice),.95),0 0 32px rgba(var(--fg-ice),.55);animation:fgnum 1.3s ease-out 1}
.fg-js .fg-on.bx-stage-card .bx-sn,.fg-js .flow .fg-on b,.fg-js .way.fg-on b,.fg-js .road-lane .fg-on .n,.fg-js .fig.fg-on b{text-shadow:0 0 16px rgba(var(--fg-ice),.9),0 0 34px rgba(var(--fg-ice),.45);animation:fgnum 1.3s ease-out 1}
@keyframes fgnum{0%{color:rgb(var(--fg-hot));text-shadow:0 0 6px rgba(var(--fg-hot),0)}20%{color:#fff;text-shadow:0 0 22px rgba(var(--fg-hot),1),0 0 46px rgba(var(--fg-hot),.7)}100%{}}

/* ───────── the current: one step at a time glows brighter, forever ───────── */
.fg-js .fg-item.fg-on.fg-hot{border-color:#d8f1ff;transform:translateY(-3px);
  box-shadow:0 14px 34px rgba(0,0,0,.34),0 0 40px rgba(var(--fg-ice),.6),0 0 0 1px rgba(var(--fg-ice),.55),inset 0 1px 0 rgba(255,255,255,.28),inset 0 0 34px rgba(var(--fg-ice),.16)}
.fg-js .fg-item.fg-on.fg-hot .fg-skin::before{box-shadow:0 0 18px rgba(var(--fg-ice),1),0 0 4px #fff}
.fg-js .steps .fg-hot::before,.fg-js .ladder .fg-hot::before{text-shadow:0 0 20px #fff,0 0 40px rgba(var(--fg-ice),.9)}
.fg-js .fg-item.fg-on:hover,.fg-js .fg-item.fg-on:focus-within{border-color:#d8f1ff;transform:translateY(-5px);
  box-shadow:0 18px 40px rgba(0,0,0,.4),0 0 46px rgba(var(--fg-ice),.55),0 0 0 1px rgba(var(--fg-ice),.6),inset 0 1px 0 rgba(255,255,255,.3)}

/* ───────── sparks (created by forge.js, removed after they fade) ───────── */
.fg-sp{position:absolute;width:3px;height:3px;border-radius:50%;background:#ffe3c4;box-shadow:0 0 7px 1px rgb(var(--fg-hot)),0 0 2px #fff;
  opacity:0;animation:fgsp var(--t,.8s) cubic-bezier(.15,.7,.3,1) forwards}
@keyframes fgsp{0%{opacity:1;transform:translate(0,0) scale(1.2)}70%{opacity:.9}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.15)}}

/* ───────── ordered sequences get a connecting seam so the steps read as one chain ───────── */
@media(min-width:900px){
  .fg-js .flow li.fg-on:not(:last-child){border-right-color:rgba(var(--fg-ice),.9)}
}

@media(prefers-reduced-motion:reduce){
  .fg-js .fg-item,.fg-js .fg-item.fg-on,.fg-js .fg-item.fg-on .fg-skin,.fg-js .steps .fg-on::before,.fg-js .ladder .fg-on::before,.fg-js .fg-on .bx-sn,.fg-js .flow .fg-on b{animation:none;transition:none}
  .fg-skin::before{transition:none}
  .fg-sp{display:none}
}
@media(max-width:620px){
  .fg-js .fg-item.fg-on.fg-hot,.fg-js .fg-item.fg-on:hover{transform:none}
}

/* ───────── phones / touch: same lit-from-the-forge look, but light enough that taps land instantly ─────────
   The big animated glows (box-shadow keyframes, passing "current", spark bursts, text-shadow pulses) repaint every card on
   every frame and made taps lag or get dropped on phones. Here the strike is a quick border flash + settle that only animates
   cheap properties; the settled lit state, the hero lightning, snow and parallax are untouched. */
@media(hover:none),(max-width:820px){
  .fg-js .fg-item.fg-on{box-shadow:0 8px 20px rgba(0,0,0,.28),0 0 14px rgba(var(--fg-ice),.3),inset 0 1px 0 rgba(255,255,255,.16);animation:fgforgelite .9s ease-out 1}
  @keyframes fgforgelite{0%{border-color:#ffd8b4;opacity:.55}35%{border-color:#ffd8b4;opacity:1}100%{border-color:rgba(var(--fg-ice),.62);opacity:1}}
  .fg-js .fg-item.fg-on .fg-skin{animation:none}
  .fg-js .fg-item.fg-on.fg-hot,.fg-js .fg-item.fg-on:hover,.fg-js .fg-item.fg-on:focus-within{transform:none;box-shadow:0 8px 20px rgba(0,0,0,.28),0 0 14px rgba(var(--fg-ice),.3),inset 0 1px 0 rgba(255,255,255,.16)}
  .fg-js .fg-item.fg-on.fg-hot{border-color:rgba(var(--fg-ice),.62)}
  .fg-js .steps .fg-on::before,.fg-js .ladder .fg-on::before,.fg-js .fg-on.bx-stage-card .bx-sn,.fg-js .flow .fg-on b,.fg-js .way.fg-on b,.fg-js .road-lane .fg-on .n,.fg-js .fig.fg-on b{animation:none}
  .fg-sp{display:none}
  .fg-item a,.fg-item button,a.btn,button.btn{touch-action:manipulation}
}
