// Proof&Trust — NIS2 Supply Chain Risk Assessment landing page
// Dark navy/black theme, teal accent (from logo). Conversion-optimized.

const { useState, useEffect, useRef } = React;

// ---------- Primitives ----------

function Caption({ children, className = "", style }) {
  return <span className={`sq-caption ${className}`} style={{ color: "var(--pt-teal-light)", ...style }}>{children}</span>;
}

function Button({ children, variant = "primary", onDark = true, size = "md", style, ...rest }) {
  let cls = "sq-btn ";
  if (variant === "primary") cls += "sq-btn-primary";
  else if (variant === "secondary") cls += "sq-btn-secondary-dark";
  else if (variant === "tertiary") cls += "sq-btn-tertiary";
  const sizeStyle = size === "lg" ? { padding: "16px 28px", fontSize: 16, fontWeight: 500, borderRadius: 999 } : { borderRadius: 999 };
  return <button className={cls} style={{ ...sizeStyle, ...style }} {...rest}>{children}</button>;
}

function Chevron({ size = 12, color = "currentColor" }) {
  return (
    <svg width={size} height={size} viewBox="0 0 12 12" fill="none" style={{ display: "inline-block", verticalAlign: "middle", marginLeft: 4 }}>
      <path d="M4 2l4 4-4 4" stroke={color} strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  );
}

function ArrowRight({ size = 14, color = "currentColor" }) {
  return (
    <svg width={size} height={size} viewBox="0 0 16 16" fill="none" style={{ display: "inline-block", verticalAlign: "middle", marginLeft: 6 }}>
      <path d="M2 8h12M9 3l5 5-5 5" stroke={color} strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
    </svg>
  );
}

function Check() {
  return (
    <span className="sq-check-box" aria-hidden="true" style={{ background: "var(--pt-teal)" }}>
      <svg viewBox="0 0 12 12" fill="none"><path d="M2 6.5L4.8 9 10 3.2" stroke="#04212B" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/></svg>
    </span>
  );
}

// Brand logo — white Proof&Trust wordmark (for dark backgrounds).
function BrandMark({ size = 30 }) {
  return <img src="assets/logo-white.png" alt="Proof & Trust" style={{ height: size, width: "auto", display: "block" }} />;
}

// Icon-only mark (teal X) for use inside cards.
function BrandGlyph({ size = 22 }) {
  return <img src="assets/mark.png" alt="" aria-hidden="true" style={{ height: size, width: size, display: "block" }} />;
}

function Reveal({ children, delay = 0, as: As = "div", style, className = "" }) {
  return <As className={className} style={style}>{children}</As>;
}

// ---------- Risk gauges (dark-surface) ----------

function riskTone(value) {
  if (value >= 75) return { color: "#E0533A", label: "CRITICAL" };
  if (value >= 40) return { color: "#EC6A2B", label: "HIGH" };
  return { color: "#5BC8A0", label: "LOW" };
}

const TRACK = "rgba(255,255,255,0.10)";

function RiskGauge({ value }) {
  const cx = 140, cy = 130, r = 104;
  const total = Math.PI * r;
  const angle = -90 + (Math.max(0, Math.min(100, value)) / 100) * 180;
  const arcD = `M ${cx - r} ${cy} A ${r} ${r} 0 0 1 ${cx + r} ${cy}`;
  return (
    <div className="pt-gauge" style={{ position: "relative", width: 280, margin: "0 auto" }}>
      <svg width="280" height="160" viewBox="0 0 280 160" style={{ display: "block" }}>
        <path d={arcD} stroke={TRACK} strokeWidth="16" fill="none" />
        <path d={arcD} stroke="#5BC8A0" strokeWidth="16" fill="none" strokeDasharray={`${total*0.40 - 2} ${total}`} />
        <path d={arcD} stroke="#EC6A2B" strokeWidth="16" fill="none" strokeDasharray={`0 ${total*0.40 + 2} ${total*0.35 - 4} ${total}`} />
        <path d={arcD} stroke="#E0533A" strokeWidth="16" fill="none" strokeDasharray={`0 ${total*0.75 + 2} ${total*0.25 - 2} ${total}`} />
        {[0, 25, 50, 75, 100].map((t) => {
          const rad = (-90 + (t/100) * 180) * Math.PI / 180;
          const x1 = cx + Math.cos(rad) * (r - 24);
          const y1 = cy + Math.sin(rad) * (r - 24);
          const x2 = cx + Math.cos(rad) * (r - 16);
          const y2 = cy + Math.sin(rad) * (r - 16);
          return <line key={t} x1={x1} y1={y1} x2={x2} y2={y2} stroke="#0B1B29" strokeWidth="2" />;
        })}
        <g transform={`rotate(${angle} ${cx} ${cy})`}>
          <polygon points={`${cx-3},${cy+2} ${cx+3},${cy+2} ${cx},${cy - r + 14}`} fill="#fff" />
          <circle cx={cx} cy={cy} r="8" fill="#fff" />
          <circle cx={cx} cy={cy} r="3" fill="var(--pt-teal)" />
        </g>
      </svg>
      <div style={{ marginTop: -34, textAlign: "center", paddingBottom: 4 }}>
        <div style={{ fontFamily: "var(--font-serif)", fontSize: 38, lineHeight: 1, color: "#fff" }}>{value}</div>
        <div style={{ fontSize: 9, color: "rgba(255,255,255,0.55)", letterSpacing: "0.12em", textTransform: "uppercase", marginTop: 4 }}>Vendor risk index</div>
      </div>
    </div>
  );
}

function MiniGauge({ label, value }) {
  const { color } = riskTone(value);
  const cx = 36, cy = 36, r = 26;
  const total = Math.PI * r;
  const filled = (Math.max(0, Math.min(100, value)) / 100) * total;
  const arcD = `M ${cx - r} ${cy} A ${r} ${r} 0 0 1 ${cx + r} ${cy}`;
  return (
    <div style={{ textAlign: "center" }}>
      <svg width="72" height="44" viewBox="0 0 72 44" style={{ display: "block", margin: "0 auto" }}>
        <path d={arcD} stroke={TRACK} strokeWidth="6" fill="none" strokeLinecap="round" />
        <path d={arcD} stroke={color} strokeWidth="6" fill="none" strokeLinecap="round" strokeDasharray={`${filled} ${total}`} />
      </svg>
      <div style={{ marginTop: -10, fontFamily: "var(--font-serif)", fontSize: 18, color: "#fff", lineHeight: 1 }}>{value}</div>
      <div style={{ fontSize: 10, color: "rgba(255,255,255,0.5)", marginTop: 4, letterSpacing: "0.04em" }}>{label}</div>
    </div>
  );
}

function DonutGauge({ value, size = 64, stroke = 6, color = "var(--pt-teal)", track = "rgba(255,255,255,0.16)", fg = "#fff" }) {
  const r = (size - stroke) / 2;
  const c = 2 * Math.PI * r;
  const filled = (Math.max(0, Math.min(100, value)) / 100) * c;
  return (
    <div style={{ position: "relative", width: size, height: size }}>
      <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
        <circle cx={size/2} cy={size/2} r={r} stroke={track} strokeWidth={stroke} fill="none" />
        <circle cx={size/2} cy={size/2} r={r} stroke={color} strokeWidth={stroke} fill="none"
                strokeLinecap="round" strokeDasharray={`${filled} ${c}`}
                transform={`rotate(-90 ${size/2} ${size/2})`} />
      </svg>
      <div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-serif)", fontSize: 20, color: fg }}>{value}</div>
    </div>
  );
}

// ---------- Announcement bar ----------

function AnnouncementBar() {
  return (
    <div style={{ background: "var(--pt-ink)", color: "white", fontSize: 13, fontFamily: "var(--font-sans)", borderBottom: "1px solid rgba(255,255,255,0.06)" }}>
      <div className="pt-announce" style={{ maxWidth: 1280, margin: "0 auto", padding: "10px 32px", display: "flex", alignItems: "center", justifyContent: "center", gap: 10, flexWrap: "wrap" }}>
        <span style={{ width: 6, height: 6, borderRadius: 3, background: "var(--pt-teal)", display: "inline-block", boxShadow: "0 0 0 3px rgba(63,168,196,0.25)" }}></span>
        <span style={{ opacity: 0.85 }}>NIS2 enforcement is live across the EU.</span>
        <span style={{ opacity: 0.4 }}>·</span>
        <a href="#cta" style={{ color: "white", textDecoration: "none", fontWeight: 500 }}>
          See your exposure in 30 minutes <ArrowRight size={12} color="var(--pt-teal-light)" />
        </a>
      </div>
    </div>
  );
}

// ---------- Header ----------

function Header({ ctaCopy }) {
  return (
    <header style={{ background: "rgba(6,9,13,0.72)", color: "#fff", fontFamily: "var(--font-sans)", borderBottom: "1px solid rgba(255,255,255,0.08)", position: "sticky", top: 0, zIndex: 50, backdropFilter: "saturate(140%) blur(12px)", WebkitBackdropFilter: "saturate(140%) blur(12px)" }}>
      <nav style={{ display: "flex", alignItems: "center", padding: "14px 32px", gap: 32, maxWidth: 1280, margin: "0 auto" }}>
        <a href="#" style={{ display: "flex", alignItems: "center", textDecoration: "none" }}>
          <BrandMark size={48} />
        </a>
        <ul className="pt-navlinks" style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", gap: 28, fontSize: 14 }}>
          {[["How it works", "#how"], ["Vendor tiering", "#tiers"], ["Pricing", "#pricing"], ["Standards", "#standards"], ["FAQ", "#faq"]].map(([label, href]) => (
            <li key={label}>
              <a href={href} style={{ display: "flex", alignItems: "center", cursor: "pointer", color: "rgba(255,255,255,0.85)", textDecoration: "none" }}>{label}</a>
            </li>
          ))}
        </ul>
        <div style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: 16 }}>
          <a href="#cta" style={{ textDecoration: "none" }}><Button>{ctaCopy} <ArrowRight size={12} color="#04212B" /></Button></a>
        </div>
      </nav>
    </header>
  );
}

