// Pages.jsx — additional pages reachable from the footer
const { Fragment: PFragment } = React;

/* ─────────────────────  GOVERNANCE  ───────────────────── */
function GovernancePage() {
  return (
    <div>
      <SectionOpener section="Document 02 · Governance" version="v0.1" date="2026-04-29"
        title="Three bodies. Three different purposes."
        standfirst="Governance is structured to prevent capture by any one stakeholder class. The Governance Board sets direction, the Methodology Council certifies benchmarks, and Working Groups give stakeholders a meaningful voice without complicating decision rights." />

      <div className="container section doc-narrow">
        <h3 className="doc-h3">Governance Board</h3>
        <p className="doc-p">
          The senior governing body. Sets strategic direction, ratifies methodology decisions, approves new accreditations, manages finances, hires the Executive Director if any.
        </p>
        <p className="doc-p"><strong>Composition.</strong> Nine seats, distributed to prevent stakeholder-class capture.</p>
        <table className="table-doc doc-table">
          <thead><tr><th style={{ width: "12%" }}>Seats</th><th>Constituency</th><th style={{ width: "22%" }}>Term</th></tr></thead>
          <tbody>
            <tr><td className="mono">3</td><td>Founding Members</td><td className="mono">Permanent</td></tr>
            <tr><td className="mono">2</td><td>Accredited Maintainers (elected by Methodology Council)</td><td className="mono">2 yr · rotating</td></tr>
            <tr><td className="mono">1</td><td>Vendor representative</td><td className="mono">2 yr · rotating</td></tr>
            <tr><td className="mono">1</td><td>Buyer representative</td><td className="mono">2 yr · rotating</td></tr>
            <tr><td className="mono">1</td><td>Insurer or risk carrier representative</td><td className="mono">2 yr · rotating</td></tr>
            <tr><td className="mono">1</td><td>Academic representative</td><td className="mono">2 yr · rotating</td></tr>
          </tbody>
        </table>
        <p className="doc-p"><strong>Cap.</strong> No single stakeholder class can hold more than 4 of 9 seats.</p>
        <p className="doc-p"><strong>Decision rule.</strong> Simple majority for routine matters; 2/3 supermajority for accreditation, methodology principle changes, and amendments to the charter.</p>

        <h3 className="doc-h3">Methodology Council</h3>
        <p className="doc-p">
          The technical body. Reviews benchmark accreditation applications, resolves cross-benchmark methodology disputes, maintains the shared harness conventions and result schema standards. One representative per Accredited Maintainer.
        </p>

        <h3 className="doc-h3">Working Groups</h3>
        <p className="doc-p">Open-membership groups, organized by topic. Initial proposed groups:</p>
        <ul className="doc-bullets">
          <li>Vendor Adapter Standards (vendor-led, drives interoperability)</li>
          <li>Buyer Procurement Integration (buyer-led, drives adoption in RFPs)</li>
          <li>Insurance and Risk (insurer-led, drives malpractice underwriting integration)</li>
          <li>Academic Methodology Review (academic-led, drives scholarly publication)</li>
        </ul>
        <p className="doc-p">
          Working groups produce non-binding recommendations to the Governance Board and Methodology Council. They are the primary mechanism for stakeholder voice without complicating governance.
        </p>
      </div>
    </div>
  );
}

