# #047 — Cobalt PCB Blueprint

> Cyanotype engineering blueprint and PCB schematic viewer with copper-trace gold highlights and interactive BOM.

## Metadata

- **Index**: #047
- **Slug**: `cobalt-pcb-blueprint`
- **Kind**: `style`
- **Family**: Technical Blueprint & CAD
- **Theme**: `dark`
- **Mobile Strength**: `high`
- **Tags**: `blueprint`, `pcb`, `cad`, `cyanotype`, `engineering`, `schematic`
- **Best For**: Hardware, PCB, and embedded systems documentation, Architectural and mechanical CAD spec viewers, Open-source hardware BOM and schematic explorers
- **Real-World Inspiration**: [KiCad](https://www.kicad.org/)
- **Detail Page**: https://templates.michaelpitts.net/t/cobalt-pcb-blueprint
- **Live Demo**: https://templates.michaelpitts.net/demos/cobalt-pcb-blueprint.html
- **JSON API**: https://templates.michaelpitts.net/api/templates/cobalt-pcb-blueprint

## Why This Aesthetic Is Unique

Draws directly from architectural cyanotypes and EDA circuit drafting boards, combining orthographic hairline grids, a corner title block, and toggleable copper/silkscreen layers.

## Color Palette

| Role | Name | Hex |
|------|------|-----|
| `canvas` | Cyanotype Cobalt | `#0D2240` |
| `surface` | Schematic Sheet | `#122D54` |
| `ink` | Drafting White | `#F0F6FF` |
| `accent` | Copper Trace Gold | `#F2B705` |
| `muted` | Orthographic Grid | `#7FA4D4` |

## Typography

- **Display**: `Space Grotesk`
- **Body**: `IBM Plex Sans`
- **Mono**: `IBM Plex Mono`
- **Scale Notes**: Uppercase drafting-block labels (10-12px mono), component designators (U1, R4, J1), and crisp 14px BOM specification rows.
- **Google Fonts**: https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap
  ```html
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap">
  ```

## Layout Architecture

Framed drafting sheet with orthographic grid background, central interactive PCB SVG layout, right-hand layer visibility rack & BOM inspector, and bottom-right engineering title block.

## Interaction & Micro-Motion Rules

Toggle Front Copper, Back Copper, Silkscreen, and Ratsnest layers on the SVG board; click any component (MCU, LDO Regulator, Crystal, USB-C) to highlight its nets and BOM specs.

## Mobile & Responsive Rules

Drafting frame scales cleanly to 390px with touch-friendly layer toggle pills and stacked BOM inspector below the schematic.

## Agent Guardrails

### DO
- Include an authentic drafting title block with revision, scale, and sheet number
- Use crisp 1px orthographic hairlines and sharp corners rather than soft rounded cards
- Highlight active copper traces and selected pads in high-contrast gold

### DON'T
- Do not use blurry drop shadows or soft pastel gradients on a technical blueprint
- Do not omit real component reference designators and footprints

## Complete Standalone Starter Code

File: `demos/cobalt-pcb-blueprint.html`

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Cyanotype EDA — 4-Layer PCB Blueprint &amp; Schematic Studio</title>
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet">
  <style>
    :root {
      --canvas: #0D2240;
      --surface: #122D54;
      --surface-hi: #173866;
      --ink: #F0F6FF;
      --accent: #F2B705;
      --muted: #7FA4D4;
      --grid-minor: rgba(127, 164, 212, 0.12);
      --grid-major: rgba(127, 164, 212, 0.28);
      --border: rgba(127, 164, 212, 0.34);
      --border-strong: rgba(240, 246, 255, 0.55);
      --fcu: #F26457;
      --bcu: #4CC9F0;
      --silk: #F0F6FF;
      --rats: #9EF08C;
      --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
    }

    *, *::before, *::after {
      box-sizing: border-box;
    }

    html, body {
      margin: 0;
      padding: 0;
      background-color: var(--canvas);
      background-image:
        linear-gradient(to right, var(--grid-minor) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-minor) 1px, transparent 1px);
      background-size: 24px 24px;
      color: var(--ink);
      font-family: var(--font-sans);
      line-height: 1.45;
      overflow-x: hidden;
    }

    /* Top Engineering Bar */
    .eda-header {
      position: sticky;
      top: 0;
      z-index: 40;
      background: rgba(13, 34, 64, 0.95);
      backdrop-filter: blur(8px);
      border-bottom: 1.5px solid var(--border-strong);
    }

    .eda-header-inner {
      max-width: 1360px;
      margin: 0 auto;
      padding: 0.65rem 1.15rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.85rem;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      text-decoration: none;
      color: var(--ink);
    }

    .brand-icon {
      width: 34px;
      height: 34px;
      flex-shrink: 0;
    }

    .brand-title {
      font-weight: 700;
      font-size: 1.05rem;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      display: block;
    }

    .brand-file {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--muted);
      display: block;
    }

    .header-nav {
      display: flex;
      align-items: center;
      gap: 1.15rem;
    }

    .header-nav a {
      color: var(--muted);
      text-decoration: none;
      font-family: var(--font-mono);
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      padding: 0.3rem 0;
      border-bottom: 2px solid transparent;
    }

    .header-nav a:hover,
    .header-nav a.active {
      color: var(--ink);
      border-bottom-color: var(--accent);
    }

    .header-controls {
      display: flex;
      align-items: center;
      gap: 0.65rem;
    }

    .unit-switch {
      display: inline-flex;
      border: 1px solid var(--border-strong);
      border-radius: 3px;
      overflow: hidden;
    }

    .unit-btn {
      min-width: 44px;
      min-height: 36px;
      border: none;
      background: var(--surface);
      color: var(--muted);
      font-family: var(--font-mono);
      font-size: 0.72rem;
      font-weight: 600;
      cursor: pointer;
    }

    .unit-btn.active {
      background: var(--accent);
      color: #0D2240;
    }

    .drc-badge {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      padding: 0.35rem 0.6rem;
      border: 1px solid rgba(158, 240, 140, 0.55);
      background: rgba(158, 240, 140, 0.1);
      color: #9EF08C;
      border-radius: 3px;
      white-space: nowrap;
    }

    .mobile-menu-btn {
      display: none;
      align-items: center;
      justify-content: center;
      min-width: 44px;
      min-height: 44px;
      background: var(--surface);
      border: 1px solid var(--border-strong);
      color: var(--ink);
      border-radius: 3px;
      cursor: pointer;
    }

    .mobile-nav-panel {
      display: none;
      background: var(--surface);
      border-top: 1px solid var(--border);
      padding: 0.5rem 1.15rem 0.9rem;
    }

    .mobile-nav-panel.open {
      display: block;
    }

    .mobile-nav-panel a {
      display: flex;
      align-items: center;
      min-height: 44px;
      color: var(--ink);
      text-decoration: none;
      font-family: var(--font-mono);
      font-size: 0.82rem;
      text-transform: uppercase;
      border-bottom: 1px solid var(--border);
    }

    .mobile-nav-panel a:last-child {
      border-bottom: none;
    }

    /* Blueprint Outer Sheet */
    .blueprint-sheet {
      max-width: 1360px;
      margin: 1.25rem auto 2.5rem;
      padding: 0 1.15rem;
    }

    .drafting-border {
      border: 2px solid var(--border-strong);
      background: rgba(18, 45, 84, 0.55);
      padding: 0.75rem;
      position: relative;
    }

    .drafting-inner {
      border: 1px solid var(--border);
      padding: 1rem;
    }

    .sheet-banner {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: baseline;
      gap: 0.75rem;
      padding-bottom: 0.85rem;
      margin-bottom: 1rem;
      border-bottom: 1px solid var(--border);
    }

    .sheet-banner h1 {
      margin: 0;
      font-size: clamp(1.35rem, 2.5vw, 1.95rem);
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }

    .sheet-banner .sub {
      font-family: var(--font-mono);
      font-size: 0.74rem;
      color: var(--muted);
    }

    /* Main Workspace Grid */
    .workspace {
      display: grid;
      grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.85fr);
      gap: 1rem;
      align-items: start;
    }

    /* Orthographic PCB Viewport */
    .pcb-frame {
      background: var(--canvas);
      border: 1.5px solid var(--border-strong);
      position: relative;
    }

    .zone-bar {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      border-bottom: 1px solid var(--border);
      font-family: var(--font-mono);
      font-size: 0.65rem;
      color: var(--muted);
      text-align: center;
      padding: 0.2rem 0;
      user-select: none;
    }

    .pcb-svg-wrap {
      position: relative;
      width: 100%;
      overflow: hidden;
    }

    .pcb-svg {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 16 / 10;
    }

    .pcb-layer {
      transition: opacity 0.2s ease;
    }

    .pcb-layer.hidden {
      opacity: 0;
      pointer-events: none;
    }

    .comp-hitbox {
      cursor: pointer;
    }

    .comp-hitbox .comp-outline {
      transition: stroke 0.15s, fill 0.15s;
    }

    .comp-hitbox:hover .comp-outline {
      stroke: var(--accent);
      fill: rgba(242, 183, 5, 0.12);
    }

    .comp-hitbox.selected .comp-outline {
      stroke: var(--accent);
      stroke-width: 2.5;
      fill: rgba(242, 183, 5, 0.18);
    }

    .pcb-status-strip {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      border-top: 1px solid var(--border);
      background: var(--surface);
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--muted);
    }

    .pcb-status-strip strong {
      color: var(--accent);
    }

    /* Side Inspector */
    .side-stack {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .box {
      background: var(--surface);
      border: 1px solid var(--border-strong);
      padding: 0.9rem 1rem;
    }

    .box-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border);
      padding-bottom: 0.5rem;
      margin-bottom: 0.75rem;
    }

    .box-title {
      margin: 0;
      font-family: var(--font-mono);
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--ink);
    }

    .box-tag {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      color: var(--accent);
      border: 1px solid rgba(242, 183, 5, 0.45);
      padding: 0.1rem 0.45rem;
    }

    .layer-switches {
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
    }

    .layer-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 44px;
      padding: 0.4rem 0.65rem;
      background: var(--canvas);
      border: 1px solid var(--border);
      cursor: pointer;
      user-select: none;
    }

    .layer-row:hover {
      border-color: var(--accent);
    }

    .layer-left {
      display: flex;
      align-items: center;
      gap: 0.6rem;
    }

    .swatch {
      width: 12px;
      height: 12px;
      border: 1px solid rgba(240, 246, 255, 0.4);
    }

    .layer-code {
      font-family: var(--font-mono);
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--ink);
    }

    .layer-desc {
      font-family: var(--font-mono);
      font-size: 0.66rem;
      color: var(--muted);
    }

    .layer-row input {
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
      cursor: pointer;
    }

    /* Component Selector Pills (great for mobile tap) */
    .bom-pills {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.35rem;
      margin-bottom: 0.8rem;
    }

    .bom-pill {
      min-height: 44px;
      border: 1px solid var(--border);
      background: var(--canvas);
      color: var(--muted);
      font-family: var(--font-mono);
      font-size: 0.76rem;
      font-weight: 600;
      cursor: pointer;
    }

    .bom-pill.active {
      border-color: var(--accent);
      background: rgba(242, 183, 5, 0.16);
      color: var(--accent);
    }

    .bom-table {
      width: 100%;
      border-collapse: collapse;
      font-family: var(--font-mono);
      font-size: 0.74rem;
    }

    .bom-table tr {
      border-bottom: 1px solid var(--border);
    }

    .bom-table tr:last-child {
      border-bottom: none;
    }

    .bom-table th {
      text-align: left;
      color: var(--muted);
      font-weight: 400;
      padding: 0.42rem 0.5rem 0.42rem 0;
      width: 36%;
    }

    .bom-table td {
      color: var(--ink);
      font-weight: 500;
      padding: 0.42rem 0;
    }

    .net-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 0.3rem;
      margin-top: 0.65rem;
    }

    .net-tag {
      font-family: var(--font-mono);
      font-size: 0.66rem;
      padding: 0.18rem 0.45rem;
      background: var(--canvas);
      border: 1px solid var(--border);
      color: var(--bcu);
    }

    /* Engineering Drafting Title Block */
    .title-block {
      margin-top: 1rem;
      border: 1.5px solid var(--border-strong);
      background: var(--surface);
      display: grid;
      grid-template-columns: 2fr 1fr 1fr 1fr;
      font-family: var(--font-mono);
    }

    .tb-cell {
      padding: 0.55rem 0.75rem;
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
    }

    .tb-cell:nth-child(4n) {
      border-right: none;
    }

    .tb-label {
      display: block;
      font-size: 0.6rem;
      color: var(--muted);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 0.15rem;
    }

    .tb-value {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--ink);
    }

    .tb-value.accent {
      color: var(--accent);
    }

    @media (max-width: 980px) {
      .workspace {
        grid-template-columns: 1fr;
      }
      .title-block {
        grid-template-columns: 1fr 1fr;
      }
      .tb-cell:nth-child(2n) {
        border-right: none;
      }
    }

    @media (max-width: 720px) {
      .header-nav, .drc-badge {
        display: none;
      }
      .mobile-menu-btn {
        display: inline-flex;
      }
      .blueprint-sheet {
        padding: 0 0.6rem;
        margin-top: 0.75rem;
      }
      .drafting-border {
        padding: 0.4rem;
      }
      .drafting-inner {
        padding: 0.65rem;
      }
      .unit-btn {
        min-height: 44px;
      }
    }
  </style>
