Sturge weberb syndrome ppt

Reading File
Reading File
Reading File
Finding Sources
Searching the Web

Sturge-Weber syndrome clinical features diagnosis management 2024

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/sturge-weber-ppt && ls /home/daytona/workspace/sturge-weber-ppt

Writing File

~/sturge-weber-ppt/create_ppt.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Sturge-Weber Syndrome";
pres.author = "Medical Presentation";

// ─── Color Palette ───────────────────────────────────────────────────────────
const C = {
  darkBg:    "1A2744",   // deep navy — title/section slides
  midBg:     "243460",   // medium navy — accent blocks
  accent:    "C0392B",   // port-wine red — mirrors the birthmark colour
  accentSoft:"E8796B",   // light red for sub-accents
  white:     "FFFFFF",
  offWhite:  "F4F6FB",
  textDark:  "1A2744",
  textMid:   "2C3E6B",
  textLight: "E8ECF8",
  gold:      "E6B84A",
  lineBlue:  "4A6FA5",
};

// ─── Helper: add a section divider slide ─────────────────────────────────────
function sectionSlide(title, subtitle) {
  const sl = pres.addSlide();
  // full dark background
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  // red accent bar left
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });
  // section number bar
  sl.addShape(pres.ShapeType.rect, { x: 0.18, y: 2.1, w: 9.64, h: 0.04, fill: { color: C.accentSoft }, line: { color: C.accentSoft } });
  sl.addText(title, {
    x: 0.5, y: 1.8, w: 9, h: 1.0,
    fontSize: 38, bold: true, color: C.white, fontFace: "Calibri", align: "left", margin: 0,
  });
  if (subtitle) {
    sl.addText(subtitle, {
      x: 0.5, y: 2.9, w: 9, h: 0.7,
      fontSize: 18, color: C.accentSoft, fontFace: "Calibri", align: "left", margin: 0,
    });
  }
  return sl;
}

// ─── Helper: content slide (navy header + off-white body) ─────────────────────
function contentSlide(title) {
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.offWhite } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.1, fill: { color: C.darkBg } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 1.1, w: 0.18, h: 4.525, fill: { color: C.accent } });
  sl.addText(title, {
    x: 0.4, y: 0.15, w: 9.3, h: 0.8,
    fontSize: 24, bold: true, color: C.white, fontFace: "Calibri", align: "left", margin: 0,
  });
  return sl;
}