/* ─────────────────────  METHODOLOGY COUNCIL  ───────────────────── */
function MethodologyCouncilPage() {
  return (
    <div>
      <SectionOpener section="Body · Methodology Council" version="v0.1" date="2026-04-29"
        title="The technical body."
        standfirst="Reviews accreditation applications, resolves cross-benchmark methodology disputes, and maintains the shared harness conventions and result schema." />

      <div className="container section doc-narrow">
        <table className="table-doc doc-table">
          <thead><tr><th style={{ width: "32%" }}>Function</th><th>Description</th></tr></thead>
          <tbody>
            <tr><td>Composition</td><td>One representative per Accredited Maintainer. Founding Members hold seats by virtue of operating accredited benchmarks. New maintainers join as their benchmarks are accredited.</td></tr>
            <tr><td>Decision rule</td><td>Simple majority for technical recommendations; 2/3 supermajority for accreditation decisions.</td></tr>
            <tr><td>Cadence</td><td>Quarterly public meeting; minutes and votes published within 14 days.</td></tr>
            <tr><td>Disputes</td><td>Cross-benchmark methodology disputes resolved here. Appeals to the Governance Board.</td></tr>
            <tr><td>Standards</td><td>Maintains shared harness conventions and result schema. Versioned. Apache-2.0.</td></tr>
          </tbody>
        </table>

        <h3 className="doc-h3">Current seats</h3>
        <p className="doc-p">
          As of v0.1 the Methodology Council has no seated members. Seats fill on first accreditation in Q3 2026 (target: PatentBench, DraftBench).
        </p>
      </div>
    </div>
  );
}

/* ─────────────────────  WORKING GROUPS  ───────────────────── */
function WorkingGroupsPage() {
  const groups = [
    { name: "Vendor Adapter Standards", lead: "Vendor-led", goal: "Drives interoperability — a common adapter contract so a benchmark can run any tool without bespoke integration work.", state: "forming" },
    { name: "Buyer Procurement Integration", lead: "Buyer-led", goal: "Drives adoption in RFPs and tooling selection — turns an OIPC accreditation into a procurement signal.", state: "forming" },
    { name: "Insurance and Risk", lead: "Insurer-led", goal: "Drives malpractice underwriting integration — establishes how benchmark scores translate into rate adjustments and coverage triggers.", state: "forming" },
    { name: "Academic Methodology Review", lead: "Academic-led", goal: "Drives scholarly publication — ensures methodology meets peer-review standards and is reproducible by independent labs.", state: "forming" },
  ];
  return (
    <div>
      <SectionOpener section="Body · Working Groups" version="v0.1" date="2026-04-29"
        title="Stakeholder voice, without complicating governance."
        standfirst="Open-membership groups produce non-binding recommendations to the Governance Board and Methodology Council. Four initial groups, each led by the stakeholder class with the most at stake." />

      <div className="container section">
        <ol className="wg-list">
          {groups.map((g, i) => (
            <li key={g.name} className="wg-row">
              <div className="wg-num">{String(i + 1).padStart(2, "0")}</div>
              <div className="wg-body">
                <div className="wg-head">
                  <h3 className="wg-name">{g.name}</h3>
                  <span className="wg-state">{g.state}</span>
                </div>
                <div className="wg-lead">{g.lead}</div>
                <p className="wg-goal">{g.goal}</p>
              </div>
            </li>
          ))}
        </ol>
      </div>
    </div>
  );
}

