from PIL import Image, ImageDraw, ImageFont
F='/usr/share/fonts/truetype/wlg/Montserrat.ttf'
def f(s,n='Bold'):
    ft=ImageFont.truetype(F,s)
    try: ft.set_variation_by_name(n)
    except Exception: pass
    return ft
TEAL=(0,81,81); AMBER=(243,174,61); SKY=(175,214,230); WHITE=(255,255,255)
W,H=1200,1500
img=Image.new('RGB',(W,H),TEAL); d=ImageDraw.Draw(img)
M=100; LAB=430

d.rectangle([0,0,W,10],fill=AMBER)
d.text((M,78),"WLG",font=f(44,'Bold'),fill=AMBER)
_sf = f(22,'SemiBold')
_st = '  '.join(list('BEYOND BORDERS')).replace('     ','    ')
d.text((W-M-d.textlength(_st, font=_sf), 92), _st, font=_sf, fill=AMBER)

d.text((M,182),"What working with WLG",font=f(58,'Bold'),fill=WHITE)
d.text((M,252),"actually looks like",font=f(58,'Bold'),fill=WHITE)

rows=[("3","CVs on average to fill a role,","with clients who know us"),
      ("100+","roles closed every year",""),
      ("200","close to two hundred consultants","out on client projects worldwide")]
y=400
for big,l1,l2 in rows:
    d.text((M,y),big,font=f(96,'Bold'),fill=AMBER)
    if l2:
        d.text((LAB,y+12),l1,font=f(30,'Medium'),fill=WHITE)
        d.text((LAB,y+54),l2,font=f(30,'Medium'),fill=SKY)
    else:
        d.text((LAB,y+33),l1,font=f(30,'Medium'),fill=WHITE)
    y+=170

d.rectangle([M,960,W-M,962],fill=(0,112,112))
d.text((M,1030),"Senior and director level.",font=f(40,'SemiBold'),fill=WHITE)
d.text((M,1086),"Niche and hard-to-find roles.",font=f(40,'SemiBold'),fill=WHITE)
d.text((M,1166),"Offices in Poland and the Netherlands,",font=f(28,'Regular'),fill=SKY)
d.text((M,1206),"hiring across Europe and beyond.",font=f(28,'Regular'),fill=SKY)
d.rectangle([M,1284,M+140,1290],fill=AMBER)
d.text((M,1336),"One recruiter, from the brief to the offer.",font=f(38,'SemiBold'),fill=WHITE)
img.save('/workspace/pub/wlg_work_sample.png')
print("ok", img.size)
