{
  "id": 88,
  "slug": "excalidraw-sketchbook-ink",
  "name": "Excalidraw Sketchbook Ink",
  "kind": "style",
  "family": "Playful & Hand-Drawn",
  "sourceSite": {
    "name": "Excalidraw",
    "url": "https://excalidraw.com/",
    "verifiedStatus": 200
  },
  "tagline": "Hand-drawn sketchy whiteboard aesthetic with wobbly ink strokes, pastel highlighters, and tactile notebook grids.",
  "whyUnique": "Replaces sterile corporate polish with charming, slightly imperfect hand-drawn borders, handwritten labels, and an inviting live sketchpad that makes technical ideas feel human and approachable.",
  "theme": "light",
  "mobileStrength": "native-first",
  "tags": [
    "hand-drawn",
    "sketchbook-ui",
    "whiteboard-aesthetic",
    "wobbly-strokes",
    "playful-diagrams",
    "indie-tool"
  ],
  "bestFor": [
    "Collaborative whiteboards & diagramming tools",
    "Developer explainers & system-design blogs",
    "Interactive education & note-taking apps",
    "Friendly indie SaaS & creator utilities"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#FDFCF8",
      "name": "Sketchpad Ivory"
    },
    {
      "role": "surface",
      "hex": "#F4F1E8",
      "name": "Drafting Paper"
    },
    {
      "role": "ink",
      "hex": "#1E1E24",
      "name": "Fineliner Ink"
    },
    {
      "role": "accent",
      "hex": "#6965DB",
      "name": "Sketch Violet"
    },
    {
      "role": "muted",
      "hex": "#7C7A85",
      "name": "Pencil Graphite"
    }
  ],
  "typography": {
    "display": "Caveat, cursive",
    "body": "Patrick Hand, -apple-system, sans-serif",
    "mono": "JetBrains Mono, ui-monospace, monospace",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=JetBrains+Mono:wght@400;500&family=Patrick+Hand&display=swap",
    "scaleNotes": "Expressive Caveat headings (34–52px) paired with super-legible Patrick Hand annotations (17–19px) and crisp mono tool shortcuts."
  },
  "layoutNotes": "Floating hand-bordered toolbar over an infinite dot-grid sketchbook canvas, paired with wobbly-border sticky cards and annotated SVG arrow callouts.",
  "interactionNotes": "Real interactive Canvas 2D sketchpad supporting pointer/touch freehand drawing, pastel highlighter color picker, template diagram presets, and undo/clear actions.",
  "mobileNotes": "Touch-enabled drawing canvas with `touch-action: none` inside the pad, >=44px floating tool buttons, and scrollable toolbar strip on 390px screens.",
  "agentGuardrails": {
    "do": [
      "Use organic asymmetric border-radii (e.g., 255px 15px 225px 15px / 15px 225px 15px 255px) and rough SVG paths for authentic hand-drawn feel.",
      "Keep handwriting fonts large enough (17px+) with generous line-height so notes remain effortless to read.",
      "Provide pastel highlighter fills behind key callouts instead of heavy solid dark blocks."
    ],
    "dont": [
      "Do not mix ultra-slick glossy 3D buttons with sketchy hand-drawn borders.",
      "Do not make the background dot grid so dense that it visually competes with ink strokes."
    ]
  },
  "demoFile": "demos/excalidraw-sketchbook-ink.html",
  "thumbDesktop": "thumbs/excalidraw-sketchbook-ink-desktop.webp",
  "thumbMobile": "thumbs/excalidraw-sketchbook-ink-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/excalidraw-sketchbook-ink",
    "markdown": "https://templates.michaelpitts.net/t/excalidraw-sketchbook-ink.md",
    "api": "https://templates.michaelpitts.net/api/templates/excalidraw-sketchbook-ink",
    "demo": "https://templates.michaelpitts.net/demos/excalidraw-sketchbook-ink.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/excalidraw-sketchbook-ink-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/excalidraw-sketchbook-ink-mobile.webp"
  },
  "agentPrompt": "Design & build using template #088 \"Excalidraw Sketchbook Ink\" (style / Playful & Hand-Drawn, light theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/excalidraw-sketchbook-ink.md\nLive demo: https://templates.michaelpitts.net/demos/excalidraw-sketchbook-ink.html\nReal-world inspiration: Excalidraw (https://excalidraw.com/)\n\nCore aesthetic: Replaces sterile corporate polish with charming, slightly imperfect hand-drawn borders, handwritten labels, and an inviting live sketchpad that makes technical ideas feel human and approachable.\nPalette: canvas: #FDFCF8 (Sketchpad Ivory), surface: #F4F1E8 (Drafting Paper), ink: #1E1E24 (Fineliner Ink), accent: #6965DB (Sketch Violet), muted: #7C7A85 (Pencil Graphite)\nTypography: Display=\"Caveat, cursive\", Body=\"Patrick Hand, -apple-system, sans-serif\", Mono=\"JetBrains Mono, ui-monospace, monospace\"\nLayout: Floating hand-bordered toolbar over an infinite dot-grid sketchbook canvas, paired with wobbly-border sticky cards and annotated SVG arrow callouts.\nInteractions: Real interactive Canvas 2D sketchpad supporting pointer/touch freehand drawing, pastel highlighter color picker, template diagram presets, and undo/clear actions.\nMobile: Touch-enabled drawing canvas with `touch-action: none` inside the pad, >=44px floating tool buttons, and scrollable toolbar strip on 390px screens.\n\nGuardrails:\n- DO: Use organic asymmetric border-radii (e.g., 255px 15px 225px 15px / 15px 225px 15px 255px) and rough SVG paths for authentic hand-drawn feel.\n- DO: Keep handwriting fonts large enough (17px+) with generous line-height so notes remain effortless to read.\n- DO: Provide pastel highlighter fills behind key callouts instead of heavy solid dark blocks.\n- DON'T: Do not mix ultra-slick glossy 3D buttons with sketchy hand-drawn borders.\n- DON'T: Do not make the background dot grid so dense that it visually competes with ink strokes.",
  "sourceCode": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n  <title>Sketchpad Ink — Hand-Drawn Whiteboard for Fast Thinkers</title>\n  <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n  <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n  <link href=\"https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=JetBrains+Mono:wght@400;500&family=Patrick+Hand&display=swap\" rel=\"stylesheet\">\n  <style>\n    :root {\n      --bg: #FDFCF8;\n      --surface: #F4F1E8;\n      --ink: #1E1E24;\n      --accent: #6965DB;\n      --accent-soft: #E8E7FA;\n      --muted: #7C7A85;\n      --mint: #2B9E6F;\n      --coral: #E05263;\n      --amber: #D9822B;\n      --border-w: 2px;\n      --radius-rough: 18px 6px 20px 8px / 8px 18px 6px 20px;\n      --radius-pill: 255px 15px 225px 15px / 15px 225px 15px 255px;\n      --shadow-ink: 4px 4px 0px #1E1E24;\n      --shadow-soft: 3px 3px 0px rgba(30, 30, 36, 0.16);\n    }\n\n    *, *::before, *::after {\n      box-sizing: border-box;\n    }\n\n    html, body {\n      margin: 0;\n      padding: 0;\n      background-color: var(--bg);\n      color: var(--ink);\n      font-family: 'Patrick Hand', 'Comic Sans MS', cursive, sans-serif;\n      font-size: 18px;\n      line-height: 1.5;\n      overflow-x: hidden;\n      -webkit-font-smoothing: antialiased;\n    }\n\n    body {\n      background-image: radial-gradient(rgba(30, 30, 36, 0.13) 1.2px, transparent 1.2px);\n      background-size: 24px 24px;\n    }\n\n    h1, h2, h3, .hand-title {\n      font-family: 'Caveat', cursive, sans-serif;\n      margin: 0;\n      line-height: 1.08;\n      letter-spacing: -0.01em;\n    }\n\n    code, .mono {\n      font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;\n      font-size: 0.82rem;\n    }\n\n    a {\n      color: inherit;\n      text-decoration: none;\n    }\n\n    button {\n      font-family: inherit;\n      cursor: pointer;\n      color: var(--ink);\n      background: transparent;\n      border: none;\n    }\n\n    .container {\n      width: 100%;\n      max-width: 1120px;\n      margin: 0 auto;\n      padding: 0 20px;\n    }\n\n    /* Sketchy border helpers */\n    .sketch-box {\n      background: var(--bg);\n      border: 2px solid var(--ink);\n      border-radius: var(--radius-rough);\n      box-shadow: var(--shadow-ink);\n    }\n\n    .sketch-btn {\n      display: inline-flex;\n      align-items: center;\n      justify-content: center;\n      gap: 8px;\n      min-height: 44px;\n      min-width: 44px;\n      padding: 8px 18px;\n      font-size: 1.05rem;\n      border: 2px solid var(--ink);\n      border-radius: var(--radius-pill);\n      background: var(--bg);\n      box-shadow: 3px 3px 0px var(--ink);\n      transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;\n    }\n\n    .sketch-btn:hover {\n      transform: translate(-1px, -1px);\n      box-shadow: 4px 4px 0px var(--ink);\n    }\n\n    .sketch-btn:active {\n      transform: translate(2px, 2px);\n      box-shadow: 1px 1px 0px var(--ink);\n    }\n\n    .sketch-btn.primary {\n      background: var(--accent);\n      color: #FDFCF8;\n    }\n\n    .sketch-btn.active {\n      background: var(--accent-soft);\n      border-color: var(--accent);\n      color: var(--accent);\n      box-shadow: 3px 3px 0px var(--accent);\n    }\n\n    /* Header & Mobile Nav */\n    header {\n      position: sticky;\n      top: 0;\n      z-index: 50;\n      background: rgba(253, 252, 248, 0.94);\n      backdrop-filter: blur(6px);\n      border-bottom: 2px dashed rgba(30, 30, 36, 0.25);\n    }\n\n    .nav-bar {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      min-height: 68px;\n      gap: 16px;\n    }\n\n    .brand {\n      display: inline-flex;\n      align-items: center;\n      gap: 10px;\n      font-family: 'Caveat', cursive;\n      font-size: 1.85rem;\n      font-weight: 700;\n    }\n\n    .nav-links {\n      display: flex;\n      align-items: center;\n      gap: 22px;\n    }\n\n    .nav-links a {\n      padding: 8px 4px;\n      min-height: 44px;\n      display: inline-flex;\n      align-items: center;\n      position: relative;\n    }\n\n    .nav-links a::after {\n      content: \"\";\n      position: absolute;\n      left: 0;\n      right: 0;\n      bottom: 8px;\n      height: 3px;\n      background: var(--accent);\n      border-radius: 4px;\n      transform: scaleX(0) rotate(-1deg);\n      transition: transform 0.2s ease;\n    }\n\n    .nav-links a:hover::after {\n      transform: scaleX(1) rotate(-1deg);\n    }\n\n    .mobile-toggle {\n      display: none;\n      width: 44px;\n      height: 44px;\n      border: 2px solid var(--ink);\n      border-radius: 10px 4px 12px 6px;\n      align-items: center;\n      justify-content: center;\n      background: var(--surface);\n      box-shadow: 2px 2px 0 var(--ink);\n    }\n\n    .mobile-drawer {\n      display: none;\n      flex-direction: column;\n      gap: 10px;\n      padding: 16px 20px 22px;\n      background: var(--surface);\n      border-bottom: 2px solid var(--ink);\n    }\n\n    .mobile-drawer.open {\n      display: flex;\n    }\n\n    .mobile-drawer a {\n      min-height: 44px;\n      display: flex;\n      align-items: center;\n      padding: 6px 12px;\n      border: 1.5px dashed rgba(30, 30, 36, 0.3);\n      border-radius: 10px;\n      background: var(--bg);\n    }\n\n    /* Hero */\n    .hero {\n      padding: 42px 0 28px;\n      text-align: center;\n    }\n\n    .kicker {\n      display: inline-flex;\n      align-items: center;\n      gap: 8px;\n      background: #FFF3BF;\n      border: 2px solid var(--ink);\n      border-radius: var(--radius-pill);\n      padding: 4px 14px;\n      font-size: 0.92rem;\n      transform: rotate(-1.5deg);\n      margin-bottom: 18px;\n      box-shadow: 2px 2px 0 var(--ink);\n    }\n\n    .hero h1 {\n      font-size: clamp(2.6rem, 6vw, 4.4rem);\n      max-width: 18ch;\n      margin: 0 auto 14px;\n    }\n\n    .highlight-word {\n      position: relative;\n      display: inline-block;\n      z-index: 1;\n      padding: 0 6px;\n    }\n\n    .highlight-word::before {\n      content: \"\";\n      position: absolute;\n      inset: 52% -4px 4% -4px;\n      background: rgba(105, 101, 219, 0.24);\n      border-radius: 12px 4px 10px 6px;\n      transform: rotate(-1.4deg);\n      z-index: -1;\n    }\n\n    .hero-sub {\n      max-width: 560px;\n      margin: 0 auto 24px;\n      color: var(--muted);\n      font-size: 1.15rem;\n    }\n\n    /* Interactive Whiteboard Workbench */\n    .workbench-wrap {\n      padding: 8px 0 48px;\n    }\n\n    .workbench {\n      background: var(--surface);\n      border: 2.5px solid var(--ink);\n      border-radius: 22px 10px 24px 12px / 12px 22px 10px 24px;\n      box-shadow: 7px 7px 0 var(--ink);\n      padding: 14px;\n    }\n\n    .toolbar {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: center;\n      justify-content: space-between;\n      gap: 10px;\n      background: var(--bg);\n      border: 2px solid var(--ink);\n      border-radius: 14px 6px 16px 8px;\n      padding: 10px 12px;\n      margin-bottom: 12px;\n      box-shadow: var(--shadow-soft);\n    }\n\n    .tool-group {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: center;\n      gap: 8px;\n    }\n\n    .tool-divider {\n      width: 2px;\n      height: 28px;\n      background: repeating-linear-gradient(to bottom, var(--ink) 0 4px, transparent 4px 8px);\n      opacity: 0.35;\n      margin: 0 4px;\n    }\n\n    .swatch {\n      width: 34px;\n      height: 34px;\n      min-width: 44px;\n      min-height: 44px;\n      padding: 6px;\n      border-radius: 50%;\n      display: inline-flex;\n      align-items: center;\n      justify-content: center;\n      border: 2px solid transparent;\n      transition: transform 0.12s ease;\n    }\n\n    .swatch span {\n      width: 24px;\n      height: 24px;\n      border-radius: 50% 45% 55% 48%;\n      border: 2px solid var(--ink);\n      display: block;\n    }\n\n    .swatch.selected {\n      border-color: var(--ink);\n      background: #FFF3BF;\n      transform: scale(1.06);\n    }\n\n    .canvas-stage {\n      position: relative;\n      background: #FDFCF8;\n      border: 2px solid var(--ink);\n      border-radius: 14px 8px 16px 6px;\n      overflow: hidden;\n      background-image:\n        linear-gradient(to right, rgba(105, 101, 219, 0.06) 1px, transparent 1px),\n        linear-gradient(to bottom, rgba(105, 101, 219, 0.06) 1px, transparent 1px);\n      background-size: 28px 28px;\n    }\n\n    #sketchCanvas {\n      display: block;\n      width: 100%;\n      height: 420px;\n      touch-action: none;\n      cursor: crosshair;\n    }\n\n    .canvas-hint {\n      position: absolute;\n      bottom: 12px;\n      left: 14px;\n      background: rgba(253, 252, 248, 0.92);\n      border: 1.5px dashed var(--muted);\n      border-radius: 10px;\n      padding: 4px 10px;\n      font-size: 0.85rem;\n      color: var(--muted);\n      pointer-events: none;\n    }\n\n    .template-bar {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: center;\n      justify-content: space-between;\n      gap: 10px;\n      margin-top: 12px;\n      padding: 4px 4px 0;\n    }\n\n    .template-pills {\n      display: flex;\n      flex-wrap: wrap;\n      gap: 8px;\n    }\n\n    .mini-pill {\n      min-height: 44px;\n      padding: 6px 14px;\n      border: 2px solid var(--ink);\n      border-radius: var(--radius-pill);\n      background: var(--bg);\n      font-size: 0.95rem;\n      box-shadow: 2px 2px 0 var(--ink);\n      transition: background 0.15s;\n    }\n\n    .mini-pill:hover, .mini-pill.active {\n      background: #FFF3BF;\n    }\n\n    /* Feature Sticky Notes */\n    .section {\n      padding: 48px 0;\n    }\n\n    .section-head {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: flex-end;\n      justify-content: space-between;\n      gap: 16px;\n      margin-bottom: 28px;\n    }\n\n    .section-head h2 {\n      font-size: clamp(2rem, 4vw, 3rem);\n    }\n\n    .notes-grid {\n      display: grid;\n      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n      gap: 22px;\n    }\n\n    .note-card {\n      background: var(--bg);\n      border: 2px solid var(--ink);\n      border-radius: var(--radius-rough);\n      padding: 22px;\n      box-shadow: var(--shadow-ink);\n      position: relative;\n      transition: transform 0.18s ease;\n    }\n\n    .note-card:nth-child(2) {\n      background: #FFF8DB;\n      transform: rotate(0.7deg);\n    }\n\n    .note-card:nth-child(3) {\n      background: #EDF9F3;\n      transform: rotate(-0.8deg);\n    }\n\n    .note-card:nth-child(4) {\n      background: #F4F1FE;\n      transform: rotate(0.5deg);\n    }\n\n    .note-card:hover {\n      transform: rotate(0deg) translateY(-3px);\n    }\n\n    .note-icon {\n      width: 48px;\n      height: 48px;\n      margin-bottom: 12px;\n    }\n\n    .note-card h3 {\n      font-size: 1.7rem;\n      margin-bottom: 8px;\n    }\n\n    .note-card p {\n      margin: 0;\n      color: var(--muted);\n    }\n\n    /* Sketch Library Strip */\n    .library-grid {\n      display: grid;\n      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n      gap: 22px;\n    }\n\n    .lib-card {\n      background: var(--surface);\n      border: 2px solid var(--ink);\n      border-radius: 18px 8px 16px 10px;\n      padding: 18px;\n      box-shadow: 4px 4px 0 var(--ink);\n      display: flex;\n      flex-direction: column;\n      gap: 12px;\n    }\n\n    .lib-preview {\n      background: var(--bg);\n      border: 2px dashed rgba(30, 30, 36, 0.35);\n      border-radius: 12px;\n      height: 150px;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      padding: 12px;\n    }\n\n    .lib-meta {\n      display: flex;\n      align-items: center;\n      justify-content: space-between;\n      gap: 10px;\n    }\n\n    .tag {\n      font-family: 'JetBrains Mono', monospace;\n      font-size: 0.75rem;\n      background: var(--bg);\n      border: 1.5px solid var(--ink);\n      border-radius: 6px;\n      padding: 3px 8px;\n    }\n\n    footer {\n      border-top: 2px dashed rgba(30, 30, 36, 0.25);\n      background: var(--surface);\n      padding: 34px 0 44px;\n      margin-top: 32px;\n    }\n\n    .footer-inner {\n      display: flex;\n      flex-wrap: wrap;\n      align-items: center;\n      justify-content: space-between;\n      gap: 16px;\n    }\n\n    @media (max-width: 760px) {\n      .nav-links, .nav-cta {\n        display: none;\n      }\n      .mobile-toggle {\n        display: inline-flex;\n      }\n      .tool-divider {\n        display: none;\n      }\n      #sketchCanvas {\n        height: 330px;\n      }\n    }\n  </style>\n</head>\n<body>\n  <header>\n    <div class=\"container nav-bar\">\n      <a href=\"#top\" class=\"brand\" aria-label=\"Sketchpad Ink Home\">\n        <svg width=\"34\" height=\"34\" viewBox=\"0 0 36 36\" fill=\"none\" aria-hidden=\"true\">\n          <rect x=\"4\" y=\"5\" width=\"27\" height=\"26\" rx=\"5\" fill=\"#E8E7FA\" stroke=\"#1E1E24\" stroke-width=\"2.2\" stroke-linecap=\"round\"/>\n          <path d=\"M10 24L22 11M22 11L25 14L13 27L9 28L10 24Z\" fill=\"#6965DB\" stroke=\"#1E1E24\" stroke-width=\"2\" stroke-linejoin=\"round\"/>\n          <path d=\"M8 12C11 9 14 14 17 11\" stroke=\"#1E1E24\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n        </svg>\n        <span>Sketchpad Ink</span>\n      </a>\n\n      <nav class=\"nav-links\" aria-label=\"Primary\">\n        <a href=\"#board\">Live Board</a>\n        <a href=\"#why-rough\">Why Rough?</a>\n        <a href=\"#stencils\">Stencil Packs</a>\n      </nav>\n\n      <div class=\"nav-cta\">\n        <a href=\"#board\" class=\"sketch-btn primary\">Start Drawing</a>\n      </div>\n\n      <button class=\"mobile-toggle\" id=\"menuBtn\" aria-expanded=\"false\" aria-controls=\"mobileDrawer\" aria-label=\"Toggle navigation\">\n        <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#1E1E24\" stroke-width=\"2.4\" stroke-linecap=\"round\">\n          <path d=\"M4 7h16M4 12h15M4 17h16\"/>\n        </svg>\n      </button>\n    </div>\n\n    <div class=\"mobile-drawer\" id=\"mobileDrawer\">\n      <a href=\"#board\">Live Board</a>\n      <a href=\"#why-rough\">Why Rough?</a>\n      <a href=\"#stencils\">Stencil Packs</a>\n      <a href=\"#board\" class=\"sketch-btn primary\">Start Drawing</a>\n    </div>\n  </header>\n\n  <main id=\"top\">\n    <section class=\"hero\">\n      <div class=\"container\">\n        <div class=\"kicker\">\n          <span class=\"mono\">v2.8</span>\n          <span>No login required &bull; Saved locally in your browser</span>\n        </div>\n        <h1>Think out loud on a <span class=\"highlight-word\">hand-drawn</span> whiteboard.</h1>\n        <p class=\"hero-sub\">\n          Skip pixel-perfect boxes. Sketch architecture diagrams, product flows, and messy brainstorms with wobbly ink strokes that invite feedback instead of bike-shedding.\n        </p>\n      </div>\n    </section>\n\n    <section class=\"workbench-wrap\" id=\"board\" aria-label=\"Interactive Sketch Whiteboard\">\n      <div class=\"container\">\n        <div class=\"workbench\">\n          <div class=\"toolbar\" role=\"toolbar\" aria-label=\"Drawing tools\">\n            <div class=\"tool-group\">\n              <button class=\"sketch-btn active\" data-tool=\"pen\" aria-pressed=\"true\" title=\"Freehand Doodle\">\n                <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\"><path d=\"M4 20l4-1 11-11-3-3L5 16l-1 4z\"/></svg>\n                <span>Doodle</span>\n              </button>\n              <button class=\"sketch-btn\" data-tool=\"box\" aria-pressed=\"false\" title=\"Sketchy Box\">\n                <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\"><rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"2\"/></svg>\n                <span>Box</span>\n              </button>\n              <button class=\"sketch-btn\" data-tool=\"arrow\" aria-pressed=\"false\" title=\"Sketchy Arrow\">\n                <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\"><path d=\"M5 19L19 5M19 5h-7M19 5v7\"/></svg>\n                <span>Arrow</span>\n              </button>\n            </div>\n\n            <div class=\"tool-divider\" aria-hidden=\"true\"></div>\n\n            <div class=\"tool-group\" role=\"radiogroup\" aria-label=\"Ink color\">\n              <button class=\"swatch selected\" data-color=\"#1E1E24\" aria-label=\"Charcoal Ink\" aria-checked=\"true\"><span style=\"background:#1E1E24\"></span></button>\n              <button class=\"swatch\" data-color=\"#6965DB\" aria-label=\"Sketchy Violet\" aria-checked=\"false\"><span style=\"background:#6965DB\"></span></button>\n              <button class=\"swatch\" data-color=\"#2B9E6F\" aria-label=\"Mint Marker\" aria-checked=\"false\"><span style=\"background:#2B9E6F\"></span></button>\n              <button class=\"swatch\" data-color=\"#E05263\" aria-label=\"Coral Red\" aria-checked=\"false\"><span style=\"background:#E05263\"></span></button>\n              <button class=\"swatch\" data-color=\"#D9822B\" aria-label=\"Amber Highlighter\" aria-checked=\"false\"><span style=\"background:#D9822B\"></span></button>\n            </div>\n\n            <div class=\"tool-divider\" aria-hidden=\"true\"></div>\n\n            <div class=\"tool-group\">\n              <button class=\"sketch-btn\" id=\"undoBtn\" title=\"Undo last stroke\">Undo</button>\n              <button class=\"sketch-btn\" id=\"clearBtn\" title=\"Clear board\">Clear</button>\n            </div>\n          </div>\n\n          <div class=\"canvas-stage\">\n            <canvas id=\"sketchCanvas\" aria-label=\"Interactive hand-drawn canvas\"></canvas>\n            <div class=\"canvas-hint mono\" id=\"statusHint\">Drag to draw &bull; Mode: DOODLE</div>\n          </div>\n\n          <div class=\"template-bar\">\n            <span class=\"mono\" style=\"color:var(--muted);\">Quick Templates:</span>\n            <div class=\"template-pills\">\n              <button class=\"mini-pill active\" data-template=\"flow\">API Request Flow</button>\n              <button class=\"mini-pill\" data-template=\"mindmap\">Launch Mindmap</button>\n              <button class=\"mini-pill\" data-template=\"wireframe\">Lo-Fi Wireframe</button>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n\n    <section class=\"section\" id=\"why-rough\">\n      <div class=\"container\">\n        <div class=\"section-head\">\n          <h2>Why messy lines beat polished slides</h2>\n          <span class=\"mono\" style=\"color:var(--muted);\">// built for half-baked ideas</span>\n        </div>\n\n        <div class=\"notes-grid\">\n          <article class=\"note-card\">\n            <svg class=\"note-icon\" viewBox=\"0 0 48 48\" fill=\"none\" aria-hidden=\"true\">\n              <path d=\"M8 34C14 14 26 10 39 14\" stroke=\"#6965DB\" stroke-width=\"3\" stroke-linecap=\"round\"/>\n              <path d=\"M10 37C17 20 27 16 40 19\" stroke=\"#1E1E24\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-dasharray=\"4 4\"/>\n              <circle cx=\"38\" cy=\"15\" r=\"4\" fill=\"#FFF3BF\" stroke=\"#1E1E24\" stroke-width=\"2\"/>\n            </svg>\n            <h3>Double-Pass Wobble</h3>\n            <p>Every rectangle and arrow is rendered with gentle organic jitter so stakeholders focus on architecture, not border radius.</p>\n          </article>\n\n          <article class=\"note-card\">\n            <svg class=\"note-icon\" viewBox=\"0 0 48 48\" fill=\"none\" aria-hidden=\"true\">\n              <rect x=\"9\" y=\"16\" width=\"30\" height=\"22\" rx=\"4\" fill=\"#FDFCF8\" stroke=\"#1E1E24\" stroke-width=\"2.4\"/>\n              <path d=\"M16 16v-4a8 8 0 0116 0v4\" stroke=\"#1E1E24\" stroke-width=\"2.4\" stroke-linecap=\"round\"/>\n              <circle cx=\"24\" cy=\"27\" r=\"3\" fill=\"#6965DB\"/>\n            </svg>\n            <h3>End-to-End Local</h3>\n            <p>Your diagrams live in memory and local storage by default. Share a live room link with encrypted payloads only when you choose.</p>\n          </article>\n\n          <article class=\"note-card\">\n            <svg class=\"note-icon\" viewBox=\"0 0 48 48\" fill=\"none\" aria-hidden=\"true\">\n              <rect x=\"6\" y=\"10\" width=\"16\" height=\"12\" rx=\"3\" fill=\"#E8E7FA\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n              <rect x=\"26\" y=\"26\" width=\"16\" height=\"12\" rx=\"3\" fill=\"#FDFCF8\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n              <path d=\"M22 16h8v10\" stroke=\"#2B9E6F\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n            </svg>\n            <h3>Zero-Friction Arrows</h3>\n            <p>Connect thoughts in a single drag. Snap ideas into rough flowcharts, sequence diagrams, or napkin-level system maps.</p>\n          </article>\n\n          <article class=\"note-card\">\n            <svg class=\"note-icon\" viewBox=\"0 0 48 48\" fill=\"none\" aria-hidden=\"true\">\n              <path d=\"M12 10h18l8 8v20H12V10z\" fill=\"#FDFCF8\" stroke=\"#1E1E24\" stroke-width=\"2.2\" stroke-linejoin=\"round\"/>\n              <path d=\"M30 10v8h8\" stroke=\"#1E1E24\" stroke-width=\"2.2\" stroke-linejoin=\"round\"/>\n              <path d=\"M18 26h12M18 32h8\" stroke=\"#6965DB\" stroke-width=\"2.4\" stroke-linecap=\"round\"/>\n            </svg>\n            <h3>Crisp SVG &amp; PNG</h3>\n            <p>Drop hand-drawn diagrams straight into engineering RFCs, Notion docs, or GitHub READMEs with transparent backgrounds.</p>\n          </article>\n        </div>\n      </div>\n    </section>\n\n    <section class=\"section\" id=\"stencils\">\n      <div class=\"container\">\n        <div class=\"section-head\">\n          <h2>Community Stencil Packs</h2>\n          <span class=\"mono\" style=\"color:var(--muted);\">Click any pack to load its sketch above</span>\n        </div>\n\n        <div class=\"library-grid\">\n          <div class=\"lib-card\">\n            <div class=\"lib-preview\">\n              <svg width=\"210\" height=\"110\" viewBox=\"0 0 210 110\" fill=\"none\">\n                <rect x=\"10\" y=\"32\" width=\"54\" height=\"40\" rx=\"5\" fill=\"#E8E7FA\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n                <text x=\"37\" y=\"57\" text-anchor=\"middle\" font-family=\"Patrick Hand\" font-size=\"14\" fill=\"#1E1E24\">Client</text>\n                <path d=\"M68 52 C85 48, 100 56, 122 51\" stroke=\"#6965DB\" stroke-width=\"2.2\" stroke-linecap=\"round\"/>\n                <path d=\"M115 45 L124 51 L115 58\" stroke=\"#6965DB\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n                <ellipse cx=\"164\" cy=\"40\" rx=\"28\" ry=\"10\" fill=\"#FFF3BF\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n                <path d=\"M136 40v28c0 6 12 10 28 10s28-4 28-10V40\" fill=\"#FFF3BF\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n                <text x=\"164\" y=\"64\" text-anchor=\"middle\" font-family=\"Patrick Hand\" font-size=\"13\" fill=\"#1E1E24\">Postgres</text>\n              </svg>\n            </div>\n            <div class=\"lib-meta\">\n              <div>\n                <strong style=\"font-size:1.15rem;\">Cloud &amp; Backend Primitives</strong>\n                <div class=\"mono\" style=\"color:var(--muted);\">42 sketchy icons</div>\n              </div>\n              <button class=\"sketch-btn\" data-load-template=\"flow\">Load</button>\n            </div>\n          </div>\n\n          <div class=\"lib-card\">\n            <div class=\"lib-preview\">\n              <svg width=\"210\" height=\"110\" viewBox=\"0 0 210 110\" fill=\"none\">\n                <ellipse cx=\"105\" cy=\"55\" rx=\"34\" ry=\"20\" fill=\"#EDF9F3\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n                <text x=\"105\" y=\"60\" text-anchor=\"middle\" font-family=\"Patrick Hand\" font-size=\"14\" fill=\"#1E1E24\">v3 Launch</text>\n                <path d=\"M72 48 L38 26M74 64 L40 84M138 48 L174 28M136 65 L172 86\" stroke=\"#2B9E6F\" stroke-width=\"2.2\" stroke-linecap=\"round\"/>\n                <circle cx=\"32\" cy=\"22\" r=\"10\" fill=\"#FFF3BF\" stroke=\"#1E1E24\" stroke-width=\"2\"/>\n                <circle cx=\"34\" cy=\"88\" r=\"10\" fill=\"#FCE8EB\" stroke=\"#1E1E24\" stroke-width=\"2\"/>\n                <circle cx=\"178\" cy=\"24\" r=\"10\" fill=\"#E8E7FA\" stroke=\"#1E1E24\" stroke-width=\"2\"/>\n                <circle cx=\"176\" cy=\"88\" r=\"10\" fill=\"#FFF3BF\" stroke=\"#1E1E24\" stroke-width=\"2\"/>\n              </svg>\n            </div>\n            <div class=\"lib-meta\">\n              <div>\n                <strong style=\"font-size:1.15rem;\">Brainstorm &amp; Sticky Maps</strong>\n                <div class=\"mono\" style=\"color:var(--muted);\">28 organic nodes</div>\n              </div>\n              <button class=\"sketch-btn\" data-load-template=\"mindmap\">Load</button>\n            </div>\n          </div>\n\n          <div class=\"lib-card\">\n            <div class=\"lib-preview\">\n              <svg width=\"210\" height=\"110\" viewBox=\"0 0 210 110\" fill=\"none\">\n                <rect x=\"28\" y=\"14\" width=\"154\" height=\"84\" rx=\"6\" fill=\"#FDFCF8\" stroke=\"#1E1E24\" stroke-width=\"2.2\"/>\n                <line x1=\"28\" y1=\"30\" x2=\"182\" y2=\"30\" stroke=\"#1E1E24\" stroke-width=\"2\"/>\n                <circle cx=\"40\" cy=\"22\" r=\"3\" fill=\"#E05263\"/>\n                <circle cx=\"50\" cy=\"22\" r=\"3\" fill=\"#D9822B\"/>\n                <circle cx=\"60\" cy=\"22\" r=\"3\" fill=\"#2B9E6F\"/>\n                <rect x=\"42\" y=\"42\" width=\"56\" height=\"42\" rx=\"4\" fill=\"#F4F1E8\" stroke=\"#1E1E24\" stroke-width=\"1.8\"/>\n                <path d=\"M42 42L98 84M98 42L42 84\" stroke=\"#7C7A85\" stroke-width=\"1.4\"/>\n                <path d=\"M110 48h54M110 60h42M110 74h34\" stroke=\"#6965DB\" stroke-width=\"2.5\" stroke-linecap=\"round\"/>\n              </svg>\n            </div>\n            <div class=\"lib-meta\">\n              <div>\n                <strong style=\"font-size:1.15rem;\">Lo-Fi UI Wireframes</strong>\n                <div class=\"mono\" style=\"color:var(--muted);\">36 browser blocks</div>\n              </div>\n              <button class=\"sketch-btn\" data-load-template=\"wireframe\">Load</button>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  </main>\n\n  <footer>\n    <div class=\"container footer-inner\">\n      <div>\n        <strong class=\"hand-title\" style=\"font-size:1.7rem;\">Sketchpad Ink</strong>\n        <div style=\"color:var(--muted);\">Open-source hand-drawn diagramming &bull; MIT Licensed</div>\n      </div>\n      <div class=\"mono\" style=\"color:var(--muted);\">Press Undo or switch tools anytime &bull; Made with wobbly strokes</div>\n    </div>\n  </footer>\n\n  <script>\n    // Mobile nav toggle\n    const menuBtn = document.getElementById('menuBtn');\n    const mobileDrawer = document.getElementById('mobileDrawer');\n    menuBtn.addEventListener('click', () => {\n      const isOpen = mobileDrawer.classList.toggle('open');\n      menuBtn.setAttribute('aria-expanded', String(isOpen));\n    });\n    mobileDrawer.querySelectorAll('a').forEach(a => {\n      a.addEventListener('click', () => {\n        mobileDrawer.classList.remove('open');\n        menuBtn.setAttribute('aria-expanded', 'false');\n      });\n    });\n\n    // Interactive Rough Whiteboard Canvas\n    const canvas = document.getElementById('sketchCanvas');\n    const ctx = canvas.getContext('2d');\n    const statusHint = document.getElementById('statusHint');\n\n    let tool = 'pen';\n    let color = '#1E1E24';\n    let drawing = false;\n    let startPt = null;\n    let currentShape = null;\n    let shapes = [];\n\n    function resizeCanvas() {\n      const rect = canvas.getBoundingClientRect();\n      const dpr = Math.min(window.devicePixelRatio || 1, 2);\n      canvas.width = Math.floor(rect.width * dpr);\n      canvas.height = Math.floor(rect.height * dpr);\n      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n      renderAll();\n    }\n\n    function seededJitter(seed, amp) {\n      const x = Math.sin(seed * 127.1) * 43758.5453;\n      return ((x - Math.floor(x)) - 0.5) * 2 * amp;\n    }\n\n    function roughLine(x1, y1, x2, y2, strokeColor, seed) {\n      ctx.strokeStyle = strokeColor;\n      ctx.lineCap = 'round';\n      ctx.lineJoin = 'round';\n      for (let pass = 0; pass < 2; pass++) {\n        const s = seed + pass * 19;\n        const mx = (x1 + x2) / 2 + seededJitter(s + 1, 2.4);\n        const my = (y1 + y2) / 2 + seededJitter(s + 2, 2.4);\n        ctx.lineWidth = pass === 0 ? 2.5 : 1.7;\n        ctx.beginPath();\n        ctx.moveTo(x1 + seededJitter(s + 3, 1.5), y1 + seededJitter(s + 4, 1.5));\n        ctx.quadraticCurveTo(mx, my, x2 + seededJitter(s + 5, 1.5), y2 + seededJitter(s + 6, 1.5));\n        ctx.stroke();\n      }\n    }\n\n    function roughBox(x, y, w, h, strokeColor, fill, seed) {\n      if (fill) {\n        ctx.fillStyle = fill;\n        ctx.fillRect(x + 2, y + 2, w - 4, h - 4);\n      }\n      roughLine(x, y, x + w, y, strokeColor, seed + 1);\n      roughLine(x + w, y, x + w, y + h, strokeColor, seed + 7);\n      roughLine(x + w, y + h, x, y + h, strokeColor, seed + 13);\n      roughLine(x, y + h, x, y, strokeColor, seed + 23);\n    }\n\n    function roughArrow(x1, y1, x2, y2, strokeColor, seed) {\n      roughLine(x1, y1, x2, y2, strokeColor, seed);\n      const angle = Math.atan2(y2 - y1, x2 - x1);\n      const len = 14;\n      roughLine(x2, y2, x2 - len * Math.cos(angle - 0.5), y2 - len * Math.sin(angle - 0.5), strokeColor, seed + 31);\n      roughLine(x2, y2, x2 - len * Math.cos(angle + 0.5), y2 - len * Math.sin(angle + 0.5), strokeColor, seed + 41);\n    }\n\n    function drawShape(s) {\n      if (s.type === 'pen') {\n        if (s.points.length < 2) return;\n        ctx.strokeStyle = s.color;\n        ctx.lineWidth = 2.6;\n        ctx.lineCap = 'round';\n        ctx.lineJoin = 'round';\n        ctx.beginPath();\n        ctx.moveTo(s.points[0].x, s.points[0].y);\n        for (let i = 1; i < s.points.length; i++) {\n          ctx.lineTo(s.points[i].x, s.points[i].y);\n        }\n        ctx.stroke();\n      } else if (s.type === 'box') {\n        roughBox(s.x, s.y, s.w, s.h, s.color, s.fill || null, s.seed);\n      } else if (s.type === 'arrow') {\n        roughArrow(s.x1, s.y1, s.x2, s.y2, s.color, s.seed);\n      } else if (s.type === 'label') {\n        ctx.font = '700 21px \"Caveat\", cursive';\n        ctx.fillStyle = s.color;\n        ctx.textAlign = 'center';\n        ctx.textBaseline = 'middle';\n        ctx.fillText(s.text, s.x, s.y);\n      }\n    }\n\n    function renderAll() {\n      const rect = canvas.getBoundingClientRect();\n      ctx.clearRect(0, 0, rect.width, rect.height);\n      shapes.forEach(drawShape);\n      if (currentShape) drawShape(currentShape);\n    }\n\n    function loadTemplate(name) {\n      const w = canvas.getBoundingClientRect().width;\n      const h = canvas.getBoundingClientRect().height;\n      const cx = w / 2;\n      const cy = h / 2;\n      const compact = w < 560;\n      shapes = [];\n\n      if (name === 'flow') {\n        const bw = compact ? 96 : 138;\n        const bh = 64;\n        const gap = compact ? 22 : 66;\n        const leftX = cx - bw * 1.5 - gap;\n        const midX = cx - bw / 2;\n        const rightX = cx + bw / 2 + gap;\n        const y = cy - bh / 2;\n        shapes.push(\n          { type: 'box', x: leftX, y, w: bw, h: bh, color: '#1E1E24', fill: '#E8E7FA', seed: 11 },\n          { type: 'label', x: leftX + bw / 2, y: y + bh / 2, text: 'Browser', color: '#1E1E24' },\n          { type: 'arrow', x1: leftX + bw + 4, y1: cy, x2: midX - 6, y2: cy, color: '#6965DB', seed: 19 },\n          { type: 'box', x: midX, y, w: bw, h: bh, color: '#1E1E24', fill: '#FFF3BF', seed: 29 },\n          { type: 'label', x: midX + bw / 2, y: y + bh / 2, text: 'Edge API', color: '#1E1E24' },\n          { type: 'arrow', x1: midX + bw + 4, y1: cy, x2: rightX - 6, y2: cy, color: '#2B9E6F', seed: 37 },\n          { type: 'box', x: rightX, y, w: bw, h: bh, color: '#1E1E24', fill: '#EDF9F3', seed: 47 },\n          { type: 'label', x: rightX + bw / 2, y: y + bh / 2, text: 'Cache DB', color: '#1E1E24' },\n          { type: 'label', x: cx, y: y - 34, text: 'Draft: draw your own boxes anywhere!', color: '#7C7A85' }\n        );\n      } else if (name === 'mindmap') {\n        const dx = compact ? 105 : 165;\n        const dy = 86;\n        shapes.push(\n          { type: 'box', x: cx - 64, y: cy - 30, w: 128, h: 60, color: '#6965DB', fill: '#E8E7FA', seed: 5 },\n          { type: 'label', x: cx, y: cy, text: 'Launch v3', color: '#1E1E24' },\n          { type: 'arrow', x1: cx - 50, y1: cy - 26, x2: cx - dx + 42, y2: cy - dy + 22, color: '#1E1E24', seed: 12 },\n          { type: 'box', x: cx - dx - 48, y: cy - dy - 22, w: 96, h: 46, color: '#2B9E6F', fill: '#EDF9F3', seed: 17 },\n          { type: 'label', x: cx - dx, y: cy - dy, text: 'Docs', color: '#1E1E24' },\n          { type: 'arrow', x1: cx + 50, y1: cy - 26, x2: cx + dx - 42, y2: cy - dy + 22, color: '#1E1E24', seed: 22 },\n          { type: 'box', x: cx + dx - 48, y: cy - dy - 22, w: 96, h: 46, color: '#D9822B', fill: '#FFF3BF', seed: 27 },\n          { type: 'label', x: cx + dx, y: cy - dy, text: 'Demo Video', color: '#1E1E24' },\n          { type: 'arrow', x1: cx + 48, y1: cy + 28, x2: cx + dx - 42, y2: cy + dy - 22, color: '#E05263', seed: 33 },\n          { type: 'box', x: cx + dx - 48, y: cy + dy - 22, w: 96, h: 46, color: '#E05263', fill: '#FCE8EB', seed: 39 },\n          { type: 'label', x: cx + dx, y: cy + dy, text: 'Changelog', color: '#1E1E24' }\n        );\n      } else if (name === 'wireframe') {\n        const fw = Math.min(w - 52, 420);\n        const fh = 240;\n        const fx = cx - fw / 2;\n        const fy = cy - fh / 2;\n        shapes.push(\n          { type: 'box', x: fx, y: fy, w: fw, h: fh, color: '#1E1E24', fill: '#FDFCF8', seed: 9 },\n          { type: 'box', x: fx + 16, y: fy + 16, w: fw - 32, h: 36, color: '#6965DB', fill: '#E8E7FA', seed: 15 },\n          { type: 'label', x: cx, y: fy + 34, text: 'Header + Search Bar', color: '#1E1E24' },\n          { type: 'box', x: fx + 16, y: fy + 66, w: (fw - 44) * 0.45, h: 154, color: '#1E1E24', fill: '#F4F1E8', seed: 21 },\n          { type: 'label', x: fx + 16 + (fw - 44) * 0.225, y: fy + 142, text: 'Hero Sketch', color: '#7C7A85' },\n          { type: 'box', x: fx + 28 + (fw - 44) * 0.45, y: fy + 66, w: (fw - 44) * 0.55, h: 68, color: '#2B9E6F', fill: '#EDF9F3', seed: 28 },\n          { type: 'label', x: fx + 28 + (fw - 44) * 0.725, y: fy + 100, text: 'Value Prop', color: '#1E1E24' },\n          { type: 'box', x: fx + 28 + (fw - 44) * 0.45, y: fy + 148, w: (fw - 44) * 0.55, h: 72, color: '#D9822B', fill: '#FFF3BF', seed: 34 },\n          { type: 'label', x: fx + 28 + (fw - 44) * 0.725, y: fy + 184, text: 'Primary CTA', color: '#1E1E24' }\n        );\n      }\n\n      document.querySelectorAll('.mini-pill').forEach(btn => {\n        btn.classList.toggle('active', btn.dataset.template === name);\n      });\n      renderAll();\n    }\n\n    function getPos(e) {\n      const rect = canvas.getBoundingClientRect();\n      return { x: e.clientX - rect.left, y: e.clientY - rect.top };\n    }\n\n    canvas.addEventListener('pointerdown', (e) => {\n      canvas.setPointerCapture(e.pointerId);\n      drawing = true;\n      startPt = getPos(e);\n      const seed = Math.floor(Math.random() * 1000);\n      if (tool === 'pen') {\n        currentShape = { type: 'pen', color, points: [startPt] };\n      } else if (tool === 'box') {\n        currentShape = { type: 'box', x: startPt.x, y: startPt.y, w: 0, h: 0, color, seed };\n      } else if (tool === 'arrow') {\n        currentShape = { type: 'arrow', x1: startPt.x, y1: startPt.y, x2: startPt.x, y2: startPt.y, color, seed };\n      }\n      renderAll();\n    });\n\n    canvas.addEventListener('pointermove', (e) => {\n      if (!drawing || !currentShape) return;\n      const pt = getPos(e);\n      if (tool === 'pen') {\n        currentShape.points.push(pt);\n      } else if (tool === 'box') {\n        currentShape.x = Math.min(startPt.x, pt.x);\n        currentShape.y = Math.min(startPt.y, pt.y);\n        currentShape.w = Math.abs(pt.x - startPt.x);\n        currentShape.h = Math.abs(pt.y - startPt.y);\n      } else if (tool === 'arrow') {\n        currentShape.x2 = pt.x;\n        currentShape.y2 = pt.y;\n      }\n      renderAll();\n    });\n\n    function endDraw() {\n      if (!drawing) return;\n      drawing = false;\n      if (currentShape) {\n        shapes.push(currentShape);\n        currentShape = null;\n        renderAll();\n      }\n    }\n    canvas.addEventListener('pointerup', endDraw);\n    canvas.addEventListener('pointercancel', endDraw);\n\n    // Toolbar controls\n    document.querySelectorAll('[data-tool]').forEach(btn => {\n      btn.addEventListener('click', () => {\n        tool = btn.dataset.tool;\n        document.querySelectorAll('[data-tool]').forEach(b => {\n          const active = b === btn;\n          b.classList.toggle('active', active);\n          b.setAttribute('aria-pressed', String(active));\n        });\n        statusHint.textContent = `Drag to draw • Mode: ${tool.toUpperCase()}`;\n      });\n    });\n\n    document.querySelectorAll('.swatch').forEach(btn => {\n      btn.addEventListener('click', () => {\n        color = btn.dataset.color;\n        document.querySelectorAll('.swatch').forEach(b => {\n          const sel = b === btn;\n          b.classList.toggle('selected', sel);\n          b.setAttribute('aria-checked', String(sel));\n        });\n      });\n    });\n\n    document.getElementById('undoBtn').addEventListener('click', () => {\n      shapes.pop();\n      renderAll();\n    });\n\n    document.getElementById('clearBtn').addEventListener('click', () => {\n      shapes = [];\n      renderAll();\n    });\n\n    document.querySelectorAll('[data-template]').forEach(btn => {\n      btn.addEventListener('click', () => loadTemplate(btn.dataset.template));\n    });\n\n    document.querySelectorAll('[data-load-template]').forEach(btn => {\n      btn.addEventListener('click', () => {\n        loadTemplate(btn.dataset.loadTemplate);\n        document.getElementById('board').scrollIntoView({ behavior: 'smooth' });\n      });\n    });\n\n    window.addEventListener('resize', () => {\n      resizeCanvas();\n    });\n\n    resizeCanvas();\n    loadTemplate('flow');\n  </script>\n</body>\n</html>\n"
}
