// Shared data for the VivaMed technology page
window.POTS_ENDOTYPES = [
  {
    id:"E1", tag:"Adrenergic", name:"ADRB1-Driven Adrenoceptor Hypersensitivity",
    genes:["ADRB1","ADRB2","GNAS"], biomarkers:[
      {name:"Plasma NE (upright)", val:"≥600 pg/mL"},
      {name:"HR response to β1-agonist", val:"exaggerated"},
      {name:"ADRB1 Arg389 variant", val:"homozygous"},
    ],
    pathways:["β-adrenergic signaling","cAMP/PKA cascade"],
    definition:"Upright tachycardia driven by β1/β2 adrenoceptor hypersensitivity at the sinoatrial node. Elevated plasma norepinephrine on standing with exaggerated heart-rate response to exogenous β-agonists.",
    conf:0.92,
    drugs:[
      {rank:1,name:"Atenolol",mech:"Selective β1-blocker — directly targets ADRB1 overactivation",score:0.984,bar:98},
      {rank:2,name:"Propranolol",mech:"Non-selective β-blocker — ADRB1/ADRB2 pathway match",score:0.921,bar:92},
      {rank:3,name:"Ivabradine",mech:"HCN4 If-current inhibitor — rate control without β-effects",score:0.887,bar:89},
      {rank:4,name:"Midodrine",mech:"α1-agonist — secondary mechanism support",score:0.812,bar:81},
    ],
  },
  {
    id:"E2", tag:"Mast Cell", name:"TPSAB1 Hereditary Alpha-Tryptasemia",
    genes:["TPSAB1","HPGDS"], biomarkers:[
      {name:"Baseline serum tryptase", val:">8 ng/mL"},
      {name:"TPSAB1 copy-number", val:"≥α/α/βα/β"},
      {name:"Post-prandial flushing", val:"present"},
    ],
    pathways:["Mast-cell degranulation","Histamine H1/H2 signaling"],
    definition:"Elevated basal tryptase from TPSAB1 gene duplication driving mast-cell mediator release. Orthostatic symptoms accompanied by flushing, pruritus, and GI dysmotility.",
    conf:0.88,
    drugs:[
      {rank:1,name:"Cromolyn Sodium",mech:"Mast-cell stabilizer — direct pathway match",score:0.951,bar:95},
      {rank:2,name:"Ketotifen",mech:"Dual H1 antihistamine + mast-cell stabilizer",score:0.904,bar:90},
      {rank:3,name:"Omalizumab",mech:"Anti-IgE — upstream mast-cell modulation",score:0.842,bar:84},
      {rank:4,name:"Fexofenadine",mech:"H1-antagonist — symptom-level pathway fit",score:0.778,bar:78},
    ],
  },
  {
    id:"E3", tag:"Transporter", name:"SLC6A2 NET Transporter Loss-of-Function",
    genes:["SLC6A2","DBH"], biomarkers:[
      {name:"NE/DHPG ratio", val:"elevated"},
      {name:"SLC6A2 rs5569", val:"T/T"},
      {name:"Plasma NE clearance", val:"reduced >40%"},
    ],
    pathways:["Norepinephrine reuptake","Catecholamine clearance"],
    definition:"Partial loss-of-function of the presynaptic norepinephrine transporter causing impaired NE clearance from sympathetic synapses. Hyperadrenergic phenotype with preserved NE synthesis.",
    conf:0.85,
    drugs:[
      {rank:1,name:"Droxidopa",mech:"Norepinephrine prodrug — bypasses transporter deficit",score:0.938,bar:94},
      {rank:2,name:"Clonidine",mech:"Central α2-agonist — suppresses sympathetic outflow",score:0.889,bar:89},
      {rank:3,name:"Guanfacine",mech:"Selective α2A-agonist — pre-synaptic autoreceptor",score:0.854,bar:85},
      {rank:4,name:"Methyldopa",mech:"Centrally-acting antihypertensive",score:0.761,bar:76},
    ],
  },
  {
    id:"E4", tag:"Vascular", name:"NOS3-Driven Endothelial NO Dysregulation",
    genes:["NOS3","EDN1","VEGFA"], biomarkers:[
      {name:"Flow-mediated dilation", val:"<5%"},
      {name:"Serum NOx", val:"decreased"},
      {name:"NOS3 G894T (Glu298Asp)", val:"carrier"},
    ],
    pathways:["Endothelial nitric-oxide synthesis","Vascular tone regulation"],
    definition:"Reduced endothelial NO bioavailability causing impaired splanchnic vasoconstriction on standing. Venous pooling drives compensatory sympathetic activation.",
    conf:0.85,
    drugs:[
      {rank:1,name:"Midodrine",mech:"α1-agonist — venoconstriction compensates NO deficit",score:0.922,bar:92},
      {rank:2,name:"Droxidopa",mech:"Norepinephrine prodrug — vasoconstrictor support",score:0.878,bar:88},
      {rank:3,name:"L-Arginine",mech:"NOS3 substrate — upstream pathway supplementation",score:0.812,bar:81},
      {rank:4,name:"Octreotide",mech:"Somatostatin analog — splanchnic vasoconstriction",score:0.754,bar:75},
    ],
  },
  {
    id:"E5", tag:"Autoimmune", name:"Anti-CHRNA3 Ganglionic nAChR Autoantibody-Mediated",
    genes:["CHRNA3","FCGRT","CHRNB4"], biomarkers:[
      {name:"Anti-gAChR IgG titer", val:">0.05 nmol/L"},
      {name:"Total IgG", val:"normal"},
      {name:"Sjögren SS-A (co-occurrence)", val:"often positive"},
    ],
    pathways:["Autonomic ganglionic transmission","IgG-mediated receptor internalization"],
    definition:"Autoantibodies against the α3-subunit of neuronal nicotinic acetylcholine receptors impair ganglionic transmission. Frequently co-occurs with other autoimmune dysautonomias.",
    conf:0.82,
    drugs:[
      {rank:1,name:"Efgartigimod",mech:"Neonatal Fc receptor inhibitor — depletes pathogenic IgG",score:0.944,bar:94},
      {rank:2,name:"Pyridostigmine",mech:"AChE inhibitor — augments ganglionic signaling",score:0.901,bar:90},
      {rank:3,name:"IVIG",mech:"Polyclonal IgG — receptor blockade + immunomodulation",score:0.869,bar:87},
      {rank:4,name:"Rituximab",mech:"Anti-CD20 — upstream B-cell depletion",score:0.798,bar:80},
    ],
  },
  {
    id:"E6", tag:"Ion Channel", name:"SCN9A Nav1.7 Voltage-Gated Sodium Channelopathy",
    genes:["SCN9A","SCN1A"], biomarkers:[
      {name:"SCN9A rare variant", val:"missense, gain-of-function"},
      {name:"QSART sweat response", val:"abnormal"},
      {name:"Small-fiber density", val:"reduced"},
    ],
    pathways:["Voltage-gated Na+ channel signaling","Small-fiber sensory transduction"],
    definition:"Gain-of-function variants in Nav1.7 driving small-fiber neuropathy and aberrant autonomic signaling. Often co-presents with burning pain and gastrointestinal dysmotility.",
    conf:0.80,
    drugs:[
      {rank:1,name:"Mexiletine",mech:"Class-1B Na+-channel blocker — Nav1.7 pathway match",score:0.912,bar:91},
      {rank:2,name:"Lacosamide",mech:"Slow sodium-channel inactivation enhancer",score:0.867,bar:87},
      {rank:3,name:"Gabapentin",mech:"α2δ-subunit modulation — adjacent small-fiber pathway",score:0.821,bar:82},
      {rank:4,name:"Carbamazepine",mech:"Voltage-dependent sodium-channel blocker",score:0.784,bar:78},
    ],
  },
];

