"""Build the Lumen Digital Experience Strategist cover letter DOCX."""
import os
from docx import Document
from docx.shared import Pt, RGBColor, Inches, Cm
from docx.enum.text import WD_ALIGN_PARAGRAPH

NAVY = RGBColor(0x1F, 0x38, 0x64)
BLACK = RGBColor(0x00, 0x00, 0x00)
DARK = RGBColor(0x33, 0x33, 0x36)

NAME = "ROB BLAKE"
CONTACT = "Phone: 303-800-7628  •  rkblake@gmail.com  •  LinkedIn.com/in/robkblake"
DATE = "July 25, 2026"
COMPANY = "Lumen Technologies"
TITLE = "Digital Experience Strategist — Req 342726"
JOB_ID = "1133914260023"

PARA_1 = (
    "I am applying for the Digital Experience Strategist role on the Web Experience team (req 342726). "
    "I spent five years at Lumen as a Marketing Automation Manager, owning the campaign measurement, "
    "tracking, and segmentation backbone that supported our global demand gen and brand programs. "
    "Coming back to Lumen in a strategist role that sits at the intersection of experience architecture, "
    "content, and marketing technology feels like a natural next step rather than a leap."
)

PARA_2 = (
    "The strongest fit for this role is the throughline I have on the Adobe experience stack. "
    "At Level 3 Communications, I built the business case and managed the Adobe vendor relationship for "
    "the migration from Webtrends to Adobe Analytics, DTM, and Target across all customer-facing web "
    "properties, and ran the A/B and multivariate testing program on top of that. I extended the same "
    "measurement backbone at Trimble (variable taxonomy and multi-channel data layer) and at PMI "
    "(Adobe Analytics workspaces, segments, calculated metrics, and fallout visualizations) where I "
    "owned end-to-end measurement of marketing performance across paid, owned, and earned channels in a "
    "global B2B environment. On the AEM side, I worked hands-on during the CenturyLink to Lumen rebrand "
    "— the Marketo team was not the day-to-day owner, but we partnered with the dev team on critical "
    "website changes for the launch, so I know the authoring and component model well enough to ramp "
    "quickly to daily ownership. On 6sense, I have studied the category in my current AI education work "
    "— predictive analytics, intent data, and AI agents for account targeting — without having owned a "
    "production implementation. Optimizely I have used in past engagements, not extensively. "
    "I am honest about which depth each tool currently sits at."
)

PARA_3 = (
    "Since leaving Lumen I have built that operational grammar into AI workflow practice. "
    "I build production AI marketing agents and automation workflows with Claude Code, n8n, Zapier, "
    "and MCP connectors, and the same pattern — define the rule, instrument the data, test the variant, "
    "measure the lift — is exactly what a continuous testing cadence on a B2B web experience needs. "
    "I am also reaching out to former Lumen colleagues for an introduction to the Web Experience team "
    "and the hiring manager. Thank you for the consideration. I am flexible on time zone for a quick "
    "conversation and would value the chance to walk through the resume and answer any questions."
)

doc = Document()
section = doc.sections[0]
section.top_margin = Cm(1.8)
section.bottom_margin = Cm(1.8)
section.left_margin = Cm(2.0)
section.right_margin = Cm(2.0)

p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(2)
run = p.add_run(NAME); run.bold = True; run.font.size = Pt(14); run.font.color.rgb = NAVY; run.font.name = "Calibri"
p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(12)
run = p.add_run(CONTACT); run.font.size = Pt(10); run.font.color.rgb = DARK; run.font.name = "Calibri"

p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(8)
run = p.add_run(DATE); run.font.size = Pt(11); run.font.color.rgb = DARK; run.font.name = "Calibri"

p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(2)
run = p.add_run("Lumen Technologies"); run.bold = True; run.font.size = Pt(11); run.font.color.rgb = DARK; run.font.name = "Calibri"
p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(2)
run = p.add_run("Attn: Talent Acquisition — Web Experience Team"); run.font.size = Pt(11); run.font.color.rgb = DARK; run.font.name = "Calibri"
p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(12)
run = p.add_run(f"Re: {TITLE} (Job ID {JOB_ID})"); run.font.size = Pt(11); run.font.color.rgb = DARK; run.font.name = "Calibri"

def body(text, space_after=8):
    p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(space_after); p.paragraph_format.line_spacing = Pt(14)
    run = p.add_run(text); run.font.size = Pt(11); run.font.color.rgb = DARK; run.font.name = "Calibri"

body("Dear Hiring Team,")
body(PARA_1)
body(PARA_2)
body(PARA_3)
body("Best regards,")

p = doc.add_paragraph(); p.paragraph_format.space_after = Pt(0)
run = p.add_run("Rob Blake"); run.bold = True; run.font.size = Pt(11); run.font.color.rgb = NAVY; run.font.name = "Calibri"

out_path = "/root/.hermes/vault/01_Job_Seeker/Rob_Blake_Cover_Lumen_Digital-Experience-Strategist.docx"
os.makedirs(os.path.dirname(out_path), exist_ok=True)
doc.save(out_path)
print(f"Saved: {out_path}")
print(f"Size: {os.path.getsize(out_path)} bytes")
print(f"Paragraphs: {len(doc.paragraphs)}")
print(f"Words: {len((' '.join(p.text for p in doc.paragraphs)).split())}")
