{
  "id": 113,
  "slug": "tactile-ruler-scrubber",
  "name": "Tactile Rotary Dial / Precision Ruler Scrubber",
  "kind": "ui",
  "family": "Precision Controls",
  "sourceSite": {
    "name": "Halide",
    "url": "https://halide.cam",
    "verifiedStatus": 200
  },
  "tagline": "Camera-grade horizontal tick-ruler scrubber for fine-grained Exposure, White Balance, and ISO adjustments.",
  "whyUnique": "Replaces clumsy native range sliders with a high-precision, tactile instrument dial that offers fine sub-step control and immediate visual feedback.",
  "theme": "dark",
  "mobileStrength": "native-first",
  "tags": [
    "ruler-scrubber",
    "rotary-dial",
    "precision-control",
    "camera-ui",
    "tactile-ux"
  ],
  "bestFor": [
    "Photo & video editing apps",
    "Audio synth & EQ interfaces",
    "Smart-home thermostat & lighting dials",
    "Scientific instrument controls"
  ],
  "palette": [
    {
      "role": "canvas",
      "hex": "#0D0E10",
      "name": "Camera Matte"
    },
    {
      "role": "surface",
      "hex": "#191B1F",
      "name": "Anodized Alloy"
    },
    {
      "role": "ink",
      "hex": "#F4F4F5",
      "name": "Reticle White"
    },
    {
      "role": "accent",
      "hex": "#FACC15",
      "name": "Leica Yellow"
    },
    {
      "role": "muted",
      "hex": "#8E929B",
      "name": "Dial Pewter"
    }
  ],
  "typography": {
    "display": "Space Grotesk",
    "body": "Inter",
    "mono": "JetBrains Mono",
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=JetBrains+Mono:wght@600;700&family=Space+Grotesk:wght@600;700&display=swap",
    "scaleNotes": "High-legibility monospace numeric readouts (+0.7 EV, 5600K, ISO 400) anchored directly above the center reticle needle."
  },
  "layoutNotes": "Live responsive viewfinder stage above a dedicated dark instrument console with parameter tabs (EV, Kelvin, ISO) and a full-width precision tick ruler.",
  "interactionNotes": "Horizontal pointer drag scrubs smoothly across calibrated tick marks with real-time live canvas color/exposure rendering, wheel support, arrow keys, and double-tap/button reset.",
  "mobileNotes": "Wide drag zone (>=64px tall) with touch-action: none lets thumbs scrub finely without lifting or triggering browser back swipes.",
  "agentGuardrails": {
    "do": [
      "Display a fixed center reticle needle with live numeric readout directly above the moving tick track",
      "Offer one-tap or double-tap reset back to neutral/auto value for every parameter",
      "Support mouse wheel and keyboard ArrowLeft/ArrowRight nudging on desktop"
    ],
    "dont": [
      "Do not obscure the live preview canvas behind opaque modal controls while scrubbing",
      "Do not omit visual major/minor tick hierarchy that communicates step scale"
    ]
  },
  "demoFile": "demos/tactile-ruler-scrubber.html",
  "thumbDesktop": "thumbs/tactile-ruler-scrubber-desktop.webp",
  "thumbMobile": "thumbs/tactile-ruler-scrubber-mobile.webp",
  "urls": {
    "page": "https://templates.michaelpitts.net/t/tactile-ruler-scrubber",
    "markdown": "https://templates.michaelpitts.net/t/tactile-ruler-scrubber.md",
    "api": "https://templates.michaelpitts.net/api/templates/tactile-ruler-scrubber",
    "demo": "https://templates.michaelpitts.net/demos/tactile-ruler-scrubber.html",
    "thumbDesktop": "https://templates.michaelpitts.net/thumbs/tactile-ruler-scrubber-desktop.webp",
    "thumbMobile": "https://templates.michaelpitts.net/thumbs/tactile-ruler-scrubber-mobile.webp"
  },
  "agentPrompt": "Design & build using template #113 \"Tactile Rotary Dial / Precision Ruler Scrubber\" (ui / Precision Controls, dark theme).\nFull AI blueprint & standalone starter code: https://templates.michaelpitts.net/t/tactile-ruler-scrubber.md\nLive demo: https://templates.michaelpitts.net/demos/tactile-ruler-scrubber.html\nReal-world inspiration: Halide (https://halide.cam)\n\nCore aesthetic: Replaces clumsy native range sliders with a high-precision, tactile instrument dial that offers fine sub-step control and immediate visual feedback.\nPalette: canvas: #0D0E10 (Camera Matte), surface: #191B1F (Anodized Alloy), ink: #F4F4F5 (Reticle White), accent: #FACC15 (Leica Yellow), muted: #8E929B (Dial Pewter)\nTypography: Display=\"Space Grotesk\", Body=\"Inter\", Mono=\"JetBrains Mono\"\nLayout: Live responsive viewfinder stage above a dedicated dark instrument console with parameter tabs (EV, Kelvin, ISO) and a full-width precision tick ruler.\nInteractions: Horizontal pointer drag scrubs smoothly across calibrated tick marks with real-time live canvas color/exposure rendering, wheel support, arrow keys, and double-tap/button reset.\nMobile: Wide drag zone (>=64px tall) with touch-action: none lets thumbs scrub finely without lifting or triggering browser back swipes.\n\nGuardrails:\n- DO: Display a fixed center reticle needle with live numeric readout directly above the moving tick track\n- DO: Offer one-tap or double-tap reset back to neutral/auto value for every parameter\n- DO: Support mouse wheel and keyboard ArrowLeft/ArrowRight nudging on desktop\n- DON'T: Do not obscure the live preview canvas behind opaque modal controls while scrubbing\n- DON'T: Do not omit visual major/minor tick hierarchy that communicates step scale",
  "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>Aperture Manual — Tactile Ruler Scrubber</title>\n<style>\n  :root {\n    --canvas: #0D0E10;\n    --surface: #191B1F;\n    --surface-2: #23262C;\n    --ink: #F4F4F5;\n    --accent: #FACC15;\n    --accent-dim: rgba(250, 204, 21, 0.16);\n    --muted: #8E929B;\n    --border: rgba(255, 255, 255, 0.08);\n    --danger: #F87171;\n    --mono: ui-monospace, \"SF Mono\", \"JetBrains Mono\", Menlo, Consolas, monospace;\n    --sans: -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"Inter\", system-ui, sans-serif;\n  }\n\n  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }\n\n  html, body {\n    height: 100%;\n    background: var(--canvas);\n    color: var(--ink);\n    font-family: var(--sans);\n    overflow-x: hidden;\n    user-select: none;\n    -webkit-user-select: none;\n  }\n\n  .app {\n    min-height: 100dvh;\n    max-width: 1120px;\n    margin: 0 auto;\n    padding: 12px 14px 20px;\n    display: grid;\n    grid-template-rows: auto 1fr auto;\n    gap: 12px;\n  }\n\n  /* Top status telemetry bar */\n  .topbar {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 8px;\n    padding: 8px 12px;\n    background: var(--surface);\n    border: 1px solid var(--border);\n    border-radius: 14px;\n  }\n\n  .brand {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-weight: 600;\n    font-size: 13px;\n    letter-spacing: 0.06em;\n    text-transform: uppercase;\n  }\n\n  .brand-dot {\n    width: 8px;\n    height: 8px;\n    border-radius: 50%;\n    background: var(--accent);\n    box-shadow: 0 0 10px var(--accent);\n  }\n\n  .telemetry-pills {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    flex-wrap: wrap;\n    justify-content: flex-end;\n  }\n\n  .icon-btn {\n    min-width: 44px;\n    min-height: 44px;\n    padding: 0 12px;\n    border-radius: 10px;\n    border: 1px solid var(--border);\n    background: var(--surface-2);\n    color: var(--muted);\n    font-family: var(--mono);\n    font-size: 11px;\n    font-weight: 600;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    gap: 6px;\n    cursor: pointer;\n    transition: background 0.15s, color 0.15s, border-color 0.15s;\n  }\n\n  .icon-btn:hover { color: var(--ink); border-color: rgba(255,255,255,0.18); }\n  .icon-btn[aria-pressed=\"true\"] {\n    background: var(--accent-dim);\n    color: var(--accent);\n    border-color: rgba(250, 204, 21, 0.45);\n  }\n\n  /* Main layout: mobile stacked, desktop 2-column */\n  .workspace {\n    display: grid;\n    grid-template-columns: 1fr;\n    gap: 14px;\n    align-items: start;\n  }\n\n  @media (min-width: 900px) {\n    .app { padding: 20px 28px 28px; gap: 16px; }\n    .workspace {\n      grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);\n      gap: 20px;\n      align-items: stretch;\n    }\n  }\n\n  /* Viewfinder */\n  .viewfinder-shell {\n    position: relative;\n    background: #050607;\n    border: 1px solid var(--border);\n    border-radius: 18px;\n    overflow: hidden;\n    aspect-ratio: 4 / 3;\n    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);\n  }\n\n  #viewfinder {\n    width: 100%;\n    height: 100%;\n    display: block;\n  }\n\n  .vf-overlay {\n    position: absolute;\n    inset: 0;\n    pointer-events: none;\n    display: flex;\n    flex-direction: column;\n    justify-content: space-between;\n    padding: 12px 14px;\n  }\n\n  .vf-grid {\n    position: absolute;\n    inset: 0;\n    opacity: 0;\n    transition: opacity 0.2s;\n    background-image:\n      linear-gradient(to right, rgba(255,255,255,0.18) 1px, transparent 1px),\n      linear-gradient(to bottom, rgba(255,255,255,0.18) 1px, transparent 1px);\n    background-size: 33.333% 33.333%;\n    background-position: -1px -1px;\n  }\n  .vf-grid.visible { opacity: 1; }\n\n  .vf-corners::before, .vf-corners::after {\n    content: \"\";\n    position: absolute;\n    width: 18px;\n    height: 18px;\n    border: 1.5px solid rgba(255,255,255,0.4);\n  }\n  .vf-corners::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }\n  .vf-corners::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }\n\n  .vf-top-hud {\n    display: flex;\n    justify-content: space-between;\n    align-items: flex-start;\n    gap: 10px;\n    z-index: 2;\n  }\n\n  .hud-badge {\n    background: rgba(13, 14, 16, 0.72);\n    backdrop-filter: blur(8px);\n    -webkit-backdrop-filter: blur(8px);\n    border: 1px solid rgba(255,255,255,0.12);\n    border-radius: 8px;\n    padding: 5px 9px;\n    font-family: var(--mono);\n    font-size: 11px;\n    letter-spacing: 0.04em;\n    color: var(--ink);\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .hud-badge .accent { color: var(--accent); font-weight: 700; }\n\n  #histCanvas {\n    width: 96px;\n    height: 36px;\n    border-radius: 6px;\n    background: rgba(13, 14, 16, 0.72);\n    border: 1px solid rgba(255,255,255,0.12);\n    display: block;\n  }\n\n  .vf-reticle {\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    width: 54px;\n    height: 54px;\n    transform: translate(-50%, -50%);\n    border: 1px solid rgba(250, 204, 21, 0.65);\n    border-radius: 4px;\n    transition: transform 0.12s ease-out;\n  }\n  .vf-reticle::before, .vf-reticle::after {\n    content: \"\";\n    position: absolute;\n    background: var(--accent);\n  }\n  .vf-reticle::before { width: 8px; height: 1px; top: 50%; left: -4px; }\n  .vf-reticle::after { width: 1px; height: 8px; left: 50%; top: -4px; }\n\n  .vf-bottom-hud {\n    display: flex;\n    justify-content: space-between;\n    align-items: flex-end;\n    z-index: 2;\n  }\n\n  .meter-readout {\n    display: flex;\n    gap: 12px;\n    font-family: var(--mono);\n    font-size: 12px;\n    background: rgba(13, 14, 16, 0.78);\n    backdrop-filter: blur(8px);\n    padding: 6px 10px;\n    border-radius: 8px;\n    border: 1px solid rgba(255,255,255,0.1);\n  }\n\n  .meter-readout span b { color: var(--accent); font-weight: 700; }\n  .meter-readout .dim { color: var(--muted); font-size: 10px; margin-right: 3px; }\n\n  .shutter-flash {\n    position: absolute;\n    inset: 0;\n    background: #fff;\n    opacity: 0;\n    pointer-events: none;\n    transition: opacity 0.18s ease-out;\n    z-index: 5;\n  }\n  .shutter-flash.fire { opacity: 0.85; transition: none; }\n\n  /* Control Deck */\n  .deck {\n    background: var(--surface);\n    border: 1px solid var(--border);\n    border-radius: 18px;\n    padding: 14px;\n    display: flex;\n    flex-direction: column;\n    gap: 14px;\n  }\n\n  .param-tabs {\n    display: grid;\n    grid-template-columns: repeat(3, 1fr);\n    gap: 8px;\n  }\n\n  .param-tab {\n    min-height: 54px;\n    border-radius: 12px;\n    border: 1px solid var(--border);\n    background: var(--surface-2);\n    color: var(--muted);\n    padding: 8px 10px;\n    cursor: pointer;\n    display: flex;\n    flex-direction: column;\n    align-items: flex-start;\n    justify-content: center;\n    gap: 2px;\n    transition: border-color 0.15s, background 0.15s, transform 0.1s;\n    text-align: left;\n  }\n\n  .param-tab:active { transform: scale(0.98); }\n\n  .param-tab[aria-selected=\"true\"] {\n    background: var(--accent-dim);\n    border-color: var(--accent);\n    color: var(--ink);\n  }\n\n  .param-tab .p-label {\n    font-size: 10px;\n    font-weight: 700;\n    letter-spacing: 0.08em;\n    text-transform: uppercase;\n    color: var(--muted);\n  }\n  .param-tab[aria-selected=\"true\"] .p-label { color: var(--accent); }\n\n  .param-tab .p-val {\n    font-family: var(--mono);\n    font-size: 15px;\n    font-weight: 700;\n    color: var(--ink);\n  }\n\n  /* Active readout header */\n  .scrubber-header {\n    display: flex;\n    align-items: baseline;\n    justify-content: space-between;\n    padding: 0 2px;\n  }\n\n  .active-value {\n    font-family: var(--mono);\n    font-size: 28px;\n    font-weight: 700;\n    letter-spacing: -0.02em;\n    color: var(--accent);\n  }\n\n  .active-hint {\n    font-size: 11px;\n    color: var(--muted);\n    font-family: var(--mono);\n  }\n\n  /* Precision Tactile Ruler Scrubber */\n  .ruler-wrap {\n    position: relative;\n    height: 86px;\n    border-radius: 14px;\n    background: #101216;\n    border: 1px solid var(--border);\n    overflow: hidden;\n    touch-action: none;\n    cursor: ew-resize;\n    outline: none;\n  }\n\n  .ruler-wrap:focus-visible {\n    border-color: var(--accent);\n    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);\n  }\n\n  #rulerCanvas {\n    width: 100%;\n    height: 100%;\n    display: block;\n  }\n\n  .ruler-needle {\n    position: absolute;\n    top: 8px;\n    bottom: 8px;\n    left: 50%;\n    width: 2px;\n    transform: translateX(-50%);\n    background: var(--accent);\n    box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);\n    pointer-events: none;\n  }\n\n  .ruler-needle::before {\n    content: \"\";\n    position: absolute;\n    top: -4px;\n    left: 50%;\n    transform: translateX(-50%);\n    border-left: 5px solid transparent;\n    border-right: 5px solid transparent;\n    border-top: 6px solid var(--accent);\n  }\n\n  .ruler-fade-l, .ruler-fade-r {\n    position: absolute;\n    top: 0; bottom: 0; width: 44px;\n    pointer-events: none;\n  }\n  .ruler-fade-l { left: 0; background: linear-gradient(to right, #101216, transparent); }\n  .ruler-fade-r { right: 0; background: linear-gradient(to left, #101216, transparent); }\n\n  /* Rotary Dial + Actions Row */\n  .dial-row {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    padding-top: 4px;\n  }\n\n  .rotary-wrap {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n  }\n\n  .rotary-dial {\n    width: 72px;\n    height: 72px;\n    border-radius: 50%;\n    background: radial-gradient(circle at 35% 30%, #2d3139, #15171c 75%);\n    border: 2px solid rgba(255,255,255,0.12);\n    box-shadow: inset 0 2px 6px rgba(255,255,255,0.08), 0 8px 18px rgba(0,0,0,0.45);\n    position: relative;\n    cursor: grab;\n    touch-action: none;\n    flex-shrink: 0;\n  }\n\n  .rotary-dial:active { cursor: grabbing; border-color: rgba(250,204,21,0.5); }\n\n  .rotary-knurl {\n    position: absolute;\n    inset: 5px;\n    border-radius: 50%;\n    border: 2px dashed rgba(255,255,255,0.14);\n    pointer-events: none;\n  }\n\n  .rotary-pip {\n    position: absolute;\n    top: 8px;\n    left: 50%;\n    width: 4px;\n    height: 12px;\n    margin-left: -2px;\n    border-radius: 2px;\n    background: var(--accent);\n    box-shadow: 0 0 8px var(--accent);\n    pointer-events: none;\n  }\n\n  .dial-meta {\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n  }\n  .dial-meta strong { font-size: 12px; font-weight: 600; color: var(--ink); }\n  .dial-meta span { font-size: 11px; color: var(--muted); line-height: 1.35; }\n\n  .shutter-cluster {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .reset-btn {\n    min-width: 44px;\n    min-height: 44px;\n    padding: 0 12px;\n    border-radius: 12px;\n    border: 1px solid var(--border);\n    background: var(--surface-2);\n    color: var(--ink);\n    font-family: var(--mono);\n    font-size: 11px;\n    font-weight: 600;\n    cursor: pointer;\n  }\n  .reset-btn:hover { border-color: var(--accent); color: var(--accent); }\n\n  .shutter-btn {\n    width: 60px;\n    height: 60px;\n    border-radius: 50%;\n    border: 3px solid var(--ink);\n    background: transparent;\n    padding: 4px;\n    cursor: pointer;\n    flex-shrink: 0;\n    transition: transform 0.1s;\n  }\n  .shutter-btn:active { transform: scale(0.92); }\n  .shutter-btn-inner {\n    width: 100%;\n    height: 100%;\n    border-radius: 50%;\n    background: var(--ink);\n    display: block;\n    transition: background 0.15s;\n  }\n  .shutter-btn:hover .shutter-btn-inner { background: var(--accent); }\n\n  /* Preset quick strip */\n  .preset-strip {\n    display: flex;\n    gap: 6px;\n    flex-wrap: wrap;\n    border-top: 1px solid var(--border);\n    padding-top: 12px;\n  }\n\n  .preset-chip {\n    min-height: 36px;\n    padding: 0 10px;\n    border-radius: 8px;\n    border: 1px solid var(--border);\n    background: #121418;\n    color: var(--muted);\n    font-family: var(--mono);\n    font-size: 11px;\n    cursor: pointer;\n    transition: all 0.15s;\n  }\n  .preset-chip:hover { color: var(--ink); border-color: rgba(255,255,255,0.22); }\n\n  .footer-bar {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    font-size: 11px;\n    color: var(--muted);\n    font-family: var(--mono);\n    padding: 0 4px;\n    flex-wrap: wrap;\n    gap: 8px;\n  }\n</style>\n</head>\n<body>\n<div class=\"app\">\n  <header class=\"topbar\">\n    <div class=\"brand\">\n      <span class=\"brand-dot\"></span>\n      <span>HALIDE // MANUAL</span>\n    </div>\n    <div class=\"telemetry-pills\">\n      <button class=\"icon-btn\" id=\"gridBtn\" aria-pressed=\"true\" title=\"Toggle Rule of Thirds Grid\">GRID</button>\n      <button class=\"icon-btn\" id=\"zebraBtn\" aria-pressed=\"false\" title=\"Toggle Highlight Zebras\">ZEBRA</button>\n      <button class=\"icon-btn\" id=\"soundBtn\" aria-pressed=\"false\" title=\"Toggle Tactile Detent Audio\">\n        <span id=\"soundLabel\">TICK OFF</span>\n      </button>\n    </div>\n  </header>\n\n  <main class=\"workspace\">\n    <section class=\"viewfinder-shell\" aria-label=\"Live Camera Viewfinder\">\n      <canvas id=\"viewfinder\" width=\"960\" height=\"720\"></canvas>\n      <div class=\"vf-grid visible\" id=\"vfGrid\"></div>\n      <div class=\"vf-corners\"></div>\n      <div class=\"vf-reticle\" id=\"vfReticle\"></div>\n      <div class=\"shutter-flash\" id=\"shutterFlash\"></div>\n      <div class=\"vf-overlay\">\n        <div class=\"vf-top-hud\">\n          <div class=\"hud-badge\">\n            <span>RAW 14-BIT</span>\n            <span class=\"accent\" id=\"shotCounter\">001</span>\n          </div>\n          <canvas id=\"histCanvas\" width=\"96\" height=\"36\" aria-label=\"Live Luminance Histogram\"></canvas>\n        </div>\n        <div class=\"vf-bottom-hud\">\n          <div class=\"meter-readout\">\n            <span><span class=\"dim\">EV</span><b id=\"hudEv\">+0.0</b></span>\n            <span><span class=\"dim\">WB</span><b id=\"hudWb\">5200K</b></span>\n            <span><span class=\"dim\">ISO</span><b id=\"hudIso\">200</b></span>\n          </div>\n          <div class=\"hud-badge\">\n            <span>28mm</span>\n            <span>f/1.8</span>\n          </div>\n        </div>\n      </div>\n    </section>\n\n    <section class=\"deck\" aria-label=\"Manual Exposure Controls\">\n      <div class=\"param-tabs\" role=\"tablist\" aria-label=\"Camera Parameter\">\n        <button class=\"param-tab\" role=\"tab\" data-param=\"ev\" aria-selected=\"true\">\n          <span class=\"p-label\">Exposure</span>\n          <span class=\"p-val\" id=\"tabEv\">+0.0 EV</span>\n        </button>\n        <button class=\"param-tab\" role=\"tab\" data-param=\"wb\" aria-selected=\"false\">\n          <span class=\"p-label\">White Bal</span>\n          <span class=\"p-val\" id=\"tabWb\">5200K</span>\n        </button>\n        <button class=\"param-tab\" role=\"tab\" data-param=\"iso\" aria-selected=\"false\">\n          <span class=\"p-label\">ISO</span>\n          <span class=\"p-val\" id=\"tabIso\">200</span>\n        </button>\n      </div>\n\n      <div class=\"scrubber-header\">\n        <div class=\"active-value\" id=\"activeReadout\">+0.0 EV</div>\n        <div class=\"active-hint\">DRAG OR DOUBLE-TAP RESET</div>\n      </div>\n\n      <div class=\"ruler-wrap\" id=\"rulerWrap\" tabindex=\"0\" role=\"slider\" aria-label=\"Precision Ruler Scrubber\" aria-valuemin=\"-3\" aria-valuemax=\"3\" aria-valuenow=\"0\">\n        <canvas id=\"rulerCanvas\"></canvas>\n        <div class=\"ruler-fade-l\"></div>\n        <div class=\"ruler-fade-r\"></div>\n        <div class=\"ruler-needle\"></div>\n      </div>\n\n      <div class=\"dial-row\">\n        <div class=\"rotary-wrap\">\n          <div class=\"rotary-dial\" id=\"rotaryDial\" title=\"Drag circularly to fine-tune\">\n            <div class=\"rotary-knurl\"></div>\n            <div class=\"rotary-pip\"></div>\n          </div>\n          <div class=\"dial-meta\">\n            <strong>Rotary Fine Dial</strong>\n            <span>Twist ring or use ← / → keys for detent steps</span>\n          </div>\n        </div>\n\n        <div class=\"shutter-cluster\">\n          <button class=\"reset-btn\" id=\"resetAllBtn\" title=\"Reset all parameters\">RESET</button>\n          <button class=\"shutter-btn\" id=\"shutterBtn\" aria-label=\"Capture Frame\">\n            <span class=\"shutter-btn-inner\"></span>\n          </button>\n        </div>\n      </div>\n\n      <div class=\"preset-strip\" aria-label=\"Lighting Presets\">\n        <button class=\"preset-chip\" data-preset=\"neutral\">Daylight 5200K</button>\n        <button class=\"preset-chip\" data-preset=\"golden\">Golden Dusk</button>\n        <button class=\"preset-chip\" data-preset=\"tungsten\">Tungsten Alley</button>\n        <button class=\"preset-chip\" data-preset=\"night\">High-ISO Night</button>\n      </div>\n    </section>\n  </main>\n\n  <footer class=\"footer-bar\">\n    <span>DOUBLE-TAP RULER TO ZERO ACTIVE CHANNEL</span>\n    <span id=\"statusText\">READY · MANUAL METERING</span>\n  </footer>\n</div>\n\n<script>\n(() => {\n  const PARAMS = {\n    ev: {\n      label: 'Exposure',\n      min: -3.0, max: 3.0, step: 0.1, defaultVal: 0.0,\n      majorEvery: 10, // every 1.0 EV\n      format: v => `${v >= 0 ? '+' : ''}${v.toFixed(1)} EV`,\n      short: v => `${v >= 0 ? '+' : ''}${v.toFixed(1)}`,\n      tickLabel: v => `${v > 0 ? '+' : ''}${v.toFixed(0)}`\n    },\n    wb: {\n      label: 'White Balance',\n      min: 2800, max: 7500, step: 100, defaultVal: 5200,\n      majorEvery: 5, // every 500K\n      format: v => `${Math.round(v)}K`,\n      short: v => `${Math.round(v)}K`,\n      tickLabel: v => `${(v/1000).toFixed(1)}k`\n    },\n    iso: {\n      label: 'ISO Sensitivity',\n      min: 0, max: 18, step: 1, defaultVal: 6, // maps to realistic 1/3-stop ISO table\n      values: [50,64,80,100,125,160,200,250,320,400,500,640,800,1000,1250,1600,2000,2500,3200],\n      majorEvery: 3,\n      format: idx => `ISO ${PARAMS.iso.values[Math.round(idx)]}`,\n      short: idx => `${PARAMS.iso.values[Math.round(idx)]}`,\n      tickLabel: idx => `${PARAMS.iso.values[Math.round(idx)]}`\n    }\n  };\n\n  const state = {\n    active: 'ev',\n    ev: 0.0,\n    wb: 5200,\n    iso: 6, // index into PARAMS.iso.values -> 200\n    grid: true,\n    zebra: false,\n    sound: false,\n    shots: 1,\n    dialAngle: 0\n  };\n\n  // Web Audio subtle mechanical detent click\n  let audioCtx = null;\n  function playTick(isMajor) {\n    if (!state.sound) return;\n    try {\n      if (!audioCtx) audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n      if (audioCtx.state === 'suspended') audioCtx.resume();\n      const now = audioCtx.currentTime;\n      const osc = audioCtx.createOscillator();\n      const gain = audioCtx.createGain();\n      osc.type = 'triangle';\n      osc.frequency.setValueAtTime(isMajor ? 1450 : 920, now);\n      osc.frequency.exponentialRampToValueAtTime(220, now + 0.018);\n      gain.gain.setValueAtTime(isMajor ? 0.07 : 0.035, now);\n      gain.gain.exponentialRampToValueAtTime(0.0001, now + 0.02);\n      osc.connect(gain);\n      gain.connect(audioCtx.destination);\n      osc.start(now);\n      osc.stop(now + 0.022);\n    } catch (_) {}\n  }\n\n  // DOM refs\n  const vfCanvas = document.getElementById('viewfinder');\n  const vfCtx = vfCanvas.getContext('2d', { willReadFrequently: true });\n  const histCanvas = document.getElementById('histCanvas');\n  const histCtx = histCanvas.getContext('2d');\n  const rulerCanvas = document.getElementById('rulerCanvas');\n  const rulerCtx = rulerCanvas.getContext('2d');\n  const rulerWrap = document.getElementById('rulerWrap');\n  const rotaryDial = document.getElementById('rotaryDial');\n  const activeReadout = document.getElementById('activeReadout');\n  const hudEv = document.getElementById('hudEv');\n  const hudWb = document.getElementById('hudWb');\n  const hudIso = document.getElementById('hudIso');\n  const tabEv = document.getElementById('tabEv');\n  const tabWb = document.getElementById('tabWb');\n  const tabIso = document.getElementById('tabIso');\n  const statusText = document.getElementById('statusText');\n  const vfReticle = document.getElementById('vfReticle');\n\n  // Offscreen base architectural dusk scene (rendered once, graded in real time)\n  const baseCanvas = document.createElement('canvas');\n  baseCanvas.width = 480;\n  baseCanvas.height = 360;\n  const bCtx = baseCanvas.getContext('2d');\n\n  function buildBaseScene() {\n    const w = baseCanvas.width, h = baseCanvas.height;\n    // Deep twilight sky gradient\n    const sky = bCtx.createLinearGradient(0, 0, 0, h * 0.72);\n    sky.addColorStop(0, '#101b33');\n    sky.addColorStop(0.42, '#2b3a5c');\n    sky.addColorStop(0.75, '#b86852');\n    sky.addColorStop(1, '#f4b56a');\n    bCtx.fillStyle = sky;\n    bCtx.fillRect(0, 0, w, h);\n\n    // Sun glow low on horizon\n    const sun = bCtx.createRadialGradient(w * 0.66, h * 0.57, 4, w * 0.66, h * 0.57, 130);\n    sun.addColorStop(0, 'rgba(255, 245, 210, 0.95)');\n    sun.addColorStop(0.25, 'rgba(255, 198, 120, 0.55)');\n    sun.addColorStop(1, 'rgba(255, 140, 80, 0)');\n    bCtx.fillStyle = sun;\n    bCtx.fillRect(0, 0, w, h);\n\n    // Distant mountain ridge\n    bCtx.fillStyle = '#23283c';\n    bCtx.beginPath();\n    bCtx.moveTo(0, h * 0.66);\n    bCtx.lineTo(w * 0.18, h * 0.53);\n    bCtx.lineTo(w * 0.36, h * 0.61);\n    bCtx.lineTo(w * 0.54, h * 0.50);\n    bCtx.lineTo(w * 0.78, h * 0.59);\n    bCtx.lineTo(w, h * 0.52);\n    bCtx.lineTo(w, h);\n    bCtx.lineTo(0, h);\n    bCtx.closePath();\n    bCtx.fill();\n\n    // Water reflection plane\n    const water = bCtx.createLinearGradient(0, h * 0.66, 0, h);\n    water.addColorStop(0, '#363b52');\n    water.addColorStop(0.45, '#1e2436');\n    water.addColorStop(1, '#0d111a');\n    bCtx.fillStyle = water;\n    bCtx.fillRect(0, h * 0.66, w, h * 0.34);\n\n    // Shimmering water highlights\n    for (let i = 0; i < 42; i++) {\n      const y = h * 0.67 + i * 2.7;\n      const spread = 16 + i * 1.6;\n      const alpha = Math.max(0.05, 0.55 - i * 0.012);\n      bCtx.fillStyle = `rgba(255, 210, 140, ${alpha})`;\n      bCtx.fillRect(w * 0.66 - spread / 2 + Math.sin(i * 1.9) * 8, y, spread, 1.4);\n    }\n\n    // Modernist concrete bridge / pier silhouette & architectural towers\n    bCtx.fillStyle = '#141720';\n    // Left modernist tower\n    bCtx.fillRect(36, 98, 72, 168);\n    bCtx.fillStyle = '#1d2230';\n    bCtx.fillRect(88, 98, 20, 168);\n    // Warm lit architectural windows\n    for (let r = 0; r < 8; r++) {\n      for (let c = 0; c < 3; c++) {\n        if ((r + c) % 3 === 0) continue;\n        bCtx.fillStyle = (r * 3 + c) % 4 === 0 ? '#ffd89b' : 'rgba(245, 195, 130, 0.65)';\n        bCtx.fillRect(46 + c * 14, 112 + r * 17, 8, 10);\n      }\n    }\n\n    // Mid-left midrise\n    bCtx.fillStyle = '#181c28';\n    bCtx.fillRect(118, 152, 54, 114);\n    for (let r = 0; r < 5; r++) {\n      bCtx.fillStyle = 'rgba(180, 215, 255, 0.35)';\n      bCtx.fillRect(126, 164 + r * 16, 38, 4);\n    }\n\n    // Foreground seawall & lamp post\n    bCtx.fillStyle = '#0e1017';\n    bCtx.fillRect(0, h * 0.78, w * 0.42, h * 0.22);\n    bCtx.fillRect(w * 0.34, h * 0.55, 4, h * 0.25);\n    // Lamp glow\n    const lamp = bCtx.createRadialGradient(w * 0.34 + 2, h * 0.55, 1, w * 0.34 + 2, h * 0.55, 34);\n    lamp.addColorStop(0, 'rgba(255, 240, 195, 1)');\n    lamp.addColorStop(0.3, 'rgba(255, 200, 115, 0.45)');\n    lamp.addColorStop(1, 'rgba(255, 180, 90, 0)');\n    bCtx.fillStyle = lamp;\n    bCtx.beginPath();\n    bCtx.arc(w * 0.34 + 2, h * 0.55, 34, 0, Math.PI * 2);\n    bCtx.fill();\n  }\n\n  buildBaseScene();\n  const baseImageData = bCtx.getImageData(0, 0, baseCanvas.width, baseCanvas.height);\n\n  // Render live graded viewfinder + histogram\n  function renderViewfinder() {\n    const w = baseCanvas.width, h = baseCanvas.height;\n    const out = bCtx.createImageData(w, h);\n    const src = baseImageData.data;\n    const dst = out.data;\n\n    // Exposure multiplier\n    const isoVal = PARAMS.iso.values[Math.round(state.iso)];\n    const isoGain = Math.pow(isoVal / 200, 0.22); // subtle exposure lift with higher ISO\n    const evMult = Math.pow(2, state.ev * 0.62) * isoGain;\n\n    // White Balance Kelvin shift relative to 5200K neutral\n    const kNorm = (state.wb - 5200) / 2300; // -1.04 (cool) to +1.0 (warm)\n    const rMult = 1 + kNorm * 0.28;\n    const gMult = 1 + (kNorm > 0 ? kNorm * 0.04 : -kNorm * 0.03);\n    const bMult = 1 - kNorm * 0.30;\n\n    // Sensor grain scaled by ISO\n    const noiseAmp = Math.max(0, (isoVal - 160) / 3200) * 38;\n\n    const hist = new Uint32Array(32);\n    let seed = 1337;\n\n    for (let i = 0; i < src.length; i += 4) {\n      let r = src[i] * evMult * rMult;\n      let g = src[i + 1] * evMult * gMult;\n      let b = src[i + 2] * evMult * bMult;\n\n      if (noiseAmp > 0.5) {\n        seed = (seed * 1664525 + 1013904223) | 0;\n        const n = ((seed >>> 24) / 255 - 0.5) * noiseAmp;\n        r += n; g += n; b += n;\n      }\n\n      // Filmic soft shoulder highlight roll-off\n      r = r > 255 ? 255 : (r < 0 ? 0 : r);\n      g = g > 255 ? 255 : (g < 0 ? 0 : g);\n      b = b > 255 ? 255 : (b < 0 ? 0 : b);\n\n      const lum = (0.299 * r + 0.587 * g + 0.114 * b);\n      hist[Math.min(31, (lum / 8) | 0)]++;\n\n      // Zebra highlight warning overlay\n      if (state.zebra && lum > 238) {\n        const px = (i >> 2) % w;\n        const py = ((i >> 2) / w) | 0;\n        if (((px + py) & 7) < 3) {\n          r = 250; g = 204; b = 21;\n        }\n      }\n\n      dst[i] = r;\n      dst[i + 1] = g;\n      dst[i + 2] = b;\n      dst[i + 3] = 255;\n    }\n\n    const tempCanvas = document.createElement('canvas');\n    tempCanvas.width = w;\n    tempCanvas.height = h;\n    tempCanvas.getContext('2d').putImageData(out, 0, 0);\n\n    vfCtx.imageSmoothingEnabled = true;\n    vfCtx.drawImage(tempCanvas, 0, 0, vfCanvas.width, vfCanvas.height);\n\n    // Draw mini histogram\n    histCtx.clearRect(0, 0, histCanvas.width, histCanvas.height);\n    let maxBin = 1;\n    for (let i = 0; i < 32; i++) if (hist[i] > maxBin) maxBin = hist[i];\n    histCtx.fillStyle = 'rgba(250, 204, 21, 0.85)';\n    const bw = histCanvas.width / 32;\n    for (let i = 0; i < 32; i++) {\n      const bh = (hist[i] / maxBin) * (histCanvas.height - 4);\n      histCtx.fillRect(i * bw, histCanvas.height - bh, Math.max(1, bw - 0.8), bh);\n    }\n  }\n\n  // Draw tactile ruler canvas\n  const PX_PER_STEP = 14;\n  function renderRuler() {\n    const dpr = Math.min(window.devicePixelRatio || 1, 2);\n    const rect = rulerWrap.getBoundingClientRect();\n    const w = Math.max(200, Math.round(rect.width));\n    const h = Math.max(70, Math.round(rect.height));\n    if (rulerCanvas.width !== w * dpr || rulerCanvas.height !== h * dpr) {\n      rulerCanvas.width = w * dpr;\n      rulerCanvas.height = h * dpr;\n    }\n    rulerCtx.setTransform(dpr, 0, 0, dpr, 0, 0);\n    rulerCtx.clearRect(0, 0, w, h);\n\n    const cfg = PARAMS[state.active];\n    const current = state[state.active];\n    const totalSteps = Math.round((cfg.max - cfg.min) / cfg.step);\n    const currentStep = (current - cfg.min) / cfg.step;\n    const centerX = w / 2;\n\n    rulerCtx.font = '600 10px ui-monospace, SFMono-Regular, Menlo, monospace';\n    rulerCtx.textAlign = 'center';\n\n    for (let s = 0; s <= totalSteps; s++) {\n      const x = centerX + (s - currentStep) * PX_PER_STEP;\n      if (x < -20 || x > w + 20) continue;\n\n      const isMajor = s % cfg.majorEvery === 0;\n      const isDefault = Math.abs((cfg.min + s * cfg.step) - cfg.defaultVal) < cfg.step * 0.25;\n      const dist = Math.abs(x - centerX);\n      const nearCenter = dist < PX_PER_STEP * 0.6;\n\n      rulerCtx.strokeStyle = nearCenter\n        ? '#FACC15'\n        : isMajor\n          ? 'rgba(244, 244, 245, 0.72)'\n          : 'rgba(142, 146, 155, 0.38)';\n      rulerCtx.lineWidth = isMajor ? 1.6 : 1;\n\n      const tickH = isMajor ? 28 : 14;\n      const yTop = h - 14 - tickH;\n      rulerCtx.beginPath();\n      rulerCtx.moveTo(Math.round(x) + 0.5, h - 14);\n      rulerCtx.lineTo(Math.round(x) + 0.5, yTop);\n      rulerCtx.stroke();\n\n      if (isDefault) {\n        rulerCtx.fillStyle = '#FACC15';\n        rulerCtx.beginPath();\n        rulerCtx.arc(x, h - 7, 2.2, 0, Math.PI * 2);\n        rulerCtx.fill();\n      }\n\n      if (isMajor) {\n        const val = cfg.min + s * cfg.step;\n        rulerCtx.fillStyle = nearCenter ? '#FACC15' : '#8E929B';\n        rulerCtx.fillText(cfg.tickLabel(val), x, 22);\n      }\n    }\n  }\n\n  function updateUI(silent = false) {\n    const cfg = PARAMS[state.active];\n    const val = state[state.active];\n\n    activeReadout.textContent = cfg.format(val);\n    hudEv.textContent = PARAMS.ev.short(state.ev);\n    hudWb.textContent = PARAMS.wb.short(state.wb);\n    hudIso.textContent = PARAMS.iso.short(state.iso);\n\n    tabEv.textContent = PARAMS.ev.format(state.ev);\n    tabWb.textContent = PARAMS.wb.format(state.wb);\n    tabIso.textContent = PARAMS.iso.short(state.iso);\n\n    rulerWrap.setAttribute('aria-valuemin', cfg.min);\n    rulerWrap.setAttribute('aria-valuemax', cfg.max);\n    rulerWrap.setAttribute('aria-valuenow', val);\n\n    rotaryDial.style.transform = `rotate(${state.dialAngle}deg)`;\n\n    renderRuler();\n    renderViewfinder();\n    if (!silent) {\n      statusText.textContent = `${cfg.label.toUpperCase()} · ${cfg.format(val)}`;\n    }\n  }\n\n  function stepValue(deltaSteps) {\n    const cfg = PARAMS[state.active];\n    const prevStep = Math.round((state[state.active] - cfg.min) / cfg.step);\n    const totalSteps = Math.round((cfg.max - cfg.min) / cfg.step);\n    const nextStep = Math.max(0, Math.min(totalSteps, prevStep + deltaSteps));\n    if (nextStep !== prevStep) {\n      state[state.active] = Number((cfg.min + nextStep * cfg.step).toFixed(4));\n      state.dialAngle += deltaSteps * 15;\n      playTick(nextStep % cfg.majorEvery === 0);\n      updateUI();\n    }\n  }\n\n  // Ruler pointer drag + double-tap reset\n  let dragging = false;\n  let dragStartX = 0;\n  let dragStartVal = 0;\n  let lastNotch = 0;\n  let lastTapTime = 0;\n\n  rulerWrap.addEventListener('pointerdown', e => {\n    const now = performance.now();\n    if (now - lastTapTime < 280) {\n      // Double-tap reset active parameter\n      const cfg = PARAMS[state.active];\n      state[state.active] = cfg.defaultVal;\n      state.dialAngle = 0;\n      playTick(true);\n      updateUI();\n      statusText.textContent = `RESET ${cfg.label.toUpperCase()} TO NEUTRAL`;\n      lastTapTime = 0;\n      return;\n    }\n    lastTapTime = now;\n\n    dragging = true;\n    dragStartX = e.clientX;\n    dragStartVal = state[state.active];\n    const cfg = PARAMS[state.active];\n    lastNotch = Math.round((dragStartVal - cfg.min) / cfg.step);\n    rulerWrap.setPointerCapture(e.pointerId);\n    vfReticle.style.transform = 'translate(-50%, -50%) scale(0.92)';\n  });\n\n  rulerWrap.addEventListener('pointermove', e => {\n    if (!dragging) return;\n    const cfg = PARAMS[state.active];\n    const dx = dragStartX - e.clientX; // pull left increases value like moving a physical scale\n    const stepsMoved = Math.round(dx / PX_PER_STEP);\n    const totalSteps = Math.round((cfg.max - cfg.min) / cfg.step);\n    const startStep = Math.round((dragStartVal - cfg.min) / cfg.step);\n    const targetStep = Math.max(0, Math.min(totalSteps, startStep + stepsMoved));\n\n    if (targetStep !== lastNotch) {\n      const diff = targetStep - lastNotch;\n      lastNotch = targetStep;\n      state[state.active] = Number((cfg.min + targetStep * cfg.step).toFixed(4));\n      state.dialAngle += diff * 14;\n      playTick(targetStep % cfg.majorEvery === 0);\n      updateUI();\n    }\n  });\n\n  const endRulerDrag = () => {\n    if (!dragging) return;\n    dragging = false;\n    vfReticle.style.transform = 'translate(-50%, -50%) scale(1)';\n  };\n  rulerWrap.addEventListener('pointerup', endRulerDrag);\n  rulerWrap.addEventListener('pointercancel', endRulerDrag);\n\n  // Wheel support on ruler\n  rulerWrap.addEventListener('wheel', e => {\n    e.preventDefault();\n    const dir = (Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY) > 0 ? 1 : -1;\n    stepValue(dir);\n  }, { passive: false });\n\n  // Keyboard support on ruler\n  rulerWrap.addEventListener('keydown', e => {\n    if (e.key === 'ArrowRight' || e.key === 'ArrowUp') { e.preventDefault(); stepValue(1); }\n    else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') { e.preventDefault(); stepValue(-1); }\n    else if (e.key === '0' || e.key === 'Home') {\n      e.preventDefault();\n      state[state.active] = PARAMS[state.active].defaultVal;\n      playTick(true);\n      updateUI();\n    }\n  });\n\n  // Rotary dial circular drag\n  let dialDragging = false;\n  let lastAngle = 0;\n  let accumAngle = 0;\n\n  function getAngle(el, cx, cy) {\n    const r = el.getBoundingClientRect();\n    return Math.atan2(cy - (r.top + r.height / 2), cx - (r.left + r.width / 2)) * 180 / Math.PI;\n  }\n\n  rotaryDial.addEventListener('pointerdown', e => {\n    dialDragging = true;\n    lastAngle = getAngle(rotaryDial, e.clientX, e.clientY);\n    accumAngle = 0;\n    rotaryDial.setPointerCapture(e.pointerId);\n  });\n\n  rotaryDial.addEventListener('pointermove', e => {\n    if (!dialDragging) return;\n    const cur = getAngle(rotaryDial, e.clientX, e.clientY);\n    let delta = cur - lastAngle;\n    if (delta > 180) delta -= 360;\n    if (delta < -180) delta += 360;\n    lastAngle = cur;\n    accumAngle += delta;\n\n    const STEP_DEG = 16;\n    if (Math.abs(accumAngle) >= STEP_DEG) {\n      const steps = Math.trunc(accumAngle / STEP_DEG);\n      accumAngle -= steps * STEP_DEG;\n      stepValue(steps);\n    }\n  });\n\n  rotaryDial.addEventListener('pointerup', () => { dialDragging = false; });\n  rotaryDial.addEventListener('pointercancel', () => { dialDragging = false; });\n\n  // Tabs\n  document.querySelectorAll('.param-tab').forEach(btn => {\n    btn.addEventListener('click', () => {\n      document.querySelectorAll('.param-tab').forEach(b => b.setAttribute('aria-selected', 'false'));\n      btn.setAttribute('aria-selected', 'true');\n      state.active = btn.dataset.param;\n      playTick(true);\n      updateUI();\n    });\n  });\n\n  // Toggles\n  document.getElementById('gridBtn').addEventListener('click', e => {\n    state.grid = !state.grid;\n    e.currentTarget.setAttribute('aria-pressed', String(state.grid));\n    document.getElementById('vfGrid').classList.toggle('visible', state.grid);\n  });\n\n  document.getElementById('zebraBtn').addEventListener('click', e => {\n    state.zebra = !state.zebra;\n    e.currentTarget.setAttribute('aria-pressed', String(state.zebra));\n    renderViewfinder();\n  });\n\n  document.getElementById('soundBtn').addEventListener('click', e => {\n    state.sound = !state.sound;\n    e.currentTarget.setAttribute('aria-pressed', String(state.sound));\n    document.getElementById('soundLabel').textContent = state.sound ? 'TICK ON' : 'TICK OFF';\n    if (state.sound) playTick(true);\n  });\n\n  // Reset All\n  document.getElementById('resetAllBtn').addEventListener('click', () => {\n    state.ev = PARAMS.ev.defaultVal;\n    state.wb = PARAMS.wb.defaultVal;\n    state.iso = PARAMS.iso.defaultVal;\n    state.dialAngle = 0;\n    playTick(true);\n    updateUI();\n    statusText.textContent = 'ALL CHANNELS ZEROED';\n  });\n\n  // Shutter capture\n  document.getElementById('shutterBtn').addEventListener('click', () => {\n    const flash = document.getElementById('shutterFlash');\n    flash.classList.add('fire');\n    requestAnimationFrame(() => requestAnimationFrame(() => flash.classList.remove('fire')));\n    state.shots++;\n    document.getElementById('shotCounter').textContent = String(state.shots).padStart(3, '0');\n    playTick(true);\n    statusText.textContent = `CAPTURED DNG #${String(state.shots).padStart(3, '0')} · ${PARAMS.ev.short(state.ev)}EV ${state.wb}K`;\n  });\n\n  // Presets\n  const PRESETS = {\n    neutral: { ev: 0.0, wb: 5200, iso: 6, label: 'DAYLIGHT NEUTRAL' },\n    golden: { ev: 0.4, wb: 6800, iso: 4, label: 'GOLDEN DUSK' },\n    tungsten: { ev: -0.5, wb: 3300, iso: 11, label: 'TUNGSTEN ALLEY' },\n    night: { ev: -1.1, wb: 4100, iso: 17, label: 'HIGH-ISO NIGHT' }\n  };\n\n  document.querySelectorAll('.preset-chip').forEach(chip => {\n    chip.addEventListener('click', () => {\n      const p = PRESETS[chip.dataset.preset];\n      state.ev = p.ev;\n      state.wb = p.wb;\n      state.iso = p.iso;\n      playTick(true);\n      updateUI(true);\n      statusText.textContent = `PRESET APPLIED · ${p.label}`;\n    });\n  });\n\n  window.addEventListener('resize', renderRuler);\n  updateUI(true);\n})();\n</script>\n</body>\n</html>\n"
}
