#!/usr/bin/env python3
"""Page bodies for the portfolio site. Run: python pages.py"""
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from build import page, GH_USER, GH_ARCHITECT, CONTACT_EMAIL, WEBSITE, LINKEDIN, HACKATHON

# ============================================================ HOME
home = f"""
<section class="hero">
  <div class="wrap">
    <div class="eyebrow">Built with Claude: Life Sciences Hackathon &middot; 2026</div>
    <h1>Open therapeutic science, from target to a fundable plan.</h1>
    <p class="lead">I'm <strong>Ruth-Anne Pai, PhD</strong> &mdash; an immunologist, protein designer, and person living with
    eosinophilic esophagitis (EoE). In one week I built an end-to-end body of work: mining EoE omics to nominate targets,
    designing antigen-specific protein therapeutics with ESM-family and folding models, and packaging it all into
    reusable software, manuscripts, and a development plan. Everything here is open.</p>
    <div class="btn-row">
      <a class="btn" href="#router">Find your path &darr;</a>
      <a class="btn ghost" href="specialist.html">The Therapeutic Program Architect</a>
    </div>
  </div>
</section>

<section>
  <div class="wrap">
    <div class="stats">
      <div class="stat"><div class="num">9</div><div class="lbl">pMHC-II tolerance constructs designed &amp; folded</div></div>
      <div class="stat"><div class="num">0.87&ndash;0.90</div><div class="lbl">ipTM across the structural panel</div></div>
      <div class="stat"><div class="num">8</div><div class="lbl">open-source repositories</div></div>
      <div class="stat"><div class="num">2</div><div class="lbl">manuscripts drafted</div></div>
    </div>
  </div>
</section>

<section class="tint" id="router">
  <div class="wrap">
    <div class="section-head">
      <div class="eyebrow">Find your path</div>
      <h2>Where would you like to start?</h2>
      <p class="lead">The work spans data mining, protein design, software, and a full biotech plan.
      Pick the entry point that fits you &mdash; each card points to the pages built for you.</p>
    </div>
    <div class="router">

      <div class="rcard c3">
        <div class="who">Patient-led nonprofit &amp; advocates</div>
        <h3>Tools that work for any disease</h3>
        <p>The Therapeutic Program Architect turns your community's disease into a full, human-in-the-loop drug program.
        And the EoE plan was written patient-voice-first.</p>
        <ul>
          <li>&rarr; <a href="specialist.html">Therapeutic Program Architect</a> (disease-agnostic)</li>
          <li>&rarr; <a href="biotech.html#patients">Patient-centered differentiation</a></li>
        </ul>
      </div>

      <div class="rcard">
        <div class="who">Scientists using protein models</div>
        <h3>pMHC-II design &amp; effector-target binders</h3>
        <p>Read the methods and structures behind the antigen-specific tolerance work and the CCL26/POSTN binder designs.</p>
        <ul>
          <li>&rarr; <a href="manuscripts.html">Manuscripts</a> (pMHC-II &amp; CCL26/POSTN)</li>
          <li>&rarr; <a href="software.html#antigen">Epitope &amp; design pipelines</a></li>
        </ul>
      </div>

      <div class="rcard c2">
        <div class="who">Biotech, investors &amp; partners</div>
        <h3>Project Tolera &mdash; a roadmap to patients</h3>
        <p>The full package: platform thesis, market, competitive whitespace, regulatory path, budget, and milestones.</p>
        <ul>
          <li>&rarr; <a href="biotech.html">Project Tolera</a> (business + scientific plan)</li>
          <li>&rarr; <a href="manuscripts.html">Scientific evidence</a></li>
        </ul>
      </div>

      <div class="rcard c4">
        <div class="who">Developers &amp; Claude Science users</div>
        <h3>Reusable skills &amp; pipelines</h3>
        <p>Eight open repositories &mdash; skills for target mining, epitope mapping, market analysis, peer review, and media.</p>
        <ul>
          <li>&rarr; <a href="software.html">Software &amp; repositories</a></li>
          <li>&rarr; <a href="specialist.html#install">Install the specialist</a></li>
        </ul>
      </div>

      <div class="rcard c5">
        <div class="who">Academics &amp; data scientists</div>
        <h3>Omics-mined targets, reproducibly</h3>
        <p>A ten-stage pipeline from public GEO/PRIDE/CELLxGENE data to a ranked, druggability-annotated target shortlist.</p>
        <ul>
          <li>&rarr; <a href="software.html#omics">omics-target-mining</a></li>
          <li>&rarr; <a href="manuscripts.html">Epitope validation data</a></li>
        </ul>
      </div>

      <div class="rcard c3">
        <div class="who">Just curious?</div>
        <h3>The one-week story</h3>
        <p>How a citizen-scientist took EoE from "here is a disease" to IND-ready design and a plan &mdash; all in public.</p>
        <ul>
          <li>&rarr; <a href="about.html">About &amp; the citizen-scientist thesis</a></li>
        </ul>
      </div>

    </div>
  </div>
</section>

<section>
  <div class="wrap">
    <div class="section-head">
      <div class="eyebrow">What the week produced</div>
      <h2>Three integrated streams</h2>
    </div>
    <div class="grid cols-3">
      <div class="card">
        <span class="tag sage">Data mining</span>
        <h3>Targets from public omics</h3>
        <p>Transcriptomic, proteomic, and single-cell EoE datasets mined for dysregulated genes, pathways, and cell
        populations &mdash; surfacing high-evidence, low-competition targets like CCL26 and POSTN.</p>
        <div class="card-foot"><a href="software.html#omics">See the pipeline &rarr;</a></div>
      </div>
      <div class="card">
        <span class="tag">Protein design</span>
        <h3>Antigen-specific therapeutics</h3>
        <p>A 9-construct pMHC-II tolerance panel across dairy, wheat, and soy triggers &mdash; folded, groove-validated,
        and formulated on a multivalent nanoparticle &mdash; plus CCL26/POSTN effector-target binders.</p>
        <div class="card-foot"><a href="manuscripts.html">Read the manuscripts &rarr;</a></div>
      </div>
      <div class="card">
        <span class="tag coral">Plan &amp; tools</span>
        <h3>From design to fundable plan</h3>
        <p>A disease-agnostic drug-program pipeline, a patient-voice-first business and scientific plan, and open
        repositories anyone can pick up and run.</p>
        <div class="card-foot"><a href="biotech.html">Explore Project Tolera &rarr;</a></div>
      </div>
    </div>
  </div>
</section>

<section class="tint">
  <div class="wrap">
    <figure class="pad" style="margin:0;">
      <img src="assets/img/target_landscape.png" alt="EoE target landscape: literature evidence versus clinical maturity, sized by opportunity score">
      <figcaption>The EoE target landscape that anchored the week: strong biology, thin pipeline. High-evidence,
      no-trial targets (CCL26, POSTN, IL-13, CAPN14) mark the unexploited biology this work set out to address.</figcaption>
    </figure>
  </div>
</section>
"""