// ---------- Hero ----------

function Hero({ ctaCopy }) {
  return (
    <section style={{ background: "var(--pt-hero)", padding: "80px 48px 96px", position: "relative", overflow: "hidden" }}>
      <div aria-hidden="true" style={{ position: "absolute", inset: 0, backgroundImage: "linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px)", backgroundSize: "64px 64px", maskImage: "radial-gradient(ellipse at 72% 42%, black 25%, transparent 72%)", WebkitMaskImage: "radial-gradient(ellipse at 72% 42%, black 25%, transparent 72%)" }}></div>
      <div aria-hidden="true" style={{ position: "absolute", top: -160, right: -120, width: 560, height: 560, borderRadius: "50%", background: "radial-gradient(circle, rgba(63,168,196,0.22) 0%, transparent 62%)", pointerEvents: "none" }}></div>

      <div style={{ position: "relative", maxWidth: 1280, margin: "0 auto", display: "grid", gridTemplateColumns: "1.05fr 1fr", gap: 72, alignItems: "center" }}>
        <div>
          <div style={{ display: "inline-flex", alignItems: "center", gap: 8, padding: "6px 12px", background: "rgba(255,255,255,0.05)", border: "1px solid rgba(255,255,255,0.12)", borderRadius: 999, fontSize: 12, fontFamily: "var(--font-sans)", marginBottom: 24 }}>
            <span style={{ width: 6, height: 6, borderRadius: 3, background: "var(--pt-teal)" }}></span>
            <span style={{ color: "#fff", fontWeight: 500 }}>NIS2 Article 21 · Supply-chain risk</span>
            <span style={{ color: "rgba(255,255,255,0.55)" }}>v3.0 just shipped</span>
          </div>

          <h1 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 64, lineHeight: "70px", letterSpacing: "-0.02em", margin: 0, marginBottom: 20, textWrap: "balance", color: "#fff" }}>
            Score every vendor.<br/>
            <em>Tier every risk.</em><br/>
            <span style={{ color: "var(--pt-teal-light)" }}>Prove it</span> to your auditor.
          </h1>

          <p style={{ marginBottom: 32, maxWidth: "52ch", fontSize: 18, lineHeight: "28px", color: "rgba(255,255,255,0.72)", fontFamily: "var(--font-sans)" }}>
            Under NIS2, your suppliers are now your liability. Proof&amp;Trust replaces static questionnaires with evidence-grade scoring — drop in your supplier evidence and get a defensible, Article 21-tiered portfolio in under 30 minutes, refreshed continuously.
          </p>

          <div style={{ display: "flex", gap: 12, alignItems: "center", marginBottom: 16, flexWrap: "wrap" }}>
            <a href="#cta" style={{ textDecoration: "none" }}><Button size="lg">{ctaCopy} <ArrowRight size={14} color="#04212B" /></Button></a>
          </div>
          <div style={{ display: "flex", alignItems: "center", gap: 16, fontSize: 13, color: "rgba(255,255,255,0.6)", flexWrap: "wrap" }}>
            <span style={{ display: "inline-flex", alignItems: "center", gap: 6 }}><span style={{ width: 4, height: 4, borderRadius: 2, background: "#5BC8A0" }}></span> 30-min sample · no integration required</span>
            <span style={{ opacity: 0.4 }}>·</span>
            <span>NDA on request</span>
            <span style={{ opacity: 0.4 }}>·</span>
            <span>EU-hosted</span>
          </div>

          <div style={{ marginTop: 40, paddingTop: 24, borderTop: "1px solid rgba(255,255,255,0.1)", display: "flex", gap: 32, flexWrap: "wrap", alignItems: "center" }}>
            <span style={{ fontSize: 11, color: "rgba(255,255,255,0.5)", letterSpacing: "0.12em", textTransform: "uppercase" }}>Trusted by teams in</span>
            {["Banking", "Energy", "Healthcare", "Telecom", "Public Sector"].map((s) => (
              <span key={s} style={{ fontFamily: "var(--font-serif)", fontSize: 15, color: "rgba(255,255,255,0.65)" }}>{s}</span>
            ))}
          </div>
        </div>

        <Reveal delay={120}>
          <HeroMock />
        </Reveal>
      </div>
    </section>
  );
}

