{# Chrome icon content: 5/6-layer chrome material stack.
   Specimens: chrome-social-icon-circle-v2.svg + -square-v2.svg.
   v0.2.16: full rewrite to match v2 specimens. Both variants render at
   width=64 height=64 with viewBox=0 0 120 120 (chrome paradigm declares
   icon.viewbox_w=120 in chrome.yaml). Internal coordinates are in 120-unit
   space — every hairline, rail width, and bezel radius from v1's tuned
   material discipline scales uniformly to 64px display.

   Variant gating: icon_variant == 'binary-square' → card; else → circle.
   icon_variant comes from resolve_icon (resolver.py:740-747); chrome
   paradigm uses 'binary-circular' / 'binary-square' for circle / square.
#}
{% if icon_variant | default('binary-circular') == 'binary-square' %}
{# ─── Square variant ─── 96×96 rx=6 card at (12, 12) · 6-layer stack
       Layer order (matches v2 spec):
         1. envelope-fill rect with bevel filter
         2. inner hairline from chrome_icon_inner_stroke
         3. icon-well radial gradient
         4. env-rail vertical envelope sliver
         5. top accent from chrome_icon_top_accent
         6. rim-sweep stroke animated over the inner perimeter
       Glyph inlined at local (30, 30) → canvas (42, 42), 36×36 centered. #}
<g transform="translate({{ icon_geometry.chrome_square_group_x }}, {{ icon_geometry.chrome_square_group_y }})">
  <rect width="{{ icon_geometry.chrome_square_outer_w }}" height="{{ icon_geometry.chrome_square_outer_h }}" rx="{{ icon_geometry.chrome_square_outer_rx }}" fill="url(#{{ uid }}-env)" filter="url(#{{ uid }}-bevel)"/>
  <rect x="{{ icon_geometry.chrome_square_inner_x }}" y="{{ icon_geometry.chrome_square_inner_y }}" width="{{ icon_geometry.chrome_square_inner_w }}" height="{{ icon_geometry.chrome_square_inner_h }}" rx="{{ icon_geometry.chrome_square_inner_rx }}" fill="none" stroke="{{ chrome_icon_inner_stroke }}" stroke-width="0.7"/>
  <rect x="{{ icon_geometry.chrome_square_well_x }}" y="{{ icon_geometry.chrome_square_well_y }}" width="{{ icon_geometry.chrome_square_well_w }}" height="{{ icon_geometry.chrome_square_well_h }}" rx="{{ icon_geometry.chrome_square_well_rx }}" fill="url(#{{ uid }}-well)"/>
  <rect x="{{ icon_geometry.chrome_square_rail_x }}" y="{{ icon_geometry.chrome_square_rail_y }}" width="{{ icon_geometry.chrome_square_rail_w }}" height="{{ icon_geometry.chrome_square_rail_h }}" fill="url(#{{ uid }}-env-rail)" opacity="0.85"/>
  <rect x="{{ icon_geometry.chrome_square_accent_x }}" y="{{ icon_geometry.chrome_square_accent_y }}" width="{{ icon_geometry.chrome_square_accent_w }}" height="{{ icon_geometry.chrome_square_accent_h }}" fill="{{ chrome_icon_top_accent }}" opacity="0.16"/>
  <rect x="{{ icon_geometry.chrome_square_inner_x }}" y="{{ icon_geometry.chrome_square_inner_y }}" width="{{ icon_geometry.chrome_square_inner_w }}" height="{{ icon_geometry.chrome_square_inner_h }}" rx="{{ icon_geometry.chrome_square_inner_rx }}" fill="none" stroke="url(#{{ uid }}-rim)" stroke-width="0.9"/>
{% if glyph_path %}
  <svg viewBox="{{ glyph_viewbox }}" width="{{ icon_geometry.chrome_square_glyph_size }}" height="{{ icon_geometry.chrome_square_glyph_size }}" x="{{ icon_geometry.chrome_square_glyph_x }}" y="{{ icon_geometry.chrome_square_glyph_y }}" overflow="visible">
    <path d="{{ glyph_path }}"{% if glyph_fill_rule %} fill-rule="{{ glyph_fill_rule }}"{% endif %} fill="{{ glyph_fill }}"/>
  </svg>
{% endif %}
</g>

{% else %}
{# ─── Circle variant ─── 92-unit chrome ring centered at (60, 60) · 4-layer stack
       Layer order (matches v2 spec):
         1. envelope-gradient bezel ring
         2. radial icon-well
         3. chrome_icon_inner_stroke hairline between bezel and well
         4. travelling rim-stroke
       Square variant retains the bevel filter (96×96 fill geometry is wide
       enough for the specular kernel to read as smooth metallic surface).
       Glyph inlined at local (-24, -24) → canvas (36, 36), 48×48 centered. #}
<g transform="translate({{ icon_geometry.chrome_circle_group_x }}, {{ icon_geometry.chrome_circle_group_y }})">
  <circle r="{{ icon_geometry.chrome_circle_outer_r }}" fill="none" stroke="url(#{{ uid }}-env)" stroke-width="5"/>
  <circle r="{{ icon_geometry.chrome_circle_well_r }}" fill="url(#{{ uid }}-well)"/>
  <circle r="{{ icon_geometry.chrome_circle_well_r }}" fill="none" stroke="{{ chrome_icon_inner_stroke }}" stroke-width="0.6"/>
  <circle r="{{ icon_geometry.chrome_circle_well_r }}" fill="none" stroke="url(#{{ uid }}-rim)" stroke-width="1.0"/>
{% if glyph_path %}
  <svg viewBox="{{ glyph_viewbox }}" width="{{ icon_geometry.chrome_circle_glyph_size }}" height="{{ icon_geometry.chrome_circle_glyph_size }}" x="{{ icon_geometry.chrome_circle_glyph_x }}" y="{{ icon_geometry.chrome_circle_glyph_y }}" overflow="visible">
    <path d="{{ glyph_path }}"{% if glyph_fill_rule %} fill-rule="{{ glyph_fill_rule }}"{% endif %} fill="{{ glyph_fill }}"/>
  </svg>
{% endif %}
</g>

{% endif %}