page("index.html", "Home", home, active="index.html",
     description="Ruth-Anne Pai, PhD — open therapeutic science for eosinophilic esophagitis and beyond: target discovery, antigen-specific protein design, reusable software, and a full development plan.")

print("built index.html")

# ============================================================ SOFTWARE
# Repos grouped for the reader. Each: (id, name, blurb, url, tags, [highlights])
REPOS = {
  "Therapeutic program tooling": [
    ("architect", "therapeutic-program-architect",
     "The flagship specialist &amp; skill: an end-to-end, human-in-the-loop drug-development pipeline that is archetype-adaptive across common and genetic/rare disease. Give it a disease; it runs 10 stages to a fundable plan, stopping at every consequential gate.",
     f"{GH_USER}/therapeutic-program-architect",
     ["Python", "specialist agent", "disease-agnostic"],
     'Featured &mdash; <a href="specialist.html">full walkthrough &amp; install &rarr;</a>'),
    ("market", "patient-centered-market-and-survey",
     "Reusable Claude Science skill: build a patient-centered therapeutic market report <em>and</em> design a patient-community survey. Disease-agnostic, with an EoE worked example.",
     f"{GH_USER}/patient-centered-market-and-survey",
     ["Python", "skill", "market + survey"], None),
    ("peer", "synthetic-peer-review",
     "Run a synthetic (mock) peer-review panel on a manuscript before submission &mdash; distinct expert reviewers plus a handling-editor synthesis.",
     f"{GH_USER}/synthetic-peer-review",
     ["Python", "skill", "manuscripts"], None),
  ],
  "Target discovery &amp; antigen design": [
    ("omics", "omics-target-mining",
     "A reproducible pipeline for mining public omics datasets (GEO, ArrayExpress, PRIDE, CELLxGENE) to nominate and prioritize therapeutic targets &mdash; from &ldquo;here is a disease&rdquo; to a ranked, druggability-annotated shortlist.",
     f"{GH_USER}/omics-target-mining",
     ["Python", "skill", "GEO / PRIDE / scRNA"],
     'Ten-stage workflow &mdash; <a href="#omics">details below</a>'),
    ("antigen", "antigen-epitope-pipeline",
     "A disease-agnostic pipeline mapping antigen proteins to HLA-restricted epitopes and per-HLA presentation burden &mdash; with TG2-deamidation modeling and known-epitope benchmarking.",
     f"{GH_USER}/antigen-epitope-pipeline",
     ["Python", "pMHC / HLA", "epitope mapping"], None),
    ("inflam", "inflammatory-target-discovery-skills",
     "A disease-agnostic methodology stack for computational target discovery and antigen-specific therapeutic design in inflammatory / immune disorders (EGIDs, celiac, IBD, autoimmune).",
     f"{GH_USER}/inflammatory-target-discovery-skills",
     ["Python", "skill stack", "immune disease"], None),
  ],
  "Communication &amp; media": [
    ("scivid", "claude-science-skills",
     "Reusable Claude Science skills for scientific molecular- and cell-scale video generation (ChimeraX + Blender / Modal) &mdash; the engine behind the structural fly-around renders on this site.",
     f"{GH_USER}/claude-science-skills",
     ["Python", "ChimeraX + Blender", "rendering"], None),
    ("podcast", "podcast-debrief-skill",
     "Turn a project's data artifacts into a fact-grounded, two-voice podcast plus a local text-to-speech render package.",
     f"{GH_USER}/podcast-debrief-skill",
     ["Python", "skill", "TTS / audio"], None),
  ],
}

def repo_card(r):
    _id, name, blurb, url, tags, hl = r
    tag_html = "".join(f'<span class="tag">{t}</span>' for t in tags)
    hl_html = f'<p class="small" style="margin-top:6px;color:var(--teal-dark)">{hl}</p>' if hl else ""
    return f"""<div class="card" id="{_id}">
      <div>{tag_html}</div>
      <h3 style="font-family:'SF Mono',Menlo,monospace;font-size:1.08rem;word-break:break-word">{name}</h3>
      <p>{blurb}</p>
      {hl_html}
      <div class="card-foot"><a class="btn ghost" href="{url}" target="_blank" rel="noopener">View on GitHub &rarr;</a></div>
    </div>"""

repo_sections = ""
for group, repos in REPOS.items():
    cards = "".join(repo_card(r) for r in repos)
    repo_sections += f"""
    <h2>{group}</h2>
    <div class="grid cols-3">{cards}</div>
    """