function HeroMock() {
  return (
    <div className="pt-heromock" style={{ position: "relative", height: 540 }}>
      {/* Vendor dossier (dark UI) */}
      <div style={{ position: "absolute", left: 0, top: 24, width: "100%", maxWidth: 380, boxSizing: "border-box", background: "var(--pt-card)", borderRadius: 14, boxShadow: "0 28px 60px rgba(0,0,0,0.5)", padding: 22, fontSize: 12, fontFamily: "var(--font-sans)", border: "1px solid rgba(255,255,255,0.1)" }}>
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 6 }}>
          <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
            <span style={{ width: 28, height: 28, borderRadius: 7, background: "rgba(255,255,255,0.06)", display: "inline-flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-serif)", fontSize: 13, color: "#fff" }}>NV</span>
            <div>
              <div style={{ fontSize: 13, fontWeight: 500, color: "#fff" }}>Cross-border carrier</div>
              <div style={{ fontSize: 11, color: "rgba(255,255,255,0.5)" }}>Direct supplier · 14 dependencies</div>
            </div>
          </div>
          <span style={{ background: "rgba(236,106,43,0.18)", color: "#FF8A4C", padding: "3px 10px", borderRadius: 999, fontSize: 10, fontWeight: 500, letterSpacing: "0.06em" }}>TIER 2 · HIGH</span>
        </div>

        <RiskGauge value={67} />

        <div className="pt-keep-3" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 8, paddingTop: 14, borderTop: "1px solid rgba(255,255,255,0.1)" }}>
          <MiniGauge label="Evidence" value={72} />
          <MiniGauge label="Posture" value={41} />
          <MiniGauge label="Concentration" value={88} />
        </div>

        <div style={{ borderTop: "1px solid rgba(255,255,255,0.1)", paddingTop: 12, marginTop: 14, fontSize: 11 }}>
          <div style={{ color: "rgba(255,255,255,0.5)", marginBottom: 6, letterSpacing: "0.06em", textTransform: "uppercase", fontSize: 10 }}>NIS2 Article 21 mapping</div>
          {[
            ["21(2)(a)", "Risk analysis & ISMS", "ok"],
            ["21(2)(d)", "Supply chain security", "flag"],
            ["21(2)(j)", "MFA & secure comms", "ok"],
          ].map(([id, label, status]) => (
            <div key={id} style={{ display: "flex", justifyContent: "space-between", alignItems: "center", padding: "3px 0" }}>
              <span style={{ fontFamily: "var(--font-sans)", color: "rgba(255,255,255,0.85)" }}><b style={{ fontWeight: 500, color: "#fff" }}>{id}</b> · {label}</span>
              <span style={{ width: 8, height: 8, borderRadius: 4, background: status === "ok" ? "#5BC8A0" : "#EC6A2B" }}></span>
            </div>
          ))}
        </div>
      </div>

      {/* Auto-scored toast */}
      <div style={{ position: "absolute", right: 0, top: 0, width: 240, boxSizing: "border-box", background: "var(--pt-card)", borderRadius: 14, padding: 14, fontSize: 12, boxShadow: "0 16px 36px rgba(0,0,0,0.4)", border: "1px solid rgba(255,255,255,0.1)" }}>
        <div style={{ display: "flex", alignItems: "center", gap: 8, marginBottom: 8 }}>
          <BrandGlyph size={16} />
          <span style={{ fontSize: 11, color: "rgba(255,255,255,0.5)", letterSpacing: "0.06em", textTransform: "uppercase" }}>Auto-scored · 14s ago</span>
        </div>
        <div style={{ fontSize: 12, color: "rgba(255,255,255,0.85)", lineHeight: "16px" }}>
          ISO 27001 certificate ingested · Validity confirmed · Vendor moved to <i style={{ color: "var(--pt-teal-light)" }}>Tier 2</i>.
        </div>
      </div>

      {/* Portfolio donut tile */}
      <div style={{ position: "absolute", right: 0, bottom: 12, width: 240, boxSizing: "border-box", background: "linear-gradient(180deg, #0B2236 0%, #061521 100%)", color: "white", borderRadius: 14, padding: 16, boxShadow: "0 24px 48px rgba(0,0,0,0.5)", border: "1px solid rgba(255,255,255,0.08)" }}>
        <div style={{ fontSize: 10, color: "rgba(255,255,255,0.6)", letterSpacing: "0.1em", textTransform: "uppercase", marginBottom: 12 }}>Portfolio · live</div>
        <div style={{ display: "flex", alignItems: "center", gap: 14 }}>
          <DonutGauge value={58} />
          <div style={{ fontSize: 11, lineHeight: "16px", color: "rgba(255,255,255,0.8)" }}>
            <div style={{ fontFamily: "var(--font-sans)", color: "#fff", fontSize: 12, fontWeight: 500, marginBottom: 2 }}>Aggregate risk</div>
            247 vendors scored<br/>
            <span style={{ color: "#FF8A4C" }}>▲ 4 pts</span> last 7 days
          </div>
        </div>
        <div style={{ display: "flex", gap: 6, marginTop: 14 }}>
          {[
            ["T1", 8, "#E0533A"],
            ["T2", 21, "#EC6A2B"],
            ["T3", 44, "#5BC8A0"],
            ["T4", 27, "rgba(255,255,255,0.4)"],
          ].map(([l, w, c]) => (
            <div key={l} style={{ flex: w, textAlign: "center" }}>
              <div style={{ height: 4, background: c, borderRadius: 2, marginBottom: 4 }}></div>
              <div style={{ fontSize: 9, color: "rgba(255,255,255,0.65)", letterSpacing: "0.06em" }}>{l} · {w}%</div>
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}

// ---------- Outcomes ----------

function Outcomes() {
  const stats = [
    ["1,200+", "Vendors typically tiered in the first 6 weeks"],
    ["94%", "Reduction in manual questionnaire cycles"],
    ["10/10", "Article 21(2) measures covered"],
    ["< 30 min", "From upload to fully scored portfolio"],
  ];
  return (
    <section style={{ background: "var(--pt-navy)", padding: "72px 48px", borderTop: "1px solid rgba(255,255,255,0.06)", borderBottom: "1px solid rgba(255,255,255,0.06)" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto", display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 0 }}>
        {stats.map(([v, l], i) => (
          <div key={l} style={{ padding: "0 24px", borderLeft: i === 0 ? "none" : "1px solid rgba(255,255,255,0.1)" }}>
            <div style={{ fontFamily: "var(--font-serif)", fontSize: 56, lineHeight: 1, color: "#fff", letterSpacing: "-0.02em" }}>{v}</div>
            <div style={{ fontSize: 14, color: "rgba(255,255,255,0.6)", marginTop: 12, lineHeight: "20px", maxWidth: "26ch" }}>{l}</div>
          </div>
        ))}
      </div>
    </section>
  );
}

// ---------- Stakes / why now ----------

function Stakes() {
  const cards = [
    {
      big: "€10M",
      unit: "or 2% of global turnover",
      label: "Maximum NIS2 fines",
      body: "Essential entities face the higher of €10M or 2% of total worldwide annual turnover for non-compliance.",
    },
    {
      big: "Personal",
      unit: "management liability",
      label: "It reaches the boardroom",
      body: "Management bodies must approve and oversee cybersecurity risk measures — and can be held personally accountable.",
    },
    {
      big: "Live",
      unit: "since Oct 2024",
      label: "The deadline has passed",
      body: "NIS2 has applied across the EU since 17 October 2024. Enforcement and audits are ramping now — not later.",
    },
  ];
  return (
    <section id="why-nis2" style={{ background: "var(--pt-hero)", padding: "112px 48px", position: "relative", overflow: "hidden" }}>
      <div style={{ position: "relative", maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ maxWidth: 720, marginBottom: 56 }}>
          <span className="sq-caption" style={{ color: "#FF8A4C" }}>Why now</span>
          <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 48, lineHeight: "54px", letterSpacing: "-0.02em", margin: "12px 0 16px", color: "#fff", textWrap: "balance" }}>
            Under NIS2, your supply chain is no longer someone else's problem.
          </h2>
          <p style={{ fontSize: 18, lineHeight: "28px", color: "rgba(255,255,255,0.7)", margin: 0, maxWidth: "58ch", fontFamily: "var(--font-sans)" }}>
            Article 21(2)(d) makes the security of your direct suppliers <em>your</em> obligation. A spreadsheet of expired questionnaires won't survive an audit — and the penalties land on the people who signed off.
          </p>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
          {cards.map((c) => (
            <article key={c.label} style={{ background: "var(--pt-card)", border: "1px solid rgba(255,255,255,0.1)", borderRadius: 16, padding: 32, display: "flex", flexDirection: "column", gap: 12 }}>
              <div style={{ display: "flex", alignItems: "baseline", gap: 10 }}>
                <span style={{ fontFamily: "var(--font-serif)", fontSize: 52, lineHeight: 1, color: "#fff", letterSpacing: "-0.02em" }}>{c.big}</span>
                <span style={{ fontSize: 13, color: "#FF8A4C" }}>{c.unit}</span>
              </div>
              <div style={{ fontSize: 13, letterSpacing: "0.08em", textTransform: "uppercase", color: "rgba(255,255,255,0.55)" }}>{c.label}</div>
              <p style={{ fontSize: 15, lineHeight: "23px", color: "rgba(255,255,255,0.66)", margin: 0, fontFamily: "var(--font-sans)" }}>{c.body}</p>
            </article>
          ))}
        </div>

        <div style={{ marginTop: 40, display: "flex", alignItems: "center", gap: 20, flexWrap: "wrap" }}>
          <p style={{ fontFamily: "var(--font-serif)", fontSize: 22, color: "#fff", margin: 0 }}>
            Proof&amp;Trust turns that exposure into <em style={{ color: "var(--pt-teal-light)" }}>defensible, audit-ready proof</em>.
          </p>
          <a href="#cta" style={{ textDecoration: "none" }}><Button>See your exposure <ArrowRight size={14} color="#04212B" /></Button></a>
        </div>
      </div>
    </section>
  );
}

// ---------- How it works ----------

function HowItWorks() {
  const steps = [
    {
      n: "01",
      title: "Ingest every piece of evidence",
      body: "Connect contracts, vendor masters, and document stores. We pull in certificates, attestations, SBOMs, pen-test reports, and policies — and verify authenticity, validity, and scope automatically.",
      icon: (
        <svg width="36" height="36" viewBox="0 0 36 36" fill="none">
          <rect x="6" y="4" width="20" height="26" rx="2" stroke="#fff" strokeWidth="1.4"/>
          <path d="M11 12h10M11 17h10M11 22h6" stroke="#fff" strokeWidth="1.4" strokeLinecap="round"/>
          <circle cx="27" cy="27" r="5" fill="var(--pt-teal)"/>
          <path d="M24.5 27l1.6 1.6L29.5 25" stroke="#04212B" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/>
        </svg>
      ),
    },
    {
      n: "02",
      title: "Score each artifact, score the vendor",
      body: "Every artifact gets an evidence-grade score: completeness, recency, source trust, and control coverage. Scores roll up into a continuously recalculated vendor risk index, mapped to NIS2 Article 21(2).",
      icon: (
        <svg width="36" height="36" viewBox="0 0 36 36" fill="none">
          <path d="M4 22a14 14 0 0 1 28 0" stroke="#fff" strokeWidth="1.4"/>
          <path d="M18 22l8-7" stroke="var(--pt-teal)" strokeWidth="2" strokeLinecap="round"/>
          <circle cx="18" cy="22" r="2.4" fill="#fff"/>
          <path d="M8 24h2M26 24h2M16 12h4" stroke="#fff" strokeWidth="1.4" strokeLinecap="round"/>
        </svg>
      ),
    },
    {
      n: "03",
      title: "Tier and re-tier continuously",
      body: "Vendors auto-classify into four NIS2 tiers — Critical, High, Standard, Limited — based on dependency, concentration, and evidence quality. Tiers update the moment new evidence lands or a signal degrades.",
      icon: (
        <svg width="36" height="36" viewBox="0 0 36 36" fill="none">
          <rect x="4" y="22" width="6" height="10" rx="1" fill="#E0533A"/>
          <rect x="12" y="16" width="6" height="16" rx="1" fill="#EC6A2B"/>
          <rect x="20" y="10" width="6" height="22" rx="1" fill="#5BC8A0"/>
          <rect x="28" y="6" width="6" height="26" rx="1" stroke="#fff" strokeWidth="1.4"/>
        </svg>
      ),
    },
  ];
  return (
    <section id="how" style={{ background: "var(--pt-ink)", padding: "112px 48px" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1.4fr", gap: 48, marginBottom: 64, alignItems: "end" }}>
          <div>
            <Caption>How it works</Caption>
            <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 48, lineHeight: "54px", letterSpacing: "-0.02em", margin: "12px 0 0", textWrap: "balance", color: "#fff" }}>
              From <em>static questionnaires</em> to <em>scored evidence</em> — in three moves.
            </h2>
          </div>
          <div style={{ alignSelf: "end" }}>
            <p style={{ fontSize: 17, lineHeight: "26px", maxWidth: "44ch", color: "rgba(255,255,255,0.65)", fontFamily: "var(--font-sans)" }}>
              No more chasing PDFs across SharePoint. Proof&amp;Trust ingests, validates, and scores — so your team can spend their time deciding, not collecting.
            </p>
          </div>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
          {steps.map((s) => (
            <article key={s.n} style={{ background: "var(--pt-card)", borderRadius: 16, padding: 32, height: "100%", display: "flex", flexDirection: "column", gap: 16, position: "relative", overflow: "hidden", border: "1px solid rgba(255,255,255,0.08)" }}>
              <div style={{ position: "absolute", top: 24, right: 28, fontFamily: "var(--font-serif)", fontSize: 64, lineHeight: 1, color: "rgba(255,255,255,0.05)" }}>{s.n}</div>
              <div style={{ width: 56, height: 56, borderRadius: 12, background: "rgba(255,255,255,0.04)", display: "inline-flex", alignItems: "center", justifyContent: "center", border: "1px solid rgba(255,255,255,0.1)" }}>
                {s.icon}
              </div>
              <h3 style={{ fontFamily: "var(--font-sans)", fontWeight: 500, fontSize: 22, lineHeight: "28px", margin: "8px 0 0", color: "#fff", letterSpacing: "-0.005em" }}>{s.title}</h3>
              <p style={{ fontSize: 15, lineHeight: "24px", color: "rgba(255,255,255,0.62)", fontFamily: "var(--font-sans)", margin: 0 }}>{s.body}</p>
            </article>
          ))}
        </div>
      </div>
    </section>
  );
}

// ---------- Risk tiers (NIS2-aligned: High / Medium / Low) ----------

function RiskTiers() {
  const tiers = [
    {
      key: "High",
      label: "High",
      role: "Critical supplier",
      nis2: "Essential-grade scrutiny",
      range: "75–100",
      color: "#E0533A",
      summary: "Underpins an essential service or touches your most sensitive data. A failure here puts your own NIS2 obligations at risk.",
      points: [
        "High data criticality + high risk exposure",
        "Supports an Annex I high-criticality function",
        "Full, documented Article 21(2) evidence required",
      ],
      action: "Continuous monitoring · remediate now",
    },
    {
      key: "Medium",
      label: "Medium",
      role: "Important supplier",
      nis2: "Important-grade scrutiny",
      range: "40–74",
      color: "#EC6A2B",
      summary: "Material to service delivery or handles important — but not the most sensitive — data. Proportionate measures with gaps to close.",
      points: [
        "Moderate data criticality or risk exposure",
        "Annex II / other-critical-sector relevance",
        "Article 21(2) measures, pragmatic evidence",
      ],
      action: "Quarterly review · close the gaps",
    },
    {
      key: "Low",
      label: "Low",
      role: "Baseline supplier",
      nis2: "Baseline scrutiny",
      range: "0–39",
      color: "#5BC8A0",
      summary: "Limited data access and low operational dependency. Monitored, not a critical dependency — auto-escalates if exposure rises.",
      points: [
        "Low data criticality + low risk exposure",
        "Not a critical dependency under NIS2",
        "Baseline controls + attestation evidence",
      ],
      action: "Annual re-attestation · monitor signals",
    },
  ];
  return (
    <section id="risk-tiers" style={{ background: "var(--pt-ink)", padding: "112px 48px", borderTop: "1px solid rgba(255,255,255,0.06)" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 48, marginBottom: 44, alignItems: "end" }}>
          <div>
            <Caption>NIS2-aligned tiering</Caption>
            <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 48, lineHeight: "54px", letterSpacing: "-0.02em", margin: "12px 0 0", color: "#fff", textWrap: "balance" }}>
              Tiered the way <em>NIS2 expects</em> — by criticality and exposure.
            </h2>
          </div>
          <p style={{ fontSize: 17, lineHeight: "26px", maxWidth: "48ch", color: "rgba(255,255,255,0.65)", fontFamily: "var(--font-sans)" }}>
            Article 21(2)(d) makes you responsible for supplier security — applied <em>proportionately</em> to risk. We tier every vendor on the two dimensions the Directive cares about, then set oversight to match.
          </p>
        </div>

        {/* Two selection axes → tier */}
        <div style={{ display: "flex", alignItems: "center", gap: 16, flexWrap: "wrap", marginBottom: 36, padding: "22px 28px", background: "var(--pt-card)", border: "1px solid rgba(255,255,255,0.1)", borderRadius: 16 }}>
          <span style={{ fontSize: 11, letterSpacing: "0.1em", textTransform: "uppercase", color: "rgba(255,255,255,0.45)", marginRight: 4 }}>How vendors are selected</span>
          <span style={{ display: "inline-flex", alignItems: "center", gap: 10, background: "rgba(255,255,255,0.04)", border: "1px solid rgba(255,255,255,0.12)", borderRadius: 999, padding: "8px 16px" }}>
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="2.5" y="2.5" width="11" height="11" rx="2" stroke="var(--pt-teal-light)" strokeWidth="1.4"/><path d="M5.5 8h5M5.5 5.5h5M5.5 10.5h3" stroke="var(--pt-teal-light)" strokeWidth="1.4" strokeLinecap="round"/></svg>
            <span style={{ fontSize: 14, color: "#fff", fontWeight: 500 }}>Criticality of data &amp; service</span>
          </span>
          <span style={{ fontFamily: "var(--font-serif)", fontSize: 22, color: "rgba(255,255,255,0.4)" }}>×</span>
          <span style={{ display: "inline-flex", alignItems: "center", gap: 10, background: "rgba(255,255,255,0.04)", border: "1px solid rgba(255,255,255,0.12)", borderRadius: 999, padding: "8px 16px" }}>
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M8 2.5l5.5 3v3.2c0 2.7-2.3 4.6-5.5 5.6-3.2-1-5.5-2.9-5.5-5.6V5.5L8 2.5z" stroke="var(--pt-teal-light)" strokeWidth="1.4" strokeLinejoin="round"/><path d="M8 7v3" stroke="var(--pt-teal-light)" strokeWidth="1.4" strokeLinecap="round"/></svg>
            <span style={{ fontSize: 14, color: "#fff", fontWeight: 500 }}>Risk exposure</span>
          </span>
          <ArrowRight size={16} color="rgba(255,255,255,0.5)" />
          <span style={{ display: "inline-flex", alignItems: "center", gap: 8, fontSize: 14, color: "var(--pt-teal-light)", fontWeight: 500 }}>Vendor tier &amp; oversight depth</span>
        </div>

        {/* Risk spectrum bar */}
        <div style={{ marginBottom: 40 }}>
          <div style={{ height: 8, borderRadius: 999, background: "linear-gradient(90deg, #5BC8A0 0%, #5BC8A0 30%, #EC6A2B 50%, #E0533A 78%, #E0533A 100%)" }}></div>
          <div style={{ display: "flex", justifyContent: "space-between", marginTop: 8, fontSize: 11, letterSpacing: "0.08em", textTransform: "uppercase", color: "rgba(255,255,255,0.45)" }}>
            <span>0 · Lower risk</span>
            <span>Vendor risk index</span>
            <span>Higher risk · 100</span>
          </div>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
          {tiers.map((t) => (
            <article key={t.key} style={{ background: "var(--pt-card)", border: "1px solid rgba(255,255,255,0.1)", borderRadius: 16, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }}>
              <div style={{ height: 4, background: t.color }}></div>
              <div style={{ padding: 32, display: "flex", flexDirection: "column", gap: 16, flex: 1 }}>
                <div style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }}>
                  <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
                    <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
                      <span style={{ width: 10, height: 10, borderRadius: 5, background: t.color, boxShadow: `0 0 0 4px ${t.color}22` }}></span>
                      <span style={{ fontFamily: "var(--font-sans)", fontWeight: 500, fontSize: 20, color: "#fff", letterSpacing: "-0.005em" }}>{t.label} · {t.role}</span>
                    </div>
                    <span style={{ fontSize: 12, color: t.color, letterSpacing: "0.02em", paddingLeft: 20 }}>{t.nis2}</span>
                  </div>
                  <span style={{ fontSize: 11, letterSpacing: "0.08em", textTransform: "uppercase", color: "rgba(255,255,255,0.5)", border: "1px solid rgba(255,255,255,0.16)", borderRadius: 999, padding: "4px 10px", whiteSpace: "nowrap" }}>Score {t.range}</span>
                </div>
                <p style={{ fontSize: 15, lineHeight: "23px", color: "rgba(255,255,255,0.78)", margin: 0, fontFamily: "var(--font-sans)" }}>{t.summary}</p>
                <ul style={{ listStyle: "none", margin: 0, padding: 0, display: "flex", flexDirection: "column", gap: 10 }}>
                  {t.points.map((p) => (
                    <li key={p} style={{ position: "relative", paddingLeft: 22, fontSize: 14, lineHeight: "21px", color: "rgba(255,255,255,0.62)", fontFamily: "var(--font-sans)" }}>
                      <span style={{ position: "absolute", left: 2, top: 7, width: 6, height: 6, borderRadius: 2, background: t.color }}></span>
                      {p}
                    </li>
                  ))}
                </ul>
                <div style={{ marginTop: "auto", paddingTop: 18, borderTop: "1px solid rgba(255,255,255,0.08)", display: "flex", alignItems: "center", gap: 8, fontSize: 13, color: t.color, fontWeight: 500 }}>
                  <svg width="14" height="14" viewBox="0 0 16 16" fill="none" style={{ flex: "none" }}><path d="M8 4v4l2.5 2.5" stroke={t.color} strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/><circle cx="8" cy="8" r="6.5" stroke={t.color} strokeWidth="1.4"/></svg>
                  {t.action}
                </div>
              </div>
            </article>
          ))}
        </div>

        <p style={{ marginTop: 24, fontSize: 13, lineHeight: "20px", color: "rgba(255,255,255,0.4)", maxWidth: "82ch", fontFamily: "var(--font-sans)" }}>
          NIS2 doesn't prescribe supplier tiers directly — it requires (Art. 21(2)(d)) that supply-chain and supplier security measures be proportionate to risk. These tiers mirror the Directive's own essential / important / baseline logic so oversight scales with criticality and exposure.
        </p>
      </div>
    </section>
  );
}

