Create a complete, interactive p5.js sketch based on these detailed specifications:

```json
{
  "SIMULATION": "Pendulum Motion Interactive Simulation",
  "CONTROLS": [
    {
      "type": "Slider",
      "label": "Gravity",
      "variable": "gravity",
      "min": 0.1,
      "max": 2.0,
      "default": 1.0,
      "step": 0.05,
      "description": "Adjusts the gravitational acceleration."
    },
    {
      "type": "Slider",
      "label": "Length",
      "variable": "length",
      "min": 50,
      "max": 300,
      "default": 200,
      "step": 1,
      "description": "Adjusts the length of the pendulum arm."
    },
    {
      "type": "Slider",
      "label": "Damping",
      "variable": "damping",
      "min": 0.99,
      "max": 1.00,
      "default": 0.999,
      "step": 0.0001,
      "description": "Controls the amount of energy lost per swing (friction). Higher values mean less damping."
    },
    {
      "type": "Slider",
      "label": "Mass",
      "variable": "mass",
      "min": 1,
      "max": 50,
      "default": 10,
      "step": 1,
      "description": "Adjusts the mass of the pendulum bob. This should only affect momentum, not the period (ideally)."
    },
    {
      "type": "Slider",
      "label": "Starting Angle",
      "variable": "startingAngle",
      "min": -PI + 0.01,
      "max": PI - 0.01,
      "default": PI/4,
      "step": 0.01,
      "description": "Sets the initial angle of the pendulum (in radians)."
    },
    {
      "type": "Button",
      "label": "Reset",
      "function": "resetPendulum",
      "description": "Resets the pendulum to its initial state."
    },
    {
      "type": "Button",
      "label": "Toggle Pause/Play",
      "function": "togglePause",
      "description": "Pauses or resumes the pendulum simulation."
    },
    {
      "type": "Checkbox",
      "label": "Show Trace",
      "variable": "showTrace",
      "default": true,
      "description": "Toggles the display of the pendulum's trace."
    }
  ],
  "VISUALS": {
    "base": {
      "x": "width / 2",
      "y": 50,
      "color": "#000000",
      "shape": "rectangle",
      "width": 10,
      "height": 10,
      "style": "fill"
    },
    "arm": {
      "color": "#808080",
      "thickness": 2
    },
    "bob": {
      "color": "#FF0000",
      "diameter": "mass",
      "style": "fill"
    },
    "trace": {
      "color": "#ADD8E6",
      "alpha": 50,
      "thickness": 1
    },
    "background": {
        "color": "#FFFFFF"
    }
  },
  "PHYSICS": {
    "variables": [
      "angle (radians)",
      "angularVelocity (radians/second)",
      "angularAcceleration (radians/second^2)"
    ],
    "equations": [
      "angularAcceleration = (-gravity / length) * sin(angle)",
      "angularVelocity += angularAcceleration",
      "angularVelocity *= damping",
      "angle += angularVelocity"
    ],
    "initial_conditions": {
      "angle": "startingAngle",
      "angularVelocity": 0,
      "angularAcceleration": 0
    }
  },
  "INTERACTIONS": {
    "mouse": {
      "drag_bob": {
        "condition": "Mouse is pressed and near the bob",
        "action": "Set the angle based on the mouse position relative to the anchor point. Freeze the simulation while dragging."
      },
      "release_bob": {
        "condition": "Mouse is released after dragging the bob",
        "action": "Resume the simulation, angularVelocity calculated from recent mouse positions"
      }
    }
  },
  "ADDITIONAL_NOTES": [
    "Use p5.js for the simulation.",
    "Ensure smooth animation using frameRate(60).",
    "Provide clear labels and tooltips for the controls.",
    "Implement the resetPendulum() function to reset the angle and angularVelocity to the initial conditions.",
    "Implement the togglePause() function to pause/resume the simulation by controlling a 'paused' boolean variable.",
    "The trace should be an array of (x, y) coordinates that are drawn as a continuous line. Limit the length of the trace to prevent performance issues (e.g., keep the last 100 points).",
    "Consider using p5.Vector for position calculations to improve readability.",
    "Clamp startingAngle to within +/- PI to avoid unexpected behavior.",
    "Adjust the damping value carefully to avoid the pendulum stopping too quickly or swinging indefinitely.  A very small value approaching 1 is generally desirable.",
    "Clear the trace when Reset is pressed.",
    "Provide visual cues when the simulation is paused or playing."
  ]
}
```

Requirements:
- Include both setup() and draw() functions
- Use createCanvas(400, 400) to set canvas size
- Implement ALL specified controls (sliders, buttons) using p5.js GUI libraries or simple implementations
- Add all visual elements as described
- Implement the physics/logic accurately
- Include all specified user interactions
- Add clear comments explaining the code
- Make it educational and visually appealing
- Ensure smooth animations and responsive controls

IMPORTANT: Only output the JavaScript code, no explanations or markdown formatting. The code should be self-contained and runnable in the p5.js editor with all interactive controls working.