/* How it works (how-it-works.html): 3D and animation (how-it-works-fx.js, founder 2026-10-09). Square corners stay
   (square.css); true circles use border-radius:50% !important. */

/* ---------- Hero: 3D stack of pictures ---------- */
.hwx-art { perspective: 1200px; }
.hwx-art { transform-style: preserve-3d; transform: rotateX(var(--ax, 4deg)) rotateY(var(--ay, -8deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.hwx-art .hw-fan { animation: hwxFloat 6s ease-in-out infinite; animation-delay: var(--fd, 0s); }
.hwx-art .hw-fan-1 { transform: translateZ(var(--z)) rotate(-7deg); }
.hwx-art .hw-fan-2 { transform: translateZ(var(--z)) rotate(5deg); }
.hwx-art .hw-fan-3 { transform: translateZ(var(--z)) rotate(-1deg); }
.hwx-art .hw-fan:hover, .hwx-art .hw-fan:focus-visible { transform: translateZ(calc(var(--z) + 40px)) rotate(0) scale(1.04); }
@keyframes hwxFloat { 50% { translate: 0 -8px; } }
.hwx-art::before { content: ""; position: absolute; inset: 8% 6%; z-index: 0; background: radial-gradient(closest-side, rgba(225, 29, 72, .28), rgba(56, 182, 255, .14) 55%, transparent); filter: blur(10px); transform: translateZ(-60px); animation: hwxPulse 5s ease-in-out infinite; pointer-events: none; }
@keyframes hwxPulse { 50% { opacity: .6; transform: translateZ(-60px) scale(1.08); } }

/* ---------- Light path beside the steps (wide screens) ---------- */
.hwx-steps { position: relative; }
.hwx-rail { display: none; }
@media (min-width: 1280px) {
  .hwx-rail { display: block; position: absolute; top: 0; bottom: 0; left: calc(var(--hw-gut, 40px) / -2 - 1px); width: 2px; background: rgba(255, 255, 255, .08); pointer-events: none; }
  .hwx-fill { position: absolute; inset: 0; transform-origin: 50% 0; transform: scaleY(0); background: linear-gradient(180deg, #e11d48, #f59e0b 35%, #22d3ee 70%, #3ddc97); box-shadow: 0 0 12px rgba(225, 29, 72, .6); transition: transform .15s linear; }
  .hwx-node { position: absolute; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50% !important; display: grid; place-items: center; font: 800 .66rem/1 var(--font-head, inherit); color: #8b93ad;
    background: var(--bg, #070b1a); border: 2px solid rgba(255, 255, 255, .18); transition: color .3s, border-color .3s, background .3s, box-shadow .3s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
  .hwx-node.is-lit { color: #fff; background: var(--hw-red, #e11d48); border-color: #fda4af; box-shadow: 0 0 0 4px rgba(225, 29, 72, .18), 0 0 16px rgba(225, 29, 72, .7); transform: scale(1.12); }
}

/* ---------- Step states ---------- */
.hw-step { transition: border-color .35s, box-shadow .35s; }
.hw-step.hwx-cur { border-color: color-mix(in srgb, var(--hw-red, #e11d48) 55%, var(--border, #2a3050)); box-shadow: 0 26px 60px -36px rgba(225, 29, 72, .55); }
.hw-num { position: relative; transition: background .35s, color .35s, transform .35s cubic-bezier(.3, 1.6, .5, 1), box-shadow .35s; }
.hw-step.hwx-cur .hw-num { transform: scale(1.08); box-shadow: 0 0 0 0 rgba(225, 29, 72, .6); animation: hwxPing 1.8s ease-out infinite; }
@keyframes hwxPing { 70% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); } 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); } }
.hwx-tick { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.4) rotate(-30deg); transition: opacity .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1); color: #fff; }
.hwx-tick svg { width: 22px; height: 22px; }
.hw-step.hwx-passed .hw-num { color: transparent; background: #16a34a; }
.hw-step.hwx-passed .hwx-tick { opacity: 1; transform: none; }
.hw-toc a { position: relative; overflow: hidden; }
.hw-toc a.hwx-cur { border-color: var(--hw-red, #e11d48); box-shadow: 0 10px 24px -16px rgba(225, 29, 72, .8); }
.hw-toc a.hwx-cur::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: linear-gradient(90deg, #e11d48, #f59e0b); animation: hwxBarIn .5s ease both; }
@keyframes hwxBarIn { from { transform: scaleX(0); transform-origin: 0 50%; } }
.hw-toc a.hwx-done b { background: #16a34a; }

/* ---------- "Step N of 9" bar (computers) ---------- */
.hwx-bar { position: fixed; z-index: 60; left: 50%; bottom: 18px; /* centred: the site's pop-ups sit bottom left, the chat bottom right */ display: none; align-items: center; gap: 10px; max-width: 330px; padding: 8px 12px 8px 8px; color: var(--text, #fff); text-decoration: none;
  background: color-mix(in srgb, var(--surface, #151a33) 92%, transparent); border: 1px solid var(--border, #2a3050); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); backdrop-filter: blur(8px);
  opacity: 0; transform: translate(-50%, 16px); transition: opacity .3s, transform .3s, border-color .2s; pointer-events: none; }
@media (min-width: 1100px) and (hover: hover) { .hwx-bar { display: flex; } }
.hwx-bar.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.hwx-bar:hover { border-color: var(--hw-red, #e11d48); color: var(--text, #fff); }
.hwx-ring { width: 36px; height: 36px; flex: none; transform: rotate(-90deg); }
.hwx-ring circle { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 4; }
.hwx-ring .hwx-ring-fg { stroke: #e11d48; stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.3, .7, .2, 1); }
.hwx-bar-tx { display: grid; min-width: 0; }
.hwx-bar-tx b { font-size: .82rem; }
.hwx-bar-tx small { font-size: .74rem; color: var(--text-muted, #9aa3c0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hwx-bar-go { width: 26px; height: 26px; flex: none; display: grid; place-items: center; color: #fff; background: var(--hw-red, #e11d48); }
.hwx-bar-go svg { width: 15px; height: 15px; }
.hwx-bar:hover .hwx-bar-go { animation: hwxNudge .8s ease-in-out infinite; }
.hwx-bar.is-last .hwx-bar-go { background: #16a34a; }
@keyframes hwxNudge { 50% { transform: translateY(3px); } }

/* ---------- Steps rise in; pictures lean ---------- */
html.hwx-on .hw-wrap { overflow-x: clip; } /* pictures waiting to slide in from the side never widen the page */
html.hwx-on .hwx-rise { opacity: 0; transform: perspective(1000px) translateY(30px) rotateX(8deg); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1), border-color .35s, box-shadow .35s; }
html.hwx-on .hwx-rise .hw-pic { transition: transform .9s cubic-bezier(.2, .8, .2, 1) .1s; }
html.hwx-on .hwx-from-l .hw-pic { transform: perspective(1000px) translateX(-30px) rotateY(14deg); }
html.hwx-on .hwx-from-r .hw-pic { transform: perspective(1000px) translateX(30px) rotateY(-14deg); }
html.hwx-on .hwx-rise.hwx-in { opacity: 1; transform: none; }
html.hwx-on .hwx-rise.hwx-in .hw-pic { transform: none; }
html.hwx-on .hwx-rise.hwx-in .hw-pic.hwx-tilt { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.hw-pic.hwx-tilt { position: relative; transform-style: preserve-3d; }
.hwx-glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hw-pic.hwx-tilt:hover { box-shadow: 0 30px 50px -28px rgba(56, 182, 255, .55); }
.hw-done.hwx-in .hw-done-ic { animation: hwxPop .7s cubic-bezier(.3, 1.6, .5, 1) .3s both; }
@keyframes hwxPop { 0% { transform: scale(.4) rotate(-20deg); } 60% { transform: scale(1.2) rotate(8deg); } }

.hwx-conf { position: fixed; z-index: 1300; width: 7px; height: 11px; pointer-events: none; animation: hwxConf 1.4s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes hwxConf { to { transform: translate(var(--dx), calc(var(--dy) + 140px)) rotate(var(--rz)); opacity: 0; } }

@media (max-width: 960px) { .hwx-art { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hwx-art, .hwx-art .hw-fan, .hwx-art::before, .hw-step.hwx-cur .hw-num, .hw-done .hw-done-ic { animation: none !important; transition: none !important; }
  html.hwx-on .hwx-rise, html.hwx-on .hwx-rise .hw-pic { opacity: 1 !important; transform: none !important; transition: none !important; }
}