/* ─────────────────────  BENCHMARK DETAIL  ───────────────────── */
const BENCHES = {
  patentbench: {
    title: "PatentBench",
    maintainer: "Roger Hahn",
    status: "accredited",
    statusLabel: "Accredited",
    version: "v2026.1",
    domain: "Patent prosecution",
    standfirst: "604 cases drawn from 98 real applications across 9 USPTO Technology Centers. Four evaluation layers, five difficulty tiers. Hard floor on fabricated citations under the Therasense Standard.",
    facts: [
      ["Cases", "604"],
      ["Applications", "98 real USPTO applications"],
      ["Coverage", "9 USPTO Technology Centers"],
      ["Layers", "4 (parsing · §103 · drafting · citations)"],
      ["Tiers", "5 difficulty bands"],
      ["License", "Apache-2.0"],
      ["Source", "github.com/openipcouncil/patentbench"],
    ],
    layers: [
      ["Layer 1", "Office action parsing", "Extract rejections, cited references, claim mappings."],
      ["Layer 2", "§103 argument construction", "Construct prosecutable arguments against obviousness rejections."],
      ["Layer 3", "Claim-amendment drafting", "Draft amendments responsive to rejection while preserving scope."],
      ["Layer 4", "Citation integrity", "Therasense floor: any unverified cited reference triggers composite = 0.0."],
    ],
  },
  draftbench: {
    title: "DraftBench",
    maintainer: "CBlindspot",
    status: "accredited",
    statusLabel: "Accredited",
    version: "v2026.1",
    domain: "Pre-filing drafting",
    standfirst: "Specification quality, claim-set coherence, written-description support. Track-A ground truth from prosecution outcomes; Track-B from registered practitioner panel.",
    facts: [
      ["Domain", "Pre-filing drafting"],
      ["Track A", "Ground truth from prosecution outcomes"],
      ["Track B", "Registered practitioner expert panel"],
      ["Floor", "Cited-reference fabrication"],
      ["License", "Apache-2.0"],
      ["Source", "github.com/cblindspot/draftbench"],
    ],
    layers: [
      ["Section 1", "Specification quality", "Enablement, written-description, best-mode integrity."],
      ["Section 2", "Claim-set coherence", "Independent / dependent structure, scope ladder, antecedent basis."],
      ["Section 3", "Written-description support", "Claim limitations traceable to specification disclosure."],
      ["Section 4", "Citation integrity", "Therasense floor on any cited prior art."],
    ],
  },
  valuebench: {
    title: "ValueBench",
    maintainer: "CBlindspot",
    status: "provisional",
    statusLabel: "Provisional",
    version: "review",
    domain: "Patent valuation",
    standfirst: "Comparables-driven price estimation against transaction record, plus expert-panel calibration. Methodology Council review opens June 2026; provisional pending public-comment close.",
    facts: [
      ["Domain", "Patent valuation"],
      ["Track A", "Transaction-record comparables"],
      ["Track B", "Expert-panel calibration"],
      ["Public comment", "60 days · opens Jun 2026"],
      ["License", "Apache-2.0 (proposed)"],
      ["Status", "Provisional pending review"],
    ],
    layers: [
      ["Section 1", "Comparables retrieval", "Retrieve transaction comparables for a target asset."],
      ["Section 2", "Price estimation", "Estimate fair-market price against the transaction record."],
      ["Section 3", "Expert calibration", "Calibrate against panel valuations of held-out cases."],
      ["Section 4", "Disclosure", "Mandatory disclosure of comparables and weighting."],
    ],
  },
};

function BenchmarkDetailPage({ slug }) {
  const b = BENCHES[slug];
  if (!b) return null;
  return (
    <div>
      <SectionOpener section={"Registry · " + b.title} version={b.version} date="2026-04-29"
        title={b.title + "."}
        standfirst={b.standfirst} />

      <div className="container section">
        <div className="bench-detail">
          <aside className="bench-detail-side">
            <div className="bench-detail-status">
              <span className={"bench-status bench-status-" + b.status}>
                <span className="bench-status-dot" aria-hidden="true"></span>
                {b.statusLabel}
              </span>
            </div>
            <dl className="bench-detail-facts">
              {b.facts.map(([k, v]) => (
                <PFragment key={k}>
                  <dt>{k}</dt>
                  <dd>{v}</dd>
                </PFragment>
              ))}
            </dl>
            <div className="bench-detail-cta">
              <a className="btn btn-primary" href="#">Read methodology →</a>
            </div>
          </aside>

          <div className="bench-detail-main">
            <h3 className="doc-h3">Maintainer</h3>
            <p className="doc-p">{b.maintainer} · {b.domain}.</p>

            <h3 className="doc-h3">Evaluation layers</h3>
            <ol className="bench-layers">
              {b.layers.map(([n, t, d], i) => (
                <li key={n} className="bench-layer">
                  <div className="bench-layer-n">{String(i + 1).padStart(2, "0")}</div>
                  <div>
                    <div className="bench-layer-t"><span className="bench-layer-tag">{n}</span> {t}</div>
                    <p className="bench-layer-d">{d}</p>
                  </div>
                </li>
              ))}
            </ol>
          </div>
        </div>
      </div>
    </div>
  );
}

