import os
import re

tokens = {
    "CLIENT_NAME": "NaturallyRachB",
    "DATE": "2026-04-19",
    "PERIOD": "April 19 – May 3, 2026",
    "TARGET_MARKET": "Natural hair &amp; beauty",
    "ACTIVE_CAMPAIGN": "None — selecting first product",
    "CYCLE_ID": "naturallyrachb-2026-04-14",
    "SOURCE_COUNT": "221",
    "PAIN_COUNT": "7",
    "COMP_COUNT": "5",
    "REVIEW_COUNT": "208",
    "KW_COUNT": "8",
    "CLIENT_ID": "naturallyrachb",

    "SUMMARY_TAKEAWAY": "Rachel is perfectly positioned at the intersection of bridal natural hair and science-backed hair care — a space competitors are orbiting but none own — and this cycle confirms the audience is actively searching for both right now.",

    "FINDING_1": "Bridal natural hair content is generating sustained engagement across 3 independent sources: @_lalaronay&#39;s &quot;curls are ALWAYS invited&quot; reel (4,042 vel/day) + audience comment &quot;I&#39;m getting married this year and was JUST looking up curly bride hairstyles 🔥&quot; + r/curlyhair wedding post (64 comments). High-confidence cross-platform signal.",
    "FINDING_2": "The &quot;selfish era&quot; / self-prioritization narrative is the dominant engagement driver in the niche right now — @iamcrystalnicolee&#39;s top 2 posts this cycle are both about choosing yourself first, with 10+ comment instances of nearly identical language. Rachel&#39;s Mindset pillar (Pillar 3) is perfectly aligned.",
    "FINDING_3": "There is a hidden audience watching Rachel&#39;s content with chemically processed hair — one client comment (&quot;Me watching all your videos with my relaxed hair 👀😭&quot;) surfaces an untapped segment of curious-but-not-yet-natural women that no competitor in this dataset is addressing. Directional — validate next cycle.",
    "FINDING_4": "Rachel&#39;s biochemistry background is her uncontested competitive advantage — none of the 5 competitors reference science credentials, yet r/HaircareScience shows 4 active technical questions (humectants, heat damage type 4, scalp care, chlorine) with no creator-format answers available.",

    "MARKET_OPPORTUNITY": "Science-backed bridal natural hair guidance from a credentialed biochemist — zero competitors in this dataset own this intersection, and the audience is actively arriving at it.",
    "WHY_NOW": "Bridal season (spring/summer) is beginning. @_lalaronay went viral with curly bridal content this week. Sephora Spring Sale is live right now (itsbabykelz haul at 92,870 vel/day April 9). Rachel is personally planning her wedding — the personal story is live and closing.",

    "OPTION_1_NAME": "Curls Always Invited — Bridal Natural Hair Guide",
    "OPTION_1_RATIONALE": "3 independent sources confirm bridal x natural hair demand. Rachel&#39;s personal wedding timing is a once-in-a-lifetime launch window — she can build this from lived experience right now. Ranked #1 because no competitor can replicate this combination.",
    "OPTION_2_NAME": "Know Your Hair Porosity Kit",
    "OPTION_2_RATIONALE": "Monetizes her professional hair analysis background directly. KB FAQ confirms porosity is the #1 recurring question. Natural upsell after the bridal guide builds a list.",
    "OPTION_3_NAME": "Science-Backed Sephora Faves Guide + LTK",
    "OPTION_3_RATIONALE": "Fastest to execute (no build time), Sephora sale is live NOW — itsbabykelz haul at 92K vel/day confirms the window is open. Starts affiliate income while building toward a paid product.",
    "OPTION_4_NAME": "The Curious Naturalist Transition Guide",
    "OPTION_4_RATIONALE": "Addresses the hidden relaxed-hair audience — directional signal from one client comment but high strategic value. Low-barrier email opt-in. Validate next cycle before building.",
    "OPTION_5_NAME": "Hair Without the Hype Science Masterclass",
    "OPTION_5_RATIONALE": "Rachel&#39;s uncontested differentiation at scale, but needs a larger list to convert at $97–$197. Build this after Options 1–3 establish the audience.",

    "RECOMMENDED_FIRST_MOVE": "Option 1 — Bridal Natural Hair Guide. Rachel is personally planning her wedding now — the most authentic launch window she will ever have, and it&#39;s closing. Competitor data confirms demand; @_lalaronay&#39;s bridal content getting 4K+ vel/day and comments requesting more. Build this now. Option 2 (porosity kit) is the natural upsell once a list exists.",
    "AGENT_NOTES": "Twitter failed (0 results) — missing trending audio data. LinkedIn skipped (no li_at). DataForSEO timed out — keyword volumes are estimates. TikTok @naturallyrachb returned 0 comments — account may have comments restricted. Client comment data is thin (8 total) — all audience signal findings are directional until validated next cycle. @endlessmomdiary and @lifethru.angie are lifestyle accounts, de-weighted. No active campaign or product currently exists.",

    "PAIN_1_LABEL": "Not knowing if a style will work on my hair",
    "PAIN_1_COUNT": "12",
    "PAIN_1_QUOTE": "Watch me try this and not look this gooodddd",
    "PAIN_1_SOURCES": "@naturallyrachb client comment + @_lalaronay comments (gel frustration)",
    "PAIN_1_ANGLE": "Before/after format with science explanation of why the style works for specific hair types",

    "PAIN_2_LABEL": "Putting yourself last — burned out, no identity",
    "PAIN_2_COUNT": "15",
    "PAIN_2_QUOTE": "Yep im definitely in my selfish era. I did the service era now it&#39;s service myself",
    "PAIN_2_SOURCES": "@iamcrystalnicolee competitor comments — 10+ instances of nearly identical &quot;selfish era&quot; framing",
    "PAIN_2_ANGLE": "Morning routine / self-prioritization content connecting natural hair care to self-love",

    "PAIN_3_LABEL": "Wearing natural hair for a high-stakes occasion (wedding, event)",
    "PAIN_3_COUNT": "6",
    "PAIN_3_QUOTE": "I&#39;m getting married this year and was JUST looking up curly bride hairstyles 🔥🔥🔥 thank you!",
    "PAIN_3_SOURCES": "@_lalaronay comment section (2 direct bridal mentions) + r/curlyhair wedding post (64 comments)",
    "PAIN_3_ANGLE": "Bridal natural hair content — reassurance, tutorials, product recommendations for the big day",

    "PAIN_4_LABEL": "Not feeling feminine with natural hair",
    "PAIN_4_COUNT": "5",
    "PAIN_4_QUOTE": "I feel the most feminine when I bring out the fro 🖤",
    "PAIN_4_SOURCES": "r/NaturalHair (1 post, 121 comments — high engagement signals deep resonance)",
    "PAIN_4_ANGLE": "Affirmation + style content linking natural texture to femininity and beauty",

    "PAIN_5_LABEL": "Product confusion and conflicting advice",
    "PAIN_5_COUNT": "8",
    "PAIN_5_QUOTE": "What holding gel do you use? I can&#39;t get my hair to sleek for nothing!",
    "PAIN_5_SOURCES": "@_lalaronay comment section + @itsbabykelz &quot;battle of gels&quot; format (competitor strategy)",
    "PAIN_5_ANGLE": "Product comparison / battle format — &quot;I tested 5 gels so you don&#39;t have to (science explains why)&quot;",

    "PAIN_6_LABEL": "Hairline acne linked to haircare products",
    "PAIN_6_COUNT": "4",
    "PAIN_6_QUOTE": "Are these spots on my face clogged pores? If they are, what&#39;s the best remedy?",
    "PAIN_6_SOURCES": "r/SkincareAddiction (1 post, 392 comments — highest Reddit engagement) + Rachel&#39;s KB FAQ",
    "PAIN_6_ANGLE": "Hair product ingredients clogging pores — Rachel&#39;s chemistry background is uniquely suited here",

    "PAIN_7_LABEL": "No science-backed answers to hair care questions",
    "PAIN_7_COUNT": "4",
    "PAIN_7_QUOTE": "Why are there humectants in shampoo? / Are type 4 naturals less likely to get heat damage?",
    "PAIN_7_SOURCES": "r/HaircareScience (4 distinct technical questions with no creator-format answers available)",
    "PAIN_7_ANGLE": "Science explainer format — Rachel&#39;s biochemistry credentials differentiate her completely",

    "HIGH_FREQ_PAIN": "Self-prioritization / choosing yourself first (10+ comments with identical language)",
    "EMOTIONAL_PAIN": "&quot;Not feeling feminine with natural hair&quot; — r/NaturalHair 121-comment post signals deep identity-level vulnerability",
    "GAP_PAIN": "Science-backed natural hair guidance from a credentialed creator — zero competitors in this dataset offer this",

    "COMP_1_NAME": "@_lalaronay",
    "COMP_1_URL": "instagram.com/_lalaronay",
    "COMP_1_LEAD": "Lifestyle + curly hair identity (bridal arc)",
    "COMP_1_PRICE": "Free content",
    "COMP_1_CLAIM": "a reminder that your curls are ALWAYS invited",
    "COMP_1_OFFER": "Wash day POVs, gel comparisons, bridal curl content",
    "COMP_1_GAP": "No science depth — product recs without explaining why they work",
    "COMP_1_LANG": "&quot;Combo,&quot; &quot;battle of the gels&quot; — avoid copying these exact hooks",

    "COMP_2_NAME": "@iamcrystalnicolee",
    "COMP_2_URL": "instagram.com/iamcrystalnicolee",
    "COMP_2_LEAD": "Self-care / &quot;selfish era&quot; identity content",
    "COMP_2_PRICE": "Free content",
    "COMP_2_CLAIM": "the hours I think of no one else but me",
    "COMP_2_OFFER": "Morning routines, vacation looks, product reviews",
    "COMP_2_GAP": "No hair depth — surface-level beauty, no science",
    "COMP_2_LANG": "&quot;Selfish era,&quot; &quot;choosing me&quot; — adjacent but without Rachel&#39;s hair angle",

    "COMP_3_NAME": "@itsbabykelz",
    "COMP_3_URL": "tiktok.com/@itsbabykelz",
    "COMP_3_LEAD": "Budget beauty + Sephora haul / trending products",
    "COMP_3_PRICE": "Free content",
    "COMP_3_CLAIM": "expensive sh*t that I would add to your sephora cart",
    "COMP_3_OFFER": "Sephora hauls, product reviews, festival beauty",
    "COMP_3_GAP": "Generic beauty — no natural/Black hair specificity or science credentials",
    "COMP_3_LANG": "&quot;Baddie on a budget,&quot; &quot;this eats&quot; — genericizes what should be Rachel&#39;s science voice",

    "COMPLAINT_1": "I can&#39;t get my hair to sleek for nothing!",
    "COMPLAINT_1_SRC": "@_lalaronay comment section",
    "COMPLAINT_1_RATING": "High frustration",

    "COMPLAINT_2": "I can&#39;t wait until my kids are grown... I&#39;ll be able to enjoy mornings like this too",
    "COMPLAINT_2_SRC": "@iamcrystalnicolee comments",
    "COMPLAINT_2_RATING": "Exhausted, wistful",

    "COMPLAINT_3": "Definitely woulda been shaped like this if my momma didn&#39;t perm my hair in the 90s 🙄",
    "COMPLAINT_3_SRC": "@iamcrystalnicolee comments",
    "COMPLAINT_3_RATING": "Grief / identity loss",

    "COMPLAINT_4": "Me watching all your videos with my relaxed hair 👀😭",
    "COMPLAINT_4_SRC": "@naturallyrachb client comment",
    "COMPLAINT_4_RATING": "Curious but excluded",

    "PRAISE_1": "You have a lot of knowledge to share! ❤️🙌🔥",
    "PRAISE_1_SRC": "@naturallyrachb client comment",

    "PRAISE_2": "Beautiful curl pattern 😍 / Best curls out!!!",
    "PRAISE_2_SRC": "@_lalaronay comment section (bridal curl content)",

    "PRAISE_3": "FLAWLESS SKIN!! 🔥🔥 / Talk about glass skin, you are glowing honey 😍",
    "PRAISE_3_SRC": "@iamcrystalnicolee comments (skincare engagement)",

    "SWITCH_1_LABEL": "Seeking science-backed guidance, not opinions",
    "SWITCH_1_COUNT": "4",
    "SWITCH_1_SRC": "r/HaircareScience active questions",

    "SWITCH_2_LABEL": "Tired of product advice that doesn&#39;t translate to their hair",
    "SWITCH_2_COUNT": "8",
    "SWITCH_2_SRC": "Competitor comment sections + gel battle engagement",

    "SWITCH_3_LABEL": "Looking for a natural hair role model who&#39;s been where they are",
    "SWITCH_3_COUNT": "5",
    "SWITCH_3_SRC": "@naturallyrachb client comments + Rachel&#39;s personal story resonance",

    "INTENT_Q1": "curly bridal hairstyles",
    "INTENT_Q1_RANKS": "n/a (web data empty) — competitor content confirms active search",
    "INTENT_Q1_URGENCY": "Peak NOW — bridal season begins",
    "INTENT_Q1_GAP": "No credentialed hair scientist addressing bridal-specific needs",

    "INTENT_Q2": "natural hair porosity test",
    "INTENT_Q2_RANKS": "n/a — KB FAQ confirms as #1 recurring question",
    "INTENT_Q2_URGENCY": "Evergreen, always-on",
    "INTENT_Q2_GAP": "Generic blog answers; no creator with authority + audience",

    "INTENT_Q3": "best gel for natural hair wash and go",
    "INTENT_Q3_RANKS": "Active competitor content (@_lalaronay gel battle 3.3K vel)",
    "INTENT_Q3_URGENCY": "Spring wash-and-go season NOW",
    "INTENT_Q3_GAP": "Product comparisons exist but lack the scientific WHY",

    "INTENT_Q4": "natural hair wash day routine",
    "INTENT_Q4_RANKS": "Highly competitive — major YouTube presence",
    "INTENT_Q4_URGENCY": "Evergreen",
    "INTENT_Q4_GAP": "Overcrowded; Rachel needs chemistry angle to differentiate",

    "INTENT_Q5": "natural hair products sephora sale",
    "INTENT_Q5_RANKS": "Active right now — itsbabykelz haul viral this week",
    "INTENT_Q5_URGENCY": "RIGHT NOW — Sephora sale is live April 2026",
    "INTENT_Q5_GAP": "No Black hair-specific, science-credentialed guide to the sale exists",

    "INTENT_Q6": "type 4 hair heat damage prevention",
    "INTENT_Q6_RANKS": "r/HaircareScience active discussion",
    "INTENT_Q6_URGENCY": "Summer prep season starting",
    "INTENT_Q6_GAP": "Technical answers exist in text but not in creator video format",

    "ANGLE_1_NAME": "The Curly Bride",
    "ANGLE_1_HOOK": "Your curls aren&#39;t &#39;too much&#39; for your wedding day — they&#39;re the statement",
    "ANGLE_1_SIGNAL": "@_lalaronay bridal reel (4,042 vel) + comment &#39;I&#39;m getting married this year and JUST looking up curly bride hairstyles&#39; + r/curlyhair wedding post (64 comments)",

    "ANGLE_2_NAME": "The Selfish Era for Your Hair",
    "ANGLE_2_HOOK": "What if taking care of your hair was the most selfish — and necessary — thing you did today",
    "ANGLE_2_SIGNAL": "@iamcrystalnicolee self-prioritization content dominating engagement (36K+ vel, 99K likes); 10+ comment instances of identical &#39;selfish era&#39; language",

    "ANGLE_3_NAME": "The Science You Were Never Taught",
    "ANGLE_3_HOOK": "Your hair routine is failing because no one explained the chemistry",
    "ANGLE_3_SIGNAL": "r/HaircareScience (4 questions with no creator-format answers) + client comment &#39;You have a lot of knowledge to share!&#39; + Rachel&#39;s biochemistry background",

    "CRITERIA_1": "Women actively engaged with natural hair content on IG or TikTok",
    "CRITERIA_2": "Currently posting engagement questions about products or routines",
    "CRITERIA_3": "In a wedding, bridal, or major life milestone moment",
    "CRITERIA_4": "Science-curious women frustrated with conflicting product advice",

    "LP_1_HOOK": "I&#39;m using my biochemistry degree to make your wash day actually work",
    "LP_1_FORMAT": "Talking-head Reel (science explainer)",
    "LP_1_SIGNAL": "r/HaircareScience questions + client comment &#39;You have a lot of knowledge to share!&#39;",

    "LP_2_HOOK": "POV: figuring out your wedding hair when you&#39;re natural",
    "LP_2_FORMAT": "POV Reel / personal story format",
    "LP_2_SIGNAL": "@_lalaronay bridal content + &#39;getting married this year and JUST looking up curly bride hairstyles&#39;",

    "LP_3_HOOK": "I ranked every gel I could find for wash day — this one won (and the science explains why)",
    "LP_3_FORMAT": "Product comparison Reel",
    "LP_3_SIGNAL": "@_lalaronay &quot;battle of the gels&quot; (3,288 vel), gel frustration in comments",

    "LP_4_HOOK": "I&#39;m in my selfish era and my hair has never looked better",
    "LP_4_FORMAT": "Morning routine / lifestyle Reel with voiceover",
    "LP_4_SIGNAL": "@iamcrystalnicolee self-prioritization content at 36K+ vel, 10+ identical comment instances",

    "LP_5_HOOK": "If you&#39;re watching this with relaxed hair — this video is still for you",
    "LP_5_FORMAT": "Inclusive / transitioning narrative Reel",
    "LP_5_SIGNAL": "Client comment: &#39;Me watching all your videos with my relaxed hair 👀😭&#39;",

    "BLOG_1_TITLE": "How to Know If Your Hair Products Are Causing Breakouts (And What to Use Instead)",
    "BLOG_1_KW": "haircare products causing acne, natural hair skincare",
    "BLOG_1_INTENT": "Informational — connects Rachel&#39;s two content pillars in one piece",

    "BLOG_2_TITLE": "Natural Hair for Your Wedding Day: A Science-Backed Guide to Curl Products That Last",
    "BLOG_2_KW": "curly bridal hairstyles, natural hair wedding styles",
    "BLOG_2_INTENT": "Commercial/transactional — bridal season timing, zero science-based competitors",

    "EMAIL_1_SUBJECT": "The curly bride era is here — and I&#39;m making content for it",
    "EMAIL_1_LEAD": "Rachel&#39;s personal wedding planning + bridal natural hair research gap in the market",

    "EMAIL_2_SUBJECT": "Your hair isn&#39;t the problem. Your product order is.",
    "EMAIL_2_LEAD": "Biochemistry credential + product layering science — leads into porosity kit launch",

    "KW_1": "natural hair wash day routine",
    "KW_1_VOL": "22K–33K",
    "KW_1_COMP": "Low–Med",
    "KW_1_INTENT": "Informational",
    "KW_1_USE": "Long-form YouTube + blog tutorials",

    "KW_2": "curly hair wedding styles",
    "KW_2_VOL": "8K–12K",
    "KW_2_COMP": "Low",
    "KW_2_INTENT": "Transactional",
    "KW_2_USE": "Blog + Reels — bridal season NOW",

    "KW_3": "best gel for 4c hair",
    "KW_3_VOL": "~14K",
    "KW_3_COMP": "Medium",
    "KW_3_INTENT": "Commercial",
    "KW_3_USE": "Product comparison Reel + affiliate",

    "KW_4": "how to check hair porosity",
    "KW_4_VOL": "~18K",
    "KW_4_COMP": "Low",
    "KW_4_INTENT": "Informational",
    "KW_4_USE": "Short science explainer Reel + email opt-in",

    "KW_5": "natural hair products sephora",
    "KW_5_VOL": "~5K",
    "KW_5_COMP": "Low",
    "KW_5_INTENT": "Transactional",
    "KW_5_USE": "Timely Reel — create this week while sale is live",

    "KW_6": "hair products causing acne hairline",
    "KW_6_VOL": "~3K",
    "KW_6_COMP": "Medium",
    "KW_6_INTENT": "Commercial",
    "KW_6_USE": "Blog + Reel (Rachel&#39;s unique chemistry angle)",

    "KW_7": "big chop natural hair transition",
    "KW_7_VOL": "~9K",
    "KW_7_COMP": "Low",
    "KW_7_INTENT": "Informational",
    "KW_7_USE": "Transitioning audience entry content (Option 4 seed)",

    "KW_8": "natural hair care tips for beginners",
    "KW_8_VOL": "~15K",
    "KW_8_COMP": "Medium",
    "KW_8_INTENT": "Informational",
    "KW_8_USE": "Broad awareness Reels — top-of-funnel",

    "OBJ_1_Q": "I don&#39;t have time for a complicated natural hair routine",
    "OBJ_1_A": "Rachel&#39;s science approach is actually about simplification — knowing the why lets you do less, not more",
    "OBJ_1_SRC": "KB FAQ: &quot;a simple routine done consistently beats an elaborate one you can&#39;t stick to&quot;",

    "OBJ_2_Q": "I&#39;m not natural so this content isn&#39;t for me",
    "OBJ_2_A": "The science applies to all hair types — and the journey is gradual, not all-or-nothing",
    "OBJ_2_SRC": "Client comment: &quot;Me watching all your videos with my relaxed hair 👀😭&quot;",

    "OBJ_3_Q": "I&#39;ve tried so many products and nothing works",
    "OBJ_3_A": "Products can&#39;t work without understanding porosity first — the science changes what &#39;trying products&#39; even means",
    "OBJ_3_SRC": "@_lalaronay comments: &quot;I can&#39;t get my hair to sleek for nothing!&quot;",

    "PARTNER_1_TYPE": "Bridal hair stylists (natural hair specialists)",
    "PARTNER_1_DETAIL": "Collaborative Reels: Rachel provides science, stylist provides the hands-on look",
    "PARTNER_1_SRC": "@_lalaronay bridal arc + r/curlyhair wedding content",

    "PARTNER_2_TYPE": "Clean beauty skincare brands",
    "PARTNER_2_DETAIL": "Hairline breakout angle = perfect collab hook for ingredient-conscious brands",
    "PARTNER_2_SRC": "r/SkincareAddiction (392-comment clogged pores post) + Rachel&#39;s chemistry background",

    "PARTNER_3_TYPE": "Sephora / Ulta affiliate + natural hair product brands",
    "PARTNER_3_DETAIL": "Science-credentialed product recs convert better than standard hauls; Sephora sale timing is NOW",
    "PARTNER_3_SRC": "@itsbabykelz Sephora haul at 92K vel/day + @_lalaronay gel comparison engagement",

    "ACTIVE_PRODUCT": "None (selecting from this brief)",
    "ACTIVE_CTA": "N/A",
    "CAMPAIGN_NARRATIVE": "No active campaign exists. This research cycle IS the campaign setup. Every piece of content in Weeks 1–2 should build toward whichever product option is selected from the product picker. The bridal guide (Option 1) would make Weeks 1–2 a pre-launch content runway. The porosity kit (Option 2) would make the science explainer angle the primary awareness driver.",

    "KB_URL": "https://docs.google.com/document/d/1t4h5VpZybIcW3VePBGX8Ugtm1VqGEu4mQqNiE6jj9SA/edit",
    "KB_APPEND_DATE": "2026-04-19",
    "KB_PILLAR_1_STATUS": "Natural Hair Care — evidence-based techniques and routines",
    "KB_PILLAR_2_STATUS": "Natural Beauty &amp; Skincare — ingredient-conscious routines",
    "KB_PILLAR_3_STATUS": "Mindset &amp; Self-Confidence — unlearning internalized beauty standards",
    "KB_PILLAR_4_STATUS": "Bridal &amp; Wedding Hair — science-backed guidance for natural brides (NEW this cycle)",
    "KB_PILLAR_5_STATUS": "Product Science &amp; Ingredient Education — Rachel&#39;s biochemistry credential applied (NEW this cycle)",
    "KB_COMP_HIGHLIGHTS": "@_lalaronay leads with lifestyle + curly identity but offers no scientific explanation for product choices — biggest gap is the science layer (verified Apr 2026) | @iamcrystalnicolee leads with self-care/selfish era — high engagement but no hair depth; Rachel can own the science-meets-self-care intersection | @itsbabykelz leads with budget beauty + Sephora hauls — viral format but no Black hair specificity or chemistry credentials | None of the 5 competitors reference biochemistry, porosity, or ingredient analysis in their content hooks | Bridal natural hair content is generating 4,000+ vel/day — zero competitors producing this consistently",
    "KB_AUDIENCE_INSIGHTS": "&#39;Watch me try this and not look this gooodddd&#39; — signals uncertainty about technique transferability (client comment, Apr 2026) | &#39;Me watching all your videos with my relaxed hair 👀😭&#39; — hidden audience of relaxed-hair women consuming natural hair content (single high-value signal) | &#39;I&#39;m getting married this year and was JUST looking up curly bride hairstyles&#39; — active bridal intent in competitor comments | Self-prioritization language dominates: &#39;Selfish because I am working on choosing me&#39; — 10+ identical comments on competitor posts | Science curiosity is unmet: 4 distinct technical questions on r/HaircareScience with no creator-format answers",
    "KB_KEY_SIGNAL": "Bridal natural hair is an actively searched, emotionally charged space currently owned by NO creator with a science background — three independent sources (competitor content, Reddit, audience comments) confirm demand, and Rachel&#39;s personal wedding timing makes this a now-or-never launch window.",
    "KB_SKIPPED": "false",

    # Product picker tokens
    "OPTION_1_HOOK": "Your curls aren&#39;t &#39;too much&#39; for your wedding day — I have the biochemistry to prove it",
    "OPTION_1_WHAT": "A science-backed guide for natural-haired brides: pre-wedding prep, day-of product recs, and style longevity tips — written by a biochemist who is personally going through the same process right now.",
    "OPTION_1_WHO": "Black women planning their wedding who are worried their natural hair won&#39;t hold up — they&#39;ve seen every Pinterest board and none of it looks like them.",
    "OPTION_1_PRICE": "$27–$47 digital download",
    "OPTION_1_SIGNAL": "@_lalaronay comment: &#39;I&#39;m getting married this year and was JUST looking up curly bride hairstyles 🔥 thank you!&#39; + r/curlyhair wedding post (64 comments) + @_lalaronay bridal reel 4,042 vel/day",

    "OPTION_2_HOOK": "Your products aren&#39;t failing you. You just haven&#39;t learned what your hair is actually made of yet.",
    "OPTION_2_WHAT": "A step-by-step self-assessment toolkit: understand your hair&#39;s porosity, what it means for product selection, and how to build a simple routine — written by a professional hair analyst.",
    "OPTION_2_WHO": "Women who have tried every product recommendation and still feel like nothing works — they&#39;ve spent money and watched tutorials but can&#39;t figure out why their hair behaves the way it does.",
    "OPTION_2_PRICE": "$37–$67 digital kit",
    "OPTION_2_SIGNAL": "KB FAQ #1 recurring question: &#39;How do I know what products are right for my hair?&#39; + @_lalaronay comment: &#39;What holding gel do you use? I can&#39;t get my hair to sleek for nothing!&#39; — consistent product frustration rooted in not knowing hair&#39;s needs",

    "OPTION_3_HOOK": "A biochemist&#39;s breakdown of what&#39;s actually worth buying at the Sephora sale for natural hair",
    "OPTION_3_WHAT": "A curated Reels + LTK guide to natural hair and clean beauty products at the Sephora Spring Sale — with Rachel&#39;s chemistry lens on ingredient selection. Affiliate monetization, no build time needed.",
    "OPTION_3_WHO": "Black women shopping the Sephora sale right now who are overwhelmed by options and want someone with actual credentials to tell them what&#39;s worth the money.",
    "OPTION_3_PRICE": "Free + affiliate (LTK)",
    "OPTION_3_SIGNAL": "@itsbabykelz Sephora haul (Apr 9) at 92,870 vel/day — Sephora sale content is performing at peak RIGHT NOW. @_lalaronay &#39;battle of the gels&#39; (3,288 vel) — product comparison format works with this audience.",

    "OPTION_4_HOOK": "You don&#39;t have to be natural yet. You just have to be curious.",
    "OPTION_4_WHAT": "A zero-judgment guide for women with chemically processed hair who are curious about going natural — framed as exploration, not commitment, by someone who went through it herself.",
    "OPTION_4_WHO": "Women with relaxed or chemically processed hair who have been secretly watching natural hair content, feeling vaguely envious but unsure whether the transition is even possible for them.",
    "OPTION_4_PRICE": "Free email opt-in",
    "OPTION_4_SIGNAL": "Client comment: &#39;Me watching all your videos with my relaxed hair 👀😭&#39; — direct evidence of a relaxed-hair audience consuming Rachel&#39;s content. Single signal — directional, not confirmed. Validate next cycle.",

    "OPTION_5_HOOK": "Your hair routine is failing because no one ever taught you the chemistry.",
    "OPTION_5_WHAT": "A comprehensive science-based hair care course: porosity, protein-moisture balance, ingredient analysis, product selection frameworks, and routine building — taught by a working biochemist and former professional hair analyst.",
    "OPTION_5_WHO": "Women who are done with trial and error and want to understand the actual science behind their natural hair once and for all — willing to invest in education, not another product rec.",
    "OPTION_5_PRICE": "$97–$197 course",
    "OPTION_5_SIGNAL": "r/HaircareScience: 4 distinct technical questions with active engagement + client comment &#39;You have a lot of knowledge to share!&#39; — validates the premise, but comment counts are low (3–9/post). Needs larger audience to convert a course.",
}

