{# HyperWeave Glyph Component — unified renderer.
   Modes: auto (genome-dependent), fill (solid), wire (stroke-only).
   Expects: glyph_path, glyph_viewbox, glyph_mode, glyph_scale,
            glyph_cx, glyph_cy (center point) #}
{% set mode = glyph_mode | default('auto') %}
{% set vb = glyph_viewbox | default('0 0 640 640') %}
{% set vb_cx = glyph_viewbox_cx | default(320) %}
{% set vb_cy = glyph_viewbox_cy | default(320) %}
{% set scale = glyph_scale | default(0.0219) %}
<g data-hw-zone="glyph" transform="translate({{ glyph_cx }},{{ glyph_cy }})">
{% if mode == 'wire' %}
  {# Wire mode: stroke-only, no fill #}
  <g transform="scale({{ scale }}) translate(-{{ vb_cx }},-{{ vb_cy }})">
    <path d="{{ glyph_path }}"{% if glyph_fill_rule %} fill-rule="{{ glyph_fill_rule }}"{% endif %} fill="none"
          stroke="var(--dna-signal)" stroke-width="16"
          stroke-linecap="round" stroke-linejoin="round"/>
  </g>
{% elif mode == 'fill' or mode == 'auto' %}
  {# Fill mode: solid fill with genome signal color #}
  <g transform="scale({{ scale }}) translate(-{{ vb_cx }},-{{ vb_cy }})">
    <path d="{{ glyph_path }}"{% if glyph_fill_rule %} fill-rule="{{ glyph_fill_rule }}"{% endif %} fill="var(--dna-signal)" stroke="none"/>
  </g>
{% endif %}
</g>
