/* ============================================================
   PAAI — Private Agentic AI. The privacy section.
   Sits as section 02, replacing prior services index.
   ============================================================ */

const PAAI_CAPABILITIES = [
  {
    code: "C01",
    label: "Local LLM Inference",
    desc: "Open-weights models hosted on client-owned hardware. Deployments may be air-gapped or perimeter-bound. Prompts, embeddings, and inference traffic remain inside the client environment.",
    tags: ["Llama / Mistral / Phi / Qwen", "vLLM · TGI · llama.cpp", "GPU · CPU · NPU", "Air-gap mode"],
  },
  {
    code: "C02",
    label: "Private Transport Layer",
    desc: "Hardened mTLS 1.3, zero-trust network access, and a perimeter-bound service mesh. All inter-service traffic is mutually authenticated, encrypted in transit, and recorded for audit.",
    tags: ["mTLS 1.3 · ZTNA", "WireGuard / IPsec", "HSM-backed PKI", "Service mesh"],
  },
  {
    code: "C03",
    label: "On-Prem AI Harness",
    desc: "The full agentic stack — planner, tool routing, memory, evaluation, and audit — deployed inside the client VPC, data centre, or sovereign cloud environment.",
    tags: ["Agent orchestration", "Eval harness", "Audit trail", "Tool sandbox"],
  },
  {
    code: "C04",
    label: "Private Cloud Rollout",
    desc: "VPC-isolated deployments across AWS, Azure, GCP, and sovereign cloud providers. Customer-managed keys, private network links, and region-bound residency are configured per engagement.",
    tags: ["VPC · PrivateLink", "CMK / BYOK / HYOK", "Sovereign regions", "Confidential compute"],
  },
];

const PAAI_STANDARDS_PRIVACY = [
  ["P / 01", "GDPR · UK GDPR",              "Lawful basis · DPIA · Art. 22", "Active"],
  ["P / 02", "ISO/IEC 27701",               "Privacy information management",          "Aligned"],
  ["P / 03", "ISO/IEC 27018",               "PII in public clouds",                    "Aligned"],
  ["P / 04", "ISO/IEC 27017",               "Cloud security",                          "Aligned"],
  ["P / 05", "SOC 2 Type II",               "Trust services criteria",                 "Aligned"],
];

const PAAI_STANDARDS_CRYPTO = [
  ["C / 01", "ISO/IEC 27001",               "Information security mgmt",               "Aligned"],
  ["C / 02", "NIST SP 800-53 r.5",          "Security &amp; privacy controls",         "Aligned"],
  ["C / 03", "FIPS 140-3",                  "Cryptographic module validation",         "Aligned"],
  ["C / 04", "Common Criteria EAL4+",       "Evaluated assurance level",               "Available"],
  ["C / 05", "UK Cyber Essentials+",        "Government baseline",                     "Active"],
  ["C / 06", "NIST SP 800-208",             "Stateful hash-based signatures",          "Aligned"],
  ["C / 07", "NIST PQC · ML-KEM / ML-DSA",  "Post-quantum cryptography",               "Deployed"],
];

const PAAI_PRINCIPLES = [
  {
    n: "Ø1",
    h: "Data sovereignty by default.",
    p: "PAAI engagements operate on the principle that client data does not leave the client perimeter. The architecture is designed to enforce this position from the outset, not to mitigate exposure after the fact.",
  },
  {
    n: "Ø2",
    h: "Open weights. Owned weights.",
    p: "Open-weights models that can be audited, fine-tuned, versioned, and operated without vendor dependencies. Closed-API integrations remain available where appropriate but are not the default deployment path.",
  },
  {
    n: "Ø3",
    h: "Post-quantum readiness as standard.",
    p: "ML-KEM and ML-DSA (NIST PQC) are deployed alongside classical ciphers from the first commit. Harvest-now, decrypt-later is treated as an active threat model, not a future contingency.",
  },
];

