// Valicen — per-service schematic art for the Services page.
// On-brand geometric "network / data-flow" illustrations (no stock imagery),
// one distinct scene per service, drawn on the brand gradient panel.

function ServiceArt({ kind }) {
  const meta = {
    security: { tag: "Threat monitor", status: "Secure" },
    network: { tag: "Network", status: "All links up" },
    infra: { tag: "Data center", status: "Healthy" },
    devices: { tag: "Endpoints", status: "Protected" },
    cloud: { tag: "Cloud ops", status: "Synced" },
    backup: { tag: "Data protection", status: "Verified" } };

  const scenes = {
    // ---- Cybersecurity: protective shield + scan rings ----
    security: (
      <svg className="svc-svg" viewBox="0 0 300 240" fill="none" aria-hidden="true">
        <g stroke="rgba(255,255,255,.22)" strokeWidth="1.4">
          <circle cx="150" cy="118" r="96"></circle>
          <circle cx="150" cy="118" r="66"></circle>
        </g>
        <path d="M150 50 L208 76 V122 C208 165 182 191 150 204 C118 191 92 165 92 122 V76 Z"
          stroke="#FFFFFF" strokeWidth="2.6" fill="rgba(255,255,255,.06)" strokeLinejoin="round"></path>
        <path d="M125 119 l18 18 l34 -41" stroke="#7FECF1" strokeWidth="3.6" strokeLinecap="round" strokeLinejoin="round"></path>
        <circle className="pulse" cx="208" cy="76" r="4.2" fill="#7FECF1"></circle>
        <circle cx="80" cy="150" r="3.6" fill="#FE5701"></circle>
        <circle className="pulse" cx="150" cy="22" r="3.4" fill="rgba(255,255,255,.7)" style={{ animationDelay: "1.2s" }}></circle>
      </svg>
    ),
    // ---- Managed workstations: devices wired to a hub ----
    devices: (
      <svg className="svc-svg" viewBox="0 0 300 240" fill="none" aria-hidden="true">
        <g stroke="rgba(255,255,255,.4)" strokeWidth="1.6" strokeDasharray="2 6">
          <line x1="150" y1="120" x2="80" y2="78"></line>
          <line x1="150" y1="120" x2="150" y2="178"></line>
          <line x1="150" y1="120" x2="224" y2="86"></line>
        </g>
        <circle cx="150" cy="120" r="13" stroke="#FFFFFF" strokeWidth="2" fill="rgba(3,26,58,.45)"></circle>
        <circle className="pulse" cx="150" cy="120" r="4.6" fill="#7FECF1"></circle>
        <g stroke="#FFFFFF" strokeWidth="2.4" strokeLinejoin="round" strokeLinecap="round">
          <rect x="40" y="50" width="78" height="52" rx="5" fill="rgba(255,255,255,.05)"></rect>
          <line x1="79" y1="102" x2="79" y2="116"></line>
          <line x1="62" y1="116" x2="96" y2="116"></line>
        </g>
        <circle cx="53" cy="61" r="2.6" fill="#7FECF1"></circle>
        <g stroke="#FFFFFF" strokeWidth="2.4" strokeLinejoin="round">
          <rect x="120" y="150" width="60" height="40" rx="4" fill="rgba(255,255,255,.05)"></rect>
          <path d="M110 200 H190 L181 190 H119 Z" fill="rgba(255,255,255,.08)"></path>
        </g>
        <g stroke="#FFFFFF" strokeWidth="2.4" strokeLinejoin="round">
          <rect x="206" y="54" width="36" height="60" rx="8" fill="rgba(255,255,255,.05)"></rect>
          <line x1="218" y1="62" x2="230" y2="62"></line>
        </g>
        <circle cx="73" cy="186" r="3.6" fill="#FE5701"></circle>
      </svg>
    ),
    // ---- Data center & infrastructure: server stack + activity ----
    infra: (
      <svg className="svc-svg" viewBox="0 0 300 240" fill="none" aria-hidden="true">
        <g stroke="#FFFFFF" strokeWidth="2.2">
          <rect x="74" y="42" width="152" height="44" rx="8" fill="rgba(255,255,255,.05)"></rect>
          <rect x="74" y="98" width="152" height="44" rx="8" fill="rgba(255,255,255,.05)"></rect>
          <rect x="74" y="154" width="152" height="44" rx="8" fill="rgba(255,255,255,.05)"></rect>
        </g>
        <g>
          <circle className="pulse" cx="96" cy="64" r="3.6" fill="#7FECF1"></circle>
          <circle cx="110" cy="64" r="3.6" fill="rgba(255,255,255,.5)"></circle>
          <circle cx="96" cy="120" r="3.6" fill="#FE5701"></circle>
          <circle cx="110" cy="120" r="3.6" fill="rgba(255,255,255,.5)"></circle>
          <circle className="pulse" cx="96" cy="176" r="3.6" fill="#7FECF1" style={{ animationDelay: "1.4s" }}></circle>
          <circle cx="110" cy="176" r="3.6" fill="rgba(255,255,255,.5)"></circle>
        </g>
        <g stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round">
          <line x1="150" y1="70" x2="150" y2="58"></line>
          <line x1="162" y1="70" x2="162" y2="62"></line>
          <line x1="174" y1="70" x2="174" y2="54"></line>
          <line x1="186" y1="70" x2="186" y2="64"></line>
          <line x1="198" y1="70" x2="198" y2="60"></line>
        </g>
        <g stroke="rgba(255,255,255,.55)" strokeWidth="2.6" strokeLinecap="round">
          <line x1="150" y1="126" x2="150" y2="118"></line>
          <line x1="162" y1="126" x2="162" y2="112"></line>
          <line x1="174" y1="126" x2="174" y2="120"></line>
          <line x1="186" y1="126" x2="186" y2="110"></line>
          <line x1="198" y1="126" x2="198" y2="116"></line>
        </g>
        <g stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round">
          <line x1="150" y1="182" x2="150" y2="172"></line>
          <line x1="162" y1="182" x2="162" y2="176"></line>
          <line x1="174" y1="182" x2="174" y2="168"></line>
          <line x1="186" y1="182" x2="186" y2="174"></line>
          <line x1="198" y1="182" x2="198" y2="170"></line>
        </g>
      </svg>
    ),
    // ---- Cloud services: cloud + sync + connected devices ----
    cloud: (
      <svg className="svc-svg" viewBox="0 0 300 240" fill="none" aria-hidden="true">
        <path d="M112 116 q-26 0 -26 -24 q0 -22 24 -23 q5 -27 33 -27 q29 0 33 27 q24 1 24 23 q0 24 -26 24 Z"
          stroke="#FFFFFF" strokeWidth="2.6" fill="rgba(255,255,255,.06)" strokeLinejoin="round"></path>
        <g className="spin" style={{ transformOrigin: "150px 88px" }}>
          <path d="M150 70 a18 18 0 0 1 17 12" stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round" fill="none"></path>
          <path d="M167 82 l1 -9 l-9 3" stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" fill="none"></path>
          <path d="M150 106 a18 18 0 0 1 -17 -12" stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round" fill="none"></path>
          <path d="M133 94 l-1 9 l9 -3" stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" fill="none"></path>
        </g>
        <g stroke="rgba(255,255,255,.4)" strokeWidth="1.6" strokeDasharray="2 6">
          <line x1="100" y1="150" x2="120" y2="120"></line>
          <line x1="150" y1="158" x2="150" y2="124"></line>
          <line x1="200" y1="150" x2="180" y2="120"></line>
        </g>
        <g stroke="#FFFFFF" strokeWidth="2.2" fill="rgba(255,255,255,.05)">
          <rect x="84" y="150" width="32" height="32" rx="6"></rect>
          <rect x="134" y="158" width="32" height="32" rx="6"></rect>
          <rect x="184" y="150" width="32" height="32" rx="6"></rect>
        </g>
        <circle className="pulse" cx="100" cy="166" r="3.2" fill="#7FECF1"></circle>
        <circle cx="200" cy="166" r="3.2" fill="#FE5701"></circle>
      </svg>
    ),
    // ---- Data protection & continuity: databases + backup loop ----
    backup: (
      <svg className="svc-svg" viewBox="0 0 300 240" fill="none" aria-hidden="true">
        <g stroke="#FFFFFF" strokeWidth="2.4" strokeLinejoin="round">
          <path d="M68 96 v50 a26 11 0 0 0 52 0 v-50" fill="rgba(255,255,255,.05)"></path>
          <ellipse cx="94" cy="96" rx="26" ry="11"></ellipse>
          <path d="M68 121 a26 11 0 0 0 52 0" stroke="rgba(255,255,255,.45)"></path>
        </g>
        <g stroke="#FFFFFF" strokeWidth="2.4" strokeLinejoin="round">
          <path d="M180 96 v50 a26 11 0 0 0 52 0 v-50" fill="rgba(255,255,255,.05)"></path>
          <ellipse cx="206" cy="96" rx="26" ry="11"></ellipse>
          <path d="M180 121 a26 11 0 0 0 52 0" stroke="rgba(255,255,255,.45)"></path>
        </g>
        <path d="M124 104 q26 -22 52 0" stroke="#7FECF1" strokeWidth="2.6" fill="none" strokeLinecap="round"></path>
        <path d="M176 104 l1 -11 l-11 4" stroke="#7FECF1" strokeWidth="2.6" fill="none" strokeLinecap="round" strokeLinejoin="round"></path>
        <path d="M176 150 q-26 22 -52 0" stroke="rgba(255,255,255,.6)" strokeWidth="2.6" fill="none" strokeLinecap="round"></path>
        <path d="M124 150 l-1 11 l11 -4" stroke="rgba(255,255,255,.6)" strokeWidth="2.6" fill="none" strokeLinecap="round" strokeLinejoin="round"></path>
        <g transform="translate(150 188)">
          <path d="M0 -16 L15 -9 V1 C15 11 8 16 0 19 C-8 16 -15 11 -15 1 V-9 Z"
            stroke="#FFFFFF" strokeWidth="2.2" fill="rgba(3,26,58,.4)" strokeLinejoin="round"></path>
          <path d="M-7 0 l5 5 l9 -11" stroke="#7FECF1" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" fill="none"></path>
        </g>
        <circle className="pulse" cx="94" cy="80" r="3.4" fill="#7FECF1"></circle>
        <circle cx="206" cy="80" r="3.4" fill="#FE5701"></circle>
      </svg>
    ),
    // ---- Networking: central switch, fiber/copper links, endpoints + Wi-Fi ----
    network: (
      <svg className="svc-svg" viewBox="0 0 300 240" fill="none" aria-hidden="true">
        {/* links from the switch up to endpoints */}
        <g stroke="rgba(255,255,255,.4)" strokeWidth="1.6">
          <line x1="110" y1="176" x2="60" y2="92"></line>
          <line x1="130" y1="176" x2="124" y2="74"></line>
          <line x1="170" y1="176" x2="196" y2="70"></line>
        </g>
        {/* one fiber run highlighted in teal */}
        <line x1="190" y1="176" x2="244" y2="96" stroke="#7FECF1" strokeWidth="2" strokeDasharray="2 7" strokeLinecap="round" className="svc-flow"></line>
        {/* central switch with port lights */}
        <rect x="74" y="176" width="152" height="34" rx="6" stroke="#FFFFFF" strokeWidth="2.4" fill="rgba(3,26,58,.45)"></rect>
        <g fill="#7FECF1">
          <rect x="86" y="198" width="9" height="5" rx="1"></rect>
          <rect x="102" y="198" width="9" height="5" rx="1" className="pulse"></rect>
          <rect x="118" y="198" width="9" height="5" rx="1"></rect>
          <rect x="134" y="198" width="9" height="5" rx="1" className="pulse" style={{ animationDelay: "1s" }}></rect>
          <rect x="150" y="198" width="9" height="5" rx="1"></rect>
          <rect x="166" y="198" width="9" height="5" rx="1"></rect>
          <rect x="182" y="198" width="9" height="5" rx="1" className="pulse" style={{ animationDelay: ".5s" }}></rect>
          <rect x="198" y="198" width="9" height="5" rx="1"></rect>
        </g>
        <circle className="pulse" cx="150" cy="185" r="3" fill="#FE5701"></circle>
        {/* endpoint: workstation */}
        <g stroke="#FFFFFF" strokeWidth="2.2" strokeLinejoin="round" fill="rgba(255,255,255,.05)">
          <rect x="40" y="66" width="50" height="34" rx="4"></rect>
          <line x1="65" y1="100" x2="65" y2="110"></line>
          <line x1="52" y1="110" x2="78" y2="110"></line>
        </g>
        {/* endpoint: server node */}
        <g stroke="#FFFFFF" strokeWidth="2.2" strokeLinejoin="round" fill="rgba(255,255,255,.05)">
          <rect x="106" y="48" width="38" height="30" rx="4"></rect>
          <line x1="114" y1="58" x2="118" y2="58"></line>
          <line x1="114" y1="68" x2="118" y2="68"></line>
        </g>
        {/* endpoint: Wi-Fi access point */}
        <circle cx="196" cy="64" r="4" fill="#FFFFFF"></circle>
        <g stroke="#7FECF1" strokeWidth="2.2" fill="none" strokeLinecap="round">
          <path d="M186 56 a14 14 0 0 1 20 0"></path>
          <path d="M180 50 a22 22 0 0 1 32 0"></path>
        </g>
        {/* endpoint: cloud/global uplink (teal fiber target) */}
        <path d="M232 96 q-16 0 -16 -13 q0 -12 14 -12 q3 -12 18 -12 q17 0 18 14 q12 1 12 12 q0 11 -14 11 Z"
          stroke="#7FECF1" strokeWidth="2.2" fill="rgba(127,236,241,.08)" strokeLinejoin="round"></path>
      </svg>
    ),
  };
  const m = meta[kind] || meta.security;
  return (
    <React.Fragment>
      <div className="grid-lines"></div>
      <div className="svc-glow" aria-hidden="true"></div>
      <svg className="svc-constellation" viewBox="0 0 300 240" fill="none" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
        <g stroke="rgba(255,255,255,.10)" strokeWidth="1">
          <line x1="18" y1="28" x2="82" y2="60"></line>
          <line x1="282" y1="38" x2="228" y2="82"></line>
          <line x1="28" y1="212" x2="92" y2="180"></line>
          <line x1="272" y1="206" x2="214" y2="176"></line>
        </g>
        <g fill="rgba(127,236,241,.5)">
          <circle cx="18" cy="28" r="2"></circle>
          <circle cx="282" cy="38" r="2"></circle>
          <circle cx="28" cy="212" r="2"></circle>
          <circle cx="272" cy="206" r="2"></circle>
        </g>
      </svg>
      <div className="svc-hud">
        <span className="svc-tag">{m.tag}</span>
        <span className="svc-status"><span className="svc-dot"></span>{m.status}</span>
      </div>
      {scenes[kind] || scenes.security}
    </React.Fragment>);

}

Object.assign(window, { ServiceArt });