// ---------- Comparison ----------

function Comparison() {
  const rows = [
    ["Time to a scored portfolio", "6–12 weeks", "Under 30 minutes"],
    ["Evidence freshness", "Annual snapshot", "Continuous, event-driven"],
    ["Article 21(2) coverage", "Manual mapping", "10 / 10 measures, automated"],
    ["Auditor defensibility", "Spreadsheet trail", "Cited evidence per score"],
    ["When a CVE drops", "You email vendors", "Tiers re-calculate in minutes"],
  ];
  return (
    <section style={{ background: "var(--pt-navy)", padding: "112px 48px" }}>
      <div style={{ maxWidth: 1100, margin: "0 auto" }}>
        <div style={{ textAlign: "center", marginBottom: 48 }}>
          <Caption>Questionnaires vs. Proof&amp;Trust</Caption>
          <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 48, lineHeight: "54px", letterSpacing: "-0.02em", margin: "12px 0 0", color: "#fff" }}>
            Stop renting <em>compliance theatre</em>.
          </h2>
        </div>

        <div style={{ background: "var(--pt-card)", borderRadius: 16, overflow: "hidden", border: "1px solid rgba(255,255,255,0.1)", boxShadow: "0 24px 48px rgba(0,0,0,0.4)" }}>
          <div className="pt-compare" style={{ display: "grid", gridTemplateColumns: "1.4fr 1fr 1fr", padding: "16px 32px", background: "var(--pt-ink)", color: "white", fontSize: 12, letterSpacing: "0.1em", textTransform: "uppercase", fontFamily: "var(--font-sans)" }}>
            <div></div>
            <div style={{ textAlign: "center", opacity: 0.55 }}>Questionnaire-led</div>
            <div style={{ textAlign: "center", color: "var(--pt-teal-light)" }}>Proof&amp;Trust</div>
          </div>
          {rows.map(([label, a, b], i) => (
            <div key={i} className="pt-compare" style={{ display: "grid", gridTemplateColumns: "1.4fr 1fr 1fr", padding: "20px 32px", borderTop: "1px solid rgba(255,255,255,0.08)", alignItems: "center", fontSize: 15 }}>
              <div style={{ fontWeight: 500, color: "#fff" }}>{label}</div>
              <div style={{ textAlign: "center", color: "rgba(255,255,255,0.45)", textDecoration: "line-through", textDecorationColor: "rgba(255,255,255,0.25)" }}>{a}</div>
              <div style={{ textAlign: "center", color: "var(--pt-teal-light)", fontWeight: 500 }}>{b}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ---------- Tier visualization ----------

function DarkUseCases() {
  const tiers = [
    { name: "High · Critical supplier", nis2: "Essential-grade scrutiny", pct: "12%", note: "of suppliers · loss would put your own NIS2 essential-service obligations at risk.", body: "High data criticality and exposure. Weekly evidence refresh, continuous breach monitoring, full Article 21(2) coverage, and direct CISO notifications on any score change.", bar: 92, color: "#E0533A" },
    { name: "Medium · Important supplier", nis2: "Important-grade scrutiny", pct: "33%", note: "of suppliers · material to service delivery, but not your most sensitive data.", body: "Moderate dependency or exposure. Quarterly re-assessment, automated CVE matching, and pragmatic Article 21(2) evidence with gaps tracked to closure.", bar: 58, color: "#EC6A2B" },
    { name: "Low · Baseline supplier", nis2: "Baseline scrutiny", pct: "55%", note: "of suppliers · low dependency and low data exposure.", body: "Baseline controls with attestation-based evidence and annual refresh. Event-driven re-checks on CVE, sanctions, or breach signals — auto-escalates the moment exposure crosses threshold.", bar: 28, color: "#5BC8A0" },
  ];
  return (
    <section id="tiers" style={{ background: "var(--pt-ink)", color: "white", padding: "112px 48px", position: "relative", overflow: "hidden" }}>
      <div aria-hidden="true" style={{ position: "absolute", top: -200, right: -200, width: 600, height: 600, borderRadius: "50%", background: "radial-gradient(circle, rgba(63,168,196,0.16) 0%, transparent 60%)", pointerEvents: "none" }}></div>
      <div style={{ position: "relative", maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 48, marginBottom: 56, alignItems: "end" }}>
          <div>
            <Caption>Vendor tiering</Caption>
            <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 48, lineHeight: "54px", letterSpacing: "-0.02em", margin: "12px 0 0", color: "white", textWrap: "balance" }}>
              Three <em>defensible tiers</em>, recalculated every time evidence arrives.
            </h2>
          </div>
          <p style={{ color: "rgba(255,255,255,0.72)", fontSize: 17, lineHeight: "26px", maxWidth: "48ch", fontFamily: "var(--font-sans)" }}>
            Every tier change is timestamped, traceable to its evidence, and exportable as audit-ready proof.
          </p>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
          {tiers.map((t) => (
            <article key={t.name} style={{ background: "var(--pt-card)", border: "1px solid rgba(255,255,255,0.1)", borderRadius: 16, padding: 28, display: "flex", flexDirection: "column", gap: 16 }}>
              <div style={{ display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 }}>
                <div style={{ display: "flex", flexDirection: "column", gap: 4 }}>
                  <span style={{ fontSize: 11, letterSpacing: "0.1em", textTransform: "uppercase", color: "rgba(255,255,255,0.7)" }}>{t.name}</span>
                  <span style={{ fontSize: 12, color: t.color }}>{t.nis2}</span>
                </div>
                <span style={{ width: 10, height: 10, borderRadius: 5, background: t.color, boxShadow: `0 0 0 4px ${t.color}22`, flex: "none", marginTop: 4 }}></span>
              </div>
              <div style={{ display: "flex", alignItems: "baseline", gap: 16 }}>
                <span style={{ fontFamily: "var(--font-serif)", fontSize: 64, color: "white", lineHeight: 1, letterSpacing: "-0.02em" }}>{t.pct}</span>
                <span style={{ fontSize: 13, color: "rgba(255,255,255,0.6)", maxWidth: "28ch" }}>{t.note}</span>
              </div>
              <div style={{ height: 4, background: "rgba(255,255,255,0.1)", borderRadius: 2, overflow: "hidden" }}>
                <div style={{ width: `${t.bar}%`, height: "100%", background: t.color }}></div>
              </div>
              <p style={{ color: "rgba(255,255,255,0.66)", fontSize: 15, lineHeight: "23px", fontFamily: "var(--font-sans)", margin: 0 }}>{t.body}</p>
            </article>
          ))}
        </div>
      </div>
    </section>
  );
}

// ---------- Testimonial ----------

function Testimonial() {
  return (
    <section style={{ background: "var(--pt-navy)", padding: "112px 48px" }}>
      <div className="pt-quote" style={{ maxWidth: 1100, margin: "0 auto", background: "var(--pt-card)", borderRadius: 24, padding: "72px 80px", display: "grid", gridTemplateColumns: "1fr 280px", gap: 64, alignItems: "center", position: "relative", overflow: "hidden", border: "1px solid rgba(255,255,255,0.1)" }}>
        <div className="pt-quotemark" style={{ position: "absolute", top: -40, left: -20, fontFamily: "var(--font-serif)", fontSize: 240, lineHeight: 1, color: "var(--pt-teal)", opacity: 0.16, pointerEvents: "none" }}>&ldquo;</div>
        <div style={{ position: "relative" }}>
          <p style={{ fontFamily: "var(--font-serif)", fontSize: 30, lineHeight: "42px", color: "#fff", margin: 0, marginBottom: 32, letterSpacing: "-0.005em" }}>
            We tiered <em style={{ color: "var(--pt-teal-light)" }}>312 vendors</em> in six weeks. The Article 21 mapping alone replaced about 40% of the work my team used to do by hand — and the auditors stopped arguing.
          </p>
          <div style={{ display: "flex", alignItems: "center", gap: 14 }}>
            <div style={{ width: 48, height: 48, borderRadius: 24, background: "var(--pt-teal)", color: "#04212B", display: "inline-flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--font-serif)", fontSize: 18 }}>EM</div>
            <div>
              <div style={{ fontSize: 15, fontWeight: 500, color: "#fff" }}>Elin Marquand</div>
              <div style={{ fontSize: 13, color: "rgba(255,255,255,0.55)" }}>CISO · Tier-1 European bank (NDA)</div>
            </div>
          </div>
        </div>
        <div style={{ position: "relative", display: "flex", flexDirection: "column", gap: 12 }}>
          {[
            ["Vendors tiered", "312"],
            ["Time to first portfolio", "41 days"],
            ["Manual cycles removed", "94%"],
          ].map(([l, v]) => (
            <div key={l} style={{ background: "rgba(255,255,255,0.04)", borderRadius: 12, padding: 20, border: "1px solid rgba(255,255,255,0.1)" }}>
              <div style={{ fontFamily: "var(--font-serif)", fontSize: 32, lineHeight: 1, color: "#fff", letterSpacing: "-0.02em" }}>{v}</div>
              <div style={{ fontSize: 12, color: "rgba(255,255,255,0.55)", marginTop: 6, letterSpacing: "0.04em" }}>{l}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ---------- Recognition ----------

function Recognition() {
  return (
    <section id="standards" style={{ background: "var(--pt-ink)", padding: "0 48px 112px" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto", paddingTop: 112 }}>
        <div className="pt-recog" style={{ background: "var(--pt-card)", borderRadius: 24, padding: "64px 56px", display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 56, alignItems: "center", border: "1px solid rgba(255,255,255,0.1)" }}>
          <div>
            <Caption>Standards &amp; coverage</Caption>
            <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 40, lineHeight: "46px", letterSpacing: "-0.02em", margin: "12px 0 24px", color: "#fff" }}>
              Built to the standards your <em>auditors</em> cite.
            </h2>
            <ul style={{ listStyle: "none", padding: 0, margin: "0 0 28px", display: "flex", flexDirection: "column", gap: 12 }}>
              {[
                "Full coverage of NIS2 Article 21(2)(a)–(j) measures.",
                "Article 23 incident-notification drafting with 24-hour early-warning timing.",
                "ISO 27001 and ISO 27036 supplier-relationship aligned scoring.",
                "EU-hosted, encrypted in transit and at rest, with full data residency.",
              ].map((t, i) => (
                <li key={i} className="sq-check" style={{ fontSize: 15, alignItems: "flex-start", color: "rgba(255,255,255,0.82)" }}>
                  <Check />
                  <span style={{ flex: 1 }}>{t}</span>
                </li>
              ))}
            </ul>
          </div>
          <div className="pt-keep-2" style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 12 }}>
            {[
              ["10/10", "Article 21(2) measures"],
              ["24h", "Early-warning draft"],
              ["ISO 27001", "Aligned controls"],
              ["EU", "Hosted &amp; sovereign"],
            ].map(([v, l]) => (
              <div key={l} style={{ background: "rgba(255,255,255,0.04)", borderRadius: 12, padding: 24, border: "1px solid rgba(255,255,255,0.1)" }}>
                <div style={{ fontFamily: "var(--font-serif)", fontSize: 36, lineHeight: 1, color: "#fff", letterSpacing: "-0.02em" }} dangerouslySetInnerHTML={{ __html: v }} />
                <div style={{ fontSize: 13, color: "rgba(255,255,255,0.55)", marginTop: 10 }} dangerouslySetInnerHTML={{ __html: l }} />
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ---------- Pricing ----------

function Pricing({ ctaCopy }) {
  const plans = [
    {
      name: "Basic",
      price: "€1,999",
      cadence: "/ year",
      tagline: "For teams formalising their first NIS2 vendor programme.",
      vendors: "Up to 20 vendor assessments / year",
      cta: "Start with Basic",
      featured: false,
      features: [
        "Pre-screening questionnaire (5 questions)",
        "Low / Medium / High NIS2 questionnaires",
        "Standard PDF report — score, answers, evidence status",
        "Evidence upload + vendor invite link",
        "Basic CSV export",
        "Email support",
      ],
    },
    {
      name: "Professional",
      price: "€4,900",
      cadence: "/ year",
      tagline: "For active programmes that need automation and depth.",
      vendors: "Up to 100 vendor assessments / year",
      cta: "Choose Professional",
      featured: true,
      features: [
        "Expanded question sets for all 3 risk levels",
        "Enhanced PDF report — NIS2 summary + risk blocks",
        "Automated vendor reminders",
        "Recommended Actions section",
        "Vendor answer export (filtered CSV)",
        "Priority email support",
      ],
    },
    {
      name: "Enterprise",
      price: "€9,900+",
      cadence: "/ year",
      tagline: "For large portfolios with audit and integration needs.",
      vendors: "Up to 300 vendor assessments / year",
      cta: "Talk to sales",
      featured: false,
      features: [
        "Full question sets for all 3 risk levels",
        "Advanced PDF report — risk tables, summary insights",
        "Custom branding (your logo)",
        "Read-only auditor account",
        "Simple API export endpoint",
        "SLA (24h response) + onboarding session",
      ],
    },
  ];
  return (
    <section id="pricing" style={{ background: "var(--pt-ink)", padding: "112px 48px", borderTop: "1px solid rgba(255,255,255,0.06)" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ textAlign: "center", marginBottom: 16 }}>
          <Caption>Pricing</Caption>
          <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 48, lineHeight: "54px", letterSpacing: "-0.02em", margin: "12px 0 0", color: "#fff", textWrap: "balance" }}>
            Three clear tiers. <em>One NIS2 standard.</em>
          </h2>
          <p style={{ fontSize: 17, lineHeight: "26px", color: "rgba(255,255,255,0.65)", maxWidth: "52ch", margin: "16px auto 0", fontFamily: "var(--font-sans)" }}>
            Every plan delivers full NIS2-compliant vendor classification and the 3-tier questionnaire system. You scale on volume and depth — not on compliance.
          </p>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16, marginTop: 48, alignItems: "start" }}>
          {plans.map((p) => (
            <article key={p.name} style={{
              position: "relative",
              background: p.featured ? "var(--pt-card)" : "rgba(255,255,255,0.02)",
              border: p.featured ? "1px solid var(--pt-teal)" : "1px solid rgba(255,255,255,0.1)",
              borderRadius: 16, padding: 32, display: "flex", flexDirection: "column", gap: 22,
              boxShadow: p.featured ? "0 24px 48px rgba(63,168,196,0.18)" : "none",
              transform: p.featured ? "translateY(-8px)" : "none",
            }}>
              {p.featured && (
                <span style={{ position: "absolute", top: -13, left: "50%", transform: "translateX(-50%)", background: "var(--pt-teal)", color: "#04212B", fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", padding: "5px 14px", borderRadius: 999, whiteSpace: "nowrap" }}>Most popular</span>
              )}
              <div>
                <h3 style={{ fontFamily: "var(--font-sans)", fontWeight: 500, fontSize: 20, color: "#fff", margin: 0, letterSpacing: "-0.005em" }}>{p.name}</h3>
                <p style={{ fontSize: 14, lineHeight: "21px", color: "rgba(255,255,255,0.6)", margin: "8px 0 0", minHeight: 42, fontFamily: "var(--font-sans)" }}>{p.tagline}</p>
              </div>
              <div style={{ display: "flex", alignItems: "baseline", gap: 6 }}>
                <span style={{ fontFamily: "var(--font-serif)", fontSize: 42, lineHeight: 1, color: "#fff", letterSpacing: "-0.02em" }}>{p.price}</span>
                <span style={{ fontSize: 14, color: "rgba(255,255,255,0.5)" }}>{p.cadence}</span>
              </div>
              <div style={{ display: "inline-flex", alignItems: "center", gap: 8, fontSize: 13, fontWeight: 500, color: p.featured ? "var(--pt-teal-light)" : "rgba(255,255,255,0.8)", background: "rgba(63,168,196,0.08)", border: "1px solid rgba(63,168,196,0.2)", borderRadius: 999, padding: "8px 14px", alignSelf: "flex-start" }}>
                <svg width="14" height="14" viewBox="0 0 16 16" fill="none" style={{ flex: "none" }}><rect x="2.5" y="2.5" width="11" height="11" rx="2" stroke="var(--pt-teal-light)" strokeWidth="1.4"/><path d="M5.5 8h5M5.5 5.5h5M5.5 10.5h3" stroke="var(--pt-teal-light)" strokeWidth="1.4" strokeLinecap="round"/></svg>
                {p.vendors}
              </div>
              <a href="#cta" style={{ textDecoration: "none" }}>
                <Button variant={p.featured ? "primary" : "secondary"} size="lg" style={{ width: "100%", justifyContent: "center" }}>{p.cta} <ArrowRight size={13} color={p.featured ? "#04212B" : "#fff"} /></Button>
              </a>
              <ul style={{ listStyle: "none", margin: 0, padding: "4px 0 0", display: "flex", flexDirection: "column", gap: 12, borderTop: "1px solid rgba(255,255,255,0.08)", paddingTop: 22 }}>
                {p.features.map((f) => (
                  <li key={f} style={{ position: "relative", paddingLeft: 26, fontSize: 14, lineHeight: "21px", color: "rgba(255,255,255,0.74)", fontFamily: "var(--font-sans)" }}>
                    <svg width="16" height="16" viewBox="0 0 16 16" fill="none" style={{ position: "absolute", left: 0, top: 3 }}><circle cx="8" cy="8" r="7" fill="rgba(63,168,196,0.14)"/><path d="M4.8 8.2l2 2 4-4.4" stroke="var(--pt-teal-light)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/></svg>
                    {f}
                  </li>
                ))}
              </ul>
            </article>
          ))}
        </div>

        <p style={{ marginTop: 32, textAlign: "center", fontSize: 14, lineHeight: "22px", color: "rgba(255,255,255,0.55)", maxWidth: "70ch", margin: "32px auto 0", fontFamily: "var(--font-sans)" }}>
          All plans include full NIS2 compliance for vendor risk classification and the 3-tier questionnaire system. Annual billing, ex. VAT. Larger portfolios and private/on-prem deployments are quoted on the Enterprise tier — <a href="#cta" style={{ color: "var(--pt-teal-light)", textDecoration: "none", fontWeight: 500 }}>book a call</a> for a tailored scope.
        </p>
      </div>
    </section>
  );
}

// ---------- FAQ ----------

function FAQ() {
  const [open, setOpen] = useState(0);
  const items = [
    {
      q: "How does pricing work, and what counts as a vendor assessment?",
      a: "Plans are billed annually and scale on assessment volume: Basic (€1,999 / up to 20 assessments), Professional (€4,900 / up to 100), and Enterprise (€9,900+ / up to 300, plus custom branding, an auditor account, API export, and a 24h SLA). One assessment is one vendor taken through the NIS2 questionnaire and scored; re-running an existing vendor within the term doesn't consume a new slot. Every tier includes full NIS2-compliant classification and the 3-tier questionnaire system — you only scale on volume and depth. Larger portfolios and private/on-prem deployments are quoted on Enterprise.",
    },
    {
      q: "What does NIS2 actually require for supply-chain risk?",
      a: "NIS2 Article 21(2)(d) requires essential and important entities to manage cybersecurity risk in their supply chains, including the security of relationships with direct suppliers and service providers. Entities must assess each supplier's overall security practices, the quality of their products, and their secure-development practices. Proof&Trust automates this assessment end-to-end and produces the evidence regulators expect.",
    },
    {
      q: "How does evidence-grade scoring actually work?",
      a: "Every artifact a vendor provides — ISO certificates, SOC 2 reports, SBOMs, pen-test attestations, policies, contractual clauses — is parsed, validated against its issuer, scored on completeness, recency, scope, and control coverage, then weighted by the criticality of the NIS2 measure it addresses. Scores aggregate into a single, defensible vendor risk index.",
    },
    {
      q: "How are vendors assigned to tiers?",
      a: "Tiers are computed from three signals: dependency (how essential the vendor is to your service), concentration (single-source exposure and substitutability), and evidence quality (the aggregate score above). The model is deterministic and explainable — every tier change links back to the specific evidence event that triggered it.",
    },
    {
      q: "Can the platform be deployed entirely on-premise or in our private cloud?",
      a: "Yes. Proof&Trust ships as a multi-tenant EU-hosted SaaS, a single-tenant dedicated environment, or a private deployment in your VPC (AWS, Azure, GCP, or OVH). All deployments share the same evidence model and scoring engine.",
    },
    {
      q: "How is the assessment evidence structured for our auditors?",
      a: "Every score, tier, and recommendation ships with citations to the underlying artifacts and the specific NIS2 article it satisfies. The audit workspace exports a portable evidence pack (PDF + machine-readable JSON) that mirrors what auditors see in the live console.",
    },
    {
      q: "Does Proof&Trust generate the Article 23 incident-notification draft as well?",
      a: "Yes. When a qualifying incident is logged, the platform pre-fills the Article 23 early-warning notification (24h), incident notification (72h), and final report (1 month) with timestamped facts, affected vendors, and impact estimates — ready for your CSIRT to review and submit.",
    },
  ];
  return (
    <section id="faq" style={{ background: "var(--pt-navy)", padding: "112px 48px" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto", display: "grid", gridTemplateColumns: "1fr 2fr", gap: 64 }}>
        <div>
          <Caption>FAQ</Caption>
          <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 40, lineHeight: "46px", letterSpacing: "-0.02em", margin: "12px 0 16px", color: "#fff" }}>
            Questions, <em>answered</em>.
          </h2>
          <p style={{ fontSize: 15, lineHeight: "23px", color: "rgba(255,255,255,0.62)", fontFamily: "var(--font-sans)" }}>Can't find what you need? <a href="#cta" style={{ color: "var(--pt-teal-light)", textDecoration: "none", fontWeight: 500 }}>Talk to a specialist <ArrowRight size={11} color="var(--pt-teal-light)" /></a></p>
        </div>
        <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
          {items.map((it, i) => (
            <button key={i} onClick={() => setOpen(open === i ? -1 : i)} style={{ background: open === i ? "var(--pt-card)" : "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.1)", borderRadius: 12, padding: "20px 24px", textAlign: "left", cursor: "pointer", fontFamily: "var(--font-sans)", display: "block", width: "100%", transition: "background 160ms ease" }}>
              <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16 }}>
                <h3 style={{ fontFamily: "var(--font-sans)", fontWeight: 500, fontSize: 17, lineHeight: "24px", margin: 0, color: "#fff" }}>{it.q}</h3>
                <span style={{ width: 28, height: 28, borderRadius: 14, background: open === i ? "var(--pt-teal)" : "rgba(255,255,255,0.04)", border: "1px solid rgba(255,255,255,0.12)", color: open === i ? "#04212B" : "#fff", display: "inline-flex", alignItems: "center", justifyContent: "center", fontSize: 16, lineHeight: 1, transition: "all 200ms ease", flex: "0 0 28px" }}>
                  {open === i ? "−" : "+"}
                </span>
              </div>
              {open === i && it.a && <p style={{ fontSize: 15, marginTop: 14, lineHeight: "24px", color: "rgba(255,255,255,0.65)", fontFamily: "var(--font-sans)" }}>{it.a}</p>}
            </button>
          ))}
        </div>
      </div>
    </section>
  );
}

// ---------- Final CTA ----------

function FinalCTA({ ctaCopy }) {
  const [submitted, setSubmitted] = useState(false);
  const [sending, setSending] = useState(false);
  const [error, setError] = useState("");

  const cfg = (typeof window !== "undefined" && window.PT_FORM) || {};
  const calendlyUrl = cfg.calendlyUrl || "https://calendly.com/proof_trust";

  async function handleSubmit(e) {
    e.preventDefault();
    setError("");
    const formEl = e.target;
    const fd = new FormData(formEl);
    fd.append("_subject", "New Proof&Trust demo request");

    const endpoint = cfg.formEndpoint && cfg.formEndpoint.indexOf("YOUR_") === -1 ? cfg.formEndpoint : "";

    // No real endpoint configured yet → fall back to opening the visitor's mail client.
    if (!endpoint) {
      if (cfg.notifyEmail) {
        const get = (k) => (fd.get(k) || "").toString();
        const body = [
          `Name: ${get("firstName")} ${get("lastName")}`.trim(),
          `Work email: ${get("email")}`,
          `Company: ${get("company")}`,
          `Vendor portfolio size: ${get("portfolioSize")}`,
        ].join("\n");
        window.location.href =
          `mailto:${cfg.notifyEmail}?subject=${encodeURIComponent("Proof&Trust demo request")}&body=${encodeURIComponent(body)}`;
      }
      setSubmitted(true);
      return;
    }

    try {
      setSending(true);
      const res = await fetch(endpoint, {
        method: "POST",
        headers: { Accept: "application/json" },
        body: fd,
      });
      if (!res.ok) throw new Error("Request failed");
      setSubmitted(true);
    } catch (err) {
      setError("Something went wrong sending your request. Please email us directly or try again.");
    } finally {
      setSending(false);
    }
  }

  return (
    <section id="cta" style={{ background: "var(--pt-hero)", color: "white", padding: "112px 48px", position: "relative", overflow: "hidden" }}>
      <svg width="900" height="900" viewBox="0 0 900 900" aria-hidden="true"
           style={{ position: "absolute", right: -300, top: -200, opacity: 0.07, pointerEvents: "none" }}>
        <circle cx="450" cy="450" r="400" stroke="white" strokeWidth="2" fill="none" />
        <circle cx="450" cy="450" r="320" stroke="white" strokeWidth="1" fill="none" strokeDasharray="2 8" />
        <circle cx="450" cy="450" r="240" stroke="white" strokeWidth="1" fill="none" />
        <path d="M450 450 L450 100" stroke="var(--pt-teal)" strokeWidth="3" strokeLinecap="round" />
      </svg>

      <div style={{ position: "relative", maxWidth: 1100, margin: "0 auto", display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 64, alignItems: "center" }}>
        <div>
          <Caption>Get started</Caption>
          <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 400, fontSize: 56, lineHeight: "60px", letterSpacing: "-0.02em", margin: "12px 0 20px", color: "white", textWrap: "balance" }}>
            See your NIS2 exposure in <em style={{ color: "var(--pt-teal-light)" }}>30 minutes</em>.
          </h2>
          <p style={{ color: "rgba(255,255,255,0.82)", marginBottom: 0, fontSize: 17, lineHeight: "26px", maxWidth: "44ch", fontFamily: "var(--font-sans)" }}>
            Drop in a sample of your vendor evidence — we'll return a fully scored, NIS2-tiered portfolio. No questionnaires. No integration. NDA on request.
          </p>
        </div>

        <div style={{ background: "#fff", borderRadius: 16, padding: 28, color: "#000", boxShadow: "0 32px 64px rgba(0,0,0,0.5)" }}>
          {submitted ? (
            <div style={{ position: "relative", padding: "20px 8px", textAlign: "center" }}>
              <button type="button" onClick={() => { setSubmitted(false); setError(""); }} aria-label="Close"
                style={{ position: "absolute", top: -8, right: -8, width: 32, height: 32, borderRadius: 16, border: "1px solid rgba(0,0,0,0.1)", background: "#fff", color: "var(--sq-text-secondary)", cursor: "pointer", display: "inline-flex", alignItems: "center", justifyContent: "center", padding: 0 }}>
                <svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M3 3l8 8M11 3l-8 8" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/></svg>
              </button>
              <div style={{ width: 48, height: 48, borderRadius: 24, background: "var(--pt-teal)", margin: "0 auto 16px", display: "inline-flex", alignItems: "center", justifyContent: "center" }}>
                <svg width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M4 10.5l4 4 8-9" stroke="#04212B" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>
              </div>
              <h3 style={{ fontFamily: "var(--font-serif)", fontSize: 24, margin: 0, marginBottom: 8 }}>Request received</h3>
              <p style={{ fontSize: 14, color: "var(--sq-text-secondary)", margin: "0 0 20px", lineHeight: "20px" }}>
                Skip the wait — pick a time that suits you and we'll walk you through your scored portfolio.
              </p>
              <a href={calendlyUrl} target="_blank" rel="noopener noreferrer" style={{ textDecoration: "none" }}>
                <Button size="lg" style={{ width: "100%", justifyContent: "center" }}>Book your demo on Calendly <ArrowRight size={14} color="#04212B" /></Button>
              </a>
              <p style={{ fontSize: 12, color: "var(--sq-text-secondary)", margin: "14px 0 0" }}>Or we'll reach out within one business day.</p>
            </div>
          ) : (
            <form onSubmit={handleSubmit} style={{ display: "flex", flexDirection: "column", gap: 12 }}>
              <h3 style={{ fontFamily: "var(--font-sans)", fontWeight: 500, fontSize: 18, margin: 0, marginBottom: 4 }}>{ctaCopy}</h3>
              <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 10 }}>
                <input className="sq-input" name="firstName" placeholder="First name" />
                <input className="sq-input" name="lastName" placeholder="Last name" />
              </div>
              <input className="sq-input" name="email" placeholder="Work email" type="email" required />
              <input className="sq-input" name="company" placeholder="Company" />
              <select className="sq-input" name="portfolioSize" defaultValue="" style={{ color: "var(--sq-text-secondary)" }}>
                <option value="" disabled>Vendor portfolio size</option>
                <option>Under 100 vendors</option>
                <option>100–500 vendors</option>
                <option>500–2,000 vendors</option>
                <option>2,000+ vendors</option>
              </select>
              <Button type="submit" size="lg" disabled={sending} style={{ width: "100%", justifyContent: "center", marginTop: 4, opacity: sending ? 0.7 : 1 }}>
                {sending ? "Sending…" : <React.Fragment>{ctaCopy} <ArrowRight size={14} color="#04212B" /></React.Fragment>}
              </Button>
              {error && <p style={{ fontSize: 12, color: "#C0392B", margin: 0, textAlign: "center" }}>{error}</p>}
              <div style={{ display: "flex", alignItems: "center", gap: 10, margin: "2px 0" }}>
                <span style={{ flex: 1, height: 1, background: "rgba(0,0,0,0.1)" }}></span>
                <span style={{ fontSize: 11, color: "var(--sq-text-secondary)", letterSpacing: "0.04em" }}>OR</span>
                <span style={{ flex: 1, height: 1, background: "rgba(0,0,0,0.1)" }}></span>
              </div>
              <a href={calendlyUrl} target="_blank" rel="noopener noreferrer" style={{ fontSize: 13, color: "var(--pt-teal)", textDecoration: "none", textAlign: "center", fontWeight: 500 }}>
                Prefer to pick a time now? Book on Calendly →
              </a>
              <p style={{ fontSize: 11, color: "var(--sq-text-secondary)", margin: 0, marginTop: 4, textAlign: "center", lineHeight: "16px" }}>
                No credit card. No integration. <a href="/privacy" style={{ color: "var(--pt-teal)", textDecoration: "none" }}>Privacy policy</a>.
              </p>
            </form>
          )}
        </div>
      </div>
    </section>
  );
}

// ---------- Footer ----------

function Footer({ ctaCopy = "Book a demo" }) {
  const nav = [
    ["How it works", "#how"],
    ["Vendor tiering", "#tiers"],
    ["Standards & coverage", "#standards"],
    ["FAQ", "#faq"],
  ];
  return (
    <footer style={{ background: "var(--pt-ink)", color: "white", padding: "72px 48px 24px", borderTop: "1px solid rgba(255,255,255,0.06)" }}>
      <div style={{ maxWidth: 1280, margin: "0 auto" }}>
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 40, flexWrap: "wrap", marginBottom: 48 }}>
          <div style={{ maxWidth: 360 }}>
            <BrandMark size={56} />
            <p style={{ fontSize: 15, color: "rgba(255,255,255,0.6)", marginTop: 16, lineHeight: "23px" }}>
              Evidence-grade supply-chain risk for the NIS2 era. EU-hosted, auditor-ready, continuously scored.
            </p>
          </div>
          <div style={{ display: "flex", gap: 48, flexWrap: "wrap" }}>
            <div>
              <Caption style={{ color: "rgba(255,255,255,0.45)" }}>Explore</Caption>
              <ul style={{ listStyle: "none", padding: 0, margin: "12px 0 0", display: "flex", flexDirection: "column", gap: 10, fontSize: 14 }}>
                {nav.map(([l, h]) => (
                  <li key={l}><a href={h} style={{ color: "rgba(255,255,255,0.8)", textDecoration: "none" }}>{l}</a></li>
                ))}
              </ul>
            </div>
            <div style={{ maxWidth: 260 }}>
              <Caption style={{ color: "rgba(255,255,255,0.45)" }}>Contact</Caption>
              <address style={{ fontStyle: "normal", fontSize: 14, color: "rgba(255,255,255,0.6)", margin: "12px 0 0", lineHeight: "22px" }}>
                Proof&amp;Believe LLC,<br />
                30 N Gould St Ste N<br />
                Sheridan, WY 82801<br />
                <a href="mailto:info@proofandtrust.com" style={{ color: "var(--pt-teal-light)", textDecoration: "none" }}>info@proofandtrust.com</a>
              </address>
            </div>
            <div style={{ maxWidth: 260 }}>
              <Caption style={{ color: "rgba(255,255,255,0.45)" }}>Get started</Caption>
              <p style={{ fontSize: 14, color: "rgba(255,255,255,0.6)", margin: "12px 0 16px", lineHeight: "21px" }}>
                Score a sample of your vendor evidence in under 30 minutes.
              </p>
              <a href="#cta" style={{ textDecoration: "none" }}><Button>{ctaCopy} <ArrowRight size={12} color="#04212B" /></Button></a>
            </div>
          </div>
        </div>
        <div style={{ borderTop: "1px solid rgba(255,255,255,0.1)", paddingTop: 20, display: "flex", justifyContent: "space-between", fontSize: 12, opacity: 0.6, flexWrap: "wrap", gap: 12 }}>
          <div style={{ display: "flex", gap: 24, flexWrap: "wrap" }}>
            <span>Proof&amp;Trust © 2026</span>
            <a href="/privacy" style={{ color: "inherit", textDecoration: "none" }}>Privacy</a>
            <a href="/cookies" style={{ color: "inherit", textDecoration: "none" }}>Cookies</a>
            <a href="/terms" style={{ color: "inherit", textDecoration: "none" }}>Terms</a>
            <button onClick={() => window.dispatchEvent(new Event("pt:open-consent"))} style={{ background: "none", border: 0, padding: 0, color: "inherit", font: "inherit", cursor: "pointer", textDecoration: "underline", textUnderlineOffset: 2 }}>Cookie settings</button>
          </div>
          <div style={{ display: "flex", gap: 8, alignItems: "center" }}>
            <span style={{ width: 6, height: 6, borderRadius: 3, background: "#5BC8A0" }}></span>
            <span>All systems operational</span>
          </div>
        </div>
      </div>
    </footer>
  );
}

