{
  "id": 140,
  "slug": "parametric-product-configurator",
  "name": "Parametric Product Configurator",
  "kind": "ui",
  "family": "Commerce & Hardware",
  "sourceSite": {
    "name": "System76",
    "url": "https://system76.com/",
    "verifiedStatus": 200
  },
  "tagline": "Hardware build configurator with a live-updating SVG chassis schematic, dynamic price/TDP gauges, and a sticky mobile summary bar.",
  "whyUnique": "Links every hardware component choice (Chassis, CPU, GPU, RAM, Storage) directly to a parametric SVG workstation diagram, thermal/wattage budget, benchmark bars, and instant price delta.",
  "theme": "dark",
  "mobileStrength": "high",
  "tags": [
    "configurator",
    "parametric-ui",
    "live-pricing",
    "hardware",
    "ecommerce",
    "interactive-svg"
  ],
  "bestFor": [
    "Custom hardware, PC, and bike configurators",
    "Automotive and industrial equipment builders",
    "Modular SaaS plan and compute calculators",
    "Bespoke furniture and architectural configurators"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#111317",
      "name": "Anodized Graphite"
    },
    {
      "role": "surface",
      "hex": "#1A1D24",
      "name": "Machined Slate"
    },
    {
      "role": "ink",
      "hex": "#F3F4F6",
      "name": "Brushed Aluminum"
    },
    {
      "role": "accent",
      "hex": "#F59E0B",
      "name": "Copper Amber"
    },
    {
      "role": "muted",
      "hex": "#9CA3AF",
      "name": "Titanium Gray"
    }
  ],
  "typography": {
    "display": "Inter",
    "body": "Inter",
    "mono": "JetBrains Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap",
    "scaleNotes": "28px tabular-nums total price, 14px option titles, 12px mono price deltas (+$240) and TDP wattage readouts."
  },
  "layoutNotes": "Sticky left parametric SVG preview + live spec gauges paired with a scrollable right configuration stack on desktop; top schematic + sticky bottom price/spec drawer on mobile.",
  "interactionNotes": "Selecting any tier visually updates the workstation SVG (chassis finish, GPU fan array, RAM sticks, NVMe bays), recalculates total price, wattage, and compute/render score bars.",
  "mobileNotes": "Pins a persistent bottom summary bar showing live total price and an expandable Spec Sheet button so shoppers never lose sight of cost while scrolling options.",
  "agentGuardrails": {
    "do": [
      "Display explicit relative price deltas (+$200 / Included) on every option card.",
      "Keep the live total price continuously visible via a sticky sidebar on desktop and sticky bottom bar on mobile.",
      "Reflect configuration changes immediately in both the visual preview and technical spec gauges."
    ],
    "dont": [
      "Never force users to scroll back to the top to see how a selection affected total price.",
      "Avoid disabling incompatible options silently without explaining why."
    ]
  },
  "demoFile": "demos/parametric-product-configurator.html",
  "thumbDesktop": "thumbs/parametric-product-configurator-desktop.webp",
  "thumbMobile": "thumbs/parametric-product-configurator-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/parametric-product-configurator",
    "markdown": "https://templates.michaelpitts.net/t/parametric-product-configurator.md",
    "api": "https://templates.michaelpitts.net/api/templates/parametric-product-configurator",
    "demo": "https://templates.michaelpitts.net/demos/parametric-product-configurator.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/parametric-product-configurator-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/parametric-product-configurator-mobile.webp"
  },
  "agentPrompt": "Design & build using template #140 \"Parametric Product Configurator\" (ui / Commerce & Hardware, dark theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/parametric-product-configurator.md\nLive demo: https://templates.michaelpitts.net/demos/parametric-product-configurator.html\nReal-world inspiration: System76 (https://system76.com/)\n\nCore aesthetic: Links every hardware component choice (Chassis, CPU, GPU, RAM, Storage) directly to a parametric SVG workstation diagram, thermal/wattage budget, benchmark bars, and instant price delta.\nPalette: canvas: #111317 (Anodized Graphite), surface: #1A1D24 (Machined Slate), ink: #F3F4F6 (Brushed Aluminum), accent: #F59E0B (Copper Amber), muted: #9CA3AF (Titanium Gray)\nTypography: Display=\"Inter\", Body=\"Inter\", Mono=\"JetBrains Mono\"\nLayout: Sticky left parametric SVG preview + live spec gauges paired with a scrollable right configuration stack on desktop; top schematic + sticky bottom price/spec drawer on mobile.\nInteractions: Selecting any tier visually updates the workstation SVG (chassis finish, GPU fan array, RAM sticks, NVMe bays), recalculates total price, wattage, and compute/render score bars.\nMobile: Pins a persistent bottom summary bar showing live total price and an expandable Spec Sheet button so shoppers never lose sight of cost while scrolling options.\n\nGuardrails:\n- DO: Display explicit relative price deltas (+$200 / Included) on every option card.\n- DO: Keep the live total price continuously visible via a sticky sidebar on desktop and sticky bottom bar on mobile.\n- DO: Reflect configuration changes immediately in both the visual preview and technical spec gauges.\n- DON'T: Never force users to scroll back to the top to see how a selection affected total price.\n- DON'T: Avoid disabling incompatible options silently without explaining why.",
  "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>Kestrel Works — Parametric Workstation Configurator</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link href=\"https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap\" rel=\"stylesheet\">\n<style>\n  :root {\n    --bg: #111316;\n    --panel: #191c21;\n    --panel-2: #20242b;\n    --border: #2c313a;\n    --ink: #f1f3f5;\n    --muted: #9aa3b0;\n    --copper: #e07a3f;\n    --copper-soft: rgba(224, 122, 63, 0.14);\n    --copper-hi: #f29a63;\n    --teal: #38bdf8;\n    --ok: #34d399;\n    --warn: #f59e0b;\n  }\n  * { box-sizing: border-box; margin: 0; padding: 0; }\n  html, body { overflow-x: hidden; }\n  body {\n    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;\n    background: radial-gradient(circle at 20% 0%, #1d2128 0%, var(--bg) 55%);\n    color: var(--ink);\n    min-height: 100vh;\n    padding-bottom: 92px;\n  }\n  .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }\n\n  .shell {\n    max-width: 1260px;\n    margin: 0 auto;\n    padding: 20px 20px 40px;\n  }\n  header.top {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    padding-bottom: 18px;\n    border-bottom: 1px solid var(--border);\n    margin-bottom: 22px;\n  }\n  .logo {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n  }\n  .logo-badge {\n    width: 40px;\n    height: 40px;\n    border-radius: 8px;\n    border: 1.5px solid var(--copper);\n    background: var(--copper-soft);\n    display: grid;\n    place-items: center;\n    color: var(--copper-hi);\n    font-weight: 700;\n    font-size: 16px;\n  }\n  .logo h1 { font-size: 20px; letter-spacing: -0.02em; }\n  .logo p { font-size: 12.5px; color: var(--muted); }\n\n  .presets {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 8px;\n  }\n  .preset-btn {\n    min-height: 44px;\n    padding: 0 14px;\n    border-radius: 8px;\n    border: 1px solid var(--border);\n    background: var(--panel);\n    color: var(--muted);\n    font: inherit;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s;\n  }\n  .preset-btn:hover { border-color: var(--copper); color: var(--ink); }\n  .preset-btn.active {\n    background: var(--copper-soft);\n    border-color: var(--copper);\n    color: var(--copper-hi);\n  }\n\n  .grid {\n    display: grid;\n    grid-template-columns: 1.05fr 1fr;\n    gap: 22px;\n    align-items: start;\n  }\n\n  /* Left sticky schematic & telemetry */\n  .stage-col {\n    position: sticky;\n    top: 20px;\n    display: flex;\n    flex-direction: column;\n    gap: 16px;\n  }\n  .schematic-card {\n    background: var(--panel);\n    border: 1px solid var(--border);\n    border-radius: 16px;\n    padding: 18px;\n    position: relative;\n    overflow: hidden;\n  }\n  .schematic-head {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 12px;\n  }\n  .schematic-head .tag {\n    font-size: 11px;\n    letter-spacing: 0.08em;\n    text-transform: uppercase;\n    color: var(--copper-hi);\n    background: var(--copper-soft);\n    padding: 4px 9px;\n    border-radius: 6px;\n  }\n  .schematic-head .sku { font-size: 12px; color: var(--muted); }\n  .svg-wrap {\n    width: 100%;\n    aspect-ratio: 16 / 10;\n    background: #121519;\n    border: 1px solid #262b33;\n    border-radius: 12px;\n    display: grid;\n    place-items: center;\n    padding: 10px;\n  }\n  .svg-wrap svg { width: 100%; height: 100%; max-height: 310px; }\n\n  .gauges {\n    display: grid;\n    grid-template-columns: repeat(3, 1fr);\n    gap: 10px;\n    margin-top: 14px;\n  }\n  .gauge {\n    background: var(--panel-2);\n    border: 1px solid var(--border);\n    border-radius: 12px;\n    padding: 12px;\n  }\n  .gauge-label {\n    font-size: 11px;\n    text-transform: uppercase;\n    letter-spacing: 0.06em;\n    color: var(--muted);\n    margin-bottom: 4px;\n  }\n  .gauge-val {\n    font-size: 20px;\n    font-weight: 700;\n    font-variant-numeric: tabular-nums;\n  }\n  .gauge-bar {\n    height: 6px;\n    border-radius: 99px;\n    background: #2b303a;\n    margin-top: 8px;\n    overflow: hidden;\n  }\n  .gauge-fill {\n    height: 100%;\n    border-radius: 99px;\n    transition: width 0.3s ease, background 0.3s ease;\n  }\n\n  .spec-sheet {\n    background: var(--panel);\n    border: 1px solid var(--border);\n    border-radius: 16px;\n    padding: 16px 18px;\n  }\n  .spec-sheet h2 {\n    font-size: 13px;\n    text-transform: uppercase;\n    letter-spacing: 0.08em;\n    color: var(--muted);\n    margin-bottom: 12px;\n    display: flex;\n    justify-content: space-between;\n  }\n  .spec-list {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n  }\n  .spec-row {\n    display: flex;\n    justify-content: space-between;\n    gap: 12px;\n    font-size: 13px;\n    padding-bottom: 8px;\n    border-bottom: 1px dashed #282d36;\n  }\n  .spec-row:last-child { border-bottom: none; padding-bottom: 0; }\n  .spec-row span:first-child { color: var(--muted); }\n  .spec-row span:last-child { text-align: right; font-weight: 500; }\n\n  .desktop-cta {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 14px;\n    margin-top: 14px;\n    padding-top: 14px;\n    border-top: 1px solid var(--border);\n  }\n  .price-big {\n    font-size: 28px;\n    font-weight: 700;\n    letter-spacing: -0.02em;\n  }\n  .price-sub { font-size: 12px; color: var(--muted); }\n  .btn-order {\n    min-height: 48px;\n    padding: 0 22px;\n    border-radius: 10px;\n    border: none;\n    background: linear-gradient(135deg, var(--copper), #c85f26);\n    color: #fff;\n    font: inherit;\n    font-size: 14.5px;\n    font-weight: 700;\n    cursor: pointer;\n    transition: transform 0.12s, filter 0.15s;\n  }\n  .btn-order:hover { filter: brightness(1.08); }\n  .btn-order:active { transform: scale(0.98); }\n\n  /* Right options column */\n  .controls-col {\n    display: flex;\n    flex-direction: column;\n    gap: 16px;\n  }\n  .group {\n    background: var(--panel);\n    border: 1px solid var(--border);\n    border-radius: 16px;\n    padding: 16px;\n  }\n  .group-head {\n    display: flex;\n    justify-content: space-between;\n    align-items: baseline;\n    margin-bottom: 12px;\n  }\n  .group-head h3 {\n    font-size: 15px;\n    font-weight: 600;\n  }\n  .group-head span {\n    font-size: 12px;\n    color: var(--muted);\n  }\n  .options {\n    display: grid;\n    grid-template-columns: 1fr;\n    gap: 8px;\n  }\n  .options.two-col {\n    grid-template-columns: repeat(2, 1fr);\n  }\n  .opt-card {\n    min-height: 56px;\n    text-align: left;\n    padding: 12px 14px;\n    border-radius: 11px;\n    border: 1.5px solid var(--border);\n    background: var(--panel-2);\n    color: var(--ink);\n    font: inherit;\n    cursor: pointer;\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    gap: 10px;\n    transition: border-color 0.15s, background 0.15s;\n  }\n  .opt-card:hover { border-color: #4a5260; }\n  .opt-card.selected {\n    border-color: var(--copper);\n    background: linear-gradient(135deg, rgba(224, 122, 63, 0.14), rgba(224, 122, 63, 0.04));\n  }\n  .opt-title { font-size: 14px; font-weight: 600; }\n  .opt-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }\n  .opt-price {\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--copper-hi);\n    white-space: nowrap;\n  }\n\n  /* Mobile sticky summary bar */\n  .mobile-bar {\n    display: none;\n    position: fixed;\n    left: 0; right: 0; bottom: 0;\n    background: rgba(20, 23, 28, 0.96);\n    backdrop-filter: blur(10px);\n    border-top: 1px solid var(--border);\n    padding: 10px 14px;\n    z-index: 40;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n  }\n  .toast {\n    position: fixed;\n    top: 18px;\n    right: 18px;\n    background: #1d2a24;\n    border: 1px solid var(--ok);\n    color: #d1fae5;\n    padding: 12px 16px;\n    border-radius: 10px;\n    font-size: 13.5px;\n    font-weight: 500;\n    box-shadow: 0 10px 30px rgba(0,0,0,0.4);\n    opacity: 0;\n    transform: translateY(-10px);\n    pointer-events: none;\n    transition: all 0.25s ease;\n    z-index: 60;\n  }\n  .toast.show { opacity: 1; transform: translateY(0); }\n\n  @media (max-width: 900px) {\n    .grid { grid-template-columns: 1fr; }\n    .stage-col { position: static; }\n    .desktop-cta { display: none; }\n    .mobile-bar { display: flex; }\n  }\n  @media (max-width: 480px) {\n    .shell { padding: 14px 12px 24px; }\n    .gauges { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }\n    .gauge { padding: 9px; }\n    .gauge-val { font-size: 16px; }\n    .options.two-col { grid-template-columns: 1fr; }\n  }\n</style>\n</head>\n<body>\n<div class=\"shell\">\n  <header class=\"top\">\n    <div class=\"logo\">\n      <div class=\"logo-badge mono\">K7</div>\n      <div>\n        <h1>Kestrel R7 Workstation</h1>\n        <p>Hand-assembled Linux &amp; AI compute tower · Boulder, CO</p>\n      </div>\n    </div>\n    <div class=\"presets\" id=\"presetBar\">\n      <button class=\"preset-btn active\" data-preset=\"dev\">Kernel Dev</button>\n      <button class=\"preset-btn\" data-preset=\"ml\">Local LLM Rig</button>\n      <button class=\"preset-btn\" data-preset=\"render\">3D Render Node</button>\n    </div>\n  </header>\n\n  <div class=\"grid\">\n    <div class=\"stage-col\">\n      <section class=\"schematic-card\">\n        <div class=\"schematic-head\">\n          <span class=\"tag mono\" id=\"chassisTag\">ANODIZED GRAPHITE</span>\n          <span class=\"sku mono\" id=\"skuLabel\">K7-TR32-4090-128</span>\n        </div>\n        <div class=\"svg-wrap\">\n          <svg id=\"rigSvg\" viewBox=\"0 0 560 340\" role=\"img\" aria-label=\"Interactive workstation internal schematic\">\n            <defs>\n              <pattern id=\"gridPat\" width=\"20\" height=\"20\" patternUnits=\"userSpaceOnUse\">\n                <path d=\"M 20 0 L 0 0 0 20\" fill=\"none\" stroke=\"#1e232b\" stroke-width=\"1\"/>\n              </pattern>\n            </defs>\n            <rect width=\"560\" height=\"340\" fill=\"url(#gridPat)\"/>\n            <!-- Chassis Frame -->\n            <rect id=\"svgChassis\" x=\"34\" y=\"24\" width=\"492\" height=\"292\" rx=\"14\" fill=\"#181c22\" stroke=\"#525b68\" stroke-width=\"3\"/>\n            <rect id=\"svgAccent\" x=\"34\" y=\"24\" width=\"12\" height=\"292\" rx=\"4\" fill=\"#e07a3f\"/>\n            <!-- Front Intake Fans -->\n            <g id=\"svgFans\" transform=\"translate(465, 50)\">\n              <circle cx=\"22\" cy=\"36\" r=\"24\" fill=\"#121519\" stroke=\"#3a414c\" stroke-width=\"2\"/>\n              <circle cx=\"22\" cy=\"36\" r=\"8\" fill=\"#e07a3f\" opacity=\"0.8\"/>\n              <circle cx=\"22\" cy=\"116\" r=\"24\" fill=\"#121519\" stroke=\"#3a414c\" stroke-width=\"2\"/>\n              <circle cx=\"22\" cy=\"116\" r=\"8\" fill=\"#e07a3f\" opacity=\"0.8\"/>\n              <circle cx=\"22\" cy=\"196\" r=\"24\" fill=\"#121519\" stroke=\"#3a414c\" stroke-width=\"2\"/>\n              <circle cx=\"22\" cy=\"196\" r=\"8\" fill=\"#e07a3f\" opacity=\"0.8\"/>\n            </g>\n            <!-- Motherboard -->\n            <rect x=\"64\" y=\"42\" width=\"376\" height=\"256\" rx=\"8\" fill=\"#1f242c\" stroke=\"#333a45\" stroke-width=\"1.5\"/>\n            <!-- CPU Socket & Cooler -->\n            <g id=\"svgCpu\" transform=\"translate(110, 62)\">\n              <rect width=\"108\" height=\"96\" rx=\"8\" fill=\"#272d38\" stroke=\"#e07a3f\" stroke-width=\"2\"/>\n              <rect x=\"14\" y=\"14\" width=\"80\" height=\"68\" rx=\"4\" fill=\"#16191f\" stroke=\"#47505e\"/>\n              <text id=\"svgCpuText\" x=\"54\" y=\"46\" text-anchor=\"middle\" fill=\"#f1f3f5\" font-family=\"IBM Plex Mono, monospace\" font-size=\"11\" font-weight=\"600\">24-CORE</text>\n              <text id=\"svgCpuSub\" x=\"54\" y=\"63\" text-anchor=\"middle\" fill=\"#e07a3f\" font-family=\"IBM Plex Mono, monospace\" font-size=\"9\">THREADRIPPER</text>\n            </g>\n            <!-- RAM DIMM Slots (up to 8 sticks) -->\n            <g id=\"svgRam\" transform=\"translate(238, 62)\"></g>\n            <!-- NVMe Storage Bays -->\n            <g id=\"svgStorage\" transform=\"translate(344, 62)\"></g>\n            <!-- GPU Slots -->\n            <g id=\"svgGpu\" transform=\"translate(88, 184)\"></g>\n            <!-- PSU Shroud -->\n            <rect x=\"64\" y=\"264\" width=\"376\" height=\"34\" rx=\"5\" fill=\"#15181d\" stroke=\"#2e343f\"/>\n            <text id=\"svgPsuText\" x=\"252\" y=\"285\" text-anchor=\"middle\" fill=\"#9aa3b0\" font-family=\"IBM Plex Mono, monospace\" font-size=\"11\">1000W TITANIUM PSU · 48% LOAD</text>\n          </svg>\n        </div>\n\n        <div class=\"gauges\">\n          <div class=\"gauge\">\n            <div class=\"gauge-label\">Compute Score</div>\n            <div class=\"gauge-val mono\" id=\"gScore\">0</div>\n            <div class=\"gauge-bar\"><div class=\"gauge-fill\" id=\"barScore\" style=\"width:0%;background:var(--copper)\"></div></div>\n          </div>\n          <div class=\"gauge\">\n            <div class=\"gauge-label\">Peak Draw</div>\n            <div class=\"gauge-val mono\" id=\"gWatts\">0W</div>\n            <div class=\"gauge-bar\"><div class=\"gauge-fill\" id=\"barWatts\" style=\"width:0%;background:var(--teal)\"></div></div>\n          </div>\n          <div class=\"gauge\">\n            <div class=\"gauge-label\">Acoustics</div>\n            <div class=\"gauge-val mono\" id=\"gNoise\">24 dBA</div>\n            <div class=\"gauge-bar\"><div class=\"gauge-fill\" id=\"barNoise\" style=\"width:0%;background:var(--ok)\"></div></div>\n          </div>\n        </div>\n      </section>\n\n      <section class=\"spec-sheet\">\n        <h2><span>Live Spec Sheet</span><span class=\"mono\" id=\"shipLead\">Ships in 5 days</span></h2>\n        <div class=\"spec-list\" id=\"specList\"></div>\n        <div class=\"desktop-cta\">\n          <div>\n            <div class=\"price-big mono\" id=\"desktopPrice\">$0</div>\n            <div class=\"price-sub\">Includes 3-year US hardware warranty</div>\n          </div>\n          <button class=\"btn-order\" id=\"orderBtnDesktop\">Save Build &amp; Quote</button>\n        </div>\n      </section>\n    </div>\n\n    <div class=\"controls-col\" id=\"controlsCol\"></div>\n  </div>\n</div>\n\n<div class=\"mobile-bar\">\n  <div>\n    <div class=\"mono\" style=\"font-size:20px;font-weight:700\" id=\"mobilePrice\">$0</div>\n    <div style=\"font-size:11.5px;color:var(--muted)\" id=\"mobileSummary\">0W · Score 0</div>\n  </div>\n  <button class=\"btn-order\" id=\"orderBtnMobile\">Save Quote</button>\n</div>\n\n<div class=\"toast\" id=\"toast\" role=\"status\" aria-live=\"polite\"></div>\n\n<script>\n(() => {\n  const CATALOG = [\n    {\n      key: 'chassis',\n      title: 'Chassis Finish',\n      hint: 'CNC milled aluminum',\n      twoCol: true,\n      options: [\n        { id: 'graphite', name: 'Anodized Graphite', sub: 'Bead-blasted slate · copper accent', price: 0, watts: 15, score: 0, fill: '#181c22', stroke: '#525b68', accent: '#e07a3f', tag: 'ANODIZED GRAPHITE' },\n        { id: 'walnut', name: 'Charred Walnut Front', sub: 'Acoustic timber slats · brass trim', price: 180, watts: 15, score: 0, fill: '#221c18', stroke: '#8c6244', accent: '#d9a05b', tag: 'WALNUT EDITION' }\n      ]\n    },\n    {\n      key: 'cpu',\n      title: 'Processor (CPU)',\n      hint: 'Socket sTR5 · ECC ready',\n      options: [\n        { id: 'tr24', name: 'Threadripper 7960X', sub: '24 Cores / 48 Threads · 5.3 GHz', price: 1490, watts: 280, score: 62, short: '24-CORE', sku: 'TR24' },\n        { id: 'tr32', name: 'Threadripper 7970X', sub: '32 Cores / 64 Threads · 5.3 GHz', price: 2490, watts: 330, score: 82, short: '32-CORE', sku: 'TR32' },\n        { id: 'tr64', name: 'Threadripper PRO 7985WX', sub: '64 Cores / 128 Threads · 256MB L3', price: 4890, watts: 350, score: 100, short: '64-CORE', sku: 'TR64' }\n      ]\n    },\n    {\n      key: 'gpu',\n      title: 'Graphics & AI Compute (GPU)',\n      hint: 'PCIe 5.0 x16',\n      options: [\n        { id: 'rtx4070', name: '1× RTX 4070 Ti Super', sub: '16 GB GDDR6X · Quiet dual-fan', price: 820, watts: 285, score: 48, cards: 1, vram: '16GB', sku: '4070S' },\n        { id: 'rtx4090', name: '1× RTX 4090 Workstation', sub: '24 GB GDDR6X · Blower vapor chamber', price: 1890, watts: 450, score: 78, cards: 1, vram: '24GB', sku: '4090' },\n        { id: 'dual4090', name: '2× RTX 4090 NV-Link Pair', sub: '48 GB Total VRAM · Local 70B models', price: 3780, watts: 860, score: 100, cards: 2, vram: '48GB', sku: '2X4090' }\n      ]\n    },\n    {\n      key: 'ram',\n      title: 'ECC DDR5 Memory',\n      hint: '4800 MT/s Registered',\n      twoCol: true,\n      options: [\n        { id: '64g', name: '64 GB (2×32)', sub: 'Dual channel ECC', price: 260, watts: 24, score: 35, sticks: 2, sku: '64G' },\n        { id: '128g', name: '128 GB (4×32)', sub: 'Quad channel ECC', price: 520, watts: 42, score: 65, sticks: 4, sku: '128G' },\n        { id: '256g', name: '256 GB (8×32)', sub: 'Full 8-DIMM bank', price: 1080, watts: 74, score: 90, sticks: 8, sku: '256G' },\n        { id: '512g', name: '512 GB (8×64)', sub: 'Max dataset capacity', price: 2240, watts: 92, score: 100, sticks: 8, sku: '512G' }\n      ]\n    },\n    {\n      key: 'storage',\n      title: 'NVMe PCIe 5.0 Storage',\n      hint: 'Up to 14 GB/s sequential',\n      twoCol: true,\n      options: [\n        { id: '2tb', name: '2 TB Gen5 NVMe', sub: '1× M.2 drive', price: 220, watts: 10, score: 45, drives: 1 },\n        { id: '4tb', name: '4 TB (2×2 TB RAID)', sub: '2× M.2 mirrored', price: 460, watts: 18, score: 70, drives: 2 },\n        { id: '8tb', name: '8 TB (2×4 TB)', sub: '2× M.2 scratch + OS', price: 890, watts: 22, score: 88, drives: 2 },\n        { id: '12tb', name: '12 TB (3×4 TB)', sub: '3× M.2 full bay', price: 1320, watts: 30, score: 100, drives: 3 }\n      ]\n    }\n  ];\n\n  const PRESETS = {\n    dev: { chassis: 'graphite', cpu: 'tr24', gpu: 'rtx4070', ram: '64g', storage: '2tb' },\n    ml: { chassis: 'graphite', cpu: 'tr32', gpu: 'dual4090', ram: '256g', storage: '8tb' },\n    render: { chassis: 'walnut', cpu: 'tr64', gpu: 'rtx4090', ram: '128g', storage: '12tb' }\n  };\n\n  const BASE_PRICE = 680; // Motherboard, chassis base, liquid cooler, Linux OS\n  let state = { ...PRESETS.dev };\n\n  const controlsCol = document.getElementById('controlsCol');\n  const specList = document.getElementById('specList');\n\n  function getOpt(key) {\n    const group = CATALOG.find(g => g.key === key);\n    return group.options.find(o => o.id === state[key]);\n  }\n\n  function renderControls() {\n    controlsCol.innerHTML = '';\n    CATALOG.forEach(group => {\n      const sec = document.createElement('section');\n      sec.className = 'group';\n      sec.innerHTML = `<div class=\"group-head\"><h3>${group.title}</h3><span>${group.hint}</span></div>`;\n      const grid = document.createElement('div');\n      grid.className = 'options' + (group.twoCol ? ' two-col' : '');\n      group.options.forEach(opt => {\n        const btn = document.createElement('button');\n        btn.type = 'button';\n        btn.className = 'opt-card' + (state[group.key] === opt.id ? ' selected' : '');\n        btn.innerHTML = `\n          <div>\n            <div class=\"opt-title\">${opt.name}</div>\n            <div class=\"opt-sub\">${opt.sub}</div>\n          </div>\n          <div class=\"opt-price mono\">${opt.price === 0 ? 'Incl.' : '+$' + opt.price.toLocaleString()}</div>\n        `;\n        btn.addEventListener('click', () => {\n          state[group.key] = opt.id;\n          document.querySelectorAll('.preset-btn').forEach(b => b.classList.remove('active'));\n          updateAll();\n        });\n        grid.appendChild(btn);\n      });\n      sec.appendChild(grid);\n      controlsCol.appendChild(sec);\n    });\n  }\n\n  function updateSchematic(ch, cpu, gpu, ram, sto, watts, psuCap) {\n    document.getElementById('svgChassis').setAttribute('fill', ch.fill);\n    document.getElementById('svgChassis').setAttribute('stroke', ch.stroke);\n    document.getElementById('svgAccent').setAttribute('fill', ch.accent);\n    document.getElementById('chassisTag').textContent = ch.tag;\n    document.getElementById('skuLabel').textContent = `K7-${cpu.sku}-${gpu.sku}-${ram.sku}`;\n\n    document.getElementById('svgCpuText').textContent = cpu.short;\n\n    // RAM sticks\n    const ramG = document.getElementById('svgRam');\n    ramG.innerHTML = '';\n    for (let i = 0; i < 8; i++) {\n      const filled = i < ram.sticks;\n      const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n      rect.setAttribute('x', i * 11);\n      rect.setAttribute('y', 0);\n      rect.setAttribute('width', 7);\n      rect.setAttribute('height', 96);\n      rect.setAttribute('rx', 2);\n      rect.setAttribute('fill', filled ? '#38bdf8' : '#16191f');\n      rect.setAttribute('stroke', filled ? '#7dd3fc' : '#2e3540');\n      rect.setAttribute('opacity', filled ? '0.9' : '0.6');\n      ramG.appendChild(rect);\n    }\n\n    // Storage bays\n    const stoG = document.getElementById('svgStorage');\n    stoG.innerHTML = '';\n    for (let i = 0; i < 3; i++) {\n      const filled = i < sto.drives;\n      const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n      rect.setAttribute('x', 0);\n      rect.setAttribute('y', i * 33);\n      rect.setAttribute('width', 78);\n      rect.setAttribute('height', 24);\n      rect.setAttribute('rx', 4);\n      rect.setAttribute('fill', filled ? '#23352f' : '#16191f');\n      rect.setAttribute('stroke', filled ? '#34d399' : '#2e3540');\n      stoG.appendChild(rect);\n      const txt = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n      txt.setAttribute('x', 39);\n      txt.setAttribute('y', i * 33 + 15);\n      txt.setAttribute('text-anchor', 'middle');\n      txt.setAttribute('fill', filled ? '#a7f3d0' : '#4b5563');\n      txt.setAttribute('font-family', 'IBM Plex Mono, monospace');\n      txt.setAttribute('font-size', '9');\n      txt.textContent = filled ? `NVMe #${i + 1}` : 'OPEN M.2';\n      stoG.appendChild(txt);\n    }\n\n    // GPUs\n    const gpuG = document.getElementById('svgGpu');\n    gpuG.innerHTML = '';\n    for (let i = 0; i < gpu.cards; i++) {\n      const y = i * 38;\n      const g = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n      g.innerHTML = `\n        <rect x=\"0\" y=\"${y}\" width=\"324\" height=\"32\" rx=\"5\" fill=\"#252a34\" stroke=\"${ch.accent}\" stroke-width=\"1.8\"/>\n        <circle cx=\"292\" cy=\"${y + 16}\" r=\"10\" fill=\"#14171c\" stroke=\"#525b68\"/>\n        <text x=\"16\" y=\"${y + 20}\" fill=\"#f1f3f5\" font-family=\"IBM Plex Mono, monospace\" font-size=\"11\" font-weight=\"600\">${gpu.name.replace(/^\\d×\\s*/, '')} · ${gpu.cards === 2 ? '24GB' : gpu.vram}</text>\n      `;\n      gpuG.appendChild(g);\n    }\n\n    const loadPct = Math.round((watts / psuCap) * 100);\n    document.getElementById('svgPsuText').textContent = `${psuCap}W TITANIUM PSU · ${loadPct}% PEAK LOAD`;\n  }\n\n  function updateAll() {\n    renderControls();\n    const ch = getOpt('chassis');\n    const cpu = getOpt('cpu');\n    const gpu = getOpt('gpu');\n    const ram = getOpt('ram');\n    const sto = getOpt('storage');\n\n    const total = BASE_PRICE + ch.price + cpu.price + gpu.price + ram.price + sto.price;\n    const watts = 45 + ch.watts + cpu.watts + gpu.watts + ram.watts + sto.watts;\n    const psuCap = watts > 950 ? 1600 : (watts > 700 ? 1200 : 1000);\n    const score = Math.round(cpu.score * 0.35 + gpu.score * 0.42 + ram.score * 0.15 + sto.score * 0.08);\n    const dba = Math.round(21 + (watts / 1450) * 18);\n\n    updateSchematic(ch, cpu, gpu, ram, sto, watts, psuCap);\n\n    document.getElementById('gScore').textContent = `${score}/100`;\n    document.getElementById('barScore').style.width = `${score}%`;\n\n    document.getElementById('gWatts').textContent = `${watts}W`;\n    const wPct = Math.min(100, Math.round((watts / 1500) * 100));\n    const barW = document.getElementById('barWatts');\n    barW.style.width = `${wPct}%`;\n    barW.style.background = watts > 1100 ? 'var(--warn)' : 'var(--teal)';\n\n    document.getElementById('gNoise').textContent = `${dba} dBA`;\n    document.getElementById('barNoise').style.width = `${Math.min(100, Math.round((dba / 45) * 100))}%`;\n\n    const formatted = '$' + total.toLocaleString();\n    document.getElementById('desktopPrice').textContent = formatted;\n    document.getElementById('mobilePrice').textContent = formatted;\n    document.getElementById('mobileSummary').textContent = `${watts}W · Score ${score} · ${psuCap}W PSU`;\n    document.getElementById('shipLead').textContent = gpu.cards === 2 ? 'Ships in 8 days' : 'Ships in 5 days';\n\n    specList.innerHTML = [\n      ['Chassis', ch.name],\n      ['Processor', cpu.name],\n      ['Graphics', gpu.name],\n      ['Memory', ram.name + ' ECC'],\n      ['Storage', sto.name],\n      ['Power Supply', `${psuCap}W 80+ Titanium Modular`],\n      ['OS Preload', 'Pop!_OS 24.04 LTS + CUDA 12.6']\n    ].map(([k, v]) => `<div class=\"spec-row\"><span>${k}</span><span class=\"mono\">${v}</span></div>`).join('');\n  }\n\n  document.getElementById('presetBar').addEventListener('click', (e) => {\n    const btn = e.target.closest('.preset-btn');\n    if (!btn) return;\n    document.querySelectorAll('.preset-btn').forEach(b => b.classList.toggle('active', b === btn));\n    state = { ...PRESETS[btn.dataset.preset] };\n    updateAll();\n  });\n\n  function triggerQuote() {\n    const sku = document.getElementById('skuLabel').textContent;\n    const price = document.getElementById('desktopPrice').textContent;\n    const toast = document.getElementById('toast');\n    toast.textContent = `Build ${sku} (${price}) saved to quote clipboard.`;\n    toast.classList.add('show');\n    if (navigator.clipboard) navigator.clipboard.writeText(`${sku} — ${price}`).catch(() => {});\n    setTimeout(() => toast.classList.remove('show'), 2800);\n  }\n  document.getElementById('orderBtnDesktop').addEventListener('click', triggerQuote);\n  document.getElementById('orderBtnMobile').addEventListener('click', triggerQuote);\n\n  updateAll();\n})();\n</script>\n</body>\n</html>\n"
}
