/* CircuitDrill FX: sockets on buttons, zap, circuit canvas, wires between sections, image stickers. */
.btn { position: relative; }
.btn::before { content: ""; flex: none; width: 14px; height: 18px; background: currentColor; opacity: .9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath fill-rule='evenodd' d='M2 0h10a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zM3.2 4h1.8v4.2H3.2zM9 4h1.8v4.2H9zM5.2 12.8a1.8 1.8 0 1 1 3.6 0 1.8 1.8 0 1 1-3.6 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cpath fill-rule='evenodd' d='M2 0h10a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zM3.2 4h1.8v4.2H3.2zM9 4h1.8v4.2H9zM5.2 12.8a1.8 1.8 0 1 1 3.6 0 1.8 1.8 0 1 1-3.6 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .25s ease, opacity .25s ease; }
.btn::after { content: ""; position: absolute; left: 6px; top: 50%; width: 24px; height: 14px; margin-top: -7px; pointer-events: none;
  background: var(--spark); opacity: 0; transform: translateX(-22px);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Cpath d='M0 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zM12 3.4h11v2H12zM12 8.6h11v2H12z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Cpath d='M0 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zM12 3.4h11v2H12zM12 8.6h11v2H12z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .28s cubic-bezier(.2,.9,.3,1.2), opacity .2s ease; }
.btn:hover::after, .btn:focus-visible::after, .btn.is-live::after { opacity: 1; transform: translateX(0); }
.btn:hover::before, .btn:focus-visible::before, .btn.is-live::before { opacity: 1; }
.btn.is-live, .btn:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--spark) 55%, transparent), 0 0 22px color-mix(in srgb, var(--spark) 34%, transparent); }
html.fx-cable .btn::after { display: none; }
.btn.is-zap { animation: fx-zap .45s ease-out; }
@keyframes fx-zap { 0% { filter: brightness(1.9); transform: translateY(1px) scale(.985); } 60% { filter: brightness(1.2); } 100% { filter: none; transform: none; } }
.fx-burst { position: absolute; left: 27px; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.fx-burst i { position: absolute; left: 0; top: 0; width: 14px; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--spark);
  transform-origin: 0 50%; transform: rotate(var(--a)) translateX(6px); animation: fx-ray .5s ease-out forwards; }
@keyframes fx-ray { from { opacity: 1; transform: rotate(var(--a)) translateX(6px) scaleX(.4); } to { opacity: 0; transform: rotate(var(--a)) translateX(30px) scaleX(1.2); } }

/* cable canvas */
.fx-cable-cv { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 40; pointer-events: none; }

/* hero circuit */
.hero .fx-circuit { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }

/* wires between sections */
.fx-wire { position: relative; height: 26px; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.fx-wire::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--edge); }
.fx-wire::after { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--spark) 45%, var(--accent) 55%, transparent) no-repeat; background-size: 220px 100%; background-position: -220px 0; }
.fx-wire.on::after { opacity: 1; animation: fx-run 3.4s linear infinite; }
.fx-wire i { position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; border: 2px solid var(--edge-ui); background: var(--bg); }
.fx-wire i:first-child { left: calc(var(--gutter) - 5px); } .fx-wire i:last-child { right: calc(var(--gutter) - 5px); }
.fx-wire.on i { border-color: var(--accent); }
@keyframes fx-run { from { background-position: -220px 0; } to { background-position: calc(100% + 220px) 0; } }

/* image stickers (existing CircuitDrill artwork, shown as paper prints) */
.fx-split { display: grid; gap: 28px; align-items: center; }
.fx-sticker { margin: 0; position: relative; max-width: 360px; justify-self: center; perspective: 900px; }
.fx-sticker .in { display: block; padding: 10px; background: #F3EEE3; border: 2px solid #15181A; border-radius: 18px; box-shadow: 6px 8px 0 color-mix(in srgb, var(--accent) 80%, #000), 0 18px 40px rgba(0,0,0,.28);
  transform: rotate(-2deg) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)); transition: transform .25s ease; animation: fx-float 6s ease-in-out infinite; will-change: transform; }
.fx-sticker img { width: 100%; height: auto; border-radius: 10px; display: block; }
.fx-sticker::after { content: ""; position: absolute; left: 50%; top: 14px; width: 52px; height: 16px; margin-left: -26px; background: color-mix(in srgb, var(--spark) 50%, transparent); transform: rotate(-3deg); border-radius: 2px; opacity: .85; }
@keyframes fx-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.fx-float-r { float: right; width: 240px; margin: 4px 0 18px 24px; }
@media (min-width: 860px) { .fx-split { grid-template-columns: 0.8fr 1.2fr; gap: 48px; } .fx-split.rev { grid-template-columns: 1.2fr 0.8fr; } .fx-split.rev .fx-sticker { order: 2; } }
@media (max-width: 560px) { .fx-float-r { float: none; margin: 0 auto 22px; } }
@media (prefers-reduced-motion: reduce) {
  .fx-sticker .in, .fx-wire.on::after, .btn.is-zap { animation: none; }
  .btn::after, .btn::before { transition: none; }
}