software = f"""
<section class="hero">
  <div class="wrap">
    <div class="eyebrow">Software</div>
    <h1>Open repositories &amp; reusable skills</h1>
    <p class="lead">Eight open-source repositories from the hackathon &mdash; a disease-agnostic drug-program
    pipeline, target-discovery and epitope-mapping tools, market and peer-review skills, and a scientific-media engine.
    Most are packaged as <a href="{HACKATHON}" target="_blank" rel="noopener">Claude Science</a> skills you can drop in and run.</p>
    <div class="btn-row">
      <a class="btn" href="{GH_USER}" target="_blank" rel="noopener">All repositories on GitHub &rarr;</a>
    </div>
  </div>
</section>

<section>
  <div class="wrap">
    {repo_sections}
  </div>
</section>

<section class="tint" id="omics">
  <div class="wrap narrow">
    <div class="eyebrow">Deep dive</div>
    <h2>omics-target-mining &mdash; ten reproducible stages</h2>
    <p>From a disease name to a ranked, druggability-annotated target shortlist, using only public data. Each stage
    ends by saving artifacts, so a run is fully auditable. Two core statistics (<code>moderated_de</code>,
    <code>meta_analysis</code>) are dependency-light and usable stand-alone.</p>
    <ol class="steps">
      <li><strong>Dataset inventory</strong> Query GEO / ArrayExpress / PRIDE / CELLxGENE; build one master table; audit for keyword-only false positives.</li>
      <li><strong>Tier &amp; prioritize</strong> Score datasets on relevance, analytical role, and tractability (Tier 1 bulk case-control &rarr; Tier 3 complementary).</li>
      <li><strong>Retrieve &amp; QC bulk</strong> Harmonize IDs to gene symbols, normalize, PCA + canonical-marker sanity checks.</li>
      <li><strong>Per-study differential expression</strong> Variance-moderated Welch <em>t</em>-test with BH-FDR.</li>
      <li><strong>Cross-study meta-analysis</strong> DerSimonian&ndash;Laird random-effects pooling with heterogeneity stats.</li>
      <li><strong>Single-cell validation</strong> scanpy QC &rarr; HVG &rarr; Harmony &rarr; Leiden &rarr; composition shift + per-cell-type DE.</li>
      <li><strong>Pathway / regulator / cell-cell communication</strong> Enrichr (GO_BP, Reactome, Hallmark, TF libraries) + LIANA.</li>
      <li><strong>Multi-omics integration</strong> Per-gene evidence table across independently-varying layers.</li>
      <li><strong>Druggability</strong> Open Targets GraphQL: tractability, clinical candidates, subcellular location, target class.</li>
      <li><strong>Consolidate</strong> A Tier-A shortlist with mechanism rationale and a suggested modality per target.</li>
    </ol>
    <div class="callout">
      <h3>Try the helpers directly</h3>
      <pre><code>from kernel import moderated_de, meta_analysis

# per-study DE on log2 expression (genes x samples)
de = moderated_de(expr, labels, case="disease", control="control")

# pool per-study effects (log2FC and SE across studies)
meta = meta_analysis(fc_df, se_df, min_studies=3)</code></pre>
    </div>
    <div class="btn-row">
      <a class="btn" href="{GH_USER}/omics-target-mining" target="_blank" rel="noopener">Repository &rarr;</a>
      <a class="btn ghost" href="assets/docs/omics-target-mining-repo.zip" download>Download source (.zip)</a>
    </div>
  </div>
</section>
"""
page("software.html", "Software", software, active="software.html",
     description="Eight open-source repositories: a disease-agnostic drug-program pipeline, target discovery and epitope-mapping tools, market and peer-review skills, and a scientific-media engine.")
print("built software.html")

# ============================================================ SPECIALIST
STAGES = [
  ("Indication &amp; unmet need", "Epidemiology, biology, standard of care, and precedent."),
  ("Patient priorities / PFDD", "What patients actually want fixed &mdash; with an optional community survey."),
  ("Literature + competitive pipeline", "Mechanism map plus who is developing what, and why they succeeded or failed."),
  ("Data mining &rarr; targets", "Omics meta-analysis and single-cell &rarr; ranked druggable targets."),
  ("Target &amp; modality selection", "The pivotal fork: a scored rubric &rarr; <strong>you confirm</strong>."),
  ("Design &amp; pressure-test", "Modality-routed AI/ML design plus in-silico validation."),
  ("Scientific development plan", "AI-to-first-in-human assay cascade, CMC, biomarkers."),
  ("Regulatory strategy", "FDA / EMA path, designations, endpoints."),
  ("Commercial &amp; financing", "TAM/SAM/SOM, whitespace, financial model, and the Ask."),
  ("Deliverables &amp; synthesis", "Business plan, scientific plan, deck, manuscript, peer review."),
]
stage_html = "".join(
    f'<li><strong>{t}</strong> {d}</li>' for t, d in STAGES
)

