"""Stroke-based reconstruction of the Aura mark: six outward arrows on hexagon vertices plus a centre Y."""
import math, sys

def mark(color="#026fe5", w=4.6, R=20.2, arm=5.2, shaft=6.7, y_len=7.0, stem=7.4, y_c=(22, 22.0), hexagon=False,
         shafts=True, center=True, chevrons=True, box=(44, 45)):
    cx, cy = box[0] / 2, box[1] / 2
    fit = min(cy, cx / math.cos(math.radians(30))) - w / 2 - 0.2  # keep round caps inside the viewBox
    if R > fit:
        k = fit / R
        R, arm, shaft = fit, arm * k, shaft * k
    parts = []
    for k in range(6):
        a = math.radians(-90 + 60 * k)
        vx, vy = cx + R * math.cos(a), cy + R * math.sin(a)
        d = [f"M{vx:.2f},{vy:.2f}"]
        if chevrons:
            for s in (-1, 1):
                e = a + math.radians(180 + s * 60)  # along the two hexagon edges
                d.append(f"M{vx + arm * math.cos(e):.2f},{vy + arm * math.sin(e):.2f}L{vx:.2f},{vy:.2f}")
        if shafts:
            d.append(f"M{vx:.2f},{vy:.2f}L{vx - shaft * math.cos(a):.2f},{vy - shaft * math.sin(a):.2f}")
        parts.append("".join(d[1:]) if chevrons or shafts else "")
    if center:
        x0, y0 = y_c
        for ang in (-150, -30, 90):
            t = math.radians(ang); ln = stem if ang == 90 else y_len
            parts.append(f"M{x0},{y0}L{x0 + ln * math.cos(t):.2f},{y0 + ln * math.sin(t):.2f}")
    if hexagon:
        pts = [(cx + R * math.cos(math.radians(-90 + 60 * k)), cy + R * math.sin(math.radians(-90 + 60 * k))) for k in range(6)]
        parts.append("M" + "L".join(f"{x:.2f},{y:.2f}" for x, y in pts) + "Z")
    p = "".join(parts)
    return (f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {box[0]} {box[1]}">'
            f'<path d="{p}" fill="none" stroke="{color}" stroke-width="{w}" stroke-linecap="round" stroke-linejoin="round"/></svg>')

# Forms of the mark (decisions.md, 21 October 2026, "вариант А"): the small form is a little denser.
PRESETS = {
    "full": dict(w=4.6, R=20.2, arm=5.2, shaft=6.7, y_len=7.0, stem=7.4),
    "small": dict(w=5.0, R=20.2, arm=4.8, shaft=6.0, y_len=6.6, stem=7.0),
}
SMALL_MAX_PX = 22  # decisions.md, 22 October 2026: the small form up to 22 px, the full one from 23


def form_for(px):
    return "small" if px <= SMALL_MAX_PX else "full"


def mark_svg(color, px):
    return mark(color=color, **PRESETS[form_for(px)])


if __name__ == "__main__":
    print(mark())
