import os

mermaid_content = """
graph TD
    subgraph "Public Domain"
        GW[Public API Gateway]
    end

    subgraph "Secure Perimeter (Zero-Trust)"
        B[Bastion Host]
        VPN[WireGuard Hypergraph VPN]
    end

    subgraph "Clustering Polyfractal Mesh"
        subgraph "ML Environment"
            ML1[ML Container 1]
            ML2[ML Container 2]
            ML3[ML Container 3]
        end

        subgraph "Compute Cluster"
            VM1[Virtual Machine - CPU]
            VM2[Virtual Machine - GPU]
            ST[Storage Node]
        end
    end

    GW --> B
    B --> VPN
    VPN --> ML1
    VPN --> ML2
    VPN --> ML3
    VPN --> VM1
    VPN --> VM2
    VPN --> ST

    ML1 <--> ML2
    ML2 <--> ML3
    VM1 <--> VM2
    VM1 <--> ST

    style VPN fill:#f9f,stroke:#333,stroke-width:4px
    style B fill:#ccf,stroke:#333,stroke-width:2px
    style GW fill:#fcf,stroke:#333,stroke-width:2px
"""

with open("/home/ubuntu/bundle/simulations/topology.mmd", "w") as f:
    f.write(mermaid_content)

print("Mermaid diagram generated at /home/ubuntu/bundle/simulations/topology.mmd")