specialist = f"""
<section class="hero">
  <div class="wrap">
    <div class="eyebrow">Flagship &middot; disease-agnostic</div>
    <h1>The Therapeutic Program Architect</h1>
    <p class="lead">Give it <em>any</em> disease &mdash; common or genetic/rare &mdash; and it runs a full,
    human-in-the-loop drug-development program: from unmet need and patient priorities, through data- and
    literature-mined target and modality selection, AI/ML design and in-silico pressure-testing, to scientific,
    regulatory, and commercial strategy. It stops and asks you at every consequential decision.</p>
    <div class="btn-row">
      <a class="btn" href="#install">How to install &amp; use &darr;</a>
      <a class="btn ghost" href="{GH_ARCHITECT}" target="_blank" rel="noopener">Repository &rarr;</a>
    </div>
  </div>
</section>

<section>
  <div class="wrap narrow">
    <div class="callout coral">
      <h3>This is for any disease &mdash; not just EoE</h3>
      <p>The disease, target, and modality are all <strong>parameters</strong> resolved from data and your
      decisions, not hard-coded. The same modality router that produced a tolerizing <em>vaccine</em> for
      eosinophilic esophagitis produces a <em>ligand-trap</em>, <em>antibody</em>, or <em>small molecule</em> for
      another disease depending on the target biology. If your community has a disease and a question, this is built
      for you.</p>
    </div>
  </div>
</section>

<section class="tint">
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">How it works</div><h2>Ten stages, threaded through one dossier</h2>
    <p class="lead">A single JSON program dossier is the source of truth for a whole run &mdash; disease, scope, every
    decision and who made it, per-stage artifacts, gate status, and open questions. A program can be paused,
    resumed, and audited.</p></div>
    <div class="narrow"><ol class="steps">{stage_html}</ol></div>
  </div>
</section>

<section>
  <div class="wrap narrow">
    <div class="eyebrow">You stay in control</div>
    <h2>Human-in-the-loop by design</h2>
    <p>The pipeline <strong>never silently</strong> commits a target, modality, endpoint, price, or go/no-go. It stops
    at named gates and asks a structured question with its recommendation and options.</p>
    <div class="grid cols-2">
      <div class="card">
        <span class="tag coral">Hard gates</span>
        <h3>Block until you answer</h3>
        <ul>
          <li>Scope lock</li>
          <li>Whitespace confirm</li>
          <li>Target / modality lock</li>
          <li>Design go / no-go</li>
          <li>Financing assumptions</li>
          <li>Final review</li>
        </ul>
      </div>
      <div class="card">
        <span class="tag">Soft gates</span>
        <h3>It proposes; you can veto</h3>
        <ul>
          <li>Priority rank</li>
          <li>Target evidence</li>
          <li>Regulatory assumptions</li>
          <li>Any low-confidence flag becomes a recorded open question &mdash; not a confident-sounding assertion</li>
        </ul>
      </div>
    </div>
  </div>
</section>

<section class="tint">
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">Evidence it generalizes</div><h2>Validated beyond EoE</h2></div>
    <div class="grid cols-3">
      <div class="card">
        <span class="tag sage">Dry run</span>
        <h3>IPF</h3>
        <p>Idiopathic pulmonary fibrosis. The modality router lands on a <strong>ligand-trap / antibody / small
        molecule</strong> path driven by the target biology &mdash; not the tolerizing vaccine EoE called for.</p>
      </div>
      <div class="card">
        <span class="tag sage">Dry run</span>
        <h3>SMA (genetic)</h3>
        <p>Spinal muscular atrophy. Exercises the genetic/rare archetype branch &mdash; a monogenic, mechanism-driven
        program with a different modality decision tree.</p>
      </div>
      <div class="card">
        <span class="tag coral">Full build</span>
        <h3>EoE</h3>
        <p>Eosinophilic esophagitis. The complete run behind <a href="biotech.html">Project Tolera</a> &mdash; a
        personalized pMHC-II tolerance vaccine, end to end.</p>
      </div>
    </div>
  </div>
</section>

<section id="install">
  <div class="wrap narrow">
    <div class="eyebrow">Get started</div>
    <h2>How to install and use it</h2>
    <p>It comes in two pieces: <strong>drug-program-orchestration</strong> (the conductor skill) and the
    <strong>Therapeutic Program Architect</strong> (a specialist agent that preloads the skill and has full access
    to the skill catalog and all data/regulatory connectors).</p>

    <ol class="steps">
      <li><strong>Get the repository</strong> Clone or download from GitHub:
        <pre><code>git clone {GH_ARCHITECT}.git</code></pre></li>
      <li><strong>Add it to Claude Science</strong> Drop the skill folder into your skills directory, or publish it via
        the skill SDK. The specialist profile registers the orchestration skill and its connectors.</li>
      <li><strong>Switch to the specialist</strong> In the Claude Science session-config popover, choose the
        <em>Therapeutic Program Architect</em> specialist (or accept the switch prompt).</li>
      <li><strong>Run a program</strong> Say it in one line:
        <pre><code>Run the drug program for &lt;your disease&gt;.</code></pre>
        The orchestrator initializes a dossier and walks the ten stages, stopping at each gate.</li>
    </ol>

    <div class="callout">
      <h3>No specialist switch? Any agent can run it</h3>
      <pre><code>Load the drug-program-orchestration skill
and run the pipeline for &lt;your disease&gt;.</code></pre>
    </div>

    <div class="callout warn">
      <h3>Requirements &amp; caveats</h3>
      <p>The design stage (Stage&nbsp;6) benefits from a GPU compute target &mdash; the orchestrator checks for one
      and runs the CPU-feasible parts or defers design if none is configured. Connector calls
      (ClinicalTrials.gov, Open Targets, FDA, GEO/PRIDE, ChEMBL) run automatically inside the specialist. All
      forward-looking scientific, regulatory, and commercial statements are development hypotheses &mdash; not
      established results, medical advice, or guaranteed outcomes.</p>
    </div>

    <div class="btn-row">
      <a class="btn" href="{GH_ARCHITECT}" target="_blank" rel="noopener">Open the repository &rarr;</a>
      <a class="btn ghost" href="{GH_USER}" target="_blank" rel="noopener">All repositories</a>
    </div>
  </div>
</section>
"""
page("specialist.html", "Therapeutic Program Architect", specialist, active="specialist.html",
     description="A disease-agnostic, human-in-the-loop drug-development specialist agent. Give it any disease; it runs a 10-stage program to a fundable plan, stopping at every consequential gate. How to install and use it.")
print("built specialist.html")