os.makedirs('/Users/bryce/FLSM/.tmp/briefs/naturallyrachb-2026-04-14', exist_ok=True)

# Research brief
with open('/Users/bryce/FLSM/Emerson North/templates/research_brief.html', 'r') as f:
    html = f.read()

for k, v in tokens.items():
    html = html.replace('{{' + k + '}}', v)

# Fix P4 and P5 badges to show "confirmed" since we're filling them with research-backed data
html = html.replace(
    '<span class="kb-pn">P4</span><span class="kb-pt">{{KB_PILLAR_4_STATUS}}</span><span class="kb-badge inferred">⚠ Inferred</span>',
    '<span class="kb-pn">P4</span><span class="kb-pt">Bridal &amp; Wedding Hair — science-backed guidance for natural brides (NEW this cycle)</span><span class="kb-badge confirmed">Confirmed</span>'
)
html = html.replace(
    '<span class="kb-pn">P5</span><span class="kb-pt">{{KB_PILLAR_5_STATUS}}</span><span class="kb-badge inferred">⚠ Inferred</span>',
    '<span class="kb-pn">P5</span><span class="kb-pt">Product Science &amp; Ingredient Education — Rachel&#39;s biochemistry credential applied (NEW this cycle)</span><span class="kb-badge confirmed">Confirmed</span>'
)