// ─── Helper: bullet items ─────────────────────────────────────────────────────
function bullets(items, opts = {}) {
  return items.map((item, i) => ({
    text: item,
    options: { bullet: { type: "bullet" }, breakLine: i < items.length - 1, ...opts },
  }));
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  // bg
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  // bold red swoosh — left diagonal block
  sl.addShape(pres.ShapeType.rect, { x: -0.5, y: 3.5, w: 5, h: 2.5, fill: { color: C.accent }, rotate: -10 });
  // white card
  sl.addShape(pres.ShapeType.roundRect, { x: 0.5, y: 0.5, w: 9, h: 4.5, fill: { color: "FFFFFF", transparency: 8 }, rectRadius: 0.12 });

  sl.addText("Sturge-Weber Syndrome", {
    x: 0.7, y: 0.9, w: 8.6, h: 1.4,
    fontSize: 40, bold: true, color: C.darkBg, fontFace: "Calibri", align: "center", margin: 0,
  });
  sl.addShape(pres.ShapeType.rect, { x: 2.5, y: 2.35, w: 5, h: 0.06, fill: { color: C.accent } });
  sl.addText("Encephalotrigeminal Angiomatosis", {
    x: 0.7, y: 2.5, w: 8.6, h: 0.6,
    fontSize: 20, italic: true, color: C.textMid, fontFace: "Calibri", align: "center", margin: 0,
  });
  sl.addText("A Neurocutaneous Phakomatosis", {
    x: 0.7, y: 3.2, w: 8.6, h: 0.5,
    fontSize: 16, color: C.textMid, fontFace: "Calibri", align: "center", margin: 0,
  });
  sl.addText("Neurology  |  Dermatology  |  Ophthalmology", {
    x: 0.7, y: 3.9, w: 8.6, h: 0.4,
    fontSize: 13, color: C.accent, fontFace: "Calibri", align: "center", bold: true, margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW / OUTLINE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Presentation Outline");
  const topics = [
    "Definition & Epidemiology",
    "Etiology & Pathogenesis",
    "Classification (Roach Scale)",
    "Clinical Features  —  Cutaneous, Neurological, Ocular",
    "Diagnostic Approach  —  Imaging & Investigations",
    "Management",
    "Prognosis",
  ];
  // numbered boxes
  const colors = [C.accent, "2E5FA3", "2E7D32", "6A1B9A", "BF360C", "00695C", "37474F"];
  topics.forEach((t, i) => {
    const col = i % 2 === 0 ? 0.35 : 5.25;
    const row = Math.floor(i / 2);
    const yBase = 1.35 + row * 0.92;
    if (i === topics.length - 1 && topics.length % 2 !== 0) {
      // last odd item — center it
      sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: yBase, w: 9.3, h: 0.72, fill: { color: colors[i] }, rectRadius: 0.08 });
      sl.addText(`${i + 1}.  ${t}`, { x: 0.55, y: yBase + 0.12, w: 9.0, h: 0.48, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    } else {
      sl.addShape(pres.ShapeType.roundRect, { x: col, y: yBase, w: 4.5, h: 0.72, fill: { color: colors[i] }, rectRadius: 0.08 });
      sl.addText(`${i + 1}.  ${t}`, { x: col + 0.15, y: yBase + 0.1, w: 4.2, h: 0.52, fontSize: 12.5, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    }
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DEFINITION & EPIDEMIOLOGY
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Definition & Epidemiology");

  // definition box
  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.25, w: 9.3, h: 1.5, fill: { color: C.midBg }, rectRadius: 0.1 });
  sl.addText([
    { text: "Sturge-Weber Syndrome (SWS)", options: { bold: true, color: C.gold } },
    { text: " is a congenital, sporadic ", options: { color: C.white } },
    { text: "neurocutaneous phakomatosis", options: { bold: true, color: C.accentSoft } },
    { text: " (encephalotrigeminal angiomatosis) characterised by a facial port-wine birthmark, leptomeningeal angiomatosis, and ocular involvement.", options: { color: C.white } },
  ], { x: 0.55, y: 1.35, w: 9.0, h: 1.3, fontSize: 14, fontFace: "Calibri", margin: 0 });

  // Epi stats in coloured tiles
  const stats = [
    { label: "Incidence", value: "~1 in 20,000\nlive births" },
    { label: "Inheritance", value: "Sporadic\n(not inherited)" },
    { label: "Race", value: "All races\nequally affected" },
    { label: "Gene", value: "GNAQ somatic\nmutation (9q21)" },
  ];
  const tileW = 2.0, tileH = 1.1, tileY = 3.05, gap = 0.32;
  const tileColors = [C.accent, "2E5FA3", "2E7D32", "6A1B9A"];
  stats.forEach((s, i) => {
    const x = 0.5 + i * (tileW + gap);
    sl.addShape(pres.ShapeType.roundRect, { x, y: tileY, w: tileW, h: tileH, fill: { color: tileColors[i] }, rectRadius: 0.1 });
    sl.addText(s.label.toUpperCase(), { x: x + 0.05, y: tileY + 0.06, w: tileW - 0.1, h: 0.28, fontSize: 8.5, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
    sl.addText(s.value, { x: x + 0.05, y: tileY + 0.32, w: tileW - 0.1, h: 0.72, fontSize: 13, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
  });

  sl.addText("SWS is a phakomatosis — diseases with cutaneous, neurological, and ocular manifestations sharing a common embryonic origin.", {
    x: 0.4, y: 4.3, w: 9.2, h: 0.55, fontSize: 11, italic: true, color: C.textMid, fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — ETIOLOGY & PATHOGENESIS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Etiology & Pathogenesis");

  // Left column — genetic basis
  sl.addShape(pres.ShapeType.rect, { x: 0.35, y: 1.2, w: 4.4, h: 3.8, fill: { color: "EAF0FA" }, line: { color: C.lineBlue, pt: 1 } });
  sl.addText("GENETIC BASIS", { x: 0.45, y: 1.3, w: 4.2, h: 0.4, fontSize: 13, bold: true, color: C.darkBg, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Somatic (non-germline) mosaic mutation in GNAQ gene on chromosome 9q21",
    "Mutation: R183Q (Arg183Gln) — most common",
    "GNAQ codes for G-protein alpha-q subunit",
    "Mutant Gαq has impaired GTPase activity → reduced deactivation",
    "Hyperactivation of downstream MAPK/ERK and mTOR pathways",
    "Mutation enriched in endothelial cells",
    "GNA11 mutations also implicated in some cases",
  ], { fontSize: 11.5, color: C.textDark, fontFace: "Calibri" }), {
    x: 0.45, y: 1.75, w: 4.2, h: 3.1, fontFace: "Calibri", margin: 0,
  });

  // Right column — embryological basis
  sl.addShape(pres.ShapeType.rect, { x: 5.0, y: 1.2, w: 4.65, h: 3.8, fill: { color: "FEF0EE" }, line: { color: C.accent, pt: 1 } });
  sl.addText("EMBRYOLOGICAL BASIS", { x: 5.1, y: 1.3, w: 4.4, h: 0.4, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Primitive vascular plexus develops at ~6th fetal week around the cephalic neural tube and facial skin",
    "Normally regresses at ~9th fetal week",
    "In SWS: the plexus PERSISTS due to the GNAQ mutation",
    "Results in persistent vascular malformations in skin, leptomeninges, and choroid",
    "Abnormal venous drainage → chronic cortical ischemia → atrophy + calcification",
  ], { fontSize: 11.5, color: C.textDark, fontFace: "Calibri" }), {
    x: 5.1, y: 1.75, w: 4.45, h: 3.1, fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — CLASSIFICATION (ROACH SCALE)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Classification — Roach Scale");

  sl.addText("The Roach Scale classifies SWS into three types based on clinical involvement:", {
    x: 0.35, y: 1.2, w: 9.3, h: 0.45, fontSize: 13, color: C.textDark, fontFace: "Calibri", margin: 0,
  });

  const types = [
    {
      type: "Type I",
      title: "Facial AND Leptomeningeal Angiomas",
      desc: "Port-wine birthmark on face PLUS leptomeningeal angiomatosis. May have glaucoma.",
      color: C.accent,
    },
    {
      type: "Type II",
      title: "Facial Angioma Only",
      desc: "Port-wine birthmark WITHOUT leptomeningeal involvement. May or may not have glaucoma.",
      color: "2E5FA3",
    },
    {
      type: "Type III",
      title: "Leptomeningeal Angioma Only",
      desc: "Leptomeningeal angiomatosis WITHOUT facial port-wine birthmark. Usually no glaucoma.",
      color: "2E7D32",
    },
  ];

  types.forEach((t, i) => {
    const y = 1.8 + i * 1.1;
    sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y, w: 1.5, h: 0.85, fill: { color: t.color }, rectRadius: 0.1 });
    sl.addText(t.type, { x: 0.35, y: y + 0.22, w: 1.5, h: 0.42, fontSize: 18, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
    sl.addShape(pres.ShapeType.roundRect, { x: 2.0, y, w: 7.65, h: 0.85, fill: { color: "F0F4FF" }, line: { color: t.color, pt: 1.5 }, rectRadius: 0.1 });
    sl.addText(t.title, { x: 2.15, y: y + 0.05, w: 7.3, h: 0.35, fontSize: 13, bold: true, color: t.color, fontFace: "Calibri", margin: 0 });
    sl.addText(t.desc, { x: 2.15, y: y + 0.4, w: 7.3, h: 0.38, fontSize: 11.5, color: C.textDark, fontFace: "Calibri", margin: 0 });
  });

  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 5.0, w: 9.3, h: 0.42, fill: { color: C.darkBg }, rectRadius: 0.08 });
  sl.addText("Note: Involvement of upper face/forehead (V1) confers highest risk of SWS. Bilateral involvement is more severe.", {
    x: 0.5, y: 5.04, w: 9.1, h: 0.34, fontSize: 11, color: C.white, fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SECTION DIVIDER — CLINICAL FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
sectionSlide("Clinical Features", "The Classic Triad: Skin  •  Brain  •  Eye");

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — CUTANEOUS FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Cutaneous Features — Port-Wine Birthmark (PWB)");

  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.2, w: 5.8, h: 3.85, fill: { color: "FFF3F0" }, line: { color: C.accent, pt: 1.5 }, rectRadius: 0.1 });
  sl.addText("Port-Wine Birthmark (Capillary Malformation)", {
    x: 0.5, y: 1.3, w: 5.5, h: 0.42, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri", margin: 0,
  });
  sl.addText(bullets([
    "Congenital, flat, painless vascular malformation",
    "Typically involves forehead and upper eyelid (V1 — ophthalmic branch of trigeminal nerve)",
    "May extend to both sides of face, trunk, and limbs",
    "Facial nevi sparing the upper face rarely associated with intracranial angioma",
    "May THICKEN over time and develop nodular texture",
    "Reactive hypertrophy of adjacent bone and connective tissue can occur",
    "Lesion does not blanche fully and is NEVER warm (unlike AVM)",
    "Only 10-20% of children with forehead PWB have a leptomeningeal angioma",
  ], { fontSize: 11.5, color: C.textDark, fontFace: "Calibri" }), {
    x: 0.5, y: 1.78, w: 5.5, h: 3.15, fontFace: "Calibri", margin: 0,
  });

  // right panel — distribution risk box
  sl.addShape(pres.ShapeType.roundRect, { x: 6.4, y: 1.2, w: 3.25, h: 1.8, fill: { color: C.midBg }, rectRadius: 0.1 });
  sl.addText("Highest Risk Pattern", { x: 6.55, y: 1.28, w: 2.95, h: 0.38, fontSize: 12.5, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Forehead (V1 / S1 distribution)",
    "More facial area involved = higher risk",
    "Bilateral V1 or V1+V2+V3 = significantly higher SWS risk",
  ], { fontSize: 11, color: C.white, fontFace: "Calibri" }), {
    x: 6.55, y: 1.7, w: 2.95, h: 1.2, fontFace: "Calibri", margin: 0,
  });

  sl.addShape(pres.ShapeType.roundRect, { x: 6.4, y: 3.2, w: 3.25, h: 1.85, fill: { color: "FEF0EE" }, line: { color: C.accent, pt: 1 }, rectRadius: 0.1 });
  sl.addText("Tram-Track Calcification", { x: 6.55, y: 3.28, w: 2.95, h: 0.38, fontSize: 12.5, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Characteristic 'tram-track' / 'trolley-track' calcifications in cerebral cortex",
    "Seen on CT / skull X-ray",
    "Follow brain convolutions (gyriform pattern)",
    "Usually absent in neonates",
  ], { fontSize: 10.5, color: C.textDark, fontFace: "Calibri" }), {
    x: 6.55, y: 3.7, w: 2.95, h: 1.25, fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — NEUROLOGICAL FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Neurological Features");

  // Seizures box
  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.2, w: 4.55, h: 2.5, fill: { color: "FFF3F0" }, line: { color: C.accent, pt: 1.5 }, rectRadius: 0.1 });
  sl.addText("Epilepsy", { x: 0.5, y: 1.28, w: 4.2, h: 0.38, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Epilepsy in 72-80% (unilateral) and 93% (bilateral lesions)",
    "75% begin in first year; 95% before age 5",
    "Focal motor or generalized tonic-clonic seizures (most common)",
    "Also: infantile spasms, myoclonic, atonic seizures",
    "Early onset (<2 yrs) = worse cognitive prognosis",
    "Seizures often co-present with hemiparesis",
  ], { fontSize: 11, color: C.textDark, fontFace: "Calibri" }), {
    x: 0.5, y: 1.7, w: 4.2, h: 1.9, fontFace: "Calibri", margin: 0,
  });

  // Cognitive box
  sl.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.2, w: 4.55, h: 2.5, fill: { color: "EAF0FA" }, line: { color: C.lineBlue, pt: 1.5 }, rectRadius: 0.1 });
  sl.addText("Cognitive & Neurological Deficits", { x: 5.25, y: 1.28, w: 4.2, h: 0.38, fontSize: 13, bold: true, color: C.textMid, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Intellectual disability in ~50% overall; only 8% with bilateral lesions are normal",
    "Hemiparesis — often contralateral to the facial nevus; may be permanent",
    "Homonymous hemianopia (occipital involvement common)",
    "Stroke-like episodes / TIA-like events possible",
    "Behavioral problems frequent even in non-disabled patients",
    "Children normal at age 3 rarely develop severe impairment later",
  ], { fontSize: 11, color: C.textDark, fontFace: "Calibri" }), {
    x: 5.25, y: 1.7, w: 4.2, h: 1.9, fontFace: "Calibri", margin: 0,
  });

  // Mechanism
  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 3.9, w: 9.3, h: 1.5, fill: { color: C.darkBg }, rectRadius: 0.1 });
  sl.addText("Pathophysiology of Neurological Damage", { x: 0.55, y: 3.97, w: 9.0, h: 0.38, fontSize: 13, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
  sl.addText("Leptomeningeal angioma → abnormal venous drainage → chronic cortical ischemia → cortical atrophy + calcification → progressive neurological deficits", {
    x: 0.55, y: 4.38, w: 9.0, h: 0.9, fontSize: 12, color: C.white, fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — OCULAR FEATURES
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Ocular Features");

  const ocularItems = [
    {
      title: "Glaucoma",
      color: C.accent,
      points: [
        "Main ophthalmological feature of SWS",
        "Two age peaks: infancy and late childhood",
        "Progressive if untreated — may cause blindness",
        "Mandatory periodic IOP measurement, especially when nevus is near eye",
      ],
    },
    {
      title: "Buphthalmos",
      color: "2E5FA3",
      points: [
        "Enlarged globe due to infantile glaucoma",
        "Related to abnormal development of iris-cornea angle",
        "May be present at birth",
      ],
    },
    {
      title: "Choroidal Hemangioma",
      color: "2E7D32",
      points: [
        "Diffuse choroidal angioma ipsilateral to facial nevus",
        "Risk of retinal detachment",
        "Detected on contrast MRI (bilateral choroidal angiomas possible)",
      ],
    },
    {
      title: "Other Features",
      color: "6A1B9A",
      points: [
        "Heterochromia of the iris (ipsilateral to nevus)",
        "Episcleral / conjunctival angiomas on affected side",
        "Amblyopia",
        "Ocular abnormalities may occur WITHOUT leptomeningeal involvement",
      ],
    },
  ];

  ocularItems.forEach((item, i) => {
    const col = i % 2 === 0 ? 0.35 : 5.2;
    const row = Math.floor(i / 2);
    const y = 1.2 + row * 2.05;
    const w = 4.5;
    sl.addShape(pres.ShapeType.roundRect, { x: col, y, w, h: 1.85, fill: { color: "F8F9FF" }, line: { color: item.color, pt: 2 }, rectRadius: 0.1 });
    sl.addShape(pres.ShapeType.rect, { x: col, y, w, h: 0.42, fill: { color: item.color } });
    sl.addText(item.title, { x: col + 0.12, y: y + 0.07, w: w - 0.2, h: 0.3, fontSize: 13, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    sl.addText(bullets(item.points, { fontSize: 11, color: C.textDark, fontFace: "Calibri" }), {
      x: col + 0.12, y: y + 0.48, w: w - 0.2, h: 1.3, fontFace: "Calibri", margin: 0,
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SECTION DIVIDER — DIAGNOSIS
// ═══════════════════════════════════════════════════════════════════════════════
sectionSlide("Diagnosis & Investigations", "Neuroimaging  •  Clinical Findings  •  Ophthalmology");

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — DIAGNOSTIC APPROACH
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Diagnostic Approach");

  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.2, w: 9.3, h: 0.7, fill: { color: C.midBg }, rectRadius: 0.08 });
  sl.addText("Diagnosis rests on CLINICAL FINDINGS — somatic mosaic GNAQ mutation is NOT detectable on blood-based genetic testing.", {
    x: 0.5, y: 1.27, w: 9.1, h: 0.56, fontSize: 12.5, bold: true, color: C.white, fontFace: "Calibri", margin: 0,
  });

  const invs = [
    { title: "MRI Brain (with Gadolinium)", color: C.accent, points: ["Most sensitive test, especially in infancy", "Post-contrast: diffuse pial enhancement = leptomeningeal angioma", "Cortical atrophy, enlarged choroid plexus", "Ipsilateral choroid plexus enlargement", "Prominent subependymal and medullary veins", "Normal in early infancy — repeat if suspected"] },
    { title: "CT Brain", color: "2E5FA3", points: ["Detects cortical calcification earlier than skull X-ray", "Classic: gyriform 'tram-track' calcifications (occipitoparietal)", "May look normal in neonates and young infants", "Calcifications develop after age 2 years typically"] },
    { title: "PET / SPECT", color: "2E7D32", points: ["PET: reduced metabolism adjacent to leptomeningeal lesion", "Recent seizures → may show increased metabolism", "SPECT: reduced perfusion of affected brain", "Both reveal extent beyond CT/MRI abnormalities", "Useful pre-surgical planning"] },
    { title: "EEG & Ophthalmology", color: "6A1B9A", points: ["EEG: helpful for seizure characterisation", "Ophthalmology: mandatory assessment for glaucoma (IOP)", "Fundoscopy for choroidal angioma", "Cerebral arteriography: rarely needed; enlarged tortuous subependymal veins"] },
  ];

  invs.forEach((inv, i) => {
    const col = i % 2 === 0 ? 0.35 : 5.2;
    const row = Math.floor(i / 2);
    const y = 2.05 + row * 1.7;
    const w = 4.5;
    sl.addShape(pres.ShapeType.rect, { x: col, y, w: 0.18, h: 1.5, fill: { color: inv.color } });
    sl.addShape(pres.ShapeType.roundRect, { x: col + 0.18, y, w: w - 0.18, h: 1.5, fill: { color: "F5F7FF" }, line: { color: inv.color, pt: 1 }, rectRadius: 0.05 });
    sl.addText(inv.title, { x: col + 0.32, y: y + 0.05, w: w - 0.42, h: 0.35, fontSize: 12, bold: true, color: inv.color, fontFace: "Calibri", margin: 0 });
    sl.addText(bullets(inv.points, { fontSize: 10.5, color: C.textDark, fontFace: "Calibri" }), {
      x: col + 0.32, y: y + 0.42, w: w - 0.42, h: 1.0, fontFace: "Calibri", margin: 0,
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — IMAGING FINDINGS (visual descriptions since images are in textbook)
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Neuroimaging Findings in SWS");

  // MRI findings panel
  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.2, w: 4.55, h: 4.1, fill: { color: "EAF0FA" }, line: { color: C.lineBlue, pt: 1.5 }, rectRadius: 0.1 });
  sl.addText("MRI (Gadolinium)", { x: 0.5, y: 1.28, w: 4.2, h: 0.38, fontSize: 13, bold: true, color: C.textMid, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Pial (leptomeningeal) angioma: diffuse post-contrast pial enhancement over cerebral hemisphere",
    "Ipsilateral cerebral hemisphere atrophy",
    "Ipsilateral choroid plexus enlargement",
    "Prominent subependymal / medullary veins (compensatory collaterals)",
    "Bilateral choroidal angiomas in some cases",
    "T1 pre-contrast may appear NORMAL — always give gadolinium",
    "Pial angioma may not be conspicuous until after age 2 years",
  ], { fontSize: 11, color: C.textDark, fontFace: "Calibri" }), {
    x: 0.5, y: 1.72, w: 4.2, h: 3.4, fontFace: "Calibri", margin: 0,
  });

  // CT findings panel
  sl.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 1.2, w: 4.55, h: 2.0, fill: { color: "FFF3F0" }, line: { color: C.accent, pt: 1.5 }, rectRadius: 0.1 });
  sl.addText("CT — Tram-Track Calcification", { x: 5.25, y: 1.28, w: 4.2, h: 0.38, fontSize: 13, bold: true, color: C.accent, fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "Gyriform (tram-track / trolley-track) calcifications in outer layers of cerebral cortex",
    "Parieto-occipital distribution predominates",
    "Double-contoured — follow brain convolutions",
    "Develop usually after 2 years; rarely present in neonates",
  ], { fontSize: 11, color: C.textDark, fontFace: "Calibri" }), {
    x: 5.25, y: 1.7, w: 4.2, h: 1.4, fontFace: "Calibri", margin: 0,
  });

  // PET/SPECT
  sl.addShape(pres.ShapeType.roundRect, { x: 5.1, y: 3.35, w: 4.55, h: 2.0, fill: { color: "F0FFF4" }, line: { color: "2E7D32", pt: 1.5 }, rectRadius: 0.1 });
  sl.addText("PET / SPECT", { x: 5.25, y: 3.43, w: 4.2, h: 0.38, fontSize: 13, bold: true, color: "2E7D32", fontFace: "Calibri", margin: 0 });
  sl.addText(bullets([
    "PET: reduced cerebral metabolism adjacent to leptomeningeal lesion; increased near recent seizure focus",
    "SPECT: reduced perfusion of affected hemisphere",
    "Reveal extent of vascular changes beyond CT/MRI",
  ], { fontSize: 11, color: C.textDark, fontFace: "Calibri" }), {
    x: 5.25, y: 3.85, w: 4.2, h: 1.4, fontFace: "Calibri", margin: 0,
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SECTION DIVIDER — MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
sectionSlide("Management", "Seizures  •  Glaucoma  •  Port-Wine Birthmark  •  Aspirin");

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 — MANAGEMENT
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Management Overview");

  const mgmt = [
    {
      title: "Seizure Management", color: C.accent,
      points: [
        "Anti-seizure medications (ASMs) as first-line",
        "More extensive intracranial lesion = harder to control seizures",
        "Refractory epilepsy: surgical resection of epileptogenic zone",
        "Hemispherectomy for widespread refractory epilepsy",
        "Corpus callosotomy for tonic/atonic seizures with extensive disease",
        "Early surgery may improve intellectual development",
        "Patient selection: refractory seizures + dysfunction in resection area + failed adequate ASM trial",
      ],
    },
    {
      title: "Glaucoma Management", color: "2E5FA3",
      points: [
        "Regular ophthalmological follow-up from birth",
        "Topical anti-glaucoma medications (prostaglandins, beta-blockers)",
        "Surgical intervention if medical therapy fails",
        "Goal: prevent blindness from progressive glaucoma",
        "Monitor for buphthalmos, retinal detachment",
      ],
    },
    {
      title: "Port-Wine Birthmark", color: "2E7D32",
      points: [
        "Pulsed dye laser (PDL) — selective photo-thermolysis",
        "Treatment cosmetic and functional (prevents thickening/nodularity)",
        "Multiple sessions required; early treatment preferred",
      ],
    },
    {
      title: "Aspirin & Other Therapies", color: "6A1B9A",
      points: [
        "Low-dose aspirin offered to minimise stroke-like episodes, seizures, cognitive impairment",
        "Early imaging now recommended → early aspirin if SWS confirmed",
        "Efficacy not fully established but generally well-tolerated",
        "Emerging: mTOR inhibitors (sirolimus) and cannabidiol under investigation",
        "MEK/ERK pathway inhibitors — future targeted therapy",
      ],
    },
  ];

  mgmt.forEach((m, i) => {
    const col = i % 2 === 0 ? 0.35 : 5.2;
    const row = Math.floor(i / 2);
    const y = 1.2 + row * 2.15;
    const w = 4.5;
    sl.addShape(pres.ShapeType.rect, { x: col, y, w, h: 0.4, fill: { color: m.color } });
    sl.addShape(pres.ShapeType.roundRect, { x: col, y: y + 0.4, w, h: 1.65, fill: { color: "F8F9FF" }, line: { color: m.color, pt: 1 }, rectRadius: 0.05 });
    sl.addText(m.title, { x: col + 0.12, y: y + 0.05, w: w - 0.2, h: 0.32, fontSize: 12.5, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    sl.addText(bullets(m.points, { fontSize: 10.5, color: C.textDark, fontFace: "Calibri" }), {
      x: col + 0.12, y: y + 0.46, w: w - 0.2, h: 1.55, fontFace: "Calibri", margin: 0,
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 15 — PROGNOSIS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = contentSlide("Prognosis");

  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 1.2, w: 9.3, h: 0.62, fill: { color: C.darkBg }, rectRadius: 0.08 });
  sl.addText("Prognosis depends primarily on: extent of intracranial involvement, seizure onset age, and seizure control", {
    x: 0.5, y: 1.27, w: 9.0, h: 0.5, fontSize: 12, bold: true, color: C.gold, fontFace: "Calibri", margin: 0,
  });

  const prognRows = [
    { factor: "Unilateral lesion", outlook: "Epilepsy in 72-80%; some achieve seizure control with ASMs", color: "2E7D32" },
    { factor: "Bilateral lesions", outlook: "Epilepsy in 93%; only 8% achieve normal intellectual function", color: C.accent },
    { factor: "Seizure onset < 2 yrs", outlook: "Increased risk of refractory epilepsy and intellectual disability", color: C.accent },
    { factor: "Seizure-free children", outlook: "Usually have normal intelligence; rarely develop severe impairment after age 3", color: "2E7D32" },
    { factor: "Eventually stabilises", outlook: "Residual hemiparesis, hemianopia, intellectual disability, epilepsy — but no further deterioration", color: "2E5FA3" },
    { factor: "Surgery (hemispherectomy)", outlook: "Can improve seizure control and intellectual development when well-selected", color: "6A1B9A" },
  ];

  prognRows.forEach((row, i) => {
    const y = 1.98 + i * 0.57;
    sl.addShape(pres.ShapeType.rect, { x: 0.35, y, w: 0.18, h: 0.48, fill: { color: row.color } });
    sl.addShape(pres.ShapeType.roundRect, { x: 0.53, y, w: 3.2, h: 0.48, fill: { color: "EAF0FA" }, rectRadius: 0.04 });
    sl.addShape(pres.ShapeType.roundRect, { x: 3.83, y, w: 5.8, h: 0.48, fill: { color: "F8F9FF" }, line: { color: row.color, pt: 1 }, rectRadius: 0.04 });
    sl.addText(row.factor, { x: 0.62, y: y + 0.07, w: 3.0, h: 0.34, fontSize: 11.5, bold: true, color: C.textDark, fontFace: "Calibri", margin: 0 });
    sl.addText(row.outlook, { x: 3.95, y: y + 0.07, w: 5.55, h: 0.34, fontSize: 11, color: C.textDark, fontFace: "Calibri", margin: 0 });
  });

  sl.addShape(pres.ShapeType.roundRect, { x: 0.35, y: 5.38, w: 9.3, h: 0.0, fill: { color: "none" } });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 16 — KEY POINTS / SUMMARY
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: C.accent } });
  sl.addShape(pres.ShapeType.rect, { x: 0.18, y: 1.05, w: 9.64, h: 0.04, fill: { color: C.accentSoft } });

  sl.addText("Key Points", {
    x: 0.5, y: 0.3, w: 9, h: 0.7, fontSize: 32, bold: true, color: C.white, fontFace: "Calibri", margin: 0,
  });

  const keys = [
    { num: "01", text: "SWS is caused by a somatic GNAQ (R183Q) mutation — NOT inherited; sporadic, all races, ~1:20,000 births" },
    { num: "02", text: "Classic triad: Port-wine birthmark (V1 area) + Leptomeningeal angiomatosis + Glaucoma" },
    { num: "03", text: "Only 10-20% of forehead PWB have leptomeningeal angioma; bilateral involvement is much more severe" },
    { num: "04", text: "Epilepsy develops in up to 93%; early onset (<2 yrs) predicts intellectual disability and refractory seizures" },
    { num: "05", text: "Diagnosis is clinical; MRI with gadolinium is the most sensitive test; tram-track calcification on CT" },
    { num: "06", text: "Management: ASMs, hemispherectomy for refractory epilepsy, pulsed dye laser for PWB, glaucoma monitoring" },
    { num: "07", text: "Early aspirin may reduce stroke-like episodes; emerging therapies target mTOR and MAPK/ERK pathways" },
  ];

  keys.forEach((k, i) => {
    const y = 1.18 + i * 0.61;
    sl.addShape(pres.ShapeType.roundRect, { x: 0.4, y, w: 0.65, h: 0.48, fill: { color: C.accent }, rectRadius: 0.06 });
    sl.addText(k.num, { x: 0.4, y: y + 0.08, w: 0.65, h: 0.32, fontSize: 14, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
    sl.addText(k.text, { x: 1.18, y: y + 0.06, w: 8.5, h: 0.38, fontSize: 11.5, color: C.textLight, fontFace: "Calibri", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 17 — THANK YOU
// ═══════════════════════════════════════════════════════════════════════════════
{
  const sl = pres.addSlide();
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkBg } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.18, fill: { color: C.accent } });
  sl.addShape(pres.ShapeType.rect, { x: 0, y: 5.445, w: 10, h: 0.18, fill: { color: C.accent } });

  sl.addText("Thank You", {
    x: 1, y: 1.5, w: 8, h: 1.1, fontSize: 52, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0,
  });
  sl.addShape(pres.ShapeType.rect, { x: 3.5, y: 2.7, w: 3, h: 0.06, fill: { color: C.accent } });
  sl.addText("Sturge-Weber Syndrome  |  Encephalotrigeminal Angiomatosis", {
    x: 1, y: 2.85, w: 8, h: 0.5, fontSize: 14, italic: true, color: C.accentSoft, align: "center", fontFace: "Calibri", margin: 0,
  });
  sl.addText("Sources: Bradley & Daroff's Neurology in Clinical Practice • Andrews' Diseases of the Skin\nFitzpatrick's Dermatology • Grainger & Allison's Diagnostic Radiology • Goldman-Cecil Medicine", {
    x: 1, y: 3.6, w: 8, h: 0.8, fontSize: 10, color: "8899CC", align: "center", fontFace: "Calibri", margin: 0,
  });
}

// ─── Write file ────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pptx" })
  .then(() => console.log("PPT created successfully!"))
  .catch(err => { console.error("Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/sturge-weber-ppt && node create_ppt.js

Running Command

ls -lh /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pptx

Your presentation is ready!

Sturge Weber Syndrome

Presentation · PPTX


What's in the deck (17 slides)

SlideContent
1Title slide — dark navy + port-wine red design
2Outline — colour-coded topic boxes
3Definition & Epidemiology — 1 in 20,000 births, GNAQ, sporadic
4Etiology & Pathogenesis — GNAQ R183Q mutation, embryological failure of regression of primitive vascular plexus
5Roach Classification — Type I, II, III with visual cards
6Section divider: Clinical Features
7Cutaneous Features — port-wine birthmark, V1 distribution, risk patterns, tram-track calcification
8Neurological Features — seizures (72-93%), cognitive impairment, hemiparesis, stroke-like episodes
9Ocular Features — glaucoma, buphthalmos, choroidal hemangioma, iris heterochromia
10Section divider: Diagnosis
11Diagnostic Approach — MRI, CT, PET/SPECT, EEG, ophthalmology
12Neuroimaging Findings — pial enhancement, tram-track calcifications, choroid plexus enlargement
13Section divider: Management
14Management — ASMs, hemispherectomy, pulsed dye laser, aspirin, emerging mTOR/MEK therapies
15Prognosis — factor-by-outcome table
16Key Points Summary — 7 numbered takeaways
17Thank You — sources cited
Sources: Bradley & Daroff's Neurology, Andrews' Diseases of the Skin, Fitzpatrick's Dermatology, Grainger & Allison's Diagnostic Radiology, Goldman-Cecil Medicine.

Unable to download pdf

Running Command

cd /home/daytona/workspace/sturge-weber-ppt && libreoffice --headless --convert-to pdf Sturge_Weber_Syndrome.pptx --outdir . 2>&1

Running Command

mkdir -p /home/daytona/workspace/sturge-weber-ppt/output && libreoffice --headless --convert-to pdf /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pptx --outdir /home/daytona/workspace/sturge-weber-ppt/output 2>&1

Running Command

chmod 777 /home/daytona/workspace/sturge-weber-ppt/output && ls -la /home/daytona/workspace/sturge-weber-ppt/ && libreoffice --headless --convert-to pdf /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pptx --outdir /home/daytona/workspace/sturge-weber-ppt/output 2>&1

Running Command

ls -la /home/daytona/workspace/sturge-weber-ppt/

Running Command

cp /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pptx /tmp/sws.pptx && libreoffice --headless --convert-to pdf /tmp/sws.pptx --outdir /tmp 2>&1 && ls -lh /tmp/sws.pdf

Running Command

cp /tmp/sws.pdf /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pdf && ls -lh /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pdf

Done! Here are both formats for download:
PDF:

Sturge Weber Syndrome

PDF Document · PDF

PowerPoint (editable):

Sturge Weber Syndrome

Presentation · PPTX

Still showing error

Reading File
Writing File

~/sturge-weber-ppt/make_pdf.py

from reportlab.lib.pagesizes import landscape, A4
from reportlab.lib import colors
from reportlab.lib.units import inch, cm
from reportlab.pdfgen import canvas
from reportlab.lib.utils import simpleSplit

W, H = landscape(A4)  # 841.89 x 595.28 pt

# ── Palette ──────────────────────────────────────────────────────────────────
DARK_BG    = colors.HexColor("#1A2744")
MID_BG     = colors.HexColor("#243460")
ACCENT     = colors.HexColor("#C0392B")
ACCENT_S   = colors.HexColor("#E8796B")
WHITE      = colors.white
OFF_WHITE  = colors.HexColor("#F4F6FB")
TEXT_DARK  = colors.HexColor("#1A2744")
TEXT_MID   = colors.HexColor("#2C3E6B")
TEXT_LIGHT = colors.HexColor("#E8ECF8")
GOLD       = colors.HexColor("#E6B84A")
LINE_BLUE  = colors.HexColor("#4A6FA5")
GREEN      = colors.HexColor("#2E7D32")
BLUE       = colors.HexColor("#2E5FA3")
PURPLE     = colors.HexColor("#6A1B9A")

PAD = 0.35 * inch

def hex2rgb(h):
    h = h.lstrip('#')
    return tuple(int(h[i:i+2], 16)/255 for i in (0, 2, 4))

def rect(c, x, y, w, h, fill=None, stroke=None, lw=0):
    c.saveState()
    if fill:
        c.setFillColor(fill)
    if stroke:
        c.setStrokeColor(stroke)
        c.setLineWidth(lw if lw else 1)
    if fill and stroke:
        c.rect(x, y, w, h, fill=1, stroke=1)
    elif fill:
        c.rect(x, y, w, h, fill=1, stroke=0)
    else:
        c.rect(x, y, w, h, fill=0, stroke=1)
    c.restoreState()

def text(c, txt, x, y, size=11, color=WHITE, bold=False, italic=False, align='left', maxw=None):
    c.saveState()
    c.setFillColor(color)
    fname = "Helvetica-Bold" if bold and not italic else \
            "Helvetica-BoldOblique" if bold and italic else \
            "Helvetica-Oblique" if italic else "Helvetica"
    c.setFont(fname, size)
    if align == 'center' and maxw:
        c.drawCentredString(x + maxw/2, y, txt)
    elif align == 'right' and maxw:
        c.drawRightString(x + maxw, y, txt)
    else:
        c.drawString(x, y, txt)
    c.restoreState()

def wrapped_text(c, txt, x, y, maxw, size=11, color=WHITE, bold=False, italic=False, leading=None, align='left'):
    """Draw wrapped text, returns new y after drawing."""
    fname = "Helvetica-Bold" if bold and not italic else \
            "Helvetica-BoldOblique" if bold and italic else \
            "Helvetica-Oblique" if italic else "Helvetica"
    if leading is None:
        leading = size * 1.35
    lines = simpleSplit(txt, fname, size, maxw)
    c.saveState()
    c.setFillColor(color)
    c.setFont(fname, size)
    for line in lines:
        if align == 'center':
            c.drawCentredString(x + maxw/2, y, line)
        else:
            c.drawString(x, y, line)
        y -= leading
    c.restoreState()
    return y

def bullet_list(c, items, x, y, maxw, size=11, color=TEXT_DARK, leading=None, indent=12):
    if leading is None:
        leading = size * 1.45
    for item in items:
        # bullet dot
        c.saveState()
        c.setFillColor(ACCENT)
        c.circle(x + 4, y + size*0.35, 2.5, fill=1, stroke=0)
        c.restoreState()
        y = wrapped_text(c, item, x + indent, y, maxw - indent, size=size, color=color, leading=leading)
        y -= 1
    return y

def dark_slide_header(c, title, subtitle=None):
    """Full dark background with accent bar + title."""
    rect(c, 0, 0, W, H, fill=DARK_BG)
    rect(c, 0, 0, 8, H, fill=ACCENT)  # left accent bar
    rect(c, 8, H*0.47, W-8, 2, fill=ACCENT_S)
    text(c, title, 24, H*0.52, size=36, color=WHITE, bold=True)
    if subtitle:
        text(c, subtitle, 24, H*0.40, size=16, color=ACCENT_S, italic=True)

def content_header(c, title):
    """Off-white bg + dark header bar."""
    rect(c, 0, 0, W, H, fill=OFF_WHITE)
    rect(c, 0, H-70, W, 70, fill=DARK_BG)
    rect(c, 0, 0, 8, H, fill=ACCENT)
    text(c, title, 18, H-48, size=18, color=WHITE, bold=True)

def slide_footer(c, num, total=17):
    c.saveState()
    c.setFillColor(colors.HexColor("#AAAAAA"))
    c.setFont("Helvetica", 8)
    c.drawRightString(W - 10, 8, f"{num} / {total}")
    c.restoreState()

# ─────────────────────────────────────────────────────────────────────────────
out = "/home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pdf"
c = canvas.Canvas(out, pagesize=landscape(A4))
c.setTitle("Sturge-Weber Syndrome")
c.setAuthor("Medical Presentation")

TOTAL = 16

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 1 — TITLE
# ══════════════════════════════════════════════════════════════════════════════
rect(c, 0, 0, W, H, fill=DARK_BG)
rect(c, 0, 0, W, 18, fill=ACCENT)
rect(c, 0, H-18, W, 18, fill=ACCENT)

text(c, "Sturge-Weber Syndrome", W/2, H*0.62, size=42, color=WHITE, bold=True, align='center', maxw=W)
rect(c, W/2-160, H*0.55, 320, 3, fill=ACCENT)
text(c, "Encephalotrigeminal Angiomatosis", W/2, H*0.48, size=20, color=ACCENT_S, italic=True, align='center', maxw=W)
text(c, "A Neurocutaneous Phakomatosis", W/2, H*0.40, size=14, color=TEXT_LIGHT, align='center', maxw=W)
text(c, "Neurology  |  Dermatology  |  Ophthalmology", W/2, H*0.30, size=13, color=GOLD, bold=True, align='center', maxw=W)
slide_footer(c, 1, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 2 — DEFINITION & EPIDEMIOLOGY
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Definition & Epidemiology")

# definition box
rect(c, PAD, H-190, W-2*PAD, 100, fill=MID_BG)
text(c, "Sturge-Weber Syndrome (SWS)", PAD+12, H-115, size=12, color=GOLD, bold=True)
wrapped_text(c,
    "is a congenital, sporadic neurocutaneous phakomatosis (encephalotrigeminal angiomatosis) characterised "
    "by a facial port-wine birthmark, leptomeningeal angiomatosis, and ocular involvement.",
    PAD+12, H-132, W-2*PAD-24, size=11, color=WHITE)

# stat tiles
tile_data = [
    ("INCIDENCE", "~1 in 20,000\nlive births", ACCENT),
    ("INHERITANCE", "Sporadic\n(not inherited)", BLUE),
    ("RACE", "All races\nequally affected", GREEN),
    ("GENE", "GNAQ somatic\nmutation (9q21)", PURPLE),
]
tw = (W - 2*PAD - 30) / 4
for i, (lbl, val, col) in enumerate(tile_data):
    tx = PAD + i*(tw+10)
    ty = H-310
    rect(c, tx, ty, tw, 90, fill=col)
    text(c, lbl, tx+5, ty+68, size=8, color=WHITE, bold=True)
    for j, line in enumerate(val.split('\n')):
        text(c, line, tx+5, ty+48-j*18, size=12, color=WHITE, bold=True)

wrapped_text(c,
    "SWS is a phakomatosis — a group of diseases with cutaneous, neurological, and ocular manifestations sharing a common embryonic origin.",
    PAD, 30, W-2*PAD, size=10, color=TEXT_MID, italic=True)

slide_footer(c, 2, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 3 — ETIOLOGY & PATHOGENESIS
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Etiology & Pathogenesis")

col_w = (W - 2*PAD - 20) / 2
lx = PAD
rx = PAD + col_w + 20
col_y_top = H - 90
col_h = H - 90 - 30

rect(c, lx, 30, col_w, col_h, fill=colors.HexColor("#EAF0FA"), stroke=LINE_BLUE, lw=1)
text(c, "GENETIC BASIS", lx+10, col_y_top-20, size=13, color=DARK_BG, bold=True)
bullet_list(c, [
    "Somatic mosaic mutation in GNAQ gene (chromosome 9q21)",
    "Key mutation: R183Q (Arg183Gln) — most common",
    "GNAQ codes for G-protein alpha-q (Gαq) subunit",
    "Mutant Gαq: impaired GTPase activity → reduced deactivation",
    "Hyperactivation of MAPK/ERK and mTOR downstream pathways",
    "Mutation enriched in endothelial cells",
    "GNA11 mutations also implicated in some cases",
    "Somatic — NOT heritable; arises de novo during embryogenesis",
], lx+10, col_y_top-42, col_w-20, size=10.5, color=TEXT_DARK)

rect(c, rx, 30, col_w, col_h, fill=colors.HexColor("#FEF0EE"), stroke=ACCENT, lw=1)
text(c, "EMBRYOLOGICAL BASIS", rx+10, col_y_top-20, size=13, color=ACCENT, bold=True)
bullet_list(c, [
    "Primitive vascular plexus develops at ~6th fetal week around cephalic neural tube and facial skin",
    "Normally REGRESSES at ~9th fetal week",
    "In SWS: plexus PERSISTS due to GNAQ mutation in endothelial cells",
    "Results in persistent vascular malformations in skin, leptomeninges, and choroid",
    "Abnormal venous drainage → chronic cortical ischaemia",
    "Progressive cortical atrophy + calcification → neurological deficits",
], rx+10, col_y_top-42, col_w-20, size=10.5, color=TEXT_DARK)

slide_footer(c, 3, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 4 — CLASSIFICATION (ROACH SCALE)
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Classification — Roach Scale")

wrapped_text(c,
    "The Roach Scale classifies SWS into three types based on extent of involvement:",
    PAD, H-92, W-2*PAD, size=12, color=TEXT_DARK)

types = [
    ("Type I", "Facial AND Leptomeningeal Angiomas",
     "Port-wine birthmark on face PLUS leptomeningeal angiomatosis. May have glaucoma. MOST COMMON form.", ACCENT),
    ("Type II", "Facial Angioma ONLY (No Leptomeningeal Involvement)",
     "Port-wine birthmark WITHOUT leptomeningeal angioma. May or may not have glaucoma. No CNS involvement.", BLUE),
    ("Type III", "Leptomeningeal Angioma ONLY (No Facial PWB)",
     "Leptomeningeal angiomatosis WITHOUT facial port-wine birthmark. Usually no glaucoma. Rare.", GREEN),
]
for i, (typ, title, desc, col) in enumerate(types):
    ty = H - 160 - i*120
    rect(c, PAD, ty, 80, 80, fill=col)
    text(c, typ, PAD+8, ty+45, size=18, color=WHITE, bold=True)
    rect(c, PAD+90, ty, W-2*PAD-90, 80, fill=colors.HexColor("#F0F4FF"), stroke=col, lw=1.5)
    text(c, title, PAD+102, ty+56, size=12, color=col, bold=True)
    wrapped_text(c, desc, PAD+102, ty+38, W-2*PAD-112, size=10.5, color=TEXT_DARK)

rect(c, PAD, 18, W-2*PAD, 28, fill=DARK_BG)
wrapped_text(c,
    "Note: Upper face/forehead (V1 distribution) involvement carries highest risk of SWS. Bilateral involvement is more severe.",
    PAD+10, 35, W-2*PAD-20, size=10, color=WHITE)

slide_footer(c, 4, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 5 — SECTION: CLINICAL FEATURES
# ══════════════════════════════════════════════════════════════════════════════
dark_slide_header(c, "Clinical Features", "The Classic Triad:  Skin  •  Brain  •  Eye")
slide_footer(c, 5, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 6 — CUTANEOUS FEATURES
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Cutaneous Features — Port-Wine Birthmark (PWB)")

rect(c, PAD, 30, W*0.58-PAD-10, H-110, fill=colors.HexColor("#FFF3F0"), stroke=ACCENT, lw=1.5)
text(c, "Port-Wine Birthmark (Capillary Malformation)", PAD+10, H-95, size=12, color=ACCENT, bold=True)
bullet_list(c, [
    "Congenital, flat, painless vascular malformation — present at birth",
    "Typically involves forehead & upper eyelid (V1 — ophthalmic branch of trigeminal nerve)",
    "May extend to both sides of face, trunk, and limbs",
    "Facial nevi sparing the upper face: rarely associated with intracranial angioma",
    "May THICKEN over time and develop nodular texture",
    "Reactive hypertrophy of adjacent bone and connective tissue can occur",
    "Never warm on palpation (unlike AVM)",
    "Only 10-20% of children with forehead PWB have a leptomeningeal angioma",
    "Bilateral V1/V2/V3 involvement = significantly higher SWS risk",
], PAD+10, H-115, W*0.58-PAD-25, size=10.5, color=TEXT_DARK)

rx = W*0.58 + 5
rw = W - rx - PAD

rect(c, rx, H*0.52, rw, H*0.40, fill=MID_BG)
text(c, "Highest Risk Pattern", rx+8, H*0.52+H*0.40-22, size=11.5, color=GOLD, bold=True)
bullet_list(c, [
    "Forehead (V1/S1 distribution)",
    "More facial area = higher risk",
    "Bilateral V1 or V1+V2+V3",
], rx+8, H*0.52+H*0.40-40, rw-16, size=10, color=WHITE)

rect(c, rx, 30, rw, H*0.45, fill=colors.HexColor("#FEF0EE"), stroke=ACCENT, lw=1)
text(c, "Tram-Track Calcification", rx+8, 30+H*0.45-22, size=11.5, color=ACCENT, bold=True)
bullet_list(c, [
    "Double-contoured 'tram-track' calcifications in cerebral cortex",
    "Follow brain convolutions (gyriform pattern)",
    "Seen on CT scan / skull X-ray",
    "Usually absent in neonates; develop after age 2",
], rx+8, 30+H*0.45-40, rw-16, size=10, color=TEXT_DARK)

slide_footer(c, 6, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 7 — NEUROLOGICAL FEATURES
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Neurological Features")

lx, rx = PAD, W/2 + 10
cw = W/2 - PAD - 15
top = H - 90

rect(c, lx, 30, cw, top-30, fill=colors.HexColor("#FFF3F0"), stroke=ACCENT, lw=1.5)
text(c, "Epilepsy", lx+10, top-18, size=13, color=ACCENT, bold=True)
bullet_list(c, [
    "Epilepsy in 72-80% (unilateral) and 93% (bilateral lesions)",
    "75% begin in 1st year; 95% before age 5",
    "Focal motor or generalised tonic-clonic seizures (most common initially)",
    "Also: infantile spasms, myoclonic, atonic seizures",
    "Early onset (<2 yrs) = worse cognitive prognosis and risk of refractory epilepsy",
    "Seizures often co-present with hemiparesis",
], lx+10, top-38, cw-20, size=10.5, color=TEXT_DARK)

rect(c, rx, 30, cw, top-30, fill=colors.HexColor("#EAF0FA"), stroke=LINE_BLUE, lw=1.5)
text(c, "Cognitive & Neurological Deficits", rx+10, top-18, size=13, color=TEXT_MID, bold=True)
bullet_list(c, [
    "Intellectual disability in ~50% overall",
    "Only 8% with bilateral lesions are intellectually normal",
    "Hemiparesis (contralateral) — may be permanent",
    "Homonymous hemianopia (occipital involvement frequent)",
    "Stroke-like episodes / TIA-like events",
    "Behavioral problems even in non-disabled patients",
    "Children normal at age 3 rarely develop severe impairment later",
], rx+10, top-38, cw-20, size=10.5, color=TEXT_DARK)

rect(c, PAD, 15, W-2*PAD, 25, fill=DARK_BG)
wrapped_text(c,
    "Mechanism: Leptomeningeal angioma → abnormal venous drainage → chronic cortical ischaemia → cortical atrophy + calcification",
    PAD+8, 29, W-2*PAD-16, size=10, color=WHITE)

slide_footer(c, 7, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 8 — OCULAR FEATURES
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Ocular Features")

ocular = [
    ("Glaucoma", ACCENT,
     ["Main ophthalmological feature of SWS",
      "Two age peaks: infancy and late childhood",
      "Mandatory periodic IOP measurement",
      "Progressive if untreated — may cause blindness"]),
    ("Buphthalmos", BLUE,
     ["Enlarged globe due to infantile glaucoma",
      "Abnormal development of iris-cornea angle",
      "May be present at birth"]),
    ("Choroidal Hemangioma", GREEN,
     ["Diffuse choroidal angioma ipsilateral to nevus",
      "Risk of retinal detachment",
      "Seen on contrast MRI"]),
    ("Other Ocular Features", PURPLE,
     ["Iris heterochromia (ipsilateral to nevus)",
      "Episcleral/conjunctival angiomas",
      "Amblyopia",
      "Ocular features may occur WITHOUT leptomeningeal involvement"]),
]
bw = (W - 2*PAD - 30) / 2
bh = (H - 110) / 2 - 10
for i, (title, col, pts) in enumerate(ocular):
    bx = PAD + (i % 2)*(bw+15)
    by = H - 90 - (i // 2)*(bh+12) - bh
    rect(c, bx, by, bw, bh, fill=colors.HexColor("#F8F9FF"), stroke=col, lw=2)
    rect(c, bx, by+bh-28, bw, 28, fill=col)
    text(c, title, bx+10, by+bh-16, size=12, color=WHITE, bold=True)
    bullet_list(c, pts, bx+8, by+bh-44, bw-16, size=10.5, color=TEXT_DARK)

slide_footer(c, 8, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 9 — SECTION: DIAGNOSIS
# ══════════════════════════════════════════════════════════════════════════════
dark_slide_header(c, "Diagnosis & Investigations", "Neuroimaging  •  Clinical Findings  •  Ophthalmology")
slide_footer(c, 9, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 10 — DIAGNOSTIC APPROACH
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Diagnostic Approach")

rect(c, PAD, H-160, W-2*PAD, 48, fill=MID_BG)
wrapped_text(c,
    "Diagnosis rests on CLINICAL FINDINGS — somatic GNAQ mutation is NOT detectable on standard blood-based genetic testing.",
    PAD+10, H-122, W-2*PAD-20, size=11, color=WHITE, bold=True)

invs = [
    ("MRI Brain (with Gadolinium)", ACCENT, [
        "Most sensitive test, especially in infancy",
        "Post-contrast: diffuse pial enhancement = leptomeningeal angioma",
        "Cortical atrophy, enlarged ipsilateral choroid plexus",
        "Prominent subependymal and medullary veins (collaterals)",
        "Bilateral choroidal angiomas in some cases",
        "May appear NORMAL pre-contrast — always use gadolinium",
    ]),
    ("CT Brain", BLUE, [
        "Detects gyriform 'tram-track' cortical calcifications",
        "Parieto-occipital distribution predominates",
        "Calcifications develop typically after age 2 years",
        "May look normal in neonates",
    ]),
    ("PET / SPECT", GREEN, [
        "PET: reduced cerebral metabolism adjacent to leptomeningeal lesion",
        "Increased metabolism near recent seizure focus",
        "SPECT: reduced perfusion of affected hemisphere",
        "Useful for pre-surgical mapping",
    ]),
    ("EEG & Ophthalmology", PURPLE, [
        "EEG: seizure characterisation and localisation",
        "Ophthalmology: mandatory — IOP, fundoscopy for choroidal angioma",
        "Cerebral arteriography: rarely needed; abnormal deep veins",
    ]),
]
iw = (W - 2*PAD - 30) / 2
ih = (H - 220) / 2 - 10
for i, (title, col, pts) in enumerate(invs):
    ix = PAD + (i % 2)*(iw+15)
    iy = H - 175 - (i // 2)*(ih+12) - ih
    rect(c, ix, iy, 10, ih, fill=col)
    rect(c, ix+10, iy, iw-10, ih, fill=colors.HexColor("#F5F7FF"), stroke=col, lw=1)
    text(c, title, ix+18, iy+ih-18, size=11.5, color=col, bold=True)
    bullet_list(c, pts, ix+18, iy+ih-35, iw-28, size=10, color=TEXT_DARK)

slide_footer(c, 10, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 11 — IMAGING FINDINGS
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Neuroimaging Findings in SWS")

lx, rx = PAD, W/2 + 10
cw = W/2 - PAD - 15
top = H - 90

rect(c, lx, 30, cw, top-30, fill=colors.HexColor("#EAF0FA"), stroke=LINE_BLUE, lw=1.5)
text(c, "MRI with Gadolinium", lx+10, top-18, size=13, color=DARK_BG, bold=True)
bullet_list(c, [
    "Pial (leptomeningeal) angioma: diffuse post-contrast pial enhancement",
    "Ipsilateral cerebral hemisphere atrophy (progressive)",
    "Ipsilateral choroid plexus enlargement",
    "Prominent subependymal / medullary veins (compensatory collaterals)",
    "Bilateral choroidal angiomas possible",
    "T1 pre-contrast may appear NORMAL in early infancy",
    "Pial angioma may not be conspicuous until after age 2 years",
    "In 'burnt out' cases: pial angioma may no longer enhance — only shrunken, calcified hemisphere remains",
], lx+10, top-38, cw-20, size=10.5, color=TEXT_DARK)

rh1 = (top-30)*0.45
rh2 = (top-30)*0.48
rect(c, rx, top-rh1, cw, rh1-5, fill=colors.HexColor("#FFF3F0"), stroke=ACCENT, lw=1.5)
text(c, "CT — Tram-Track Calcification", rx+10, top-18, size=13, color=ACCENT, bold=True)
bullet_list(c, [
    "Gyriform calcifications in outer cortical layers",
    "Double-contoured 'tram-track' pattern",
    "Parieto-occipital distribution",
    "Rarely present in neonates; develop after ~2 years",
], rx+10, top-38, cw-20, size=10.5, color=TEXT_DARK)

y2 = top - rh1 - 8
rect(c, rx, 30, cw, y2-30, fill=colors.HexColor("#F0FFF4"), stroke=GREEN, lw=1.5)
text(c, "PET / SPECT", rx+10, y2-12, size=13, color=GREEN, bold=True)
bullet_list(c, [
    "PET: ↓ metabolism adjacent to angioma; ↑ near recent seizure focus",
    "SPECT: ↓ perfusion of affected hemisphere",
    "Reveal extent beyond CT/MRI changes",
    "Useful for pre-surgical evaluation",
], rx+10, y2-30, cw-20, size=10.5, color=TEXT_DARK)

slide_footer(c, 11, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 12 — SECTION: MANAGEMENT
# ══════════════════════════════════════════════════════════════════════════════
dark_slide_header(c, "Management", "Seizures  •  Glaucoma  •  Port-Wine Birthmark  •  Aspirin")
slide_footer(c, 12, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 13 — MANAGEMENT
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Management")

mgmt = [
    ("Seizure Management", ACCENT, [
        "Anti-seizure medications (ASMs) as first-line",
        "More extensive lesion = harder to control",
        "Refractory: surgical resection of epileptogenic zone",
        "Hemispherectomy for widespread refractory epilepsy",
        "Corpus callosotomy for tonic/atonic seizures with extensive disease",
        "Early surgery may improve intellectual development",
    ]),
    ("Glaucoma Management", BLUE, [
        "Regular ophthalmology follow-up from birth",
        "Topical anti-glaucoma medications",
        "Surgical intervention if medical therapy fails",
        "Goal: prevent blindness from progressive glaucoma",
        "Monitor for buphthalmos, retinal detachment",
    ]),
    ("Port-Wine Birthmark", GREEN, [
        "Pulsed dye laser (PDL) — selective photo-thermolysis",
        "Prevents thickening and nodularity",
        "Multiple sessions required; early treatment preferred",
        "Cosmetic and functional benefits",
    ]),
    ("Aspirin & Emerging Therapies", PURPLE, [
        "Low-dose aspirin to reduce stroke-like episodes",
        "Early imaging + aspirin if SWS confirmed",
        "Emerging: mTOR inhibitors (sirolimus), cannabidiol",
        "MEK/ERK pathway inhibitors — future targeted therapy",
        "Efficacy of aspirin not fully established but well-tolerated",
    ]),
]
mw = (W - 2*PAD - 30) / 2
mh = (H - 110) / 2 - 10
for i, (title, col, pts) in enumerate(mgmt):
    mx = PAD + (i % 2)*(mw+15)
    my = H - 90 - (i // 2)*(mh+12) - mh
    rect(c, mx, my+mh-30, mw, 30, fill=col)
    rect(c, mx, my, mw, mh-30, fill=colors.HexColor("#F8F9FF"), stroke=col, lw=1)
    text(c, title, mx+10, my+mh-16, size=12, color=WHITE, bold=True)
    bullet_list(c, pts, mx+8, my+mh-46, mw-16, size=10, color=TEXT_DARK)

slide_footer(c, 13, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 14 — PROGNOSIS
# ══════════════════════════════════════════════════════════════════════════════
content_header(c, "Prognosis")

rect(c, PAD, H-130, W-2*PAD, 35, fill=DARK_BG)
wrapped_text(c,
    "Prognosis depends primarily on: extent of intracranial involvement, seizure onset age, and seizure control",
    PAD+10, H-105, W-2*PAD-20, size=11, color=GOLD, bold=True)

progs = [
    ("Unilateral lesion", "Epilepsy in 72-80%; some achieve seizure control with ASMs", GREEN),
    ("Bilateral lesions", "Epilepsy in 93%; only 8% achieve normal intellectual function", ACCENT),
    ("Seizure onset < 2 yrs", "Increased risk of refractory epilepsy and intellectual disability", ACCENT),
    ("Seizure-free children", "Usually have normal intelligence; rarely develop severe impairment after age 3", GREEN),
    ("Eventually stabilises", "Residual hemiparesis, hemianopia, intellectual disability, epilepsy — no further deterioration", BLUE),
    ("Surgery (hemispherectomy)", "Improves seizure control and intellectual development when well-selected", PURPLE),
]
row_h = 44
for i, (factor, outlook, col) in enumerate(progs):
    ry = H - 160 - i*row_h
    rect(c, PAD, ry, 8, row_h-4, fill=col)
    rect(c, PAD+8, ry, W*0.32-PAD, row_h-4, fill=colors.HexColor("#EAF0FA"))
    rect(c, W*0.32+10, ry, W-W*0.32-10-PAD, row_h-4, fill=colors.HexColor("#F8F9FF"), stroke=col, lw=1)
    text(c, factor, PAD+14, ry+row_h-20, size=11, color=TEXT_DARK, bold=True)
    wrapped_text(c, outlook, W*0.32+18, ry+row_h-20, W-W*0.32-28-PAD, size=10.5, color=TEXT_DARK)

slide_footer(c, 14, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 15 — KEY POINTS
# ══════════════════════════════════════════════════════════════════════════════
rect(c, 0, 0, W, H, fill=DARK_BG)
rect(c, 0, 0, 8, H, fill=ACCENT)
text(c, "Key Points", 24, H-52, size=30, color=WHITE, bold=True)
rect(c, 20, H-62, W-30, 2, fill=ACCENT_S)

keys = [
    ("01", "SWS is caused by a somatic GNAQ (R183Q) mutation — NOT inherited; sporadic, ~1:20,000 births"),
    ("02", "Classic triad: Port-wine birthmark (V1 area) + Leptomeningeal angiomatosis + Glaucoma"),
    ("03", "Only 10-20% of forehead PWB have leptomeningeal angioma; bilateral involvement is far more severe"),
    ("04", "Epilepsy in up to 93%; early onset (<2 yrs) predicts intellectual disability and refractory seizures"),
    ("05", "Diagnosis is clinical; MRI with gadolinium is most sensitive; CT shows tram-track calcifications"),
    ("06", "Treatment: ASMs, hemispherectomy for refractory epilepsy, pulsed dye laser for PWB, glaucoma monitoring"),
    ("07", "Early aspirin reduces stroke-like episodes; emerging therapies target mTOR and MAPK/ERK pathways"),
]
kcolors = [ACCENT, BLUE, GREEN, PURPLE, colors.HexColor("#BF360C"), colors.HexColor("#00695C"), colors.HexColor("#37474F")]
for i, (num, ktext) in enumerate(keys):
    ky = H - 80 - i*64
    rect(c, 20, ky-34, 44, 40, fill=kcolors[i])
    text(c, num, 20, ky-16, size=16, color=WHITE, bold=True, align='center', maxw=44)
    wrapped_text(c, ktext, 74, ky-14, W-100, size=11, color=TEXT_LIGHT)

slide_footer(c, 15, TOTAL)
c.showPage()

# ══════════════════════════════════════════════════════════════════════════════
# SLIDE 16 — THANK YOU
# ══════════════════════════════════════════════════════════════════════════════
rect(c, 0, 0, W, H, fill=DARK_BG)
rect(c, 0, 0, W, 12, fill=ACCENT)
rect(c, 0, H-12, W, 12, fill=ACCENT)
text(c, "Thank You", W/2, H*0.58, size=52, color=WHITE, bold=True, align='center', maxw=W)
rect(c, W/2-140, H*0.50, 280, 3, fill=ACCENT)
text(c, "Sturge-Weber Syndrome  |  Encephalotrigeminal Angiomatosis", W/2, H*0.44, size=14, color=ACCENT_S, italic=True, align='center', maxw=W)
wrapped_text(c,
    "Sources: Bradley & Daroff's Neurology  •  Andrews' Diseases of the Skin  •  Fitzpatrick's Dermatology  •  Grainger & Allison's Diagnostic Radiology  •  Goldman-Cecil Medicine",
    PAD, H*0.31, W-2*PAD, size=9.5, color=colors.HexColor("#8899CC"), align='center')

slide_footer(c, 16, TOTAL)
c.showPage()

# ── Save ─────────────────────────────────────────────────────────────────────
c.save()
print(f"PDF saved: {out}")
Running Command

python3 /home/daytona/workspace/sturge-weber-ppt/make_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/sturge-weber-ppt/Sturge_Weber_Syndrome.pdf

PDF is ready — built directly with Python (bypassing LibreOffice):

Sturge Weber Syndrome

PDF Document · PDF

16 slides covering Definition & Epidemiology, Etiology & Pathogenesis, Roach Classification, Clinical Features (Cutaneous / Neurological / Ocular), Diagnosis & Imaging, Management, Prognosis, and Key Points — in a dark navy + port-wine red design.
The PPTX is still available too if you need the editable version:

Sturge Weber Syndrome

Presentation · PPTX

This is a shared conversation. Sign in to Orris to start your own chat.