# ============================================================ MANUSCRIPTS
manuscripts = f"""
<section class="hero">
  <div class="wrap">
    <div class="eyebrow">Manuscripts</div>
    <h1>Two manuscripts, from design to evidence</h1>
    <p class="lead">A design-and-roadmap paper on antigen-specific pMHC-II nanoparticle therapeutics for EoE, and a
    target-and-binder brief on the CCL26 / POSTN effector axis. Both are computationally grounded and openly
    documented, with structures and data available to download.</p>
  </div>
</section>

<!-- ---------- Manuscript 1 ---------- -->
<section id="pmhc">
  <div class="wrap">
    <span class="tag coral" style="display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--coral-dark);background:#fbe9e4;padding:3px 9px;border-radius:20px;">Manuscript 1</span>
    <h2 style="margin-top:.4em">Rational design of multivalent nanoparticle&ndash;pMHC-II immunotherapies for food-allergen tolerance in eosinophilic esophagitis</h2>
    <p class="muted">Ruth-Anne Pai, PhD (lead author, EoE patient-researcher) &middot; with Claude AI computational support</p>

    <p class="lead">Rather than broadly suppressing the immune system, this design re-educates the specific
    food-reactive T-cell clones that drive EoE. Three food triggers (dairy, wheat, soy) converge on a single
    HLA-DRB1*07:01 backbone with a swappable peptide cassette &mdash; folded, groove-validated, and displayed
    multivalently on an iron-oxide nanoparticle to induce IL-10&ndash;secreting regulatory (Tr1) T cells.</p>

    <div class="stats">
      <div class="stat"><div class="num">9</div><div class="lbl">constructs (3 formats &times; 3 foods)</div></div>
      <div class="stat"><div class="num">0.87&ndash;0.90</div><div class="lbl">ipTM across pMHC-II complexes</div></div>
      <div class="stat"><div class="num">15/15</div><div class="lbl">peptide residues seated in-groove</div></div>
      <div class="stat"><div class="num">24&times;</div><div class="lbl">avidity gain at 5 pMHC / nanoparticle</div></div>
    </div>

    <figure class="pad">
      <img src="assets/img/pmhc_strategy.png" alt="Design strategy: three tolerance-therapeutic formats across three EoE food triggers on one shared HLA-DRB1*07:01 backbone, with per-food epitope affinities and co-folded groove geometries">
      <figcaption><strong>Design space.</strong> Three formats (soluble single-chain &rarr; anergy; nanoparticle &rarr; Tr1
      tolerance; tetramer &rarr; clone depletion) across dairy, wheat, and soy. All nine share one backbone; only the
      15-mer peptide cassette changes. Lead epitopes: dairy FAQTQSLVY (17&nbsp;nM), wheat HNVVHAIIL (35&nbsp;nM),
      soy FVVNATSNL (50&nbsp;nM), all HLA-DR7-restricted.</figcaption>
    </figure>

    <div class="fig-2">
      <figure class="pad" style="margin:0">
        <img src="assets/img/epitope_discovery.png" alt="Epitope discovery: affinity ranking, IEDB percentile stringency, protein-context dependency, and validation status">
        <figcaption><strong>Epitope discovery &amp; validation.</strong> Affinity ranking, IEDB stringency, and the
        ~92-fold context dependency that favored the dairy precursor form. The dairy epitope is tetramer-validated;
        wheat and soy are computational priors flagged for Phase-1 functional validation.</figcaption>
      </figure>
      <figure class="pad" style="margin:0">
        <img src="assets/img/np_architecture.png" alt="Nanoparticle architecture: 20 nm Fe3O4 core, PEG-maleimide conjugation, avidity enhancement curve, and surface-coverage analysis">
        <figcaption><strong>Nanoparticle architecture.</strong> A 20&nbsp;nm Fe&#8323;O&#8324; core, ~75 PEG-maleimide
        linkers, 5 pMHC copies at 5.8&nbsp;nm spacing &mdash; tuned for TCR cross-linking and Tr1 priming, with a
        3/5/8-copy valency-optimization ladder.</figcaption>
      </figure>
    </div>

    <h3>Structural models</h3>
    <p>Three pMHC-II:peptide complexes were co-folded (ESMFold2-Fast, GPU) and inspected for canonical groove
    geometry. Download the atomic coordinates below &mdash; <code>.pdb</code> files open in PyMOL, ChimeraX, or any
    Mol* viewer.</p>
    <div class="table-wrap">
      <table>
        <thead><tr><th>Complex</th><th>Peptide (15-mer)</th><th>ipTM</th><th>Structure</th></tr></thead>
        <tbody>
          <tr><td>Dairy pMHC-II</td><td><code>KIHPFAQTQSLVYPF</code></td><td>0.872</td><td><a href="assets/structures/dairy_pmhc.pdb" download>dairy_pmhc.pdb</a></td></tr>
          <tr><td>Wheat pMHC-II</td><td><code>IHNVVHAIILHQQQQ</code></td><td>0.896</td><td><a href="assets/structures/wheat_pmhc.pdb" download>wheat_pmhc.pdb</a></td></tr>
          <tr><td>Soy pMHC-II</td><td><code>AYPFVVNATSNLNFL</code></td><td>0.891</td><td><a href="assets/structures/soy_pmhc.pdb" download>soy_pmhc.pdb</a></td></tr>
        </tbody>
      </table>
    </div>

    <h3>Preclinical roadmap</h3>
    <figure class="pad">
      <img src="assets/img/preclinical_roadmap.png" alt="Preclinical development roadmap: five phases over an 18-24 month timeline to IND submission">
      <figcaption>A five-phase, 18&ndash;24 month path to IND submission &mdash; human ex-vivo validation, murine
      proof-of-concept, GLP toxicology and biodistribution, GMP manufacturing, and regulatory filing &mdash; each with
      explicit go / no-go decision gates.</figcaption>
    </figure>

    <div class="callout">
      <h3>Downloads</h3>
      <div class="btn-row" style="margin-top:8px">
        <a class="btn" href="assets/docs/EoE_pMHC_Science_Manuscript.docx" download>Manuscript (.docx)</a>
        <a class="btn ghost" href="assets/docs/EoE_pMHC_Manuscript_Supplemental.docx" download>Supplemental (.docx)</a>
        <a class="btn ghost" href="assets/docs/eoe_pmhc_constructs.fasta" download>Construct sequences (.fasta)</a>
        <a class="btn ghost" href="assets/docs/eoe_pmhc_construct_spec.csv" download>Construct specs (.csv)</a>
        <a class="btn ghost" href="assets/docs/eoe_pmhc_epitope_cores.csv" download>Epitope table (.csv)</a>
        <a class="btn ghost" href="assets/docs/pMHC_Deliverables_Index.md" download>Full deliverables index (.md)</a>
      </div>
    </div>
  </div>
</section>

<!-- ---------- Manuscript 2 ---------- -->
<section class="tint" id="ccl26">
  <div class="wrap">
    <span style="display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--teal-dark);background:var(--mist);padding:3px 9px;border-radius:20px;">Manuscript 2</span>
    <h2 style="margin-top:.4em">Effector-specific blockade of the CCL26 (eotaxin-3) &amp; POSTN axis in EoE</h2>
    <p class="lead">CCL26 and POSTN emerged from the omics target scan as high-evidence, no-trial biology &mdash; the
    eosinophil-recruitment axis downstream of Th2 inflammation. This brief lays out the binder-design strategy:
    a neutralizing anti-CCL26 antibody (or CCR3 antagonist) and a POSTN-interface binder, with ESM-guided
    escape-risk analysis steering the paratope.</p>

    <div class="fig-2">
      <figure style="margin:0">
        <img src="assets/img/ccl26_render.png" alt="Structural render of a designed binder (orange) engaging the CCL26 chemokine surface (grey), with the target epitope highlighted in blue">
        <figcaption><strong>CCL26 (eotaxin-3) binder.</strong> A designed binder (orange) occludes the CCR3-engagement
        surface of the mature chemokine (epitope in blue) &mdash; neutralizing the dominant EoE eosinophil chemoattractant.</figcaption>
      </figure>
      <figure style="margin:0">
        <img src="assets/img/postn_render.png" alt="Structural render of a designed helical binder (orange) engaging the POSTN target surface (grey), interface residues in blue">
        <figcaption><strong>POSTN (periostin) binder.</strong> A helical binder engaging the POSTN interface &mdash;
        targeting the matricellular protein that amplifies eosinophil adhesion and tissue remodeling in EoE.</figcaption>
      </figure>
    </div>

    <h3>Design rationale</h3>
    <div class="grid cols-2">
      <div class="card">
        <h3 style="margin-top:0">Two routes for CCL26</h3>
        <p>A neutralizing anti-CCL26 IgG1 must occlude the N-loop / 40s-loop docking surface to block CCR3
        site-1 engagement &mdash; a high-affinity (K<sub>D</sub>&nbsp;&lt;&nbsp;1&nbsp;nM) requirement for the small,
        71-aa antigen. Alternatively, a small-molecule CCR3 antagonist targets the invariant receptor and captures the
        other eotaxins (CCL11/CCL24) on the same axis for a broader anti-eosinophil effect.</p>
      </div>
      <div class="card">
        <h3 style="margin-top:0">ESM-guided escape hardening</h3>
        <p>The sole ESM escape-risk position in the CCL26 epitope (H39) sits inside the N-loop docking surface &mdash; so
        the design co-engages the disulfide-rigid, conserved 40s loop rather than relying on H39. For the IL1RL1
        interface, CDRs are steered toward conserved aromatic hotspots (Y119 / F245) and away from the escape-prone rim.</p>
      </div>
    </div>

    <div class="callout coral">
      <h3>Why it differentiates</h3>
      <p>Effector-specific eosinophil-recruitment blockade &mdash; narrower and more targeted than dupilumab's broad
      Th2 blockade, and universal across EoE endotypes (Phase-2 addressable in ~99% of patients).</p>
    </div>

    <div class="callout">
      <h3>Structure downloads</h3>
      <div class="btn-row" style="margin-top:8px">
        <a class="btn ghost" href="assets/structures/ccl26_lead_complex.pdb" download>CCL26 lead complex (.pdb)</a>
        <a class="btn ghost" href="assets/structures/ccl26_target.pdb" download>CCL26 target (.pdb)</a>
        <a class="btn ghost" href="assets/structures/postn_lead_complex.pdb" download>POSTN lead complex (.pdb)</a>
      </div>
    </div>
  </div>
</section>
"""
page("manuscripts.html", "Manuscripts", manuscripts, active="manuscripts.html",
     description="Two manuscripts: rational design of pMHC-II nanoparticle tolerance therapeutics for EoE (9 constructs, ipTM 0.87-0.90, preclinical roadmap), and effector-specific CCL26/POSTN binder design.")