/* ─────────────────────  PRESS KIT  ───────────────────── */
function PressKitPage() {
  return (
    <div>
      <SectionOpener section="Document · Press kit" version="v0.1" date="2026-04-29"
        title="Press kit."
        standfirst="Logo, charter PDF, factsheet, and approved photography. Embargo: lifts at INTA 2026." />

      <div className="container section">
        <div className="press-grid">
          <article className="press-asset">
            <div className="press-asset-art press-asset-art-seal">
              <img src="assets/seal-ink.svg" alt="" width="80" height="80" />
            </div>
            <div className="press-asset-meta">
              <div className="press-asset-eyebrow">Mark</div>
              <div className="press-asset-name">OIPC seal</div>
              <div className="press-asset-spec">SVG · PNG (1×, 2×) · 12 KB</div>
            </div>
            <a className="press-asset-link" href="#">Download →</a>
          </article>

          <article className="press-asset">
            <div className="press-asset-art press-asset-art-doc">
              <span className="press-asset-doc">PDF</span>
            </div>
            <div className="press-asset-meta">
              <div className="press-asset-eyebrow">Document</div>
              <div className="press-asset-name">Charter v0.1</div>
              <div className="press-asset-spec">PDF · 68 pages · 412 KB</div>
            </div>
            <a className="press-asset-link" href="#">Download →</a>
          </article>

          <article className="press-asset">
            <div className="press-asset-art press-asset-art-fact">
              <span className="press-asset-doc">FACT</span>
            </div>
            <div className="press-asset-meta">
              <div className="press-asset-eyebrow">Document</div>
              <div className="press-asset-name">Factsheet</div>
              <div className="press-asset-spec">PDF · 2 pages · 84 KB</div>
            </div>
            <a className="press-asset-link" href="#">Download →</a>
          </article>

          <article className="press-asset">
            <div className="press-asset-art press-asset-art-q">
              <span className="press-asset-doc">Q&amp;A</span>
            </div>
            <div className="press-asset-meta">
              <div className="press-asset-eyebrow">Document</div>
              <div className="press-asset-name">Open Questions v0.1</div>
              <div className="press-asset-spec">PDF · 18 pages · 196 KB</div>
            </div>
            <a className="press-asset-link" href="#">Download →</a>
          </article>
        </div>

        <div className="press-contact">
          <div className="press-contact-l">
            <div className="press-contact-eyebrow">Press inquiries</div>
            <a className="press-contact-mail" href="mailto:press@openipcouncil.org">press@openipcouncil.org</a>
          </div>
          <div className="press-contact-r">
            Embargo lifts at INTA 2026 · May 2026
          </div>
        </div>
      </div>
    </div>
  );
}

/* ─────────────────────  OPEN QUESTIONS  ───────────────────── */
function OpenQuestionsPage() {
  const qs = [
    { n: "01", t: "Membership openness", b: "Should Tier 3 stakeholder membership be open to any organization that pays dues, or gated by Working Group sponsorship? Open Comment: 60 days." },
    { n: "02", t: "Single-track justification", b: "Under what conditions can an accredited benchmark publish a single-track score? Drafting Council requests case examples from drafting and trademark prosecution domains." },
    { n: "03", t: "Reproducibility threshold", b: "The 5% scoring delta is a working figure. Is there a defensible empirical basis for tightening to 3%, or for varying it by domain?" },
    { n: "04", t: "Third Founding Member", b: "Candidate categories under discussion: academic institution, existing standards body sponsor, or a respected practitioner with an open-source benchmark project. Submissions accepted until Apr 30, 2026." },
    { n: "05", t: "Insurance integration", b: "What evidentiary standard would a carrier accept for using OIPC scores in malpractice underwriting? First conversations target Aon Affinity." },
    { n: "06", t: "International scope", b: "OIPC v0.1 is US-centric (USPTO, Therasense). What is the path to EPO, JPO, and CNIPA without diluting the integrity floors?" },
  ];
  return (
    <div>
      <SectionOpener section="Companion · Open Questions" version="v0.1" date="2026-04-29"
        title="Six unresolved questions."
        standfirst="Tracked alongside the charter. Each question carries a public comment window. Submit comments to comments@openipcouncil.org with the question number in the subject line." />

      <div className="container section">
        <ol className="oq-list">
          {qs.map((q) => (
            <li key={q.n} className="oq-row">
              <div className="oq-num">{q.n}</div>
              <div className="oq-body">
                <h3 className="oq-t">{q.t}</h3>
                <p className="oq-b">{q.b}</p>
                <a className="oq-link" href="#">Submit a comment →</a>
              </div>
            </li>
          ))}
        </ol>
      </div>
    </div>
  );
}

