/* Scroll art for Platform (hex core) and Security (shield). Driven by --p from scroll.js; --p: 1 is the finished
   picture. Continuous spins use the `rotate`/`translate` properties so they stack on the scroll `transform`. */

/* ---------- Hex core: six glass triangles fly in and lock into an isometric cube ---------- */
.hx-halo { fill: url(#hxHalo); opacity: calc(var(--p) * .9); }
.hx-ticks { fill: none; stroke: rgba(127, 233, 255, .3); stroke-width: 5; stroke-dasharray: .6 9.4; transform: rotate(calc(var(--p) * 60deg)); }
.hx-arc { fill: none; stroke: url(#hxStroke); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 12 88; opacity: clamp(0, (var(--p) - .6) * 3, 1); }
.hx-orbit { transform: rotate(calc(var(--p) * -150deg)); }
.hx-orbit-path { fill: none; stroke: rgba(91, 124, 255, .22); stroke-width: 1; stroke-dasharray: 2 5; }
.hx-sat { fill: #7fe9ff; filter: url(#hxGlow); }
.hx-trace { fill: none; stroke: url(#hxStroke); stroke-width: 1.2; stroke-linejoin: round; opacity: .8; stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - clamp(0, (var(--p) - .76) * 5, 1) / 6); }
.hx-pad { fill: #0b1220; stroke: #7fe9ff; stroke-width: 1.2; opacity: clamp(0, (var(--p) - .84) * 6, 1); }

.hx-t {
  transform: translate(calc(var(--dx, 0) * (1 - var(--e)) * 1px), calc(var(--dy, 0) * (1 - var(--e)) * 1px)) rotate(calc(var(--rot, 0) * (1 - var(--e)) * 1deg));
  opacity: calc(.1 + var(--e) * .9);
}
.hx-face { stroke: rgba(127, 233, 255, .38); stroke-width: .8; stroke-linejoin: round; }
.hx-top { fill: url(#hxTop); } .hx-right { fill: url(#hxRight); } .hx-left { fill: url(#hxLeft); }
.hx-stripe { fill: none; stroke: rgba(127, 233, 255, .34); stroke-width: 1; }
.hx-stripe2 { stroke: rgba(127, 233, 255, .18); stroke-dasharray: 2 3; }
.hx-outline { fill: none; stroke: url(#hxStroke); stroke-width: 1.8; stroke-linejoin: round; filter: url(#hxGlow); opacity: clamp(0, (var(--p) - .7) * 4, 1); }
.hx-edges { fill: none; stroke: #c4f4ff; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - clamp(0, (var(--p) - .8) * 5, 1) / 3); }
.hx-inner { --io: clamp(0, (var(--p) - .85) * 6.67, 1); fill: rgba(5, 12, 22, .7); stroke: rgba(127, 233, 255, .6); stroke-width: 1;
  opacity: var(--io); transform: rotate(calc((1 - var(--io)) * 60deg)); }
.hx-core { fill: url(#hxCore); opacity: clamp(0, (var(--p) - .86) * 7, 1); }
.hx-dot { fill: #fff; filter: url(#hxGlow); opacity: clamp(0, (var(--p) - .9) * 10, 1); }
.hx-pulse { --po: clamp(0, (var(--p) - .9) * 10, 1); fill: none; stroke: #7fe9ff; stroke-width: 1.2; opacity: 0; }

/* ---------- Shield: glass halves close, the seam flashes, the lock shuts, a verified badge lands ---------- */
.sfx-shield { width: min(260px, 64vw); height: auto; margin-top: clamp(20px, 4vw, 40px); }
.sh-halo { fill: url(#shHalo); opacity: var(--p); }
.sh-ticks { fill: none; stroke: rgba(0, 174, 239, .32); stroke-width: 5; stroke-dasharray: .6 9.4; transform: rotate(calc(var(--p) * -50deg)); }
.sh-orbit { transform: rotate(calc(var(--p) * 120deg)); }
.sh-orbit-path { fill: none; stroke: rgba(91, 124, 255, .22); stroke-width: 1; stroke-dasharray: 2 5; }
.sh-sat { fill: #7fe9ff; filter: url(#shGlow); }

.sh-half { --k: clamp(0, var(--p) / .7, 1); }
.sh-l { transform-origin: right center; transform: translate(calc((1 - var(--k)) * -64px), calc((1 - var(--k)) * 16px)) rotate(calc((1 - var(--k)) * -16deg)); }
.sh-r { transform-origin: left center; transform: translate(calc((1 - var(--k)) * 64px), calc((1 - var(--k)) * 16px)) rotate(calc((1 - var(--k)) * 16deg)); }
.sh-fill { fill: url(#shFillG); }
.sh-grid { fill: url(#shHex); }
#shHex path { fill: none; stroke: rgba(127, 233, 255, .15); stroke-width: .8; }
.sh-inset { fill: none; stroke: rgba(127, 233, 255, .3); stroke-width: 1; stroke-dasharray: 3 4; }
.sh-rim { fill: none; stroke: url(#shRimG); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
/* The seam flashes as the halves meet, then settles to a faint line. */
.sh-seam { fill: none; stroke: #c4f4ff; stroke-width: 1.6; filter: url(#shGlow);
  opacity: calc(clamp(0, (var(--p) - .66) * 10, 1) - clamp(0, (var(--p) - .78) * 5, 1) * .65); }
.sh-scan { fill: url(#shScanG); opacity: clamp(0, (var(--p) - .92) * 12.5, 1); }

.sh-lock { --lo: clamp(0, (var(--p) - .6) * 4.5, 1); }
.sh-shackle { fill: none; stroke: url(#shShackleG); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - clamp(0, (var(--p) - .66) * 5, 1)); transform: translateY(calc((1 - clamp(0, (var(--p) - .86) * 7.2, 1)) * -10px)); }
.sh-body { fill: url(#shBodyG); opacity: var(--lo); transform: scale(calc(.7 + var(--lo) * .3)); }
.sh-bevel { fill: none; stroke: rgba(255, 255, 255, .38); stroke-width: 1; opacity: var(--lo); }
.sh-key { fill: #04121f; opacity: var(--lo); }
.sh-badge { --bo: clamp(0, (var(--p) - .92) * 12.5, 1); transform: scale(var(--bo)); opacity: var(--bo); }
.sh-badge circle { fill: #07170f; stroke: #3ddc97; stroke-width: 1.6; }
.sh-badge path { fill: none; stroke: #3ddc97; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - clamp(0, (var(--p) - .94) * 16.7, 1)); }

/* ---------- Idle life once assembled (off under reduced motion) ---------- */
.sfx-on .hx-spin { animation: sfxSpin 9s linear infinite; }
.sfx-on .hx-orbit { animation: sfxSpinBack 26s linear infinite; }
.sfx-on .sh-orbit { animation: sfxSpin 30s linear infinite; }
.sfx-on .hx-pulse { animation: sfxRing 2.8s ease-out infinite; }
.sfx-on .sh-scan { animation: sfxScan 3.4s ease-in-out infinite; }
@keyframes sfxSpin { to { rotate: 360deg; } }
@keyframes sfxSpinBack { to { rotate: -360deg; } }
@keyframes sfxRing { 0% { scale: .7; opacity: var(--po); } 100% { scale: 3; opacity: 0; } }
@keyframes sfxScan { 0% { translate: 0 18px; } 50% { translate: 0 196px; } 100% { translate: 0 18px; } }
@media (prefers-reduced-motion: reduce) {
  .hx-spin, .hx-orbit, .sh-orbit, .hx-pulse, .sh-scan { animation: none !important; }
}