print("built manuscripts.html")

# ============================================================ BIOTECH
biotech = f"""
<section class="hero">
  <div class="wrap">
    <div class="eyebrow">Project Tolera &middot; a roadmap to patients</div>
    <h1>Antigen-specific tolerance, one patient at a time.</h1>
    <p class="lead">A citizen-scientist's roadmap for a personalized pMHC-II tolerance vaccine in eosinophilic
    esophagitis &mdash; from AI/ML design to first-in-patient. EoE is, at its root, antigen-specific: a food peptide
    presented on an MHC-II molecule to a pathogenic T-cell clone. Yet every approved and pipeline therapy is a broad,
    chronically-dosed symptom suppressor. Project Tolera maps the path to a one-course therapy that retires the clone.</p>
    <div class="btn-row">
      <a class="btn" href="assets/docs/Project_Tolera_Business_Plan.pdf" download>Business plan (PDF)</a>
      <a class="btn ghost" href="assets/docs/EoE_Scientific_Plan.pdf" download>Scientific plan (PDF)</a>
      <a class="btn ghost" href="assets/docs/Project_Tolera_Pitch_Deck.pptx" download>Pitch deck (PPTX)</a>
    </div>
  </div>
</section>

<section>
  <div class="wrap">
    <figure class="pad" style="margin:0 0 8px">
      <img src="assets/img/whitespace.png" alt="Competitive whitespace: every EoE therapy clusters in the broad-mechanism, chronic-dosing corner; TOL-EoE occupies the antigen-specific, durable/one-course corner alone">
      <figcaption><strong>The whitespace.</strong> Every approved and pipeline EoE therapy clusters in one corner &mdash;
      broad mechanism, chronic dosing. No agent is both antigen-specific and durable off-therapy. Tolera occupies the
      opposite corner alone.</figcaption>
    </figure>
  </div>
</section>

<section class="tint">
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">The platform</div><h2>PACT&trade; &mdash; the N-of-1 manufacturing thesis</h2>
    <p class="lead">Personalized therapy is only investable if manufacturing is tractable. PACT uses a shared,
    GPU-validated MHC-II backbone with a swappable peptide cassette &mdash; only the peptide changes per patient, so the
    expensive, regulated components are standardized and validated once. Vein-to-vaccine target: 6&ndash;10 weeks.</p></div>
    <figure class="pad" style="margin:0">
      <img src="assets/img/platform_architecture.png" alt="PACT platform: from an esophageal biopsy and blood draw through HLA typing, trigger profiling, epitope selection, construct assembly, GMP manufacture, to dosing">
      <figcaption>From one biopsy and blood draw to a patient-specific tolerance vaccine: read the patient's
      HLA&times;food&times;TCR triad, select the epitope, assemble on the shared backbone, formulate on nanoparticle,
      dose. Signal-1 (peptide) drives clonal anergy; Signal-2 (multivalent display) drives antigen-specific Tr1
      (IL-10) induction.</figcaption>
    </figure>
  </div>
</section>

<section>
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">Market</div><h2>A ~$2.2B unmet need, sized against a real precedent</h2></div>
    <div class="table-wrap">
      <table>
        <thead><tr><th>Layer</th><th>Definition</th><th>Patients (US)</th></tr></thead>
        <tbody>
          <tr><td>Prevalence</td><td>US EoE (~1 in 2,000)</td><td>~167,500</td></tr>
          <tr><td>Diagnosed</td><td>Clinically diagnosed (~60%)</td><td>~100,500</td></tr>
          <tr><td>SAM</td><td>Biologic-eligible (moderate&ndash;severe / failing conventional care)</td><td>~55,300</td></tr>
          <tr class="hl"><td>SOM (mature)</td><td>Realistic annual serviceable share (~12% of SAM)</td><td>~6,600 / yr</td></tr>
        </tbody>
      </table>
    </div>
    <figure class="pad">
      <img src="assets/img/market.png" alt="US market funnel and mature-year revenue by adoption scenario at $150k per course: conservative $0.66B, base $0.99B, upside $1.49B">
      <figcaption>Base-case SOM revenue ~$1.0B/yr at maturity (~6,600 patients &times; $150k one-course price). The
      adoption range is anchored to Tzield's real-world, screening-gated uptake &mdash; the bottleneck is screening
      infrastructure, not demand, which is why a companion diagnostic is a day-one deliverable.</figcaption>
    </figure>
  </div>
</section>

<section class="tint" id="patients">
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">Patient-centered differentiation</div>
    <h2>The voice-first thesis</h2>
    <p class="lead">Across prior antigen-specific programs, the teams that understood what patients actually
    experienced designed better trials &mdash; and patient voice arrived too late every time. EoE has no dedicated
    patient-focused drug-development (PFDD) meeting and no pMHC program. Tolera can invert that sequence: capture
    patient priorities <em>before</em> designing the trial.</p></div>
    <figure class="pad" style="margin:0">
      <img src="assets/img/patient_priorities.png" alt="Five cross-disease patient priorities mapped to the specific design requirements they demand of a tolerance vaccine">
      <figcaption>Five cross-disease patient priorities (from celiac, T1D, and EoE communities) mapped directly to the
      design choices they demand &mdash; one course over lifelong dosing, tolerogenic delivery over bare allergen, a
      low-burden schedule, an equitable companion diagnostic, and PRO instruments co-designed with patients.</figcaption>
    </figure>
  </div>
</section>

<section>
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">Regulatory strategy</div><h2>A platform IND, not one per patient</h2>
    <p class="lead">An EoE pMHC vaccine follows the trail blazed by Tzield (T1D), KAN-101 (celiac), and dupilumab
    (EoE). The plan pursues an expedited-designation sequence and engages FDA early on whether histologic remission can
    serve as a registration-enabling surrogate.</p></div>
    <figure class="pad" style="margin:0">
      <img src="assets/img/regulatory_timeline.png" alt="Regulatory and value-inflection timeline: Orphan Drug filing, INTERACT and Pre-IND meetings, GLP tox and GMP lots, IND submission, first-in-human, and Phase 2 proof-of-concept">
      <figcaption>The regulatory and value-inflection path across the seed-to-IND and Series-A-to-Phase-2 runways &mdash;
      a single platform IND built on the individualized-product framework validated by neoantigen cancer vaccines,
      with the companion diagnostic co-developed in parallel.</figcaption>
    </figure>
  </div>
</section>

<section class="tint">
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">What it would take</div><h2>Capital mapped to value inflections</h2>
    <p class="lead">~$8M carries the concept from validated in-silico design to a cleared IND and first-in-human dosing
    &mdash; the single largest de-risking step available today. A further ~$35M funds through the Phase 2
    durable-remission proof-of-concept. These figures scope the work, not a raise.</p></div>
    <figure class="pad">
      <img src="assets/img/use_of_proceeds.png" alt="Use of proceeds: $8M seed to IND plus first-in-human, and $35M Series A to Phase 2 proof-of-concept, broken down by category">
      <figcaption>Seed ($8M &rarr; IND + FIH) and Series&nbsp;A ($35M &rarr; Phase&nbsp;2 PoC), allocated across
      functional validation, murine PoC, GLP tox, GMP/IND lots, the companion diagnostic, regulatory, and team.</figcaption>
    </figure>
    <figure class="pad">
      <img src="assets/img/milestone_timeline.png" alt="Value-inflection timeline with each milestone tagged by the de-risking it delivers, across seed and Series A runways">
      <figcaption>Each milestone tagged with the de-risking it delivers &mdash; from Orphan Drug Designation through the
      IND clearance step-up to the Phase&nbsp;2 durable-remission inflection where a dedicated organization and
      partnering make sense.</figcaption>
    </figure>
  </div>
</section>

<section>
  <div class="wrap narrow">
    <div class="eyebrow">The full package</div>
    <h2>Documents</h2>
    <p>The complete Project Tolera package &mdash; business plan, scientific plan, financial model, market analysis, and
    investor deck. Everything below is downloadable.</p>
    <div class="grid cols-2">
      <div class="card">
        <h3 style="margin-top:0">Strategy &amp; commercial</h3>
        <ul>
          <li><a href="assets/docs/Project_Tolera_Business_Plan.pdf" download>Business plan (PDF)</a></li>
          <li><a href="assets/docs/Project_Tolera_Pitch_Deck.pptx" download>Investor pitch deck (PPTX)</a></li>
          <li><a href="assets/docs/market_analysis.md" download>Market analysis (Markdown)</a></li>
          <li><a href="assets/docs/financial_model.csv" download>Financial model (CSV)</a></li>
        </ul>
      </div>
      <div class="card">
        <h3 style="margin-top:0">Scientific &amp; development</h3>
        <ul>
          <li><a href="assets/docs/EoE_Scientific_Plan.pdf" download>Scientific plan (PDF)</a></li>
          <li><a href="assets/docs/pMHC_Deliverables_Index.md" download>Deliverables index (Markdown)</a></li>
          <li><a href="manuscripts.html">Manuscripts &amp; structures &rarr;</a></li>
          <li><a href="specialist.html">The pipeline that built this &rarr;</a></li>
        </ul>
      </div>
    </div>

    <div class="disclaimer">
      This is an independent research roadmap, not a company prospectus or an offer to invest. It maps what a credible
      path from AI/ML design to first-in-patient could look like &mdash; a scoped brief for any biotech partner or funder
      who wants to take it forward. Preclinical-stage concept. Financial and market figures are illustrative planning
      assumptions grounded in public data, not guidance. Non-dairy epitope activity is a computational prior pending
      wet-lab validation. The food-trigger assay concept is patented (Hill/Spergel) &mdash; a freedom-to-operate /
      licensing consideration for anyone taking this forward. Not medical advice.
    </div>
  </div>
</section>
"""
page("biotech.html", "Project Tolera", biotech, active="biotech.html",
     description="Project Tolera: a citizen-scientist roadmap for a personalized pMHC-II tolerance vaccine in EoE. Platform (PACT), market (~$2.2B), competitive whitespace, patient-first differentiation, regulatory path, and budget.")
