# hormozi-lead-magnet

Adopt this skill: https://proskills.md/skills/other/kjagsadvisors-keeran-ai-hormozi-lead-magnet

Page: https://proskills.md/skills/other/kjagsadvisors-keeran-ai-hormozi-lead-magnet
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: hormozi-lead-magnet/SKILL.md
size: 18247
sha: ad8de80902a019dfbc81950f13f6743cfed2f9dc
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/SKILL.md

````text
---
name: hormozi-lead-magnet
description: Make a finished lead magnet for any business with Alex Hormozi's lead magnet method from $100M Leads (reveal a problem, a sample or trial, or one step of many; name it so people want it; end with a clear CTA). The owner answers an intake and gives their website; the output is a working, self-contained page restyled to their brand (colours, fonts, logo, button shape, measured from their site) (a scored assessment, a step-by-step guide that also prints to PDF, or a claim page for a free service) plus the post that gives it away and a plan for testing the name. Use when someone wants a lead magnet, a freebie, an opt-in, a scorecard or quiz funnel, a free audit offer, "something to give away for emails", more leads from the same traffic, or $100M Leads.
---

# Lead magnets with Hormozi's method

Hormozi's case: most businesses send traffic straight to "buy" or "get a quote", and most visitors aren't ready yet. A
lead magnet is a **complete solution to a narrow problem**, given away free or cheap. Solving it reveals the next
problem, and the paid offer solves that one. You get more customers from the same traffic.

This skill makes the finished thing:
- **`out/index.html`:** one self-contained page, which works on any host.
- **`out/<name>.pdf`:** for guides.
- **`post.md`:** the post that gives it away, plus a test plan for the name.

Content comes from the owner's answers. Claude structures it, and never invents the expertise or the proof.

**Reference in this folder:**
- `reference-breakdown.md`: his two full lessons on lead magnets, step by step, with timestamps.
- `hormozi-lead-magnet-research.md`: everything else he's said about lead magnets across 281.9 hours of his videos, with timestamped links.

**Borrow the framework, not the identity.** Say "built on the lead magnet method from Alex Hormozi's *$100M Leads*".
Never put his name, face or branding on an owner's lead magnet, and never imply he endorses this.

## 1. The framework

His 7-step checklist ([reference-breakdown.md](reference-breakdown.md), L2) and what this skill does for each:

| # | Hormozi | What this skill does |
|---|---|---|
| 1 | **Pick the problem, and who it's for** | Intake questions 1–3; the narrow problem comes from their customer journey |
| 2 | **Pick how it solves it:** reveal a problem, sample/trial, or one step of many | Proposes one type, with the reason, from their answers. The owner decides. |
| 3 | **Pick how it's delivered:** software, information, service, physical | `assessment` = software, `guide` = information, `claim` = service. Physical: write the offer and the claim page only. |
| 4 | **Package it:** the name matters most, and gets tested | 5 names from his 4 formulas in their words, plus a test plan in `post.md` |
| 5 | **Make it fast and easy to consume** | Under 3 minutes for an assessment, one sitting for a guide; web page + PDF |
| 6 | **Make it good:** better than competitors' paid stuff | Their real checks, steps and numbers. `magnet.py check` flags thin spots. |
| 7 | **Make the next step easy:** clear CTA, a reason to act now, several ways to act | A CTA routed by the qualifier, a real capacity limit, an alternative way to act |

Three rules apply to every lead magnet:
- **Don't give away what the core offer solves. Solve the problem just before it.** Solving it should create the want
  for the paid thing. That's the entree, then dessert.
- **Complete, not partial.** Six minutes of a twelve-minute video with "click for the rest" loses trust.
- **Qualify.** Freebie seekers are solved with a qualifying question, not by giving less. Unqualified people get routed
  somewhere else. Use a real qualifier (budget, authority, need, timing, revenue), never a fake one like "are you
  willing to invest in yourself?".
- **Effortless to consume, friction to qualify.** Speed beats size: a fast, smaller win beats a bigger, slower one.

**When it isn't the lever (tell the owner):** in a small or already-warm market, a direct offer can beat a lead magnet.
He said so for a janitorial company and a craft box, and called it "mostly a fresh hook" for roofers. If the intake
points that way, say so before building.

## 2. Intake: one message, in the owner's words

Ask all of these at once. Their answers become the content: questions, problems, steps and proof.
1. **What do you sell, for how much, and who buys it?** If several things, which makes you the most money?
2. **Who exactly is this for, and who should *not* get it?** The second half becomes the qualifying question.
3. **Walk me through what a customer goes through to get the result: before, during, after.** Every step, even the boring ones.
4. **When you first look at a new customer's situation, what do you check, and what do you almost always find wrong?**
   Which of those get worse the longer they wait? Any numbers on what it costs them?
5. **What could you give away that costs you a little but is worth a lot to them?** For example an audit, a first
   session, a template you already use, a calculation you do by hand.