/* ─────────────────────  THERASENSE STANDARD  ───────────────────── */
function TherasensePage() {
  return (
    <div>
      <SectionOpener section="Standard · Integrity 8.1" version="v0.1" date="2026-04-29"
        title="The Therasense Standard."
        standfirst="Any accredited benchmark that evaluates AI tools producing content for filing with a patent or trademark office must include a fabrication-detection layer with a hard floor on composite score." />

      <div className="container section doc-narrow">
        <div className="doc-callout">
          <div className="doc-callout-eyebrow">Doctrinal basis</div>
          <p className="doc-callout-body">
            <em>Therasense, Inc. v. Becton, Dickinson &amp; Co.</em>, 649 F.3d 1276 (Fed. Cir. 2011) (en banc), establishing affirmative egregious misconduct — including citation of nonexistent prior art — as per se material under the inequitable conduct doctrine.
          </p>
        </div>

        <h3 className="doc-h3">Operational requirement</h3>
        <p className="doc-p">
          Any cited US patent or publication number must be verified against an authoritative source (USPTO PatentsView API, USPTO Patent Public Search, or jurisdictional equivalent). Citations that fail verification trigger a <strong>hard floor</strong>: composite score equals <code className="code">0.0</code> for that draft or output.
        </p>
        <p className="doc-p">
          This standard is <strong>not optional</strong> for in-scope benchmarks. It is a non-negotiable accreditation criterion.
        </p>

        <h3 className="doc-h3">Verification sources</h3>
        <table className="table-doc doc-table">
          <thead><tr><th style={{ width: "30%" }}>Jurisdiction</th><th>Authoritative source</th></tr></thead>
          <tbody>
            <tr><td>United States</td><td className="mono">USPTO PatentsView · USPTO Patent Public Search</td></tr>
            <tr><td>Europe</td><td className="mono">EPO Open Patent Services · Espacenet</td></tr>
            <tr><td>Japan</td><td className="mono">J-PlatPat</td></tr>
            <tr><td>China</td><td className="mono">CNIPA Patent Search</td></tr>
            <tr><td>Other</td><td className="mono">National patent office equivalent</td></tr>
          </tbody>
        </table>

        <h3 className="doc-h3">Companion standards</h3>
        <ul className="doc-bullets">
          <li><strong>8.2 The Conflict Standard</strong> — disclose all financial relationships with evaluated vendors.</li>
          <li><strong>8.3 The Reproducibility Standard</strong> — third parties reproduce within a 5% scoring delta.</li>
        </ul>
      </div>
    </div>
  );
}

window.GovernancePage = GovernancePage;
window.MethodologyCouncilPage = MethodologyCouncilPage;
window.WorkingGroupsPage = WorkingGroupsPage;
window.BenchmarkDetailPage = BenchmarkDetailPage;
window.PressKitPage = PressKitPage;
window.OpenQuestionsPage = OpenQuestionsPage;
window.TherasensePage = TherasensePage;