// Scoring internals (feature weights) intentionally not shipped to the public
// site — the ranking is described qualitatively in the platform "How ranking
// works" panel. Do not reintroduce per-feature weights here.

window.TAXONOMY_LAYERS = [
  { num:"01", title:"Mechanism Families", count:"167", sub:"Broadest shared-mechanism groupings",
    body:"The top tier of organization. Endotypes are regrouped across diseases by shared molecular mechanism — RAS/MAPK signaling, cytokine & inflammatory signaling, ion-channel dysfunction, epigenetic regulation, metabolic enzyme deficiency — each a major axis of human disease biology.",
    chips:["RAS/MAPK","Cytokine","Ion Channel","Epigenetic","Metabolic","+162"]},
  { num:"02", title:"Cross-Disease Baskets", count:"1,046", sub:"Coherence-gated mechanism clusters",
    body:"Endotypes that share a causal mechanism cluster together regardless of organ or diagnosis — placing BRAF-melanoma beside BRAF-thyroid beside BRAF-glioma. Each coherent basket is a ready-made, tissue-agnostic trial cohort.",
    chips:["BCR-ABL","IL-4/IL-13","HCN","mTORC1","BRAF","+1,041"]},
  { num:"03", title:"Endotypes", count:"79,362", sub:"Atomic molecular subtypes",
    body:"The atomic unit of BioAtlas. Each endotype is a self-contained biological hypothesis: mechanism definition, causal genes, dysregulated pathways, HPO phenotypes, biomarkers, and a confidence tier.",
    chips:["mechanism","genes","biomarkers","HPO","pathways","confidence"]},
];