6. **Real proof:** results, numbers, a customer's words, screenshots. Only real ones.
7. **What should they do next?** Give the link, and say how many new customers you can actually take per week or
   month (that's the reason to act now).
8. **Where will people find it?** For example an Instagram comment word, ads, your website, or in person.
9. **What's your website?** The page is restyled to it: colours, fonts, logo, button shape. With no site, ask for a
   logo file, a brand colour and a font name.

Use their words. If an answer is thin, ask a follow-up; never fill the gap yourself. If they have no proof yet, the
lead magnet ships without a proof block, never with a made-up one.

## 3. Pick the type (propose one, the owner decides)

| Type | Pick it when | Delivery here |
|---|---|---|
| **Reveal a problem** (Hormozi's favourite) | Q4 gives 5+ checks, and the problems get worse while they wait (cash flow, rot, back taxes, a slow site) | `assessment`: 5–10 questions → score → the specific problems their answers reveal → the delta → CTA |
| **One step of many** | Q3 has a step you can give away complete that leads straight into the paid steps | `guide`: numbered steps with checklists, CTA mid-way and at the end, prints to PDF |
| **Sample / trial or free service** | Q5 has real work they can do free for qualified people, and they have capacity | `claim`: what you get, what it's worth, the limit, how it works, a qualifying claim form |

- Combinations are fine. An assessment whose result offers the free audit is the most common one.
- Say which type you'd pick and why in one line, then let the owner decide.

## 4. Name it (the most important step)

Write **5 options** from their words. Name the **result, not the vehicle**: "big booty boot camp", not "deadlift seminar".
Use his four formulas:
1. **Number + outcome + time frame:** "3 emails that turn cold leads into clients in 24 hours"
2. **How to [good thing] without [bad thing], even if [insecurity]**
3. **The [adjective] [thing] that [good thing]**
4. **X mistakes that [cost them the goal]:** "4 leaks keeping your shop under $1M"

For an assessment, formula 4 fits best: the problems it reveals *are* the mistakes. Then put the test plan in `post.md`
(his order, cheapest first):
- a story poll, with "if you're not a [who], don't answer";
- a text to 10 customers, "which would you want?";
- a post asking people to comment A or B;
- with budget, a small ad split on the headlines only.

With ad budget he tests 10 to 30 names. The winner goes in `title`. Until it's tested, tell the owner the name is a
draft.

More from the research:
- **Name the freebie, not the sale:** "let's get coffee", not "marry me".
- **Pair the result with the biggest objection,** e.g. "dress for your tone using your existing closet".
- **Say "free".**
- **Re-wrap the same magnet about once a quarter** (seasonal names). Re-test the name each time.

## 5. Build

```bash
mkdir -p launches/<name> && cp <skill>/examples/skeleton/magnet.json launches/<name>/
python3 <skill>/brand.py launches/<name> https://their-site.com   # restyle to their brand (step 5a)
# fill magnet.json from the intake (fields below), then:
python3 <skill>/magnet.py check launches/<name>          # Hormozi's rules as errors/warnings
python3 <skill>/magnet.py build launches/<name>          # -> out/index.html
python3 <skill>/magnet.py shot  launches/<name> --mobile # -> out/shot-mobile.png (look at it)
python3 <skill>/magnet.py pdf   launches/<name>          # guides: -> out/<name>.pdf
```

### 5a. Restyle it to their brand

`brand.py` opens their homepage in headless Chrome, with the site's scripts stripped, and measures what's actually
rendered:
- **Colours:** the page background, the headline colour, and the main button's colour, which becomes the accent.
  - Colours on words inside a heading (an orange italic, say) become the second accent, used for the highlighter and
    eyebrows.
- **Type:** heading and body fonts, heading weight, letter-spacing and case, and the italic accent font.
  - Google Fonts are linked.
  - Next.js-hashed names and names like "Inter Variable" are mapped back to their Google family.
  - Anything else is downloaded from their CSS into `brand/fonts/` and embedded.
- **Shape and type on buttons:** the button's font, weight, case and letter-spacing, and its corner radius (sharp,
  rounded or pill). Card corners follow from it.
- **Logo:** the header logo, saved to `brand/logo.*`. In the page it's trimmed of transparent padding, and a wide
  wordmark hides the name text.

It writes the `brand` block into `magnet.json` and saves `brand/site.png` and `brand/site-mobile.png`.

Then **look**: build, run `shot`, and put `out/shot.png` next to `brand/site.png`. Fix what's off by hand in `brand`.
The usual fixes:
- a logo variant that doesn't show on the background (use their light or dark version);
- an accent that's really a secondary button;
- a font flagged "set by hand" (Typekit and some custom fonts can't be downloaded; pick the closest Google font).

**Brand fields** (all optional, all hex colours):
- `color` (accent), `on` (text on it), `highlight` (second accent), `em` (italic heading words);
- `bg`, `ink`, `cover`, `theme`;
- `radius`, `button_radius` (999 = pill);
- `button`: `{font: "display"|"body", weight, transform, tracking}`;
- `fonts`: `{display, body, serif, weight, tracking, transform, google: [css2 families], files: [{family, weight, style, file}]}`.

**Only the owner's own brand.** Their fonts are embedded for their page only. Never restyle a lead magnet to a
company the owner doesn't own or represent.

**Fields** (the skeleton shows every one):
- `type`: `assessment`, `guide` or `claim`.
- `brand.name`, `brand.color` (hex), and optionally `brand.logo` (a local path; it gets inlined).
  - `brand.header: false` hides the logo and name. Use it for **cold traffic (ads)**, where Hormozi cuts both from the
    top of the page.
- `brand.theme`: `"dark"` (the default) or `"light"`. Text colour on the brand colour is picked automatically for
  contrast.
- `image`: optional, an image of the thing (a cover, a before/after). He wants one on the opt-in page.
  - Without one, the page draws a 3D cover card from `cover_title` (or `title`).
- `tag`: the pill top-right, e.g. "Free · 60 sec".
- `start`, `meta`: the main button's label, and the small line under it, e.g. `["8 questions", "60 seconds", "free"]`.
- `stats`: optional proof as big numbers, `[{value, label}]`. Real numbers only.
- `footnote`: optional small print at the bottom, e.g. a "not affiliated with" line.
- **Text markup**, anywhere owner text goes:
  - `**bold**`;
  - `==highlight==`, the brand-colour highlighter (keep it to 1–3 words, since it never wraps);
  - `*serif italic*`.
- `who`: one line on who it's for. It shows above the title and makes the wrong people self-select out.
- `title`, `subtitle`.
- `proof`: their real results, as `{text, who, img?}`.
- `next_problem`: the problem this one reveals, which is the bridge to the paid offer, in their words.
- `capture`:
  - `action`: where leads go.
  - `fields`: from `name`, `email`, `phone`, `company`.
  - `qualify`: the question that routes people. Each option sets `route`, which picks a key in `cta`.
  - `gate`: `false` to skip the form.
- `cta`: `main` is required; add others per route. Each has:
  - `text`: clear, not clever;
  - `reason`: why now, preferably their real capacity limit;
  - `button`, `url`;
  - `alt`: another way to act, e.g. a phone number.
- **assessment:**
  - `questions[].options[]`, each `{label, points, problem?}`. The `problem` text is what that answer reveals. Make it
    specific, about *their* situation, with a number where the owner has one.
  - `results[]`: buckets covering 0–100 by `min`/`max`, each with `label`, `body` and `delta` (where they are vs where
    they could be, in real numbers).
- **guide:** `steps[]` as `{title, body (string or list), checklist?, img?}`.
- **claim:** `includes`, `worth`, `for_who`, `limit`, `how`, `thanks`.

**Content rules (Hormozi):**
- **Specific on the negatives, modest on the positives.** If you name their problems exactly, they assume you can fix
  them. Promise nothing you can't prove.
- **Assessments:** only answers that reveal a problem get a `problem`, and healthy answers get none. 5–10 questions.
- **Guides:** each step is done completely, not teased. 3–7 steps. The last line says what they'll hit next.
- **Claims:** state the real limit ("4 a week"). Free services only go to people who pass the qualifier.
  - A bare free trial is what he calls the "bad money model". Give trials skin in the game: a card on file, a no-show
    fee, or a deposit refunded when they hit the goal. Say it on the page in `how`.
- **Copy at a third-grade reading level:** clear beats clever, and cutting beats explaining. Each line sells only the
  next step.
- **"20 mistakes people make buying [category]"** is his template for service businesses. Put one real proof under
  each mistake.
- **Friction is a dial.** Too many bad leads: add a qualifier field. Too few leads: remove fields.
- **Ungated is an option.** He leaves his own free courses ungated, because that's better for sharing. For a guide
  meant to spread, set `capture.gate: false` and rely on the CTAs. Gate it when it feeds calls or ads.
- **One CTA:** the routes change who sees which CTA, never how many asks there are at once.
- **The best CTA offers a personal version of what they just got.** For example: "Book 20 minutes and we'll go through
  your results with you." He runs the call off the lead magnet: go through what they got, take a few of their numbers,
  then explain how you'd help if it's a fit.

**Connecting the form:**
- `capture.action` is any URL that accepts a form POST:
  - a Zapier or Make "catch hook" (then into their email tool or CRM);
  - Formspree;
  - their CRM's form endpoint.
- The page sends `name`, `email`, any other fields, plus `qualify`, `magnet`, and for assessments `score` and `result`.
- Until it's set, a yellow "Draft" bar shows on the page. Submit one test lead and confirm it arrives before calling it
  live.

**Hosting:** `out/index.html` is a single file, so any static host works: Netlify Drop, Vercel, GitHub Pages, or a page
on their own site.

**Screenshots and recordings:**
- Add `?clean=1` to the URL to hide the draft bar.
- `magnet.py shot` already adds it.
- Assessments work with the keyboard: A–H or 1–8 picks an answer, Backspace goes back.

## 6. The post that gives it away: `post.md`

Write it for where people find it (intake Q8). In the owner's voice, from their answers:
- **3 hooks.** The name is already a headline, so lead with it or with the problem it reveals.
- **What they get**, in 2–3 lines. It's free, and here's exactly what it does for them.
- **One CTA:** the comment word, the link, or the QR.
  - In video, keep it to about 3 seconds; he found 6 too long.
  - For comment-a-word DMs, his flow sorts people in the DM with one question ("here for the free thing, or to fix
    this for good?").
- **The name test plan** from step 4.
- **The delivery email:** deliver it, give a reason to stay on the list, and ask them to reply (that keeps you out of
  the promotions tab).

Hormozi's promotion rules (research §6):
- **Lighter asks reach further.** "Comment for a free assessment, then book a call" is the heaviest ask there is.
- **Rotate magnets,** because people who already have one won't respond to it again.
- **Ads:** call out the avatar, open on a pain hook, then offer the free thing.

**Benchmark** once it's live: 20–50% of qualified visitors should opt in. He called a 5% and a 7% opt-in the biggest
lever in those funnels. Fix the page, starting with the name, before buying more traffic.

## 7. Check before delivering

- Open `out/shot-mobile.png`, then click through the whole flow once on a phone-sized window. For assessments, answer
  badly to see the problems list, then answer well.
- **Does it solve the core offer's problem for free?** Cut it back to the step before.
- **Is any part partial or teased?** Finish it.
- **Is every number, quote and result the owner's?**
- **Does `magnet.py check` show no errors**, and does every warning have a reason it's being left?

## 8. Deliver

Give the owner:
- `out/index.html`, the screenshot, and the PDF for guides;
- `post.md`;
- what's left: connect `capture.action`, test the name, and replace any bracketed placeholders.

## Pitfalls

- **Writing their expertise for them.** The questions, problems and steps must come from the intake. A generic
  "5 signs your marketing isn't working" is the fluff Hormozi says loses the buyer *and* the people they tell.
- **Too broad.** "Grow your business" isn't a narrow problem. One problem, solved completely, for one kind of person.
- **Forgetting to ask.** Every type ends on the CTA, with a reason to act now and another way to act.
- **Testing the contents before the name.** The name moves demand 2–10x, so test it first.
- **Shipping with no form connected.** The draft bar is there for a reason.
````

## File: hormozi-lead-magnet/README.md
size: 3047
sha: f96d0de96d52a581191cc3e5343ca8044c9e8a63
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/README.md

````text
# hormozi-lead-magnet, a Claude Code skill

It makes a finished lead magnet for your business: a page that works, the post that gives it away, and a plan for
testing its name.

**It's built on the lead magnet method from Alex Hormozi's *$100M Leads*:**
1. Pick one narrow problem your buyer has, and solve it completely, for free. Solving it should reveal the next
   problem, the one your paid offer solves.
2. Solve it one of three ways:
   - reveal a problem they didn't know they had;
   - give a sample or trial;
   - do one step of a multi-step process.
3. Name it for the result, not the method, and test the name, because he says it moves demand more than anything inside.
4. End with one clear next step and a real reason to take it now.

`reference-breakdown.md` walks through his two lead magnet lessons step by step. `hormozi-lead-magnet-research.md`
covers everything else he's said about lead magnets across 281.9 hours of his videos. Both have timestamped links.
This skill isn't affiliated with or endorsed by Alex Hormozi.

## How it works

1. **Claude asks you eight questions.** For example: what you sell, who it's for (and who it isn't), what you always
   find wrong when you first look at a customer's situation, and how many new customers you can take on.
2. **It suggests a type and five names**, using his four naming formulas. You pick.
3. **It builds one self-contained page from your answers.** Your words, your checks, your proof. The page is one of:
   - **Assessment:** questions → a score → the specific problems their answers reveal → your next step.
   - **Guide:** numbered steps with checklists. It also saves as a PDF.
   - **Free service claim:** what they get, what it's worth, your limit, and a qualifying form.
4. **It's restyled to your brand.** Give it your website: it measures your colours, fonts, logo and button shape, and
   the page comes out looking like your own site, not a template.
5. **You get the post that gives it away**, plus a cheap way to test the name before you spend anything on it.

The page runs on any host (Netlify Drop, Vercel, GitHub Pages, your own site). Point the form at your email tool, CRM
or a Zapier/Make webhook, and a qualifying question sends qualified and unqualified leads to different next steps.

## Install

**The easy way:** paste the repo link into Claude Code (or ChatGPT's Codex) and say "set up the hormozi-lead-magnet
skill and build me a lead magnet":

```
https://github.com/kjagsadvisors/keeran.ai
```

**By hand:**

1. Put the `hormozi-lead-magnet` folder in `~/.claude/skills/`.
2. You need Python 3 and Google Chrome (for restyling to your site, the PDF and screenshots).
3. In Claude Code, say "make me a lead magnet" (or run `/hormozi-lead-magnet`).

Start from `examples/skeleton/magnet.json` to see the structure:

```bash
python3 magnet.py check examples/skeleton
python3 magnet.py build examples/skeleton    # -> examples/skeleton/out/index.html
```

Only real proof: every result, number and quote on your lead magnet has to be yours.
````

## File: hormozi-lead-magnet/brand.py
size: 28347
sha: dcc184cbe97a504037880aeff1a7106d514de3a9
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/brand.py

```text
"""Restyle a lead magnet to the owner's brand, measured from their own website.

  python3 brand.py <dir> <url>           measure <url>, save <dir>/brand/ and write the brand into <dir>/magnet.json
  python3 brand.py <dir> <url> --dry     measure and report only

What it measures, in headless Chrome (no installs beyond Google Chrome):
  colours   page background, text, and the main button (the accent); falls back to theme-color, then the most-used
            saturated colour
  fonts     heading and body families, heading weight and letter-spacing. Google Fonts are linked; the site's own
            font files are saved to brand/fonts/ and embedded (the owner's own fonts, for the owner's own page)
  shape     button and card corner radius (sharp, rounded or pill)
  logo      the header logo (image or inline SVG, colours resolved), saved to brand/logo.*
  name      og:site_name or the page title

It also saves brand/site.png and brand/site-mobile.png. Compare them with out/shot.png after building; fix anything
that's off by editing "brand" in magnet.json. Never use a brand the owner doesn't own.
"""
import base64, colorsys, html, json, os, re, subprocess, sys, tempfile, urllib.error, urllib.parse, urllib.request

HERE = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, HERE)
from magnet import chrome, ink_on  # noqa: E402

UA = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) "
      "Chrome/131.0.0.0 Safari/537.36")
GENERIC = {"system-ui", "-apple-system", "blinkmacsystemfont", "segoe ui", "ui-sans-serif", "ui-serif", "ui-monospace",
           "sans-serif", "serif", "monospace", "cursive", "fantasy", "inherit", "initial", "apple color emoji",
           "segoe ui emoji", "segoe ui symbol", "noto color emoji", "emoji", "math", "fangsong"}
SYSTEM = {"helvetica", "helvetica neue", "arial", "georgia", "times", "times new roman", "verdana", "tahoma",
          "trebuchet ms", "courier new", "sf pro display", "sf pro text", "-apple-system"}

# Runs inside the mirrored page. Measured from computed styles and layout boxes only.
MEASURE = r"""
(function () {
  function run() {
    if (document.getElementById("__brand")) return;
    var cs = function (e) { return getComputedStyle(e); };
    var clear = function (c) { return !c || /rgba\(0, 0, 0, 0\)|transparent/.test(c); };
    var vis = function (e) { var r = e.getBoundingClientRect(), s = cs(e); return r.width > 0 && r.height > 0 && s.display !== "none" && s.visibility !== "hidden"; };
    var bgOf = function (e) { for (var n = e; n && n.nodeType === 1; n = n.parentElement) { var c = cs(n).backgroundColor; if (!clear(c)) return c; } return "rgb(255, 255, 255)"; };
    var out = {};
    out.page_bg = clear(cs(document.body).backgroundColor) ? bgOf(document.documentElement) : cs(document.body).backgroundColor;
    var p = Array.prototype.find.call(document.querySelectorAll("main p, article p, p"), function (e) { return vis(e) && e.textContent.trim().length > 40; }) || document.body;
    var ps = cs(p);
    out.body = { color: ps.color, font: ps.fontFamily, size: parseFloat(ps.fontSize), bg: bgOf(p) };
    out.headings = Array.prototype.filter.call(document.querySelectorAll("h1, h2"), vis).slice(0, 6).map(function (h) {
      var s = cs(h);
      // coloured or italic words inside the heading: the brand's second accent (and often a second font)
      var accents = Array.prototype.filter.call(h.querySelectorAll("span, em, i, strong, b, mark"), function (e) {
        var t = cs(e); return e.textContent.trim() && (t.color !== s.color || t.fontStyle !== s.fontStyle || t.fontFamily !== s.fontFamily);
      }).slice(0, 4).map(function (e) { var t = cs(e); return { text: e.textContent.trim().slice(0, 40), color: t.color, font: t.fontFamily, style: t.fontStyle, weight: t.fontWeight }; });
      return { tag: h.tagName, text: h.textContent.trim().slice(0, 60), font: s.fontFamily, weight: s.fontWeight, size: parseFloat(s.fontSize), track: s.letterSpacing, transform: s.textTransform, color: s.color, top: h.getBoundingClientRect().top + scrollY, accents: accents };
    });
    out.buttons = Array.prototype.filter.call(document.querySelectorAll("a, button, input[type=submit], [role=button]"), vis).map(function (e) {
      var s = cs(e), r = e.getBoundingClientRect();
      return { text: (e.textContent || e.value || "").trim().replace(/\s+/g, " ").slice(0, 40), bg: s.backgroundColor, color: s.color, radius: s.borderTopLeftRadius,
               h: r.height, w: r.width, top: r.top + scrollY, font: s.fontFamily, weight: s.fontWeight, border: s.borderTopColor, bw: parseFloat(s.borderTopWidth),
               transform: s.textTransform, track: s.letterSpacing, size: parseFloat(s.fontSize) };
    }).filter(function (b) { return b.h >= 28 && b.h <= 96 && b.w >= 56 && b.w <= 520 && b.text && b.top >= 0 && !/^skip to/i.test(b.text); }).slice(0, 60);
    out.links = Array.prototype.filter.call(document.querySelectorAll("main a, p a"), vis).slice(0, 60).map(function (a) { return cs(a).color; });
    var tally = {};
    var add = function (c, w) { if (!clear(c)) tally[c] = (tally[c] || 0) + w; };
    Array.prototype.slice.call(document.querySelectorAll("body *"), 0, 4000).forEach(function (e) {
      if (!vis(e)) return;
      var r = e.getBoundingClientRect(), s = cs(e), area = Math.min(r.width * r.height, 1440 * 900);
      add(s.backgroundColor, area);
      if (Array.prototype.some.call(e.childNodes, function (n) { return n.nodeType === 3 && n.textContent.trim(); })) add(s.color, Math.min(area, 30000) * 0.5);
      if (parseFloat(s.borderTopWidth) > 0) add(s.borderTopColor, (r.width + r.height) * 2);
    });
    out.colors = Object.keys(tally).map(function (k) { return [k, Math.round(tally[k])]; }).sort(function (a, b) { return b[1] - a[1]; }).slice(0, 40);
    var meta = function (n) { var m = document.querySelector('meta[name="' + n + '"], meta[property="' + n + '"]'); return m ? m.content : null; };
    out.meta = { theme_color: meta("theme-color"), site_name: meta("og:site_name"), og_image: meta("og:image"), title: document.title };
    out.icons = Array.prototype.map.call(document.querySelectorAll('link[rel~="icon"], link[rel="apple-touch-icon"]'), function (l) { return { rel: l.rel, href: l.href, sizes: l.sizes ? l.sizes.value : "" }; });
    var words = function (e) { if (!e || e.nodeType !== 1) return ""; var c = e.className; return [e.id, c && (c.baseVal !== undefined ? c.baseVal : c), e.getAttribute("alt"), e.getAttribute("aria-label"), e.getAttribute("src"), e.getAttribute("title")].join(" "); };
    var cands = [];
    Array.prototype.forEach.call(document.querySelectorAll("img, svg"), function (e) {
      if (e.closest("svg") && e.closest("svg") !== e) return;
      if (!vis(e)) return;
      var r = e.getBoundingClientRect();
      if (r.width < 18 || r.height < 10 || r.width > 520 || r.height > 200 || r.top + scrollY > 400) return;
      var head = !!e.closest("header, nav, [class*=header], [class*=Header], [class*=navbar], [class*=nav-]");
      var a = e.closest("a"), home = !!(a && /^(\/|\.\/|#?)$/.test((a.getAttribute("href") || "").replace(location.origin, "")));
      var named = /logo|brand|wordmark/i.test(words(e) + " " + words(e.parentElement) + " " + words(a));
      var score = (named ? 3 : 0) + (head ? 2 : 0) + (home ? 2 : 0) + (r.left < innerWidth / 2 ? 1 : 0);
      if (score < 3) return;
      var c = { score: score, top: r.top, left: r.left, w: r.width, h: r.height };
      if (e.tagName.toLowerCase() === "img") { c.type = "img"; c.src = e.currentSrc || e.src; }
      else {
        var clone = e.cloneNode(true), src = [e].concat(Array.prototype.slice.call(e.querySelectorAll("*"))), dst = [clone].concat(Array.prototype.slice.call(clone.querySelectorAll("*")));
        src.forEach(function (n, i) { var s = cs(n); if (dst[i] && dst[i].setAttribute) { if (s.fill && s.fill !== "none") dst[i].setAttribute("fill", s.fill); if (s.stroke && s.stroke !== "none") dst[i].setAttribute("stroke", s.stroke); } });
        clone.setAttribute("width", Math.round(r.width)); clone.setAttribute("height", Math.round(r.height));
        if (!clone.getAttribute("xmlns")) clone.setAttribute("xmlns", "http://www.w3.org/2000/svg");
        c.type = "svg"; c.svg = clone.outerHTML.slice(0, 300000);
      }
      cands.push(c);
    });
    out.logos = cands.sort(function (a, b) { return b.score - a.score || a.top - b.top || a.left - b.left; }).slice(0, 6);
    out.stylesheets = Array.prototype.map.call(document.styleSheets, function (s) { return s.href; }).filter(Boolean);
    var pre = document.createElement("pre"); pre.id = "__brand"; pre.textContent = JSON.stringify(out); document.body.appendChild(pre);
  }
  addEventListener("load", function () { setTimeout(run, 400); });
  setTimeout(run, 5000);
})();
"""

def fetch(url, limit=6_000_000, binary=False):
    req = urllib.request.Request(url, headers={"User-Agent": UA, "Accept-Language": "en-US,en;q=0.9"})
    with urllib.request.urlopen(req, timeout=25) as r:
        body = r.read(limit)
        return (body if binary else body.decode(r.headers.get_content_charset() or "utf-8", "replace")), r.geturl(), r.headers.get("Content-Type", "")

# ---- colour helpers ----
def oklab_to_rgb(L, a, b):
    l_, m_, s_ = (L + 0.3963377774 * a + 0.2158037573 * b, L - 0.1055613458 * a - 0.0638541728 * b,
                  L - 0.0894841775 * a - 1.2914855480 * b)
    l, m, s = l_ ** 3, m_ ** 3, s_ ** 3
    lin = (4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
           -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
           -0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s)
    enc = lambda c: 12.92 * c if c <= 0.0031308 else 1.055 * c ** (1 / 2.4) - 0.055
    return tuple(int(round(max(0.0, min(1.0, enc(max(0.0, c)))) * 255)) for c in lin)

def rgb(c):
    """'rgb(1, 2, 3)' / 'rgba(...)' / 'oklch(...)' / 'oklab(...)' / 'color(srgb ...)' / '#abc' -> (r, g, b, a) or None.
    Chrome reports colours in whatever space the site's CSS used (Tailwind v4 uses oklch)."""
    if not c:
        return None
    num = lambda v, pct=1.0: float(v[:-1]) / 100 * pct if v.endswith("%") else float(v)
    m = re.match(r"(oklch|oklab|color)\(\s*(srgb\s+)?([-\d.%]+)\s+([-\d.%]+)\s+([-\d.%]+)(?:\s*/\s*([\d.]+%?))?\s*\)", c.strip())
    if m:
        kind, x, y, z, al = m.group(1), m.group(3), m.group(4), m.group(5), m.group(6)
        alpha = 1.0 if al is None else num(al)
        if kind == "color":
            return tuple(int(round(max(0, min(1, num(v))) * 255)) for v in (x, y, z)) + (alpha,)
        L = num(x)
        if kind == "oklch":
            import math
            C, H = num(y, 0.4), float(z.rstrip("deg") or 0)
            a, b = C * math.cos(math.radians(H)), C * math.sin(math.radians(H))
        else:
            a, b = num(y, 0.4), num(z, 0.4)
        return oklab_to_rgb(L, a, b) + (alpha,)
    m = re.match(r"rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?", c)
    if m:
        a = m.group(4)
        a = 1.0 if a is None else (float(a[:-1]) / 100 if a.endswith("%") else float(a))
        return tuple(int(float(m.group(i))) for i in (1, 2, 3)) + (a,)
    m = re.match(r"#([0-9a-f]{3}|[0-9a-f]{6})$", c.strip().lower())
    if m:
        h = m.group(1)
        h = "".join(x * 2 for x in h) if len(h) == 3 else h
        return (int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16), 1.0)
    return None

def hexc(t):
    return "#%02x%02x%02x" % t[:3]

def lum(t):
    c = [x / 255 for x in t[:3]]
    c = [x / 12.92 if x <= 0.03928 else ((x + 0.055) / 1.055) ** 2.4 for x in c]
    return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]

def sat(t):
    h, l, s = colorsys.rgb_to_hls(*(x / 255 for x in t[:3]))
    return s if 0.08 < l < 0.92 else 0.0

def dist(a, b):
    return sum((x - y) ** 2 for x, y in zip(a[:3], b[:3])) ** 0.5

def contrast(a, b):
    la, lb = sorted((lum(a), lum(b)), reverse=True)
    return (la + 0.05) / (lb + 0.05)

# ---- fonts ----
def families(stack):
    out = []
    for f in (stack or "").split(","):
        f = f.strip().strip('"\'').strip()
        if f:
            out.append(f)
    return out

def primary(stack):
    """First real family in a CSS stack, or None if the site uses the system font."""
    for f in families(stack):
        if f.lower() in GENERIC:
            continue
        return f
    return None

def unhash(fam):
    """The Google Fonts name behind a site's local name: next/font's __Name_1a2b3c, or 'Inter Variable' / 'Inter VF'."""
    m = re.match(r"^__(.+?)(?:_Fallback)?_[0-9a-f]{5,8}$", fam)
    name = m.group(1).replace("_", " ") if m else fam
    name = re.sub(r"\s+(Variable|VF|Var|Web)$", "", name, flags=re.I)
    return name if name != fam else None

def google(family, weights):
    """The css2 family param that Google Fonts serves for this family, or None if it isn't a Google font."""
    base = "https://fonts.googleapis.com/css2?family=" + urllib.parse.quote(family).replace("%20", "+")
    tries = [":wght@" + ";".join(str(w) for w in sorted(set(weights))), ":wght@100..900", ""]
    for t in tries:
        try:
            fetch(base + t, limit=200_000)
            return family + t
        except urllib.error.HTTPError:
            continue
        except Exception:
            return None
    return None

def font_faces(css, base_url):
    """@font-face rules in a stylesheet -> [{family, weight, style, url}]."""
    out = []
    for block in re.findall(r"@font-face\s*{([^}]*)}", css, re.I):
        fam = re.search(r"font-family\s*:\s*([^;]+)", block, re.I)
        src = re.search(r"src\s*:\s*([^;]+)", block, re.I)
        if not fam or not src:
            continue
        urls = re.findall(r"url\(\s*['\"]?([^'\")]+)['\"]?\s*\)\s*(?:format\(\s*['\"]?([\w-]+)['\"]?\s*\))?", src.group(1))
        if not urls:
            continue
        rank = {"woff2": 0, "woff": 1, "truetype": 2, "opentype": 3}
        urls.sort(key=lambda u: rank.get(u[1] or u[0].rsplit(".", 1)[-1].split("?")[0], 4))
        if urls[0][0].startswith("data:"):
            continue
        w = re.search(r"font-weight\s*:\s*([^;]+)", block, re.I)
        st = re.search(r"font-style\s*:\s*([^;]+)", block, re.I)
        out.append({"family": fam.group(1).strip().strip('"\''), "weight": (w.group(1).strip() if w else "400"),
                    "style": (st.group(1).strip() if st else "normal"), "url": urllib.parse.urljoin(base_url, urls[0][0])})
    return out

def weight_hits(wspec, want):
    """Does a @font-face font-weight ('400', '100 900', 'bold') cover the weight we want?"""
    nums = [int(x) for x in re.findall(r"\d+", wspec.replace("bold", "700").replace("normal", "400"))] or [400]
    return min(nums) <= want <= max(nums), min(abs(n - want) for n in nums)

def embed_fonts(fam, weights, css_texts, out_dir, style="normal"):
    """Download the site's own files for one family (nearest match per weight). Returns [{family, weight, style, file}]."""
    faces = [f for css, url in css_texts for f in font_faces(css, url) if f["family"].lower() == fam.lower() and f["style"] == style]
    got, files = set(), []
    for want in sorted(set(weights)):
        if not faces:
            break
        best = min(faces, key=lambda f: (not weight_hits(f["weight"], want)[0], weight_hits(f["weight"], want)[1]))
        if best["url"] in got:
            continue
        try:
            data, _, _ = fetch(best["url"], limit=800_000, binary=True)
        except Exception as e:
            print(f"  warn   couldn't download {fam} ({e.__class__.__name__}); pick a close Google font by hand")
            return []
        ext = best["url"].split("?")[0].rsplit(".", 1)[-1].lower()
        ext = ext if ext in ("woff2", "woff", "ttf", "otf") else "woff2"
        name = re.sub(r"[^a-z0-9]+", "-", fam.lower()).strip("-") + "-" + re.sub(r"\s+", "-", best["weight"]) + ("-italic" if style == "italic" else "") + "." + ext
        os.makedirs(os.path.join(out_dir, "fonts"), exist_ok=True)
        open(os.path.join(out_dir, "fonts", name), "wb").write(data)
        got.add(best["url"])
        files.append({"family": fam, "weight": best["weight"], "style": style, "file": "brand/fonts/" + name})
    return files

# ---- measuring ----
def measure(url, work):
    page, final, _ = fetch(url)
    stripped = re.sub(r"<script\b[^>]*>.*?</script\s*>", "", page, flags=re.S | re.I)
    stripped = re.sub(r"<meta[^>]+http-equiv=[\"']?content-security-policy[^>]*>", "", stripped, flags=re.I)
    head = re.search(r"<head[^>]*>", stripped, re.I)
    base = f'<base href="{html.escape(final)}">'
    stripped = stripped[:head.end()] + base + stripped[head.end():] if head else base + stripped
    stripped += "<script>" + MEASURE + "</script>"
    mirror = os.path.join(work, "mirror.html")
    open(mirror, "w").write(stripped)
    dom = subprocess.run([chrome(), "--headless=new", "--disable-gpu", "--hide-scrollbars", "--window-size=1440,900",
                          "--virtual-time-budget=12000", "--run-all-compositor-stages-before-draw", "--dump-dom",
                          "file://" + mirror], capture_output=True, text=True, timeout=120).stdout
    m = re.search(r'<pre id="__brand">(.*?)</pre>', dom, re.S)
    if not m:
        sys.exit("couldn't measure the page (it may need JavaScript to render). Set the brand by hand: see SKILL.md.")
    data = json.loads(html.unescape(m.group(1)))
    inline_css = [(c, final) for c in re.findall(r"<style[^>]*>(.*?)</style>", page, re.S | re.I)]
    return data, final, inline_css

def shoot(url, dst, size):
    subprocess.run([chrome(), "--headless=new", "--disable-gpu", "--hide-scrollbars", "--virtual-time-budget=8000",
                    f"--window-size={size}", "--force-device-scale-factor=1", f"--screenshot={dst}", url],
                   capture_output=True, timeout=120)

def pick_accent(data, bg):
    """The main button's colour: prominent, saturated, near the top. Falls back to theme-color, then the page's colours."""
    scored = []
    for b in data["buttons"]:
        c = rgb(b["bg"])
        if not c or c[3] < 0.9 or dist(c, bg) < 40:
            continue
        s = b["w"] * b["h"] * (1.5 if b["top"] < 900 else 1) * (1 + 2 * sat(c))
        scored.append((s, c, b))
    if scored:
        scored.sort(key=lambda x: -x[0])
        tot = {}
        for s, c, b in scored:
            tot[c[:3]] = tot.get(c[:3], 0) + s
        best = max(tot, key=tot.get)
        b = next(b for s, c, b in scored if c[:3] == best)
        return best, rgb(b["color"]), "the main button", b
    tc = rgb(data["meta"].get("theme_color"))
    if tc and sat(tc) > 0.2:
        return tc[:3], None, "theme-color", None
    for c, w in data["colors"]:
        t = rgb(c)
        if t and t[3] > 0.9 and sat(t) > 0.35:
            return t[:3], None, "the most-used saturated colour", None
    links = [rgb(c) for c in data["links"]]
    links = [l for l in links if l and sat(l) > 0.3]
    if links:
        return links[0][:3], None, "link colour", None
    return None, None, "nothing found", None

def save_logo(cand, out_dir):
    if cand["type"] == "svg":
        svg = cand["svg"].replace("currentColor", "#000")
        open(os.path.join(out_dir, "logo.svg"), "w").write(svg)
        return "brand/logo.svg"
    data, _, ctype = fetch(cand["src"], limit=3_000_000, binary=True)
    ext = {"image/svg+xml": "svg", "image/png": "png", "image/webp": "webp", "image/jpeg": "jpg", "image/gif": "gif"}.get(
        ctype.split(";")[0].strip(), cand["src"].split("?")[0].rsplit(".", 1)[-1].lower())
    ext = ext if ext in ("svg", "png", "webp", "jpg", "jpeg", "gif") else "png"
    open(os.path.join(out_dir, "logo." + ext), "wb").write(data)
    return "brand/logo." + ext

def main():
    if len(sys.argv) < 3:
        sys.exit(__doc__)
    d, url = sys.argv[1], sys.argv[2]
    if not re.match(r"https?://", url):
        url = "https://" + url
    dry = "--dry" in sys.argv
    out_dir = os.path.join(d, "brand")
    os.makedirs(out_dir, exist_ok=True)
    with tempfile.TemporaryDirectory() as work:
        print(f"measuring {url} ...")
        data, final, inline_css = measure(url, work)
    shoot(final, os.path.join(out_dir, "site.png"), "1440,900")
    shoot(final, os.path.join(out_dir, "site-mobile.png"), "500,1000")

    bg = rgb(data["page_bg"]) or (255, 255, 255, 1)
    theme = "dark" if lum(bg) < 0.35 else "light"
    h1c = next((rgb(h["color"]) for h in data["headings"] if h["tag"] == "H1" and rgb(h["color"]) and contrast(rgb(h["color"]), bg) > 4.5), None)
    ink = h1c or rgb(data["body"]["color"]) or (17, 17, 17, 1)
    accent, on, why, btn = pick_accent(data, bg)
    notes = []
    if not accent:
        notes.append("no accent colour found: set brand.color by hand")
    if accent and contrast(accent, bg) < 1.6:
        notes.append(f"accent {hexc(accent)} is close to the background: check the buttons in out/shot.png")

    # fonts
    h1s = [h for h in data["headings"] if h["tag"] == "H1"]
    h1 = h1s[0] if h1s else (max(data["headings"], key=lambda h: h["size"]) if data["headings"] else None)
    disp_stack = h1["font"] if h1 else data["body"]["font"]
    body_stack = data["body"]["font"]
    disp, body = primary(disp_stack), primary(body_stack)
    weight = int(h1["weight"]) if h1 and str(h1["weight"]).isdigit() else 700
    track = 0.0
    if h1 and h1["track"] not in ("normal", "") and h1["size"]:
        px = re.match(r"(-?[\d.]+)px", h1["track"])
        track = round(float(px.group(1)) / h1["size"], 3) if px else 0.0
    track = max(-0.06, min(0.06, track))
    fonts = {"weight": weight, "tracking": track}
    if h1 and h1.get("transform") == "uppercase":
        fonts["transform"] = "uppercase"
    # second accent: a saturated colour on words inside a heading; an italic in another font becomes the serif accent
    highlight, serif = None, None
    for h in ([h1] if h1 else []) + [h for h in data["headings"] if h is not h1]:
        for a in h.get("accents", []):
            c = rgb(a["color"])
            if c and sat(c) > 0.3 and (not accent or dist(c, accent) > 60) and not highlight:
                highlight = c[:3]
            if a["style"] == "italic" and primary(a["font"]) and primary(a["font"]) != primary(h["font"]) and not serif:
                serif = a["font"]
    roles = [("display", disp, disp_stack, [weight]), ("body", body, body_stack, [400, 500, 600])]
    if serif:
        roles.append(("serif", primary(serif), serif, [400]))
    css_texts = None
    for role, fam, stack, weights in roles:
        if not fam:
            fonts[role + "_stack"] = ", ".join(f'"{f}"' if " " in f else f for f in families(stack))
            fonts[role] = families(stack)[0] if families(stack) else "system-ui"
            notes.append(f"{role} font is the system font ({stack[:60]})")
            continue
        fonts[role] = fam
        if fam.lower() in SYSTEM:
            fonts[role + "_stack"] = ", ".join(f'"{f}"' if " " in f else f for f in families(stack))
            continue
        real = unhash(fam)
        g = google(real or fam, weights + ([700] if role == "display" else [])) if role != "serif" else \
            google(real or fam, []) and (real or fam) + ":ital@1"
        if g:
            name = real or fam
            fonts[role] = name
            fonts.setdefault("google", [])
            # one entry per family: Google rejects a request that names the same family twice
            same = [x for x in fonts["google"] if x.split(":")[0] == name]
            if same and role != "serif":
                had = [int(w) for x in same for w in re.findall(r"\d{3}", x.split("@")[-1]) if ".." not in x]
                merged = google(name, weights + [700] + had)
                fonts["google"] = [x for x in fonts["google"] if x not in same] + [merged or same[0]]
            elif not same:
                fonts["google"].append(g)
            continue
        if css_texts is None:
            css_texts = list(inline_css)
            for href in data["stylesheets"][:12]:
                try:
                    css, u, _ = fetch(href, limit=3_000_000)
                    css_texts.append((css, u))
                except Exception:
                    pass
        files = embed_fonts(fam, weights, css_texts, out_dir, "italic" if role == "serif" else "normal")
        if files:
            fonts.setdefault("files", []).extend(f for f in files if f not in fonts.get("files", []))
        else:
            notes.append(f"{role} font '{fam}' isn't on Google Fonts and its files weren't found: set "
                         f"brand.fonts.{role} to the closest Google font")
    if fonts.get("display") == fonts.get("body"):
        fonts.pop("display_stack", None)

    # shape
    rb = None
    if btn:
        r = re.match(r"([\d.]+)px", btn["radius"] or "")
        rb = int(float(r.group(1))) if r else 0
        if rb >= btn["h"] / 2 - 1:
            rb = 999
    radius = None if rb is None else (18 if rb == 999 else min(28, max(0, round(rb * 1.4))))
    button = None
    if btn:
        bf = primary(btn["font"])
        role = "display" if bf and bf == disp else "body" if bf and bf == body else None
        bt = re.match(r"(-?[\d.]+)px", btn.get("track") or "")
        button = {"font": role, "weight": int(btn["weight"]) if str(btn["weight"]).isdigit() else 600,
                  "transform": btn.get("transform") if btn.get("transform") in ("uppercase", "none") else "none",
                  "tracking": round(float(bt.group(1)) / btn["size"], 3) if bt and btn.get("size") else 0.0}

    # logo + name
    logo = None
    for cand in data["logos"]:
        try:
            logo = save_logo(cand, out_dir)
            break
        except Exception:
            continue
    if not logo:
        notes.append("no logo found: add brand.logo by hand (a file in the project folder)")
    title = data["meta"].get("site_name") or re.split(r"\s+[|\-–—:·]\s+", data["meta"].get("title") or "")[0]
    name = (title or urllib.parse.urlparse(final).netloc.replace("www.", "")).strip()[:40]

    brand = {"name": name, "theme": theme, "bg": hexc(bg), "ink": hexc(ink), "fonts": fonts, "source": final}
    if accent:
        brand["color"] = hexc(accent)
        if on and contrast(on, accent) >= 3:
            brand["on"] = hexc(on)
        elif accent:
            brand["on"] = ink_on(hexc(accent))
    if theme == "light" and lum(ink) < 0.08:
        brand["cover"] = hexc(ink)
    if rb is not None:
        brand["button_radius"], brand["radius"] = rb, radius
    if button:
        brand["button"] = button
    if highlight:
        brand["highlight"] = hexc(highlight)
        if serif:
            brand["em"] = hexc(highlight)
    if logo:
        brand["logo"] = logo

    json.dump({"brand": brand, "accent_from": why, "notes": notes, "measured": data}, open(os.path.join(out_dir, "brand.json"), "w"), indent=1)
    print(f"  name     {name}")
    print(f"  theme    {theme}   bg {brand['bg']}   ink {brand['ink']}")
    print(f"  accent   {brand.get('color', '-')} (from {why})   text on it {brand.get('on', '-')}")
    print(f"  fonts    display {fonts.get('display')} {weight} {track:+.3f}em   body {fonts.get('body')}   "
          f"google {fonts.get('google', [])}   embedded {[f['file'] for f in fonts.get('files', [])]}")
    print(f"  shape    button radius {rb}   card radius {radius}")
    print(f"  logo     {logo or '-'}   (padding is trimmed in the page; a wide wordmark hides the name text)")
    print(f"  accent 2 {brand.get('highlight', '-')}   accent font {fonts.get('serif', '-')}   heading case {fonts.get('transform', 'as typed')}")
    print(f"  button   {button}")
    for n in notes:
        print(f"  check    {n}")
    print(f"  saved    {out_dir}/site.png, site-mobile.png, brand.json")

    if not dry:
        p = os.path.join(d, "magnet.json")
        m = json.load(open(p))
        old = m.get("brand") or {}
        keep = {k: old[k] for k in ("header",) if k in old}
        m["brand"] = {**brand, **keep}
        m["brand"].pop("source", None)
        json.dump(m, open(p, "w"), indent=2, ensure_ascii=False)
        print(f"  wrote    brand into {p}; now build, shoot, and compare out/shot.png with brand/site.png")

if __name__ == "__main__":
    main()
```

## File: hormozi-lead-magnet/examples/skeleton/magnet.json
size: 3488
sha: 0ee04a3aeb03dacd63540887b8fc63062651721a
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/examples/skeleton/magnet.json

```text
{
  "type": "assessment",
  "brand": { "name": "[Your business]", "color": "#1f5eff" },
  "who": "[Who it's for, e.g. For HVAC owners doing $1-5M a year]",
  "title": "[Name from the tested options, e.g. The 4 Leaks Keeping Your Business Under $5M]",
  "subtitle": "[The result, not the vehicle. e.g. Answer 6 questions. See exactly what's costing you jobs.]",
  "start": "Take the 2-minute assessment",
  "time": "6 questions · about 2 minutes",
  "proof": [
    { "text": "[A real result in a customer's words, e.g. \"We booked 31 more jobs in March.\"]", "who": "[Name, business, city]" }
  ],
  "questions": [
    {
      "q": "[Question 1: checks for the first problem you always find, in your words]",
      "options": [
        { "label": "[Healthy answer]", "points": 2 },
        { "label": "[Middle answer]", "points": 1, "problem": "[What this answer means, specifically. Be specific on the negative.]" },
        { "label": "[Bad answer]", "points": 0, "problem": "[What this answer costs them, with a real number if you have one]" }
      ]
    },
    {
      "q": "[Question 2]",
      "options": [
        { "label": "[Healthy answer]", "points": 2 },
        { "label": "[Bad answer]", "points": 0, "problem": "[The problem it reveals]" }
      ]
    },
    {
      "q": "[Question 3: a problem that gets worse while they wait]",
      "options": [
        { "label": "[Healthy answer]", "points": 2 },
        { "label": "[Middle answer]", "points": 1, "problem": "[The problem, and why it gets worse every month]" },
        { "label": "[Bad answer]", "points": 0, "problem": "[The problem, and why it gets worse every month]" }
      ]
    }
  ],
  "results": [
    { "min": 0, "max": 49, "label": "[Bucket name for low scores]", "body": "[What it means, in one or two lines]", "delta": "[Where they are vs where they could be, in your real numbers]" },
    { "min": 50, "max": 79, "label": "[Bucket name for middle scores]", "body": "[What it means]", "delta": "[The delta]" },
    { "min": 80, "max": 100, "label": "[Bucket name for high scores]", "body": "[What it means]" }
  ],
  "problems_title": "{n} things your answers revealed",
  "next_problem": "[What they'll hit once these are fixed, which is the thing your paid offer solves]",
  "capture": {
    "action": "",
    "fields": ["name", "email"],
    "button": "Show my results",
    "fine": "[One line on what happens to their email, e.g. You'll get your results and one email a week. Unsubscribe anytime.]",
    "qualify": {
      "label": "[Qualifying question, e.g. What's your yearly revenue?]",
      "options": [
        { "label": "[Qualified answer]", "route": "main" },
        { "label": "[Qualified answer]", "route": "main" },
        { "label": "[Not a fit yet]", "route": "later" }
      ]
    }
  },
  "gate": { "title": "Your results are ready", "text": "Where should we send them?" },
  "cta": {
    "main": {
      "text": "[Clear next step, e.g. Book a 20-minute call and we'll fix the biggest one with you]",
      "reason": "[A real reason to act now, e.g. We take 4 new clients a month.]",
      "button": "Book my call",
      "url": "[https://your-booking-link]",
      "alt": "[Another way to act, e.g. Or text us at 555-0100]"
    },
    "later": {
      "text": "[What not-yet-qualified people get instead, e.g. Start with the free guide]",
      "reason": "[Why this is the right next step for them]",
      "button": "Get the guide",
      "url": "[https://link]"
    }
  }
}
```

## File: hormozi-lead-magnet/hormozi-lead-magnet-research.md
size: 30876
sha: 913b385d492832ea6128cf0003f438080550266e
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/hormozi-lead-magnet-research.md

```text
# Hormozi on lead magnets: research notes

Compiled 2026-10-28, only from Hormozi's own YouTube channel (@AlexHormozi, videos and streams). No books, book
summaries or paid courses were used.

**The corpus:**
- 551 videos with transcripts, **281.9 hours**.
- 196 passages match lead-magnet terms. Together with the two full lessons they span 99 videos.
  - 86 passages (from 49 videos) name lead magnets directly. They're the source for sections 1–10.
  - The other 110 cover free audits, trials, guides and other free offers. They're the source for section 11.
- Every passage was read in full: about 450 cited points before deduplication.
- The two complete lessons are broken down step by step in `reference-breakdown.md`.

Everything is paraphrased; links go to the second. The transcripts are auto-captions with no speaker labels.

**Tags:**
- **[C]** a caller, client or guest said it, not Hormozi.
- **[I]** inference.
- No tag means Hormozi said it.

## 1. What it's for

- **The definition:** a complete solution to one narrow problem, given away before the paid offer, so that solving it
  exposes the next problem, which the paid offer solves. Don't try to solve their whole problem for free.
  ([Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2251s), [Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=155s), [Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=283s))
- **Most buyers want "a little bit first".** He puts it at 80% or more. "Get more info" is too big a jump from zero, so
  it mostly attracts desperate buyers. ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=155s))
- **High-information vs low-information buyers.** A minority buy straight from an ad. The other ~97% need more time and
  information, and giving it to everyone closes more people overall. ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=715s))
- **Solve one loop and they assume the rest.** The lead magnet is one small problem-solution loop inside their bigger
  goal; solve it accurately and they assume you can solve the others. With a reveal-a-problem magnet, "this is exactly
  what I'm struggling with" raises their belief that you can help. ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=775s), [Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=994s))
- **His claim for the upside:** done right, a lead magnet can 2x, 5x, sometimes 10x leads. As a back-of-envelope:
  1 buyer in 100 from a direct pitch becomes about 3 in 100 with a free step first. Both are illustrations, not
  measurements. ([Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2281s), [Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=185s))
- **It's a filter as well as a magnet.** Pull in the right people and weed out the wrong ones. ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=916s))
- **Reputation:** 99% will never buy, but they judge you on your free stuff and tell others.
  ([Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2313s), [Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=308s))
- **Reciprocity needs a visible hard cost.** Free only creates the pull to repay if they can see what it cost you.
  ([3 Fastest Ways](https://www.youtube.com/watch?v=ovL6Z5z0jxQ&t=834s))
- **Content is the cheapest lead magnet:** hundreds of tiny ones with no opt-in, a "pre-lead magnet" to the lead magnet.
  ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=185s), [Get Rich Young](https://www.youtube.com/watch?v=DfXy_PzlC0o&t=1184s))
- **A paid front end counts too.** He calls a lash studio's $99 promo a lead magnet: it isn't built to profit. Watch
  how many step-one buyers take step two. ([Stranger $2.3M](https://www.youtube.com/watch?v=-Koq14DPXC4&t=710s))
- **The usual chain:** ad → lead magnet → VSL → qualify → call. Non-buyers go into email or a group and get "reheated"
  later. ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=1670s))
- **Where scaling stalls:** when ad spend rises and ROAS falls, the first thing that limits you is the lead magnet.
  ([Top Questions](https://www.youtube.com/watch?v=QwEb78e5a8Y&t=725s))
- **It isn't always the lever.**
  - Direct "buy my X" ads can get higher immediate ROAS, but they cap out at the warm few percent.
  - For a janitorial company or a craft box he said the offer or channel matters more.
  - For roofers he called the lead magnet mostly a fresh hook.

  ([34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=4254s), [Hotline](https://www.youtube.com/watch?v=-HbwUdqUcEs&t=7985s), [34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=9473s))

## 2. Types and delivery

- **Three types:** reveal a problem, a sample or free trial, one step of a multi-step process. Type 2 is called "free
  trial" in some videos and "sample of the solution" in others.
  ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=921s), [Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=838s), [3 Fastest Ways](https://www.youtube.com/watch?v=ovL6Z5z0jxQ&t=896s))
- **Reveal-a-problem examples he uses:**
  - his $100M Scaling Roadmap, which shows which of 10 stages you're at and what's holding you back;
  - "Gym Launch Secrets", which shows everything wrong with your gym until it feels overwhelming and you want help;
  - a DM framework that shows why you aren't getting replies.

  ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=963s), [3 Fastest Ways](https://www.youtube.com/watch?v=ovL6Z5z0jxQ&t=926s))
- **Challenges:** a 7- or 14-day challenge pulled from what already works for customers. It hits all four parts of the
  value equation: a clear outcome, believable, fast because it's time-boxed, and easy. It works as a mini version of a
  slow, big outcome. ([Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=314s), [Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=405s))
- **Services:** "a lead magnet does not have to be an ebook" or automated.
  - Examples: a personal style assessment, a FaceTime kitchen or grocery walk-through, five free one-to-one calls, a
    personalised Loom showing opportunities, a live walk-through of a gym's sales setup.
  - In fitness he thinks time and effort beat free materials.

  ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=338s), [1/0 Live](https://www.youtube.com/watch?v=9OsUfwTTslc&t=4995s), [Answers](https://www.youtube.com/watch?v=IG9IWQVmxqk&t=1987s), [Scaled Sales Team](https://www.youtube.com/watch?v=okA9Yt2KZuk&t=899s))
- **Tools:** an internal spreadsheet that shows a bar its revenue opportunity from its top sellers, and his roadmap
  diagnostic. ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=981s))
- **Other forms:** free communities, events, books (his own are lead magnets), the first module of a course, a "secret
  chapter", and free facility access sold up to personal training.
  ([Paid Ads 30 Min](https://www.youtube.com/watch?v=fSbqaTlWaYI&t=1754s), [Runs Without You](https://www.youtube.com/watch?v=TLpLmhWqKEU&t=3517s), [13 Ways](https://www.youtube.com/watch?v=Lc8DNduiwKA&t=2343s))
- **Costly or personal magnets are fine for qualified people only.** Say so on the page.
  ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1415s))

## 3. Making one

- **The 7 steps:**
  1. pick the best problem;
  2. how to solve it;
  3. how to deliver it;
  4. test the name;
  5. make it easy to consume;
  6. make it really good;
  7. make it easy for them to say they want more.

  He says #7 is the one people miss. His page-45 recap lists only the first six.
  ([Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2404s), [Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=277s))
- **One avatar first.** A "get your first five clients" magnet draws beginners who aren't your buyer today. Look at the
  top 20% of customers by spend, or the ones who've stayed two years, and build for what they have in common.
  ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=899s), [Get Rich Young](https://www.youtube.com/watch?v=DfXy_PzlC0o&t=1153s))
- **Make sure it attracts the buyer you want.** A client's book about quitting his job pulled in employees. Hormozi told
  him to write it about the business instead. ([Being Fast](https://www.youtube.com/watch?v=fcyIoN8CUOk&t=85s))
- **Pick the problem.** Choose the tiniest one you can solve completely and so well it blows them away. Picking the
  wrong one is among the biggest mistakes, because some problems lead to purchases and some just waste your time.
  ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=684s), [Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2374s))
- **Where to find problems:** the comments on your content, and the friction customers hit when they implement your
  product. ([13 Years Marketing](https://www.youtube.com/watch?v=reisEL_D7xc&t=3914s))
- **Build it from what already works.** Pull something out of your product, or peel off the first step of your service
  that you normally charge for and template it. SOPs and checklists you already use count.
  ([Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=283s), [Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1415s), [No BS Advice](https://www.youtube.com/watch?v=cnbHgYYHzyE&t=5773s))
- **Narrow:** "deep is where the dollars are". A specific magnet beats a generic one.
  ([13 Years Marketing](https://www.youtube.com/watch?v=reisEL_D7xc&t=4035s), [Launching Live](https://www.youtube.com/watch?v=B2QbLzHvKbg&t=21001s))
  - **Tension:** elsewhere he prefers the widest net first to get flow, adding quality filters only once volume is huge.
    ([Lead Quality](https://www.youtube.com/watch?v=Kk6Vdfdwmxw&t=290s))
- **Good enough to charge for.** Would you charge $100, $1,000 or $10,000 for it? "Give away the secrets, sell the
  implementation." High-ticket done-for-you providers should put every secret in.
  ([13 Years Marketing](https://www.youtube.com/watch?v=reisEL_D7xc&t=3974s), [34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=4284s))
- **Easy to consume:** risk-free, easy and fast, and they shouldn't have to work for the value. You pre-digest it.
  **Speed beats size:** a faster, less valuable magnet beats a slower, more valuable one.
  ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1234s), [Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1324s))
- **Make it work with what they already have,** to defuse the main objection (a stylist's version: "using your existing
  closet"). ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=746s))
- **Make it feel personal cheaply.** Ask a few questions (skin tone, hair, eyes), then route the answers. People feel it
  was made for them. ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1748s))
- **No heavy first step.** A photo upload at opt-in was flagged: people wander off. Move it to the follow-up.
  ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1918s))
- **Ship it.** Don't polish so long it never goes out. His VSLs are mostly still version one, plus new objection answers.
  ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=532s))

## 4. The name and the page

- **Name first.** Capture is the first job, and before they consume it the title is all they see. Test 10, 20, even 30
  names. ([1.5M Q&A](https://www.youtube.com/watch?v=lidFtb1Ga0o&t=1675s))
- **Headlines take about 80% of the attention** and frame how the rest is read. Test them first.
  ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=715s))
- **Name the freebie, not the sale:** "let's get coffee", not "marry me". His recipe: the result ("yay") plus the
  biggest insecurity or objection ("boo"), e.g. "free lookbook to dress for your tone using your existing closet".
  ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=746s))
- **His favourite lead magnet:** "how to know if a girl wants you to kiss her". It answers one question, carries high
  pain and high promise. ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=653s))
- **Names he proposed for real businesses:**
  - "100 days of content in 100 minutes";
  - "seven revenue opportunities you can set up in 30 days, free" (he said not to call it an
    "audit", which sounds boring);
  - "top 10 drinks you shouldn't be serving";
  - "six ways to decrease CPAs".

  ([AMA](https://www.youtube.com/watch?v=_ooj0V4hpgw&t=1848s), [34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=5415s), [Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=861s))
- **Narrow the name to the buyer.** "Fill all 10 chairs in 30 days" pulls salon owners, a "free report on the hair
  industry" pulls anyone, and "first five cut-and-colour clients" pulls stylists.
  ([Insane Money](https://www.youtube.com/watch?v=QTZsh3BgOwY&t=133s))
- **Say it's free.** A clinic ad he reviewed never did. ([Stranger $5M](https://www.youtube.com/watch?v=sBJppqCeFGI&t=920s))
- **The opt-in page:**
  - a headline about what they get;
  - a sub-headline that clarifies or qualifies ("without X, Y, Z");
  - an image of the thing (make it look like a book) or a before/after;
  - the opt-in;
  - below the fold, only what helps them move forward.

  For cold traffic, remove the logo and business name from the top.
  ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=2445s), [Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=2620s), [Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1475s))
- **Congruence:** if you're high-end, the ad, magnet, qualification, price and product must all look it. The page must
  keep the ad's promise. ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=1393s), [Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=562s))
- **New wrapper, same thing.** Re-skin by season or pain about once a quarter ("Lean by Halloween", "Slim for Santa",
  "42-day fix"). You can swap the title on a live magnet and keep sending the old one to past opt-ins.
  ([Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=634s), [Start From Nothing](https://www.youtube.com/watch?v=unshZobTt6Q&t=668s), [1.5M Q&A](https://www.youtube.com/watch?v=lidFtb1Ga0o&t=1736s))

## 5. After the opt-in

- **Qualify on the same form,** with real BANT questions (budget, authority, need, timing) plus income. "Are you
  willing to invest in your future?" is a fake qualifier. Qualified people go to the scheduler; unqualified people get a
  free resource. Adding friction here has almost always made him more money, even with fewer calls.
  ([Runs Without You](https://www.youtube.com/watch?v=TLpLmhWqKEU&t=3551s), [Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1718s), [Launching Live](https://www.youtube.com/watch?v=B2QbLzHvKbg&t=21281s))
- **Friction rule:** consuming should be effortless, but qualifying and booking should have friction.
  ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1234s), [Launching Live](https://www.youtube.com/watch?v=B2QbLzHvKbg&t=21281s))
- **Thank-you page:** offer a personalised version ("book a call, we'll tailor it to your bar").
  ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=861s))
- **Run the call off the lead magnet:** go through what they got, take a few of their numbers, then explain how you'd
  help if it's a fit. ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=3258s))
- **The flow:** opt-in → VSL above the scheduler → after booking, the VSL again plus "how to prepare for your call".
  - A caller converting about 1% of opt-ins had skipped the VSL [C].
  - Host the VSL off YouTube.

  ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=1337s), [Launching Live](https://www.youtube.com/watch?v=B2QbLzHvKbg&t=21218s))
- **"I'll go through your free stuff first":** agree. If it works, they'll hit the next problem you solve; if it
  doesn't, you solve it. ([Sales Training 2026](https://www.youtube.com/watch?v=StVqS0jD7Ls&t=7424s))
- **Delivery email (his own):**
  1. Tease what's coming so they stay subscribed.
  2. Deliver the promise.
  3. Ask them to reply "yes" for a bonus, which keeps you out of the promotions tab.
  4. Sell staying on the list before giving the reward.

  The bad cases are a bad magnet, or a good magnet with no reason to stay.
  ([Email Marketing](https://www.youtube.com/watch?v=pLhQOYMGa88&t=1735s), [Email Marketing](https://www.youtube.com/watch?v=pLhQOYMGa88&t=1857s))
- **Deliver it two ways:** by email, and as a link right on the page. ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=1368s))

## 6. Promoting it

- **Ads:** call out the avatar ("attention salon owners"), lead with a pain-based hook, then offer the free thing.
  Run two ads that differ only in the magnet offered. ([Insane Money](https://www.youtube.com/watch?v=QTZsh3BgOwY&t=163s), [Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=861s))
- **Content to ad:** post lots of niche content, add a CTA to the winners, and run those as ads with the magnet as the
  offer. ([Hotline](https://www.youtube.com/watch?v=-HbwUdqUcEs&t=5183s))
- **Comment-a-word, then a DM:**
  - The ManyChat flow he recommended: the CTA in the first line of the video, an automatic DM to new followers, then a
    sorting question ("here for free stuff, or to grow your business?").
  - Keep the CTA to about 3 seconds; 6 was too long and hurt view-through.

  ([AMA](https://www.youtube.com/watch?v=_ooj0V4hpgw&t=1818s), [34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=2670s))
- **Lighter asks reach further.**
  - "Comment for a free assessment, then book a call in DMs" is the heaviest ask you can make; he'd use a cheat sheet
    plus a triage question instead.
  - His roadmap ads have lower immediate ROAS than ads straight to a workshop, but higher ROI over 60–90 days and about
    10x the reach.

  ([34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=2766s))
- **Rotate magnets.** People who already have one won't respond to it again. If posting daily, about 2 posts a week
  carry a book-a-call CTA and the rest carry lead magnets. ([34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=2702s), [34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=2828s))
- **CTAs at the start, middle and end of videos,** with about 5 short variants of each to beat banner blindness.
  ([1.2M Followers](https://www.youtube.com/watch?v=WrCt0R3FBFs&t=253s))
- **Partners:** let partners bundle your magnet free or sell it to their audience and keep the money.
  ([Investor Q&A](https://www.youtube.com/watch?v=--9kOXNCUdE&t=1206s))
- **Outbound:** if nobody replies, give away more in the opening message.
  ([1/0 Live](https://www.youtube.com/watch?v=9OsUfwTTslc&t=4904s))
- **Inside a VSL:** tease the tip early, deliver it about a third of the way in, then mention the 28 others.
  ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=1446s))

## 7. Numbers

- **Opt-in benchmarks:**
  - 20–50% (sometimes 60%) for a page with qualified traffic and a clearly defined magnet.
  - 30% for high-intent search traffic.
  - A bar consultancy's page at 7% [C] he read as about a 4x opportunity.
  - A caller's 5% opt-in [C] he called "the lever by a mile".

  ([Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1384s), [Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=3288s), [1.5M Q&A](https://www.youtube.com/watch?v=lidFtb1Ga0o&t=2112s))
- **Tailored beats generic [C]:** a general course converted about 0.5% of viewers; a PDF tailored to each YouTube
  video converted 10–15%. ([Launching Live](https://www.youtube.com/watch?v=B2QbLzHvKbg&t=20971s))
- **Email challenge:** about 10,000 registered, 800 bought at $2,000, for $1.6M, from a somewhat warm list.
  ([Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=253s))
- **$97 vs $47 front end:** about the same number of buyers at twice the money, and the $97 buyers spent more later.
  ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=1012s))
- **Launch pitch claims (promotional):**
  - 10 businesses averaging about $35k extra a month by month 3;
  - a 17x lift in applications at acquisition.com in 2022.

  ([Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2344s), [Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=2435s))
- **Group funnels:** good operators move about 10% of group opt-ins to the next level, and calls close at 30–50%.
  ([Paid Ads 30 Min](https://www.youtube.com/watch?v=fSbqaTlWaYI&t=1785s))
- **What a customer costs:** the magnet's delivery cost × the number of magnets per customer.
  - $25 of labour given to four people for one sale = $100.
  - A $10 trial massage: 20 yeses from 100 instead of 1, and 6 buy.

  ([reference L1](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1188s), [reference L2](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=184s))

## 8. Mistakes

- **No lead magnet, or a bad one.** Most are bad, and your first one probably will be.
  ([Easy Mode 2026](https://www.youtube.com/watch?v=Ds_Qp2U5I8U&t=622s))
- **The wrong problem,** **the wrong avatar,** or **a vague magnet** when a specific one is possible.
- **Hard or slow to consume,** or a heavy first step.
- **Giving a costly magnet to everyone,** or using a fake qualifier.
- **Fear of friction** at the qualifying step.
- **The same magnet CTA on every post,** long CTAs, or a heavy ask.
- **Sending the magnet with nothing else,** so they have no reason to stay on the list.
- **Stacking two magnets in one funnel.** A/B them instead.
- **Optimising only for opt-ins.** Track through to sales and LTV.
- **Mixing cold-traffic and high-intent numbers.**
- **Polishing forever instead of shipping.**
- **Logo and business name on top of a cold-traffic page,** or an ad that never says "free".

## 9. Testing

- **Test the name first and in volume:** 10–30 titles as simple ads, compared on CTR.
- **Without budget:** story polls, texts, "comment A or B" (see the reference breakdown).
- **When the opt-in is the weakest step,** put all the testing there: clarity, simplicity, more visuals, more trust.
- **Test promos on a slice first:** 10% of the list, one to three times, then send to everyone.
- **One lever at a time:** lead magnet, creative, CRO, sales efficiency.
- **Measure:** UTMs on every link to the magnet, and return per $1 at set days after opt-in.
- **Re-test after every seasonal re-wrap.**

([1.5M Q&A](https://www.youtube.com/watch?v=lidFtb1Ga0o&t=1706s), [1.5M Q&A](https://www.youtube.com/watch?v=lidFtb1Ga0o&t=2082s), [Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=1206s), [Top Questions](https://www.youtube.com/watch?v=QwEb78e5a8Y&t=755s), [Lead Quality](https://www.youtube.com/watch?v=Kk6Vdfdwmxw&t=319s))

## 10. Worked examples (business → what he suggested)

- **Personal stylist:**
  - a free lookbook to dress for your tone using the closet you already have;
  - or a style assessment for qualified leads only;
  - the easiest version is your colour palette from skin, hair and eyes.

  ([Secret Business](https://www.youtube.com/watch?v=SmiOK8Yun4s&t=746s), [Stranger $1M](https://www.youtube.com/watch?v=nrounb8NlFQ&t=1264s))
- **Bar consultant:** "the 10 worst drinks to serve" with 10 replacements, or a profit-leak tool. A/B the two, then
  offer to tailor it on a call. ([Stranger $3M](https://www.youtube.com/watch?v=n6SHLmKcY0E&t=861s))
- **SEO agency, cold outreach:** a personalised Loom on where competitors rank, packaged as "7 revenue opportunities
  you can set up in 30 days, free". ([34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=5415s))
- **B2B data consultancy:** five free calls for qualified companies, with the frame set on call one: "on call five
  I'll explain how working together would look". ([Answers](https://www.youtube.com/watch?v=IG9IWQVmxqk&t=2048s))
- **Gyms:** a six-week challenge; "Gym Launch Secrets"; free facility access sold up to personal training.
  ([3 Fastest Ways](https://www.youtube.com/watch?v=ovL6Z5z0jxQ&t=896s), [13 Ways](https://www.youtube.com/watch?v=Lc8DNduiwKA&t=2343s))
- **Weight loss:** a 7-day mini-result challenge. ([Email Campaign](https://www.youtube.com/watch?v=OpeN4O5myIg&t=436s))
- **Coding course:** the first module free, "learn this in under 60 minutes", then call the people who take it.
  ([Hotline](https://www.youtube.com/watch?v=I0nCuqu7Cac&t=9137s))
- **Salon:** "fill all 10 chairs in 30 days". ([Insane Money](https://www.youtube.com/watch?v=QTZsh3BgOwY&t=133s))
- **Any business with SOPs:** turn the checklists into lead magnets. ([No BS Advice](https://www.youtube.com/watch?v=cnbHgYYHzyE&t=5773s))

## 11. Free offers that don't use the words "lead magnet" (110 passages, 53 videos)

He also calls these "attraction offers": something free or discounted that gets a customer in, with the money made on
what they buy next.

**The payback test.** Done right, a customer pays back what they cost to acquire on day one; done wrong, you lose money
on each one. ([Money Models launch](https://www.youtube.com/watch?v=6_CCutkM11g&t=2044s), [Money Models launch](https://www.youtube.com/watch?v=6_CCutkM11g&t=2075s))

**"Give away the secrets, sell the implementation."**
- What people pay for is implementation, accountability, troubleshooting and an outside view.
- Giving everything away doesn't eat sales, because people buy on value they've already received.

([1.2M Followers](https://www.youtube.com/watch?v=WrCt0R3FBFs&t=1392s), [1.2M Followers](https://www.youtube.com/watch?v=WrCt0R3FBFs&t=1452s), [Legit Online Course](https://www.youtube.com/watch?v=oTQPxPFROck&t=224s))

**Free isn't always better.** For cold traffic he'd turn a free webinar into a $99 workshop with bonuses stacked until
the price "feels absurd". By his estimate, that cuts unqualified attendees from about 90% to about 40%.
([AMA](https://www.youtube.com/watch?v=_ooj0V4hpgw&t=524s), [AMA](https://www.youtube.com/watch?v=_ooj0V4hpgw&t=585s))

**Trials need skin in the game.** He calls a bare free trial into a membership the "bad money model": a gym takes three
months to break even, and many members quit by month four. Fixes:
- a trial with a penalty: card on file, a set minimum number of sessions, a no-show fee;
- free with a deposit that's refunded or credited when they hit the goal;
- a small upfront fee that's rebated if they use the tool;
- for software, a reason to use it during the trial.

([Money Models launch](https://www.youtube.com/watch?v=6_CCutkM11g&t=1105s), [The Offer Is King](https://www.youtube.com/watch?v=pxVeOkOVr2w&t=394s), [The Offer Is King](https://www.youtube.com/watch?v=pxVeOkOVr2w&t=425s), [Hotline](https://www.youtube.com/watch?v=-HbwUdqUcEs&t=4119s))
- If you take a card before a free visit, say it's "just how we've always done it". People don't argue with policy.
  ([Stranger $5M](https://www.youtube.com/watch?v=sBJppqCeFGI&t=1641s))

**Ungated content.**
- His own free courses have no opt-in or login. In his opinion (not a test), that retains better and gets shared more.
  ([Bacon Business](https://www.youtube.com/watch?v=orMbq2LtzKE&t=4723s))
- **Tension with §5:** he gates lead magnets for ads and call-booking funnels, but leaves broad educational content open
  with an optional opt-in partway through.

**Audits and free consults work for high-ticket services.**
- Roofing and heating/cooling: "free audits or some sort of free thing" anchored on savings, on-site or virtual.
- Dental implants: a free consult plus a free scan was fine. What failed was the call that sets the appointment and the
  missing pre-visit VSL.

([Paid Ads 30 Min](https://www.youtube.com/watch?v=fSbqaTlWaYI&t=1578s), [dentist call](https://www.youtube.com/watch?v=tnDC4ZJ0oy8&t=1047s))

**"20 mistakes people make buying [your category]".** A slide deck with one customer proof under each mistake, handed
out by QR from a conference stage. The opt-in asks whether they buy this kind of thing and how often, so the opt-in
list is the lead list. ([Service-Based Businesses](https://www.youtube.com/watch?v=mRlSb0O5QNU&t=641s), [Service-Based Businesses](https://www.youtube.com/watch?v=mRlSb0O5QNU&t=672s))

**Copy:**
- Write for someone who doesn't know you, is in a hurry and reads at a third-grade level. Clear beats clever, and
  cutting beats explaining. ([13 Years Marketing](https://www.youtube.com/watch?v=reisEL_D7xc&t=1310s))
- Each piece sells only the next step: the ad sells the click, the headline sells the opt-in, the opt-in sells the
  show-up. ([14 Years Marketing](https://www.youtube.com/watch?v=JDR-R--4HhM&t=643s))
- Changing only the landing-page headline raised bookings 62%, with the opt-in rate flat. Watch the step after the
  opt-in. ([13 Years Marketing](https://www.youtube.com/watch?v=reisEL_D7xc&t=1280s))
- Call out a narrow audience: "moms in Nevada" gets "this is for me". ([13 Years Marketing](https://www.youtube.com/watch?v=reisEL_D7xc&t=1500s))

**Qualifiers and friction:**
- Put the one or two data points that predict a buyer on the form, and score leads on them. For a travel business that
  was credit-card spend and vacation spend. ([Stranger $12M](https://www.youtube.com/watch?v=MH-IMJxbUY4&t=1089s))
- **Friction is a dial.** Too many bad leads: add friction. Too few: remove it. No friction and still bad leads: the
  targeting is off. ([Paid Ads 30 Min](https://www.youtube.com/watch?v=fSbqaTlWaYI&t=617s))

**After the opt-in:**
- Educating someone right after they opt in costs almost nothing, so put a VSL or the scheduler on the thank-you page.
  ([Top 1%](https://www.youtube.com/watch?v=noE1MQPMvAc&t=2794s), [Paid Ads 30 Min](https://www.youtube.com/watch?v=fSbqaTlWaYI&t=586s))
- Call everyone who opts in. "Conversions happen in conversations."
  ([Paid Ads 30 Min](https://www.youtube.com/watch?v=fSbqaTlWaYI&t=1609s), [34.2M Views](https://www.youtube.com/watch?v=eW04CvHKvMo&t=5121s))

**Don't polish the opt-in rate forever.** Taking a 30% page to 45% never 10x's a business; send more traffic instead.
Judge sources by what a customer costs, not by cost per opt-in.
([Hotline](https://www.youtube.com/watch?v=-HbwUdqUcEs&t=1589s), [Scale a Service Business](https://www.youtube.com/watch?v=N5MExtki_VI&t=1937s))

**Numbers:**
- His free $100M Leads launch event: $275k in ads, about 137k registrations at about $2 a lead, 55% landing-page opt-in.
  ([Leads launch](https://www.youtube.com/watch?v=k834E6OTGTM&t=1316s))
- Going business-only in content: opt-ins per week up 26%, subscriber conversion up 24.6%, on fewer views.
  ([Grow an Audience 2026](https://www.youtube.com/watch?v=Jmkq5RLjm0U&t=8688s))
```

## File: hormozi-lead-magnet/magnet.py
size: 13167
sha: ec7e257b1cd018f5ad22748446738991fa5cff47
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/magnet.py

```text
"""Lead magnets from one magnet.json: the owner's words in, one self-contained page out (works on any host, prints to PDF).

  python3 magnet.py check <dir>            validate <dir>/magnet.json against Hormozi's rules
  python3 magnet.py build <dir>            -> <dir>/out/index.html (images inlined, no external files)
  python3 magnet.py pdf   <dir>            -> <dir>/out/<slug>.pdf (print view, needs Google Chrome)
  python3 magnet.py shot  <dir> [--mobile] -> <dir>/out/shot.png (first screen, needs Google Chrome)

Three types, one per Hormozi lead magnet category:
  assessment  reveal a problem: questions -> score -> the specific problems their answers reveal -> CTA
  guide       one step of a multi-step process: numbered steps with checklists, CTAs mid-way and at the end
  claim       a free service or trial for qualified people: what you get, what it's worth, the limit, a claim form
"""
import base64, html, json, mimetypes, os, re, shutil, subprocess, sys

HERE = os.path.dirname(os.path.abspath(__file__))
CHROME = ["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "google-chrome", "chromium", "chromium-browser"]

def load(d):
    p = os.path.join(d, "magnet.json")
    if not os.path.exists(p):
        sys.exit(f"no magnet.json in {d} (start from examples/skeleton/magnet.json)")
    return json.load(open(p))

def check(m, d):
    """Errors stop the build. Warnings are Hormozi's rules the draft doesn't meet yet."""
    err, warn = [], []
    t = m.get("type")
    if t not in ("assessment", "guide", "claim"):
        err.append('type must be "assessment", "guide" or "claim"')
    if not m.get("title"):
        err.append("title is missing (the name is the most important part: pick it from the tested options)")
    elif len(plain(m["title"])) > 90:
        warn.append(f"title is {len(plain(m['title']))} characters; names that win are short and specific")
    if not m.get("who"):
        warn.append("who is missing: say who it's for, so the wrong people self-select out")
    cta = m.get("cta") or {}
    if not cta.get("main"):
        err.append("cta.main is missing: every lead magnet ends with one clear next step")
    for k, c in cta.items():
        if not c.get("url"):
            warn.append(f"cta.{k}.url is empty")
        if not c.get("reason"):
            warn.append(f"cta.{k}.reason is empty: give a reason to act now (a real capacity limit beats none, any reason beats none)")
    cap = m.get("capture") or {}
    if not cap.get("action"):
        warn.append("capture.action is empty: the page works but leads go nowhere (fine for a draft, not for live)")
    q = cap.get("qualify")
    if q:
        for o in q.get("options", []):
            if o.get("route", "main") not in cta:
                err.append(f'qualify option "{o.get("label")}" routes to cta.{o.get("route")}, which doesn\'t exist')
    if not m.get("proof") and not m.get("stats"):
        warn.append("no proof or stats: add a real result (yours, never invented)")
    if not m.get("next_problem"):
        warn.append("next_problem is empty: say what problem solving this one reveals (the one your paid offer solves)")

    if t == "assessment":
        qs = m.get("questions") or []
        if not 3 <= len(qs) <= 12:
            warn.append(f"{len(qs)} questions; 5-10 keeps it fast to finish")
        for i, x in enumerate(qs, 1):
            opts = x.get("options") or []
            if len(opts) < 2:
                err.append(f"question {i} needs at least 2 options")
            if not any(o.get("problem") for o in opts):
                warn.append(f'question {i} reveals nothing: give the weak answers a "problem" (specific, in the owner\'s words)')
        rs = sorted(m.get("results") or [], key=lambda r: r.get("min", 0))
        if not rs:
            err.append("results is empty: add score buckets (min/max 0-100)")
        else:
            covered, at = True, 0
            for r in rs:
                if r.get("min", 0) > at:
                    covered = False
                at = max(at, r.get("max", 0) + 1)
            if not covered or at < 101:
                err.append("results buckets must cover every score from 0 to 100 with no gaps")
            if not any(r.get("delta") for r in rs):
                warn.append("no result has a delta: show where they are vs where they could be, in real numbers")
    elif t == "guide":
        st = m.get("steps") or []
        if not st:
            err.append("steps is empty")
        if len(st) > 9:
            warn.append(f"{len(st)} steps: it should solve one narrow problem completely; split it or cut it")
    elif t == "claim":
        if not m.get("includes"):
            err.append("includes is empty: list exactly what they get")
        if not m.get("limit"):
            warn.append("limit is empty: say your real capacity (e.g. 4 a week); only give free services to qualified leads")
        if not q:
            warn.append("no capture.qualify: free services should only go to qualified prospects")

    for p in images(m):
        if not p.startswith(("http", "data:")) and not os.path.exists(os.path.join(d, p)):
            err.append(f"image not found: {p}")
    return err, warn

def images(m):
    out = [m["image"]] if m.get("image") else []
    if (m.get("brand") or {}).get("logo"):
        out.append(m["brand"]["logo"])
    for x in (m.get("proof") or []) + (m.get("steps") or []):
        if x.get("img"):
            out.append(x["img"])
    return out

def inline(m, d):
    """Local image paths -> data URIs, so out/index.html is one file that works anywhere."""
    def uri(p):
        if p.startswith(("http", "data:")):
            return p
        f = os.path.join(d, p)
        mt = mimetypes.guess_type(f)[0] or "image/png"
        return f"data:{mt};base64," + base64.b64encode(open(f, "rb").read()).decode()
    m = json.loads(json.dumps(m))
    if m.get("image"):
        m["image"] = uri(m["image"])
    if (m.get("brand") or {}).get("logo"):
        m["brand"]["logo"] = uri(m["brand"]["logo"])
    for x in (m.get("proof") or []) + (m.get("steps") or []):
        if x.get("img"):
            x["img"] = uri(x["img"])
    return m

def plain(s):
    """Strip the page markup (**bold**, ==highlight==, *italic*) for the tab title and file names."""
    return re.sub(r"\*\*|==|\*", "", s or "")

def ink_on(hex_color):
    """Text colour on the brand colour. White wherever it reads at button size (3:1, WCAG large text), as designers do
    on mid-blues and reds; black on light colours (yellows, greens, light greys)."""
    h = hex_color.lstrip("#")
    if len(h) == 3:
        h = "".join(c * 2 for c in h)
    lum = [(int(h[i:i + 2], 16) / 255) for i in (0, 2, 4)]
    lum = [c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4 for c in lum]
    y = 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2]
    return "#ffffff" if 1.05 / (y + 0.05) >= 3.0 else "#0a0a0a"

def slug(s):
    return re.sub(r"[^a-z0-9]+", "-", plain(s).lower()).strip("-")[:60] or "lead-magnet"

def build(d):
    m = load(d)
    err, warn = check(m, d)
    report(err, warn)
    if err:
        sys.exit(1)
    brand = m.get("brand") or {}
    color = brand.get("color") or "#22c55e"
    for k in ("color", "on", "bg", "ink", "cover"):
        if brand.get(k) and not re.fullmatch(r"#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})", brand[k]):
            sys.exit(f"brand.{k} must be a hex colour like #22c55e, got {brand[k]!r}")
    mode = brand.get("theme", "dark")
    if mode not in ("dark", "light"):
        sys.exit('brand.theme must be "dark" or "light"')
    data = json.dumps(inline(m, d), ensure_ascii=False).replace("</", "<\\/")
    page = (open(os.path.join(HERE, "template.html")).read()
            .replace("{{TITLE}}", html.escape(plain(m["title"])))
            .replace("{{DESC}}", html.escape(plain(m.get("subtitle", ""))))
            .replace("{{MODE}}", mode)
            .replace("{{BRAND}}", color)
            .replace("{{ONBRAND}}", brand.get("on") or ink_on(color))
            .replace("{{HEAD}}", brand_head(brand, d))
            .replace("{{DATA}}", data))
    os.makedirs(os.path.join(d, "out"), exist_ok=True)
    out = os.path.join(d, "out", "index.html")
    open(out, "w").write(page)
    print(f"wrote {out} ({len(page) // 1024} KB)")
    return out

def css_str(name):
    return '"' + name.replace("\\", "").replace('"', "") + '"'

def brand_head(brand, d):
    """The owner's fonts and colours (from brand.py or set by hand), as tags that override the template's defaults."""
    fonts, out, root = brand.get("fonts") or {}, [], []
    if fonts.get("google"):
        fam = "&".join("family=" + f.replace(" ", "+") for f in fonts["google"])
        out.append(f'<link href="https://fonts.googleapis.com/css2?{html.escape(fam)}&display=swap" rel="stylesheet">')
    faces = []
    for f in fonts.get("files") or []:
        path = os.path.join(d, f["file"])
        if not os.path.exists(path):
            print(f"  warn   font file missing: {f['file']}")
            continue
        fmt = {"woff2": "woff2", "woff": "woff", "ttf": "truetype", "otf": "opentype"}.get(path.rsplit(".", 1)[-1], "woff2")
        b64 = base64.b64encode(open(path, "rb").read()).decode()
        faces.append(f'@font-face{{font-family:{css_str(f["family"])};src:url(data:font/{fmt};base64,{b64}) format("{fmt}");'
                     f'font-weight:{f.get("weight", "400")};font-style:{f.get("style", "normal")};font-display:swap}}')
    if fonts.get("body"):
        root.append(f"--sans:{fonts['body_stack'] if fonts.get('body_stack') else css_str(fonts['body'])}, var(--fallback)")
    if fonts.get("display"):
        root.append(f"--display:{fonts['display_stack'] if fonts.get('display_stack') else css_str(fonts['display'])}, var(--fallback)")
    if fonts.get("weight"):
        root.append(f"--hw:{int(fonts['weight'])}")
    if fonts.get("tracking") is not None:
        root.append(f"--track:{float(fonts['tracking']):.3f}em")
    for key, var in (("bg", "--bg"), ("ink", "--ink"), ("cover", "--cover")):
        if brand.get(key):
            root.append(f"{var}:{brand[key]}")
    if brand.get("radius") is not None:
        root.append(f"--r:{max(0, min(32, int(brand['radius'])))}px")
    if brand.get("button_radius") is not None:
        root.append(f"--rb:{max(0, min(999, int(brand['button_radius'])))}px")
    if fonts.get("serif"):
        root.append(f'--serif:{css_str(fonts["serif"])}, "Instrument Serif", ui-serif, Georgia, serif')
    if fonts.get("transform") in ("uppercase", "none"):
        root.append(f"--h-tf:{fonts['transform']}")
    if brand.get("highlight"):
        root.append(f"--hl:{brand['highlight']};--hl-ink:{ink_on(brand['highlight'])}")
    if brand.get("em"):
        root.append(f"--em:{brand['em']}")
    b = brand.get("button") or {}
    if b:
        if b.get("font") in ("display", "body"):
            root.append("--btn-font:" + ("var(--display)" if b["font"] == "display" else "var(--sans)"))
        if b.get("weight"):
            root.append(f"--btn-weight:{int(b['weight'])}")
        if b.get("transform") in ("uppercase", "none"):
            root.append(f"--btn-tf:{b['transform']}")
        if b.get("tracking") is not None:
            root.append(f"--btn-track:{float(b['tracking']):.3f}em")
    if faces or root:
        out.append("<style id=\"brand\">" + "".join(faces) + (":root{" + ";".join(root) + "}" if root else "") + "</style>")
    return "\n".join(out)

def chrome():
    for c in CHROME:
        if os.path.exists(c) or shutil.which(c):
            return c
    sys.exit("Google Chrome not found (needed for pdf and shot)")

def pdf(d):
    out = build(d)
    m = load(d)
    dst = os.path.join(d, "out", slug(m["title"]) + ".pdf")
    subprocess.run([chrome(), "--headless=new", "--disable-gpu", "--no-pdf-header-footer", "--virtual-time-budget=3000",
                    f"--print-to-pdf={dst}", "file://" + os.path.abspath(out) + "?print=1"],
                   check=True, capture_output=True)
    print(f"wrote {dst}")

def shot(d, mobile):
    out = build(d)
    dst = os.path.join(d, "out", "shot-mobile.png" if mobile else "shot.png")
    size = "390,844" if mobile else "1280,900"
    subprocess.run([chrome(), "--headless=new", "--disable-gpu", "--hide-scrollbars", "--virtual-time-budget=3000",
                    f"--window-size={size}", "--force-device-scale-factor=2", f"--screenshot={dst}",
                    "file://" + os.path.abspath(out) + "?clean=1"], check=True, capture_output=True)
    print(f"wrote {dst}")

def report(err, warn):
    for e in err:
        print("  ERROR  " + e)
    for w in warn:
        print("  warn   " + w)
    if not err and not warn:
        print("  ok")

if __name__ == "__main__":
    if len(sys.argv) < 3 or sys.argv[1] not in ("check", "build", "pdf", "shot"):
        sys.exit(__doc__)
    cmd, d = sys.argv[1], sys.argv[2]
    if cmd == "check":
        e, w = check(load(d), d)
        report(e, w)
        sys.exit(1 if e else 0)
    elif cmd == "build":
        build(d)
    elif cmd == "pdf":
        pdf(d)
    else:
        shot(d, "--mobile" in sys.argv)
```

## File: hormozi-lead-magnet/reference-breakdown.md
size: 12227
sha: 15bb1b2c9fff87d0e8d276f2a4209aab42516aad
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/reference-breakdown.md

```text
# Reference: Hormozi's two lead magnet lessons, step by step

Two of his own videos teach the whole method from start to finish. Everything below is paraphrased; links go to the second.

- **L1:** "Watch This To Generate 1000s of Leads (In Any Niche)", 31 min, 872k views ([youtube.com/watch?v=Mst4hreQYl0](https://www.youtube.com/watch?v=Mst4hreQYl0))
- **L2:** "Giving Away Free Stuff Will Make You Rich", 12 min, a chapter preview of *$100M Leads* ending in a 7-step checklist ([youtube.com/watch?v=7NMH1oAkgLY](https://www.youtube.com/watch?v=7NMH1oAkgLY))

## L1: what, why, the three types, four ways to deliver, the name, the CTA

**1. The problem it fixes** ([0:00](https://www.youtube.com/watch?v=Mst4hreQYl0&t=0s))
- Most businesses send traffic straight to "buy" or "get a quote". Most visitors aren't ready, so they leave and never come back.
- "Book a call" only works on an audience that already knows you. Its real job is to capture contact details, so ask what would capture *more* of them, from people who'd plausibly buy. ([1:00](https://www.youtube.com/watch?v=Mst4hreQYl0&t=60s))

**2. The definition** ([2:01](https://www.youtube.com/watch?v=Mst4hreQYl0&t=121s))
- A lead magnet is a mini offer: a complete solution to a narrow problem, free or cheap, that shows who's interested.
- Solving it reveals the next problem, and the core offer solves that one.
- People who take something free or low-cost now are more likely to buy the related, pricier thing later. (He reads this from page 31 of *$100M Leads*.)

**3. Why it works**
- Same 100 people. Ask them to buy and maybe one says yes. Help them first and then ask, and you get three to five times as many. You convert more of the same traffic without spending more on ads. ([3:01](https://www.youtube.com/watch?v=Mst4hreQYl0&t=181s))
- His own breakthrough came in 2016. His webinar didn't work, so he swapped it for a screen-recorded "free case study" of how a small San Diego gym added 213 members and $112k. The next morning the calendar was full. ([3:31](https://www.youtube.com/watch?v=Mst4hreQYl0&t=211s))
- A webinar can be a lead magnet. Sophisticated audiences read it as a pitch, though. "Here's what I did, watch it when you like" got far more opt-ins. ([4:31](https://www.youtube.com/watch?v=Mst4hreQYl0&t=271s))
- **Test the packaging more than the contents.** The headline alone can change demand 2x, 3x or 10x, as long as the contents clearly solve the problem. ([5:01](https://www.youtube.com/watch?v=Mst4hreQYl0&t=301s))
- People who pay with time now are more likely to pay with money later. Lead magnets work; bad lead magnets don't. ([7:04](https://www.youtube.com/watch?v=Mst4hreQYl0&t=424s))

**4. The objections**
- *Freebie seekers:* only give it to qualified people. Add a qualifying drop-down and send unqualified people somewhere else. ([8:37](https://www.youtube.com/watch?v=Mst4hreQYl0&t=517s))
- *Giving away too much:* don't solve the problem your core product solves. Solve one that leads to it, so that solving it *creates* the hunger for what you sell. Sell at the point of greatest deprivation: the dessert after the entree, food after the water. ([9:09](https://www.youtube.com/watch?v=Mst4hreQYl0&t=549s))

**5. The three types** ([10:11](https://www.youtube.com/watch?v=Mst4hreQYl0&t=611s))

| Type | What it does | His examples | Best when |
|---|---|---|---|
| **Reveal a problem** (his favourite) | A diagnosis that shows a problem they didn't know about, or how bad a known one is. Bonus: show what solved looks like and the gap. | Free website speed test: each second of load time costs about 3% of conversions, so 9 s → 3 s is about 18% more business. His top Allen ad was "4 reasons why you'll never have a million-dollar agency". | Problems that get worse while they wait: posture, termites, back taxes, cash flow ([11:12](https://www.youtube.com/watch?v=Mst4hreQYl0&t=672s)) |
| **Sample / trial** | Give the solution, then take it away, so its absence creates the want. Limit uses, quantity, time, or a mix. | The Costco sampler. Gym Launch gave four months of free agency leads with the system, then they paid to keep the leads coming. ([13:13](https://www.youtube.com/watch?v=Mst4hreQYl0&t=793s)) | Prospects who already know the problem |
| **One step of many** | Do one step of a multi-step process completely; the next steps are the sale. | First coat of paint; laser hair removal (6–8 sessions); the first two videos of a course; a stylist giving you your colours first ([6:03](https://www.youtube.com/watch?v=Mst4hreQYl0&t=363s)) | Complex products and services ([15:17](https://www.youtube.com/watch?v=Mst4hreQYl0&t=917s)) |

- **Be specific about the negatives and modest about the positives.** If you name someone's problems exactly, they'll assume you can fix them. That also keeps claims compliant and expectations realistic. ([12:13](https://www.youtube.com/watch?v=Mst4hreQYl0&t=733s))

**6. Four ways to deliver** ([15:47](https://www.youtube.com/watch?v=Mst4hreQYl0&t=947s))

All four can be combined. His scaling road map is a tool plus information.
1. **Software / tools:** calculating spreadsheets, assessment tools, templates, small apps. Example: a URL-in, site-audit-out tool. ([16:17](https://www.youtube.com/watch?v=Mst4hreQYl0&t=977s))
2. **Information:** mini courses, guides, expert interviews, static templates. It costs nothing to deliver, scales infinitely and has no operational drag. ([16:47](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1007s))
3. **Services:** free audits with some implementation, same-day work, anything done for you. "People sleep on this." Only give it to qualified prospects. ([18:18](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1098s))
   - **His math:** one hour of labour costs you $25 and is worth $250 or more to them. If one in four buys, a customer costs you $100. ([19:18](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1158s))
   - **His first business:** he trained people free for a year to collect testimonials. When demand outgrew him, almost all of them agreed to start paying. ([20:19](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1219s))
4. **Physical:** his books are lead magnets. So is a "CEO" shirt you only get by proving you're a CEO, which builds a qualified list. ([20:50](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1250s), [21:52](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1312s))

**7. Name it** ([22:22](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1342s))
- The name sets the engagement rate more than anything else. **The real secret: ask your audience.**
- Advertise the result, not the vehicle. His "big booty boot camp" sold the same six weeks of squats and deadlifts that "deadlift and squat seminar" wouldn't. ([22:53](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1373s))
- **How to test** ([23:54](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1434s)):
  - With money: small ad tests on the headlines, for a defined avatar.
  - Without money: poll your stories ("if you're not a business owner, don't answer"), text people "which one?", or post "comment A or B".
  - He tested six headlines for *$100M Leads*, plus the image and the subhead. Two years writing the book justified two days testing the name.
- **Four naming formulas** ([25:27](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1527s)):
  1. **Number + outcome + time frame:** "3 emails that turn cold leads into clients in 24 hours"
  2. **How to [good thing] without [bad thing], even if [insecurity]**
  3. **The [adjective] [thing] that [good thing]:** "the lazy funnel template that converts like crazy"
  4. **X mistakes that [cost you the goal]:** "4 mistakes keeping your business under $1M a year"

**8. Make money with it: the CTA** ([26:35](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1595s))
- **Ask:** most people build a great lead magnet and forget to ask. Salespeople who ask most often close the most.
- **Value between asks:** ask as often as you can, and give value between asks so they keep listening. ([27:05](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1625s))
- **The formula:** clear, not clever; say exactly what to do; give a reason to do it now. Scarcity or urgency if you have it, but any reason beats none (the photocopier line study). ([28:08](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1688s), [29:10](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1750s))
  - The audio skips point 2 of his three; it's only on screen.
- **Real scarcity:** service businesses (he says 78% of businesses) have a real capacity limit, so state it, e.g. "4 more customers fills us". Bigger businesses can run rolling cohorts ("we start this many a week"). ([30:11](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1811s))
- **Where CTAs go:** inside the lead magnet, and before and after it. ([31:12](https://www.youtube.com/watch?v=Mst4hreQYl0&t=1872s))

## L2: the 7-step checklist he uses for any business

**Before the steps:**
- People buy on a prediction of future value. The easiest way to earn that prediction is to give value before they buy. ([0:00](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=0s))
- **The core offer is whatever makes you the most money.** If the lead magnet starts out-earning it, that's your core offer now. ([1:00](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=60s))
- **Not a partial solution.** Six minutes of a twelve-minute video with "click for the rest" loses trust. Give complete work on a narrow problem, which then opens the next one. ([1:00](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=60s), [2:01](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=121s))
- **Massage math:** $100 massages get 1 yes in 100. $10 trials get 20, and a third of those buy packages: 6 customers. What the lead magnet costs to deliver is what you pay to get a customer, and it should still lower that cost overall. ([3:04](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=184s))
- **Map the journey:** before, during and after. For weight loss: a pre-loaded grocery list by body type, then "clean and prep it in under 60 minutes", then "store and portion it". Solve the first one or two completely and charge for the third. ([5:05](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=305s))
- **Things that cost you to deliver are valued more.** A free PDF gets little credit unless it's exceptional. Free real work gets taken up far more, and the math still works. "Your free stuff should be better than their paid stuff." ([6:35](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=395s))
  - This sits in tension with L1, which praises information for costing nothing. Resolution: info is fine, but it has to be exceptional.

**The seven steps** ([7:35](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=455s))
1. **The problem, and who it's for.** Knowing who changes how you name it, package it and deliver it.
2. **How you'll solve it:**
   - reveal a problem (an assessment);
   - a trial (for people who already know they have the problem);
   - one step of many;
   - or a combination.
3. **How you'll deliver it:** information, service, physical or software. Pick whatever the prospect values most and is most likely to lead to a sale. ([8:07](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=487s))
4. **Package it:** name, subhead and image, all tested. He calls this the most important step. ([8:38](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=518s))
   - His book title tests: "advertising" beat "promotions and advertising" 69–31, then "leads" beat "advertising" 58–42, then "leads" beat "marketing".
5. **Make it fast and easy to consume.** Offer several formats. *$100M Offers* sold in almost equal quarters across audio, print, ebook and video. ([9:39](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=579s))
6. **Make it good.** Fluff loses that buyer, and they then tell other people not to buy. If people don't tell others about your lead magnet, it failed. If you've never put more than 10% into one, put in 100%. ([10:10](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=610s))
7. **Make the next step easy.** CTAs clear, not clever, with several ways to act: phone, URL, QR. Matching how people prefer to act can double or triple response. ([11:12](https://www.youtube.com/watch?v=7NMH1oAkgLY&t=672s))
```

## File: hormozi-lead-magnet/template.html
size: 47552
sha: 093c7a5e0ae827b51f5058e5aeffa1a07b3be9e4
upstream: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/template.html

Content is not inlined in the catalog. Read the upstream file: https://github.com/kjagsadvisors/keeran.ai/blob/main/hormozi-lead-magnet/template.html