function Logos() { return null; }

// ---------- Cookie / tracking consent banner ----------

function CookieConsent() {
  const [open, setOpen] = useState(false);

  useEffect(() => {
    let stored = null;
    try { stored = localStorage.getItem("pt-consent"); } catch (e) {}
    if (!stored) setOpen(true);
    const reopen = () => setOpen(true);
    window.addEventListener("pt:open-consent", reopen);
    return () => window.removeEventListener("pt:open-consent", reopen);
  }, []);

  function choose(decision) {
    try { localStorage.setItem("pt-consent", decision); } catch (e) {}
    if (decision === "granted" && typeof window.ptLoadTrackers === "function") {
      window.ptLoadTrackers();
    }
    setOpen(false);
  }

  if (!open) return null;

  return (
    <div role="dialog" aria-label="Cookie consent" style={{ position: "fixed", left: 16, right: 16, bottom: 16, zIndex: 1000, display: "flex", justifyContent: "center", pointerEvents: "none" }}>
      <div style={{ pointerEvents: "auto", maxWidth: 720, width: "100%", background: "var(--pt-card)", border: "1px solid rgba(255,255,255,0.14)", borderRadius: 16, boxShadow: "0 24px 60px rgba(0,0,0,0.6)", padding: 24, display: "flex", gap: 20, alignItems: "flex-start", flexWrap: "wrap" }}>
        <div style={{ flex: "1 1 340px", minWidth: 280 }}>
          <div style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 8 }}>
            <BrandGlyph size={18} />
            <span style={{ fontSize: 12, letterSpacing: "0.1em", textTransform: "uppercase", color: "rgba(255,255,255,0.55)" }}>Cookies &amp; analytics</span>
          </div>
          <p style={{ fontSize: 14, lineHeight: "21px", color: "rgba(255,255,255,0.78)", margin: 0, fontFamily: "var(--font-sans)" }}>
            We'd like to use optional analytics to understand how visitors use Proof&amp;Trust so we can improve it. These cookies stay off until you allow them, and essential site functions need no cookies. You can change your choice anytime. See our <a href="/privacy" style={{ color: "var(--pt-teal-light)", textDecoration: "none" }}>Privacy Policy</a>.
          </p>
        </div>
        <div style={{ display: "flex", gap: 10, alignItems: "center", flexWrap: "wrap" }}>
          <Button variant="secondary" onClick={() => choose("denied")} style={{ padding: "12px 22px" }}>Decline</Button>
          <Button onClick={() => choose("granted")} style={{ padding: "12px 22px" }}>Accept analytics</Button>
        </div>
      </div>
    </div>
  );
}

Object.assign(window, {
  Caption, Button, Chevron, ArrowRight, Check, Reveal, BrandMark, BrandGlyph,
  RiskGauge, MiniGauge, DonutGauge, riskTone,
  AnnouncementBar, Header, Hero, HeroMock, Logos, Outcomes, Stakes,
  HowItWorks, Comparison, DarkUseCases, Testimonial, Recognition, FAQ, FinalCTA, Footer, CookieConsent,
});