// Real, published headline metrics (from the VivaMed validation whitepapers).
window.VALIDATION_METRICS = [
  { v:"95.8%", l:"hit@5 on a held-out FDA approval set", sub:"z = 7.77σ vs a class-matched null" },
  { v:"85%",   l:"hit@5 on a 2019–2024 time-split", sub:"approvals never seen at ranking time" },
  { v:"9 / 9", l:"tumor-agnostic FDA approvals recovered", sub:"at 4.0× enrichment over random" },
  { v:"18.9×", l:"tighter than random clusters", sub:"confirmed on 17 of 19 orthogonal substrates" },
];

// Rediscovery examples — the platform surfaces the approved therapy at the top
// of the ranking. Qualitative only (no per-drug scores shown publicly).
window.VALIDATION = [
  { disease:"Asthma", mondo:"MONDO:0004979",
    endo:"IL-4/IL-13 Type 2 Inflammation", genes:["IL4","IL13","IL4R","STAT6"],
    family:"Cytokine & Inflammatory Signaling",
    drugs:["Dupilumab","Mepolizumab","Benralizumab"],
  },
  { disease:"Chronic Myeloid Leukemia", mondo:"MONDO:0011996",
    endo:"BCR-ABL Kinase Fusion Oncogenesis", genes:["BCR","ABL1","CRKL","GRB2"],
    family:"RAS/MAPK Kinase Signaling",
    drugs:["Imatinib","Dasatinib","Nilotinib"],
  },
  { disease:"Type 2 Diabetes", mondo:"MONDO:0005148",
    endo:"SLC2A4/AKT2 Insulin-Stimulated Glucose Uptake Failure", genes:["SLC2A4","AKT2","IRS1","INSR"],
    family:"Metabolic Dysfunction",
    drugs:["Exenatide","Metformin","Pioglitazone"],
  },
];

window.TOOLS = [
  { badge:"Most valuable", title:"Clinical Trial Design",
    desc:"Generate endotype-enriched trial protocols with biomarker-based patient selection, predicted effect sizes, and sample-size estimates. Targets lower-risk, higher-powered Phase 2s through precision enrollment.",
    stats:[],
    featured:true },
  { badge:"Commercial", title:"TAM Market Sizing",
    desc:"Calculate total addressable market by multiplying endotype prevalence × predicted efficacy. Interactive revenue modeling.",
    stats:[] },
  { badge:"Oncology", title:"Basket Trial Builder",
    desc:"Group endotypes across diseases by shared molecular target. Gene-based basket designs ready for precision-oncology adoption.",
    stats:[] },
  { badge:"Resistance", title:"Resistance Predictor",
    desc:"Identify resistance mechanisms by finding low-scoring endotypes. Separates responder and non-responder subpopulations on mechanism.",
    stats:[] },
  { badge:"CDx", title:"Biomarker Companion Designer",
    desc:"For any drug candidate, surface the minimal biomarker panel that selects the responsive endotype cohort.",
    stats:[] },
];

window.LAZARUS_STEPS = [
  { n:1, name:"Stratification", d:"Identify the responsive endotype subpopulation within the original indication." },
  { n:2, name:"Repurposing", d:"Move the compound to a disease with higher endotype overlap." },
  { n:3, name:"Combination", d:"Pair with a synergistic compound for the same endotype." },
  { n:4, name:"Indication Expansion", d:"Expand to adjacent diseases sharing the endotype." },
  { n:5, name:"Biomarker Rescue", d:"Define a companion biomarker for patient selection." },
];

// Qualitative revival strategies only — no biological/patent/commercial scores
// and no specific combination claims are exposed on the public site.
window.LAZARUS_REVIVALS = [
  { strat:"Stratification",
    d:"Restrict to the responsive molecular subpopulation within the original indication — the responders an all-comers trial averaged away." },
  { strat:"Repurposing",
    d:"Redirect the compound to a different disease whose driving mechanism it already matches — even across organ systems." },
];