# For KB_COMP_HIGHLIGHTS and KB_AUDIENCE_INSIGHTS, split into individual bullet divs
comp_bullets = tokens["KB_COMP_HIGHLIGHTS"].split(" | ")
aud_bullets = tokens["KB_AUDIENCE_INSIGHTS"].split(" | ")
comp_html = "".join(f'<div class="kb-bullet">{b}</div>' for b in comp_bullets)
aud_html = "".join(f'<div class="kb-bullet">{b}</div>' for b in aud_bullets)
html = html.replace('<div class="kb-bullet">{{KB_COMP_HIGHLIGHTS}}</div>', comp_html)
html = html.replace('<div class="kb-bullet">{{KB_AUDIENCE_INSIGHTS}}</div>', aud_html)

with open('/Users/bryce/FLSM/.tmp/briefs/naturallyrachb-2026-04-14/research_brief.html', 'w') as f:
    f.write(html)

print("research_brief.html written")

# Product selection
with open('/Users/bryce/FLSM/Emerson North/templates/product_selection.html', 'r') as f:
    phtml = f.read()

for k, v in tokens.items():
    phtml = phtml.replace('{{' + k + '}}', v)

with open('/Users/bryce/FLSM/.tmp/briefs/naturallyrachb-2026-04-14/product_selection.html', 'w') as f:
    f.write(phtml)

print("product_selection.html written")

# Check for remaining tokens
remaining_rb = re.findall(r'\{\{[A-Z_0-9]+\}\}', html)
remaining_ps = re.findall(r'\{\{[A-Z_0-9]+\}\}', phtml)
if remaining_rb:
    print(f"Remaining research_brief tokens: {set(remaining_rb)}")
if remaining_ps:
    print(f"Remaining product_selection tokens: {set(remaining_ps)}")