</head>
<body>
  <header class="eda-header">
    <div class="eda-header-inner">
      <a href="#pcb-canvas" class="brand">
        <svg class="brand-icon" viewBox="0 0 36 36" fill="none" aria-hidden="true">
          <rect x="2" y="2" width="32" height="32" stroke="#F0F6FF" stroke-width="1.5"/>
          <rect x="10" y="10" width="16" height="16" stroke="#F2B705" stroke-width="1.6"/>
          <path d="M14 2v8M22 2v8M14 26v8M22 26v8M2 14h8M2 22h8M26 14h8M26 22h8" stroke="#7FA4D4" stroke-width="1.4"/>
          <circle cx="14" cy="14" r="1.5" fill="#F2B705"/>
        </svg>
        <span>
          <span class="brand-title">Cyanotype EDA</span>
          <span class="brand-file">stm32h7-flight-ctrl_r4.kicad_pcb</span>
        </span>
      </a>

      <nav class="header-nav" aria-label="Primary">
        <a href="#pcb-canvas" class="active">PCB Layout</a>
        <a href="#bom-panel">BOM Inspector</a>
        <a href="#title-block">Stackup &amp; Title Block</a>
      </nav>

      <div class="header-controls">
        <div class="unit-switch" role="group" aria-label="Coordinate units">
          <button class="unit-btn active" data-unit="mm">mm</button>
          <button class="unit-btn" data-unit="mil">mil</button>
        </div>
        <span class="drc-badge">DRC: 0 ERR · 0 WARN</span>
        <button class="mobile-menu-btn" id="mobileMenuBtn" aria-expanded="false" aria-controls="mobileNavPanel" aria-label="Toggle navigation">
          <svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8">
            <path d="M3 5h14M3 10h14M3 15h14"/>
          </svg>
        </button>
      </div>
    </div>
    <div class="mobile-nav-panel" id="mobileNavPanel">
      <a href="#pcb-canvas">PCB Layout Viewport</a>
      <a href="#layer-panel">Layer Manager</a>
      <a href="#bom-panel">BOM Inspector</a>
      <a href="#title-block">Drafting Title Block</a>
    </div>
  </header>

  <main class="blueprint-sheet">
    <div class="drafting-border">
      <div class="drafting-inner">
        <div class="sheet-banner">
          <div>
            <h1>Flight Controller Mainboard — 4-Layer Reference Layout</h1>
            <span class="sub">IMPEDANCE CONTROLLED 90Ω USB DIFF PAIR · FR-4 TG170 · 1.60MM FINISHED THICKNESS</span>
          </div>
          <span class="sub">CLICK FOOTPRINTS (U1, U2, Y1, J1) TO INSPECT BOM</span>
        </div>

        <section class="workspace" id="pcb-canvas">
          <!-- Interactive PCB Blueprint SVG -->
          <div class="pcb-frame">
            <div class="zone-bar" aria-hidden="true">
              <span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span>
            </div>
            <div class="pcb-svg-wrap">
              <svg class="pcb-svg" viewBox="0 0 800 500" role="img" aria-label="Interactive 4-layer PCB schematic blueprint with toggleable copper, silkscreen, and ratsnest layers">
                <defs>
                  <pattern id="pcbGrid" width="25" height="25" patternUnits="userSpaceOnUse">
                    <path d="M 25 0 L 0 0 0 25" fill="none" stroke="rgba(127,164,212,0.16)" stroke-width="0.8"/>
                  </pattern>
                  <pattern id="pcbGridMajor" width="100" height="100" patternUnits="userSpaceOnUse">
                    <rect width="100" height="100" fill="url(#pcbGrid)"/>
                    <path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(127,164,212,0.34)" stroke-width="1"/>
                  </pattern>
                </defs>

                <!-- Orthographic Grid -->
                <rect width="800" height="500" fill="url(#pcbGridMajor)"/>

                <!-- Board Edge.Cuts Outline -->
                <rect x="65" y="48" width="670" height="404" rx="14" fill="rgba(18, 45, 84, 0.45)" stroke="#F2B705" stroke-width="2" stroke-dasharray="10 4"/>
                <!-- Mounting Holes -->
                <g stroke="#F0F6FF" stroke-width="1.5" fill="#0D2240">
                  <circle cx="95" cy="78" r="11"/><circle cx="95" cy="78" r="5" stroke="#F2B705"/>
                  <circle cx="705" cy="78" r="11"/><circle cx="705" cy="78" r="5" stroke="#F2B705"/>
                  <circle cx="95" cy="422" r="11"/><circle cx="95" cy="422" r="5" stroke="#F2B705"/>
                  <circle cx="705" cy="422" r="11"/><circle cx="705" cy="422" r="5" stroke="#F2B705"/>
                </g>

                <!-- LAYER: Back Copper (B.Cu) -->
                <g id="pcb-bcu" class="pcb-layer" fill="none" stroke="var(--bcu)" stroke-linecap="round" stroke-linejoin="round">
                  <path d="M160 220 H255 L290 185 H360" stroke-width="3.2" opacity="0.85"/>
                  <path d="M160 240 H265 L300 205 H360" stroke-width="3.2" opacity="0.85"/>
                  <path d="M465 315 V375 L515 405 H620 V330" stroke-width="3" opacity="0.85"/>
                  <path d="M485 315 V365 L525 390 H605 V330" stroke-width="3" opacity="0.85"/>
                  <path d="M510 170 H640 V215" stroke-width="4" opacity="0.75"/>
                  <!-- Vias -->
                  <g fill="#0D2240" stroke="var(--bcu)" stroke-width="2">
                    <circle cx="255" cy="220" r="4.5"/><circle cx="265" cy="240" r="4.5"/>
                    <circle cx="515" cy="405" r="4.5"/><circle cx="640" cy="170" r="4.5"/>
                  </g>
                </g>

                <!-- LAYER: Front Copper (F.Cu) -->
                <g id="pcb-fcu" class="pcb-layer" fill="none" stroke="var(--fcu)" stroke-linecap="round" stroke-linejoin="round">
                  <!-- USB-C Differential Pair (90 ohm) -->
                  <path d="M148 258 H230 L275 258 H360" stroke-width="3.2"/>
                  <path d="M148 270 H230 L275 270 H360" stroke-width="3.2"/>
                  <!-- 5V Power Bus to Regulator -->
                  <path d="M148 210 H210 L245 135 H565" stroke-width="5.5" opacity="0.9"/>
                  <!-- 3.3V Regulated Rail to MCU -->
                  <path d="M585 165 V215 L545 245 H505" stroke-width="4.5"/>
                  <!-- Crystal Matched Pair -->
                  <path d="M445 315 V362 H410" stroke-width="2.4"/>
                  <path d="M425 315 V362 H392" stroke-width="2.4"/>
                  <!-- SPI Breakout Traces -->
                  <path d="M505 268 H665" stroke-width="2.4"/>
                  <path d="M505 282 H665" stroke-width="2.4"/>
                  <path d="M505 296 H665" stroke-width="2.4"/>
                  <!-- Copper SMD Pads on MCU U1 -->
                  <g fill="var(--fcu)" stroke="none">
                    <rect x="352" y="182" width="12" height="5"/><rect x="352" y="196" width="12" height="5"/>
                    <rect x="352" y="210" width="12" height="5"/><rect x="352" y="224" width="12" height="5"/>
                    <rect x="352" y="238" width="12" height="5"/><rect x="352" y="252" width="12" height="5"/>
                    <rect x="352" y="266" width="12" height="5"/><rect x="352" y="280" width="12" height="5"/>
                    <rect x="352" y="294" width="12" height="5"/>
                    <rect x="496" y="182" width="12" height="5"/><rect x="496" y="196" width="12" height="5"/>
                    <rect x="496" y="210" width="12" height="5"/><rect x="496" y="224" width="12" height="5"/>
                    <rect x="496" y="238" width="12" height="5"/><rect x="496" y="252" width="12" height="5"/>
                    <rect x="496" y="266" width="12" height="5"/><rect x="496" y="280" width="12" height="5"/>
                    <rect x="496" y="294" width="12" height="5"/>
                  </g>
                </g>

                <!-- LAYER: Ratsnest Airwires -->
                <g id="pcb-ratsnest" class="pcb-layer" fill="none" stroke="var(--rats)" stroke-width="1.2" stroke-dasharray="4 4">
                  <line x1="430" y1="168" x2="585" y2="128"/>
                  <line x1="650" y1="268" x2="650" y2="335"/>
                  <line x1="398" y1="382" x2="290" y2="382"/>
                  <line x1="150" y1="295" x2="360" y2="295"/>
                </g>

                <!-- LAYER: Silkscreen & Reference Designators -->
                <g id="pcb-silk" class="pcb-layer" font-family="IBM Plex Mono, monospace" fill="var(--silk)">
                  <text x="125" y="78" font-size="11" fill="#7FA4D4">REV 4.2 · 67.0 x 40.4 MM</text>
                  <text x="530" y="78" font-size="11" fill="#7FA4D4">JTAG / SWD HEADER</text>
                  <!-- Header Silkscreen -->
                  <rect x="655" y="252" width="32" height="62" fill="none" stroke="var(--silk)" stroke-width="1.4"/>
                  <circle cx="671" cy="268" r="3.5" fill="var(--accent)"/>
                  <circle cx="671" cy="283" r="3.5" fill="none" stroke="var(--silk)"/>
                  <circle cx="671" cy="298" r="3.5" fill="none" stroke="var(--silk)"/>
                  <text x="657" y="245" font-size="10">J2</text>
                </g>

                <!-- Interactive Component Footprints -->
                <!-- U1: MCU -->
                <g class="comp-hitbox selected" data-comp="U1">
                  <rect class="comp-outline" x="366" y="172" width="128" height="136" rx="4" fill="rgba(13,34,64,0.85)" stroke="#F0F6FF" stroke-width="1.8"/>
                  <circle cx="380" cy="186" r="3.5" fill="#F2B705"/>
                  <text x="430" y="232" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="15" font-weight="600" fill="#F0F6FF">U1</text>
                  <text x="430" y="250" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="10" fill="#7FA4D4">STM32H743VI</text>
                  <text x="430" y="266" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="9" fill="#F2B705">LQFP-100</text>
                </g>

                <!-- U2: Buck Regulator -->
                <g class="comp-hitbox" data-comp="U2">
                  <rect class="comp-outline" x="556" y="106" width="84" height="64" rx="3" fill="rgba(13,34,64,0.85)" stroke="#F0F6FF" stroke-width="1.6"/>
                  <circle cx="567" cy="118" r="3" fill="#F2B705"/>
                  <text x="598" y="135" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="13" font-weight="600" fill="#F0F6FF">U2</text>
                  <text x="598" y="151" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="9.5" fill="#7FA4D4">TPS62130</text>
                </g>

                <!-- Y1: 25MHz Crystal -->
                <g class="comp-hitbox" data-comp="Y1">
                  <rect class="comp-outline" x="372" y="346" width="68" height="44" rx="3" fill="rgba(13,34,64,0.85)" stroke="#F0F6FF" stroke-width="1.6"/>
                  <text x="406" y="366" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="12" font-weight="600" fill="#F0F6FF">Y1</text>
                  <text x="406" y="381" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="9" fill="#7FA4D4">25.000MHz</text>
                </g>

                <!-- J1: USB-C Connector -->
                <g class="comp-hitbox" data-comp="J1">
                  <rect class="comp-outline" x="56" y="196" width="96" height="110" rx="5" fill="rgba(13,34,64,0.88)" stroke="#F0F6FF" stroke-width="1.8"/>
                  <line x1="65" y1="204" x2="65" y2="298" stroke="#F2B705" stroke-width="2"/>
                  <text x="106" y="246" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="13" font-weight="600" fill="#F0F6FF">J1</text>
                  <text x="106" y="263" text-anchor="middle" font-family="IBM Plex Mono, monospace" font-size="9.5" fill="#7FA4D4">USB-C 16P</text>
                </g>
              </svg>
            </div>
            <div class="pcb-status-strip">
              <span>GRID: <strong id="gridStatus">1.27 mm</strong></span>
              <span>ORIGIN: <strong>X:0.00 Y:0.00</strong></span>
              <span>ACTIVE NETS: <strong>48 ROUTED / 4 AIRWIRES</strong></span>
            </div>
          </div>

          <!-- Side Panels -->
          <aside class="side-stack">
            <div class="box" id="layer-panel">
              <div class="box-head">
                <h2 class="box-title">Layer Visibility</h2>
                <span class="box-tag" id="layerBadge">4 / 4 ON</span>
              </div>
              <div class="layer-switches">
                <label class="layer-row">
                  <span class="layer-left">
                    <span class="swatch" style="background: var(--fcu);"></span>
                    <span>
                      <span class="layer-code">F.Cu</span><br>
                      <span class="layer-desc">Front Copper · 1 oz · Signal/PWR</span>
                    </span>
                  </span>
                  <input type="checkbox" data-layer="pcb-fcu" checked>
                </label>

                <label class="layer-row">
                  <span class="layer-left">
                    <span class="swatch" style="background: var(--bcu);"></span>
                    <span>
                      <span class="layer-code">B.Cu</span><br>
                      <span class="layer-desc">Back Copper · 1 oz · Return/SPI</span>
                    </span>
                  </span>
                  <input type="checkbox" data-layer="pcb-bcu" checked>
                </label>

                <label class="layer-row">
                  <span class="layer-left">
                    <span class="swatch" style="background: var(--silk);"></span>
                    <span>
                      <span class="layer-code">F.SilkS</span><br>
                      <span class="layer-desc">Front Silkscreen · Legend &amp; Pin-1</span>
                    </span>
                  </span>
                  <input type="checkbox" data-layer="pcb-silk" checked>
                </label>

                <label class="layer-row">
                  <span class="layer-left">
                    <span class="swatch" style="background: var(--rats);"></span>
                    <span>
                      <span class="layer-code">Ratsnest</span><br>
                      <span class="layer-desc">Unrouted Airwires · 4 remaining</span>
                    </span>
                  </span>
                  <input type="checkbox" data-layer="pcb-ratsnest" checked>
                </label>
              </div>
            </div>

            <div class="box" id="bom-panel" aria-live="polite">
              <div class="box-head">
                <h2 class="box-title">Component BOM Inspector</h2>
                <span class="box-tag" id="bomRefTag">U1</span>
              </div>

              <div class="bom-pills" role="tablist" aria-label="Select PCB component">
                <button class="bom-pill active" data-comp="U1">U1</button>
                <button class="bom-pill" data-comp="U2">U2</button>
                <button class="bom-pill" data-comp="Y1">Y1</button>
                <button class="bom-pill" data-comp="J1">J1</button>
              </div>

              <table class="bom-table">
                <tbody>
                  <tr><th>Part Role</th><td id="bomRole">32-Bit ARM Cortex-M7 MCU</td></tr>
                  <tr><th>MPN</th><td id="bomMpn">STM32H743VIT6</td></tr>
                  <tr><th>Package</th><td id="bomPkg">LQFP-100 (14×14mm)</td></tr>
                  <tr><th>Position</th><td id="bomPos">X: 36.50 mm, Y: 24.00 mm</td></tr>
                  <tr><th>Spec Note</th><td id="bomNote">480 MHz, 2MB Flash, 1MB RAM</td></tr>
                </tbody>
              </table>

              <div class="net-tags" id="bomNets">
                <span class="net-tag">+3V3_MCU</span>
                <span class="net-tag">USB_D+</span>
                <span class="net-tag">USB_D-</span>
                <span class="net-tag">HSE_IN</span>
                <span class="net-tag">SPI1_SCK</span>
              </div>
            </div>
          </aside>
        </section>

        <!-- Authentic Drafting Title Block -->
        <footer class="title-block" id="title-block">
          <div class="tb-cell">
            <span class="tb-label">Drawing Title</span>
            <span class="tb-value">STM32H7 AUTOPILOT CARRIER — MAINBOARD PCB</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Drawing No.</span>
            <span class="tb-value accent">DWG-4092-A</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Revision</span>
            <span class="tb-value">REV 4.2</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Scale / Sheet</span>
            <span class="tb-value">2:1 · SHEET 1 OF 1</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Layer Stackup</span>
            <span class="tb-value">4L: F.Cu / In1.GND / In2.PWR / B.Cu (1.6mm FR-4)</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Min Trace / Space</span>
            <span class="tb-value">0.127 mm / 0.127 mm</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Drawn By</span>
            <span class="tb-value">E. VANCE</span>
          </div>
          <div class="tb-cell">
            <span class="tb-label">Tolerance</span>
            <span class="tb-value">ISO 2768-mK (±0.05mm)</span>
          </div>
        </footer>
      </div>
    </div>
  </main>

  <script>
    const BOM_DATA = {
      U1: {
        role: "32-Bit ARM Cortex-M7 MCU",
        mpn: "STM32H743VIT6",
        pkg: "LQFP-100 (14×14mm)",
        xMm: 36.50,
        yMm: 24.00,
        note: "480 MHz, 2MB Flash, 1MB RAM, 3.3V",
        nets: ["+3V3_MCU", "USB_D+", "USB_D-", "HSE_IN", "SPI1_SCK"]
      },
      U2: {
        role: "Synchronous Step-Down Buck",
        mpn: "TPS62130RGTR",
        pkg: "VQFN-16 (3×3mm)",
        xMm: 53.30,
        yMm: 13.80,
        note: "3V–17V In, 3.3V @ 3A Out, 2.5MHz SW",
        nets: ["+5V_VBUS", "+3V3_MCU", "SW_NODE", "PG_3V3", "GND"]
      },
      Y1: {
        role: "25.000 MHz Quartz Crystal",
        mpn: "ABM8G-25.000MHZ-4Y",
        pkg: "SMD-3225 (4-Pad)",
        xMm: 34.10,
        yMm: 36.80,
        note: "±10 ppm, 18 pF Load, Guard Ring GND",
        nets: ["HSE_IN", "HSE_OUT", "GND_GUARD"]
      },
      J1: {
        role: "USB Type-C 16-Pin Receptacle",
        mpn: "USB4105-GF-A",
        pkg: "Mid-Mount SMD + 4 TH Tabs",
        xMm: 4.10,
        yMm: 25.10,
        note: "5.1kΩ CC Pull-downs, 90Ω Diff Pair",
        nets: ["+5V_VBUS", "USB_D+", "USB_D-", "CC1", "CC2", "SHIELD"]
      }
    };

    let activeComp = "U1";
    let currentUnit = "mm";

    function formatCoord(mm) {
      if (currentUnit === "mil") {
        return (mm * 39.3701).toFixed(0) + " mil";
      }
      return mm.toFixed(2) + " mm";
    }

    function renderBom() {
      const item = BOM_DATA[activeComp];
      document.getElementById("bomRefTag").textContent = activeComp;
      document.getElementById("bomRole").textContent = item.role;
      document.getElementById("bomMpn").textContent = item.mpn;
      document.getElementById("bomPkg").textContent = item.pkg;
      document.getElementById("bomPos").textContent = `X: ${formatCoord(item.xMm)}, Y: ${formatCoord(item.yMm)}`;
      document.getElementById("bomNote").textContent = item.note;
      document.getElementById("bomNets").innerHTML = item.nets
        .map(n => `<span class="net-tag">${n}</span>`)
        .join("");

      document.querySelectorAll(".comp-hitbox").forEach(el => {
        el.classList.toggle("selected", el.dataset.comp === activeComp);
      });
      document.querySelectorAll(".bom-pill").forEach(btn => {
        btn.classList.toggle("active", btn.dataset.comp === activeComp);
      });
    }

    document.querySelectorAll(".comp-hitbox, .bom-pill").forEach(el => {
      el.addEventListener("click", () => {
        activeComp = el.dataset.comp;
        renderBom();
      });
    });

    // Unit toggle
    document.querySelectorAll(".unit-btn").forEach(btn => {
      btn.addEventListener("click", () => {
        currentUnit = btn.dataset.unit;
        document.querySelectorAll(".unit-btn").forEach(b => b.classList.toggle("active", b === btn));
        document.getElementById("gridStatus").textContent = currentUnit === "mm" ? "1.27 mm" : "50 mil";
        renderBom();
      });
    });

    // Layer visibility switches
    const layerInputs = document.querySelectorAll('.layer-row input[type="checkbox"]');
    function updateLayerBadge() {
      const on = Array.from(layerInputs).filter(i => i.checked).length;
      document.getElementById("layerBadge").textContent = `${on} / ${layerInputs.length} ON`;
    }
    layerInputs.forEach(input => {
      input.addEventListener("change", () => {
        const g = document.getElementById(input.dataset.layer);
        if (g) g.classList.toggle("hidden", !input.checked);
        updateLayerBadge();
      });
    });

    // Mobile menu
    const mobileMenuBtn = document.getElementById("mobileMenuBtn");
    const mobileNavPanel = document.getElementById("mobileNavPanel");
    mobileMenuBtn.addEventListener("click", () => {
      const isOpen = mobileNavPanel.classList.toggle("open");
      mobileMenuBtn.setAttribute("aria-expanded", String(isOpen));
    });

    renderBom();
  </script>
</body>
</html>
```