function Privacy() {
  return (
    <section id="privacy" className="paai">
      <div className="page">
        <div className="section-head">
          <div className="index">
            <span className="dot"></span>03 / Privacy
            <div className="paai-stamp">
              <span className="paai-stamp-mark">PAAI</span>
              <span className="paai-stamp-meta">PRIVATE · AGENTIC · AI</span>
            </div>
          </div>
          <div>
            <h2>
              Private Agentic AI.<br />
              <span className="serif-italic">Your data, your rules.</span>
            </h2>
            <p className="lede">
              PAAI — Private Agentic AI — is our framework for AI systems
              that operate within the client perimeter. The architecture
              combines local LLM inference, private transport, on-premise
              inference harnesses, and private-cloud deployments. It is
              designed for organisations whose regulatory, contractual,
              or operational requirements preclude the use of third-party
              inference services.
            </p>
          </div>
        </div>

        {/* ---- PRINCIPLES (3-up manifesto) ---- */}
        <div className="paai-principles">
          {PAAI_PRINCIPLES.map((p) => (
            <div key={p.n} className="paai-principle">
              <div className="num">{p.n}</div>
              <h3>{p.h}</h3>
              <p>{p.p}</p>
            </div>
          ))}
        </div>

        {/* ---- CAPABILITY GRID (4-up) ---- */}
        <div className="paai-caps">
          {PAAI_CAPABILITIES.map((c, i) => (
            <article key={c.code} className="paai-cap">
              <header>
                <span className="paai-cap-code">{c.code}</span>
                <span className="paai-cap-n">0{i + 1} / 04</span>
              </header>
              <h3>{c.label}</h3>
              <p>{c.desc}</p>
              <ul>
                {c.tags.map((t) => (
                  <li key={t}>{t}</li>
                ))}
              </ul>
            </article>
          ))}
        </div>

        {/* ---- STACK + RADAR + GAUGES ---- */}
        <div className="paai-viz-grid">
          <div className="paai-viz-cell paai-viz-stack">
            <StackDiagram />
            <div className="paai-viz-foot">
              Six architectural layers. Each is independently auditable,
              substitutable, and remains within the client perimeter.
            </div>
          </div>
          <div className="paai-viz-cell paai-viz-radar">
            <ThreatRadar />
            <div className="paai-viz-foot">
              Comparative threat-surface profile. PAAI deployments reduce
              exposure across all evaluated dimensions.
            </div>
          </div>
          <div className="paai-viz-cell paai-viz-gauge">
            <QuantumGauge />
            <div className="paai-viz-foot">
              ML-KEM and ML-DSA (NIST PQC, 2024) are deployed alongside
              classical ciphers from the first commit. Post-quantum
              readiness is the default configuration, not a subsequent
              upgrade.
            </div>
          </div>
        </div>

        {/* ---- COMPLIANCE — twin compact tables ---- */}
        <div className="paai-compliance">
          <div className="paai-compliance-head">
            <h3>Privacy <span className="serif-italic">Compliance</span>.</h3>
            <div className="paai-compliance-legend">
              <span><i className="dot dot-active"></i>Active</span>
              <span><i className="dot dot-aligned"></i>Aligned</span>
              <span><i className="dot dot-available"></i>Available</span>
              <span><i className="dot dot-deployed"></i>Deployed</span>
            </div>
          </div>
          <div className="paai-compliance-grid">
            <div className="paai-compliance-col">
              <div className="paai-compliance-cap">
                <span>I · Privacy &amp; data protection</span>
                <span>{PAAI_STANDARDS_PRIVACY.length} entries</span>
              </div>
              <div className="paai-compliance-table">
                {PAAI_STANDARDS_PRIVACY.map(([id, name, desc, status]) => (
                  <div className="paai-c-row" key={id}>
                    <div className="id">{id}</div>
                    <div className="name">
                      <span dangerouslySetInnerHTML={{ __html: name }} />
                      <span className="d" dangerouslySetInnerHTML={{ __html: desc }} />
                    </div>
                    <div className="status" data-state={status.toLowerCase()}>{status}</div>
                  </div>
                ))}
              </div>
            </div>
            <div className="paai-compliance-col">
              <div className="paai-compliance-cap">
                <span>II · Security &amp; cryptography</span>
                <span>{PAAI_STANDARDS_CRYPTO.length} entries</span>
              </div>
              <div className="paai-compliance-table">
                {PAAI_STANDARDS_CRYPTO.map(([id, name, desc, status]) => (
                  <div className="paai-c-row" key={id}>
                    <div className="id">{id}</div>
                    <div className="name">
                      <span dangerouslySetInnerHTML={{ __html: name }} />
                      <span className="d" dangerouslySetInnerHTML={{ __html: desc }} />
                    </div>
                    <div className="status" data-state={status.toLowerCase()}>{status}</div>
                  </div>
                ))}
              </div>
            </div>
          </div>
        </div>

        {/* ---- BIG STATEMENT ---- */}
        <div className="paai-footer">
          <div>
            <div className="paai-footer-mark">
              <span>P</span><span>A</span><span>A</span><span>I</span>
            </div>
            <div className="paai-footer-translate">
              Private · Agentic · AI
            </div>
          </div>
          <div className="paai-footer-copy">
            <div className="paai-arch-caption">STATEMENT · R-PAAI / 2026</div>
            <h3>
              We don&rsquo;t use your data to train any model. <br />
              Including ours.
            </h3>
            <p>
              Every PAAI engagement carries a contractual zero-training,
              zero-retention clause. Inference runs inside the client
              perimeter, logs are encrypted under client-managed keys, and
              no traffic is used to train any model — by ROZUMCODE, by our
              vendors, or by any downstream party.
            </p>
            <a href="mailto:info@rozumcode.com" className="btn">
              Commission a PAAI assessment <span className="arrow"></span>
            </a>
          </div>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, { Privacy });
