{# Brutalist BADGE — LIGHT substrate (v0.3.13 rebuild, reference prototype).
   Four-role: INK left panel (--dna-ink-primary) with CREAM knockout glyph +
   label (--dna-brand-text); ACCENT seam + chassis rail + value + indicator
   (--dna-signal); GROUND right panel (--dna-surface). Cohesion over CI-state
   colour: the brutalist-light badge keeps everything in the variant accent and
   lets the value WORD carry state (single-channel encoding). #}

<g clip-path="url(#{{ uid }}-clip)">
  {# Left INK panel (glyph + label zone) + right GROUND panel (value zone). The
     ground panel butts at left_panel_width — the 2px accent seam (below) draws
     on top of the boundary, so there's no separator-zone gap. #}
  <rect width="{{ left_panel_width }}" height="{{ h }}" fill="var(--dna-ink-primary)"/>
  <rect x="{{ light_right_panel.x }}" width="{{ light_right_panel.w }}" height="{{ h }}" fill="var(--dna-surface)"/>
</g>

{# Perimeter — ink hairline (variants raise stroke_opacity to 0.20 for paper). #}
<rect x="{{ light_perimeter_inset }}" y="{{ light_perimeter_inset }}" width="{{ light_perimeter_w }}" height="{{ light_perimeter_h }}" fill="none" stroke="var(--dna-ink-primary)" stroke-opacity="{{ stroke_opacity | default('0.20') }}"/>

{# Left ACCENT chassis rail (4px) over the ink panel's left edge. #}
<rect x="{{ badge_origin_x }}" y="{{ badge_origin_y }}" width="{{ accent_w }}" height="{{ h }}" fill="var(--dna-signal)" data-hw-zone="accent-bar"/>

{# ACCENT seam at the panel boundary (2px) — the single divider between the
   ink label panel and the ground value panel. #}
<rect x="{{ left_panel_width }}" y="{{ badge_origin_y }}" width="{{ light_badge_seam_w }}" height="{{ h }}" fill="var(--dna-signal)"/>

{# Glyph — CREAM knockout on the ink panel. #}
{% if has_glyph and glyph_svg %}
<g data-hw-zone="glyph" transform="translate({{ glyph_x }},{{ glyph_y }})">
  {{ glyph_svg | safe }}
</g>
{% endif %}

{# Label — CREAM knockout on the ink panel. #}
<text data-hw-zone="label"
      x="{{ label_x }}" y="{{ text_y }}"
      text-anchor="middle"
      font-family="var(--dna-font-mono, 'SF Mono', monospace)"
      font-size="11" font-weight="700"
      fill="var(--dna-brand-text)"
      letter-spacing="0.06em"{% if label_text_length and label_text_length > 0 %} textLength="{{ label_text_length }}" lengthAdjust="spacingAndGlyphs"{% endif %}>{{ label_display | default(label | upper) }}</text>

{# Value — ACCENT on the ground panel. #}
<text data-hw-zone="value"
      x="{{ value_x }}" y="{{ text_y }}"
      text-anchor="middle"
      font-family="var(--dna-font-mono, 'SF Mono', monospace)"
      font-size="11" font-weight="700"
      fill="var(--dna-signal)"
      letter-spacing="0.04em"{% if value_text_length and value_text_length > 0 %} textLength="{{ value_text_length }}" lengthAdjust="spacingAndGlyphs"{% endif %}>{{ value }}</text>

{# Status indicator — concentric ACCENT ring + dot on the ground panel. #}
{% if show_indicator %}
{% set indicator_ring_class = "" %}
{% set indicator_ring_stroke = "var(--dna-signal)" %}
{% set indicator_stroke_width_value = light_indicator_stroke_width %}
{% set indicator_bit_class = "hw-logic-bit" %}
{% set indicator_bit_fill = "var(--dna-signal)" %}
{% include "frames/badge/indicators/" ~ indicator_shape ~ "-indicator.j2" %}
{% endif %}
