{# Border motion: corner-trace — single runner tracing the perimeter.
   Context: uid, w, h, rx, perim, vis, gap #}
{% set defs %}{% endset %}
{% set overlay %}
<rect x="{{ border_rect_x }}" y="{{ border_rect_y }}" width="{{ border_rect_w }}" height="{{ border_rect_h }}" rx="{{ rx }}"
      fill="none" stroke="var(--dna-signal)" stroke-width="2"
      stroke-dasharray="{{ vis }} {{ gap }}">
  <animate attributeName="stroke-dashoffset"
           values="0;-{{ perim }}" dur="4s" repeatCount="indefinite"/>
</rect>
{% endset %}