print("built biotech.html")

# ============================================================ ABOUT
about = f"""
<section class="hero">
  <div class="wrap">
    <div class="eyebrow">About</div>
    <h1>Ruth-Anne Pai, PhD</h1>
    <p class="lead">Immunologist, protein designer, and a person living with eosinophilic esophagitis. I build open,
    patient-first therapeutic science &mdash; and this project is what one week of it looks like when the patient and
    the scientist are the same person.</p>
    <div class="btn-row">
      <a class="btn" href="mailto:{CONTACT_EMAIL}">Get in touch</a>
      <a class="btn ghost" href="{WEBSITE}" target="_blank" rel="noopener">ruthannepai.com</a>
      <a class="btn ghost" href="{LINKEDIN}" target="_blank" rel="noopener">LinkedIn</a>
    </div>
  </div>
</section>

<section>
  <div class="wrap narrow">
    <h2>The citizen-scientist thesis</h2>
    <p>For many patients the path to an EoE diagnosis is long and indirect, and the treatment that follows is
    genuinely effective for many but fundamentally incomplete: PPIs, swallowed steroids, elimination diets, and
    dupilumab each reduce inflammation, but none is curative, all require indefinite adherence, and inflammation
    typically returns when treatment stops. The burden that doesn't show up in a biopsy &mdash; chewing every bite an
    unusual number of times, drinking with every mouthful, a quiet, rational anxiety around choking &mdash; is a disease
    that asks for constant, low-grade attention, meal after meal, for life.</p>
    <p>That lived reality is not incidental to this work; it is its origin. When the immunologist and the patient are
    the same person, patient experience becomes a design input rather than a marketing note &mdash; it shapes which
    priorities lead, which endpoints matter, and how a community would be engaged.</p>

    <div class="callout coral">
      <h3>What one week produced</h3>
      <p>With access to computational tools (folding and ESM-family models on GPU, public literature and omics,
      epitope prediction), clear immunological principles, and one week of focus, this project went from
      &ldquo;here is a disease&rdquo; to: novel epitopes identified from the EoE literature, structurally validated at
      atomic resolution; a multivalent tolerance platform grounded in published precedent; a complete preclinical
      development path with decision gates and budgets; and reusable software so anyone can do the same for their
      disease. The next steps &mdash; laboratory validation and clinical translation &mdash; require a team. But the
      design is ready to be picked up, tested, and, if it holds, carried to patients.</p>
    </div>
  </div>
</section>

<section class="tint">
  <div class="wrap">
    <div class="section-head"><div class="eyebrow">The work, in one place</div><h2>Explore the project</h2></div>
    <div class="grid cols-2">
      <div class="card"><h3 style="margin-top:0">Therapeutic Program Architect</h3>
        <p>A disease-agnostic drug-development specialist &mdash; for any community, any disease.</p>
        <div class="card-foot"><a href="specialist.html">Open &rarr;</a></div></div>
      <div class="card"><h3 style="margin-top:0">Software &amp; repositories</h3>
        <p>Eight open-source repositories and reusable Claude Science skills.</p>
        <div class="card-foot"><a href="software.html">Open &rarr;</a></div></div>
      <div class="card"><h3 style="margin-top:0">Manuscripts</h3>
        <p>pMHC-II tolerance therapeutics and the CCL26 / POSTN effector axis.</p>
        <div class="card-foot"><a href="manuscripts.html">Open &rarr;</a></div></div>
      <div class="card"><h3 style="margin-top:0">Project Tolera</h3>
        <p>The full business and scientific plan for antigen-specific tolerance.</p>
        <div class="card-foot"><a href="biotech.html">Open &rarr;</a></div></div>
    </div>
  </div>
</section>

<section>
  <div class="wrap narrow center">
    <h2>Reach out</h2>
    <p class="lead">If this resonates with you &mdash; as a researcher, clinician, patient-advocate, funder, or biotech
    partner &mdash; I'd like to hear from you.</p>
    <div class="btn-row" style="justify-content:center">
      <a class="btn" href="mailto:{CONTACT_EMAIL}">{CONTACT_EMAIL}</a>
      <a class="btn ghost" href="{GH_USER}" target="_blank" rel="noopener">GitHub</a>
    </div>
    <p class="small muted" style="margin-top:24px">Work developed during the
    <a href="{HACKATHON}" target="_blank" rel="noopener">Built with Claude: Life Sciences Hackathon</a>, 2026.</p>
  </div>
</section>
"""
page("about.html", "About", about, active="about.html",
     description="Ruth-Anne Pai, PhD — immunologist, protein designer, and person living with eosinophilic esophagitis. The citizen-scientist thesis behind a week of open therapeutic science.")
print("built about.html")
