// content-sub.jsx — Tier 4 sub-pyramids (the four Investor Designs + the shared
// Growth Layer) + the Investor Design assessment (questions, scoring, routing).
//
// The four Designs — Founder, Steward, Artisan, Originator — and the 12
// assessment questions are ported from the canonical Investor Design assessment
// at alignedwealth.app/assessment/life180. Keep them in sync with that app; it
// is the source of truth for the model. Market investing is deliberately NOT a
// Design: every Design's plan includes an evidence-based portfolio, so markets
// live in the shared Growth Layer that all four route through.

// Each sub-pyramid: levels bottom->top in array order index 0 = base.
// Each level has `cells` ordered left(conservative)->right(aggressive); the
// horizontal index maps onto the 5-stop risk gradient.
window.L180_SUBPYRAMIDS = {
  // Shared Growth Layer — not a Design. Every Design's plan includes an
  // evidence-based portfolio; this is where that portfolio gets built.
  growth: {
    key: "growth",
    name: "The Growth Layer",
    domain: "Market Investing",
    dot: "🟢",
    theme: "#24CE62",
    tagline: "Every Design ends up here. Your risk tolerance shapes your pyramid — your discipline determines whether it stands.",
    gateway: "Risk Tolerance Assessment",
    axisNote: "Risk climbs as you go up — and as you move left to right within each level.",
    axisLeft: "Conservative", axisRight: "Aggressive",
    levels: [
      { name: "Protection Foundation", note: "Whole life insurance is the foundational asset — it replaces the money market as your liquid, leverage-ready operational and emergency capital. You move money in and out and borrow against it to invest. Protection before positions.",
        cells: ["Whole Life Insurance", "Money Market", "High-Yield Cash / T-Bills", "Opportunity Fund"] },
      { name: "Core Allocation", note: "Where the invested portfolio begins.",
        cells: ["Treasuries", "Investment-Grade Bonds", "Broad Index ETFs", "Sector / Geo ETFs", "Materials & Gold"] },
      { name: "Targeted Allocation", note: "Tilting the core with intention.",
        cells: ["Quality / Dividend ETFs", "Low-Volatility Factor", "Value Tilts", "Growth Tilts", "Sector Overweights", "Thematic ETFs"] },
      { name: "Specialist & Trend-Aware", note: "You won't be right every time here. The goal is engagement, learning, and developing market sense.",
        cells: ["Defensive Rotation", "Trend-Following ETFs", "Macro Plays", "Tactical Sector Bets", "Aggressive Thematic"] },
      { name: "Conviction Positions", note: "Concentrated bets you can defend.",
        cells: ["Blue-Chip Dividend", "Blue-Chip Growth", "Alternative Investments", "BTC / ETH", "Conviction Stocks", "Higher-Risk Crypto"] },
      { name: "Peak / Speculative", note: "Optional. Many clients will never have a peak level.",
        cells: ["Covered Calls / CSPs", "Defined-Risk Spreads", "Long Calls / Puts", "Speculative Small Caps", "Naked Options / Microcap"] },
    ],
    education: [
      { t: "Borrow, don't liquidate", d: "Your whole life policy is the liquid, leverage-ready capital you draw against to invest — without selling out of the market." },
      { t: "Take wins off the table", d: "As positions run, de-risk gains back down into the foundation asset instead of letting them ride." },
      { t: "Always be learning", d: "A continuous education track and live webinars keep your market sense sharp as you climb." },
      { t: "Build to your risk profile", d: "Sample pyramids by risk tolerance show what a disciplined climb looks like at every level." },
    ],
  },
  steward: {
    key: "steward",
    name: "The Steward Path",
    domain: "Real Estate",
    dot: "🔵",
    theme: "#1FC9E5",
    tagline: "Dirt, doors, and discipline.",
    gateway: "Real Estate Risk & Capacity Assessment",
    axisNote: "Passive to operator as you climb — passive to active within each level.",
    axisLeft: "Passive", axisRight: "Operator",
    levels: [
      { name: "Protection Foundation", note: "Whole life insurance is the foundational asset for every Steward. Save with the intent to invest — protection, liquidity, and leverage-ready capital before you ever buy a door. This is the floor the whole real estate pyramid stands on.",
        cells: ["Whole Life Insurance", "Emergency Reserve", "Liquidity / Money Market", "Opportunity Fund"] },
      { name: "Passive REIT Foundation", note: "Real estate exposure without the toolbelt.",
        cells: ["REIT ETFs", "Public REITs", "Private REITs", "RE Crowdfunding", "Interval Funds"] },
      { name: "Secured Paper & Lending", note: "Be the bank.",
        cells: ["Tax Liens", "Performing Notes", "Private Mortgage Lending", "Non-Performing Notes", "Tax Deeds & Auctions"] },
      { name: "Individual Properties (Hold)", note: "Owning the dirt and the doors.",
        cells: ["Turnkey SFR", "Self-Managed SFR", "Land", "Short-Term Rentals", "BRRRR / Value-Add", "House Hacking"] },
      { name: "Active SFR & Flips", note: "Forcing equity with sweat and systems.",
        cells: ["Light Cosmetic Flips", "Standard Flips", "Heavy Rehab", "Wholesaling", "Wholetailing", "Distressed Plays"] },
      { name: "Syndications (Passive LP)", note: "Scale through other operators.",
        cells: ["Debt-Fund Synd.", "Stabilized Multifamily", "Storage / MHP / Industrial", "Value-Add Synd.", "Opportunistic Synd."] },
      { name: "Active Commercial & Development", note: "You are the operator now.",
        cells: ["Stabilized MF (Op)", "Commercial NNN", "Value-Add Commercial", "Lot Banking", "Ground-Up Development"] },
    ],
    education: [
      { t: "Fund deals from the foundation", d: "Policy loans against your whole life asset feed down-payments and deals — then get repaid as they cash-flow." },
      { t: "Run financing in parallel", d: "A financing pyramid runs alongside the asset pyramid, so capital is ready before the deal is." },
      { t: "Master the mechanics", d: "Underwriting, property management, 1031 exchanges, cost-segregation, and tenant law protect every level." },
    ],
  },

  founder: {
    key: "founder",
    name: "The Founder Path",
    domain: "Business & Enterprise",
    dot: "🟠",
    theme: "#F97316",
    tagline: "Save to invest. Invest in yourself first. Then build the engine.",
    gateway: "Operator Capacity & Capital Assessment",
    axisNote: "Passive, durable businesses on the left → active, high-leverage operations on the right.",
    axisLeft: "Passive", axisRight: "Active / High-Leverage",
    levels: [
      { name: "Protection Foundation", note: "Whole life insurance is the financial foundation. You save with the intent to invest — emergency capital, opportunity capital, and a liquid base you can borrow against to fund the business.",
        cells: ["Whole Life Insurance", "Emergency Reserve", "Operating Liquidity", "Opportunity Fund"] },
      { name: "Invest in Yourself First ($50K Rule)", note: "Before funding any business, put ~$50K into your own growth — your ability to build is directly correlated to your personal expansion. This is the highest-return asset you own.",
        cells: ["Courses & Programs", "Masterminds", "Inner Circles", "Live Events", "Coaching / Mentors"] },
      { name: "Cash-Flow Businesses (Passive / Semi-Passive)", note: "Boring, durable, cash-flowing. The first rung of ownership.",
        cells: ["Etsy / Print-on-Demand", "Vending / ATM", "Laundromats", "Car Washes", "Self-Storage"] },
      { name: "Online & Operated Businesses", note: "More upside, more hands-on.",
        cells: ["Dropshipping", "FBA (Amazon)", "E-Commerce Brand", "Marketing Agency", "Consulting Firm"] },
      { name: "Active Operating Companies", note: "You are the operator. Teams, systems, and scale.",
        cells: ["Service Businesses", "Insurance Agency", "Franchises", "SaaS / Software", "Multi-Location Ops"] },
      { name: "Scale & Exit", note: "Take wins off the table on the way up — the goal is a big exit, not a forever grind.",
        cells: ["Acquisitions / Roll-Ups", "Private Equity Recap", "Strategic Sale", "IPO / Going Public"] },
    ],
    education: [
      { t: "Self-fund the build", d: "The foundation asset is flexible startup and operating capital you control — no gatekeepers." },
      { t: "Take wins off the table", d: "De-risk big wins into safe assets on the way up, so a bad year never resets the climb." },
      { t: "Structure for protection", d: "Operating, holding, and IP entity structures separate risk from the assets you've built." },
      { t: "Leverage relationships", d: "Strategic alliances and partnerships compound output and accelerate the climb." },
    ],
  },

  artisan: {
    key: "artisan",
    name: "The Artisan Path",
    domain: "Expertise & Career",
    dot: "🟣",
    theme: "#A855F7",
    tagline: "Your income is your #1 asset. Protect the earner, then compound the surplus.",
    gateway: "Income & Protection Assessment",
    axisNote: "Protection & guarantees on the left → growth & measured risk on the right.",
    axisLeft: "Protect", axisRight: "Grow",
    levels: [
      { name: "Protection Foundation", note: "Whole life insurance is the foundation — protection, emergency fund, and living benefits. Your income is your number one asset, so own-occupation disability is non-negotiable. Save with the intent to invest.",
        cells: ["Whole Life Insurance", "Own-Occupation Disability", "Emergency Fund", "Opportunity Fund"] },
      { name: "Invest in Yourself ($50K Rule)", note: "Skills compound faster than the market. $5K into your own growth — a degree, cert, or leadership skill — can lift income $20-30K/yr. That return beats the index. Climb the ranks first.",
        cells: ["Certifications", "Advanced Degree / MBA", "Leadership Training", "Technical Skills", "Executive Coaching"] },
      { name: "Tax-Advantaged Accumulation", note: "Max the tax-advantaged buckets your employer makes available.",
        cells: ["401(k) / TSP", "Roth IRA", "457 / 403(b)", "HSA", "Brokerage"] },
      { name: "Growth & Alternatives", note: "As income stabilizes, take measured risk — and weave in college planning per your values.",
        cells: ["Index Funds", "Target-Date / Balanced", "Passive Real Estate", "Sector Tilts", "529 / College Planning"] },
      { name: "Retirement De-Risking", note: "Take risk for income off the table. Pivot the whole life into a volatility buffer; layer in guaranteed income.",
        cells: ["Whole Life as Volatility Buffer", "Muni Bonds", "Bond Funds", "Annuities (Income)"] },
    ],
    education: [
      { t: "Protect the earner first", d: "Living benefits and own-occupation disability coverage protect the income everything else depends on." },
      { t: "Take wins off the table", d: "As retirement nears, move risk-for-income off the table and lock in what you've earned." },
      { t: "Pivot the foundation", d: "Whole life shifts from accumulation to a volatility buffer that lets your portfolio recover untouched." },
      { t: "Plan around your values", d: "College planning is woven in to the degree your values call for it — never one-size-fits-all." },
    ],
  },

  originator: {
    key: "originator",
    name: "The Originator Path",
    domain: "Creation & IP",
    dot: "🔴",
    theme: "#DC2626",
    tagline: "Wealth built through ideas others won't make — funded by a stable floor.",
    gateway: "Creator Stage & Runway Assessment",
    axisNote: "Audience & content on the left → owned IP, licensing, and big exits on the right.",
    axisLeft: "Build Audience", axisRight: "Own the IP",
    levels: [
      { name: "Protection Foundation", note: "Whole life insurance is the foundation. A stable floor funds the creative leap — emergency capital, a creative runway fund, and liquidity you can borrow against between wins.",
        cells: ["Whole Life Insurance", "Emergency Reserve", "Creative Runway Fund", "Opportunity Fund"] },
      { name: "Invest in Yourself ($50K Rule)", note: "Your ability to create is everything — and for Originators it's often about the rooms you're in. Masterminds and strategic collaborations that take your idea to market matter more here than anywhere.",
        cells: ["Masterminds", "Strategic Collaborations", "Coaching / Mentors", "Skills & Tools", "Live Events"] },
      { name: "Audience & Content", note: "Build the audience that everything else compounds on.",
        cells: ["YouTube / Social", "Newsletter / Audience", "Podcast", "Brand Deals", "Sponsorships"] },
      { name: "Productized IP", note: "Turn ideas into products that pay you after the work is done.",
        cells: ["Courses", "Coaching Programs", "Live Events / Workshops", "Memberships", "Digital Products"] },
      { name: "Licensing & Royalties", note: "Assets that pay long after creation.",
        cells: ["Licensing Deals", "Royalty Streams", "Physical Products", "Patents / Trademarks", "Equity Partnerships"] },
      { name: "Platforms & Big Exits", note: "Create the tools and platforms others lean on. Take wins off the table along the way.",
        cells: ["Owned Platforms / Tools", "Productized Company", "Strategic Sale", "IPO / Major Exit"] },
    ],
    education: [
      { t: "Fund the next leap", d: "The foundation asset bankrolls the next creative leap without betting the house on it." },
      { t: "Take wins off the table", d: "After a big win, de-risk into safe assets so the next bet is never make-or-break." },
      { t: "Collaborate to compound", d: "Strategic alliances and collaborative partnerships multiply what one creator can produce alone." },
      { t: "Own the IP", d: "IP-holding entities and licensing structures turn creative work into assets that pay long after." },
    ],
  },
};

// The philosophy — universal principles that hold on every path, regardless of
// what sits inside the triangle. Rendered in the sub-pyramid footer for all paths.
window.L180_PRINCIPLES = [
  { t: "Protection before positions", d: "Whole life is the foundation stone. You secure the floor before you ever reach for the upside." },
  { t: "Borrow, don't liquidate", d: "The foundation asset is liquid, leverage-ready capital you build against — never something you're forced to sell out of." },
  { t: "Take wins off the table", d: "Every climb de-risks gains back down into safe assets, so one bad year never resets the whole pyramid." },
  { t: "Alignment, not products", d: "The point isn't a product — it's money aligned with the life you actually want. Clarity + alignment = the life you desire." },
];

// The four Investor Designs. Names, taglines and summaries are the canonical
// copy from the Investor Design assessment — don't reword them here.
// Each Design keeps the colour of the pathway it replaces, so the pyramid's
// existing palette is unchanged.
window.L180_DNA = {
  founder: {
    key: "founder", name: "The Founder", short: "Founder", color: "#F97316", domain: "Business & Enterprise",
    tag: "Designed to build",
    blurb: "Wired to build businesses and systems — the enterprise is the vehicle.",
    meaning: "You create wealth through businesses and systems — the enterprise is your vehicle. You see opportunity where others see problems, and you trust your ability to figure it out. Your edge is vision and leverage; your trap is scattered, always-on burnout. Aligned, you build something that runs without you.",
    routesTo: "lens",
  },
  steward: {
    key: "steward", name: "The Steward", short: "Steward", color: "#1FC9E5", domain: "Real Estate",
    tag: "Designed to compound",
    blurb: "Wired to control tangible, cash-flowing assets you can see and improve.",
    meaning: "You create wealth through tangible, controllable assets that produce cash flow — real estate is home base because you can see, touch, control, and improve it. Your edge is patience and judgment; your trap is over-control and over-leverage. Aligned, you let assets quietly compound into freedom.",
    routesTo: "steward",
  },
  artisan: {
    key: "artisan", name: "The Artisan", short: "Artisan", color: "#A855F7", domain: "Expertise & Craft",
    tag: "Designed to master & guide",
    blurb: "Wired to be exceptional at a craft or as a trusted advisor — and convert that into ownership.",
    meaning: "You create wealth by being exceptional — at a craft, a profession, or your judgment and guidance — and converting that income into ownership. You don't want to run a business or manage tenants; you want to be the best at what you do, or the trusted expert others rely on, and be paid accordingly. Your edge is depth and excellence; your trap is golden handcuffs. Aligned, you turn mastery into assets that outlast the paycheck.",
    routesTo: "lens",
  },
  originator: {
    key: "originator", name: "The Originator", short: "Originator", color: "#DC2626", domain: "Creation & IP",
    tag: "Designed to create",
    blurb: "Wired to make what didn't exist — IP, products, content, art.",
    meaning: "You create wealth by making what didn't exist — IP, products, content, courses, art, tech. You don't fit neatly into business or real estate; your creation is the vehicle. Your edge is imagination; your trap is feast-or-famine. Aligned, you build creations that earn while you sleep.",
    routesTo: "lens",
  },
};

// Assessment — the canonical 12 Investor Design questions (ported verbatim from
// alignedwealth.app/assessment/life180), each option scoring one Design.
// Two LIFE180-specific questions follow: `risk` sets the horizontal starting
// point inside the pyramid, and `reality` captures where the client actually
// lives today (Path A–D logic). Keep the 12 in sync with the canonical app.
window.L180_DNA_QUESTIONS = [
  {
    id: "excites", q: "When you picture building wealth, what excites you most?",
    why: "Your instinctive draw is the strongest Design signal.",
    opts: [
      { t: "Starting or scaling a business", dna: { founder: 3 } },
      { t: "Acquiring property & assets you can control", dna: { steward: 3 } },
      { t: "Becoming the trusted expert or advisor people rely on — and being paid for it", dna: { artisan: 3 } },
      { t: "Creating something original — products, content, IP", dna: { originator: 3 } },
    ],
  },
  {
    id: "windfall", q: "A surprise $100,000 lands in your lap. Your first instinct:",
    why: "Where free capital goes reveals the engine you actually trust.",
    opts: [
      { t: "Fund a business idea or buy into one", dna: { founder: 3 } },
      { t: "Put it toward real estate / cash-flowing assets", dna: { steward: 3 } },
      { t: "Max tax-advantaged accounts + invest it well", dna: { artisan: 3 } },
      { t: "Invest in creating something (product, course, brand)", dna: { originator: 3 } },
    ],
  },
  {
    id: "cometoyou", q: "What do people most often come to you for?",
    why: "What others already rely on you for is your natural leverage.",
    opts: [
      { t: "Vision and “let's build this”", dna: { founder: 3 } },
      { t: "Practical judgment on what's a good buy", dna: { steward: 3 } },
      { t: "Deep expertise or trusted guidance", dna: { artisan: 3 } },
      { t: "Ideas and creativity — “how did you make that?”", dna: { originator: 3 } },
    ],
  },
  {
    id: "workday", q: "Your ideal workday looks like:",
    why: "The work you'd choose is the work you'll sustain for decades.",
    opts: [
      { t: "Leading a team, moving the business forward", dna: { founder: 3 } },
      { t: "Optimizing assets / hunting the next deal", dna: { steward: 3 } },
      { t: "Focused, high-skill work — doing it or guiding it", dna: { artisan: 3 } },
      { t: "Making something new, in flow", dna: { originator: 3 } },
    ],
  },
  {
    id: "drains", q: "What drains you most?",
    why: "What exhausts you rules out paths that look good on paper.",
    opts: [
      { t: "A ceiling on my upside / working for someone else", dna: { founder: 3 } },
      { t: "Owning things I can't see or control", dna: { steward: 3 } },
      { t: "Chaos and risk with no stability", dna: { artisan: 3 } },
      { t: "Repetitive work with no room to create", dna: { originator: 3 } },
    ],
  },
  {
    id: "freedom", q: "“Freedom” to you means:",
    why: "Your definition of freedom sets the target the whole plan aims at.",
    opts: [
      { t: "Building something that runs without me", dna: { founder: 3 } },
      { t: "Cash flow from assets covering my life", dna: { steward: 3 } },
      { t: "Mastery or trusted influence + income, without my life being consumed", dna: { artisan: 3 } },
      { t: "Getting paid to create on my terms", dna: { originator: 3 } },
    ],
  },
  {
    id: "tenx", q: "How would you most naturally 10× your income?",
    why: "The scaling move you'd reach for first is your Design's engine.",
    opts: [
      { t: "Scale a business / add revenue streams", dna: { founder: 3 } },
      { t: "Grow a portfolio of cash-flowing property", dna: { steward: 3 } },
      { t: "Reach the top of my profession or become the go-to advisor", dna: { artisan: 3 } },
      { t: "Build IP that sells while I sleep", dna: { originator: 3 } },
    ],
  },
  {
    id: "riskrel", q: "Your relationship with risk:",
    why: "How you hold risk decides how aggressively we build the climb.",
    opts: [
      { t: "I'll bet on myself — high risk, high reward", dna: { founder: 3 } },
      { t: "I like leverage on tangible, predictable assets", dna: { steward: 3 } },
      { t: "I want stability and predictability", dna: { artisan: 3 } },
      { t: "I'll risk years on a creation I believe in", dna: { originator: 3 } },
    ],
  },
  {
    id: "win", q: "The kind of win that lights you up:",
    why: "What feels like winning is what you'll keep chasing.",
    opts: [
      { t: "Closing a big deal / a growth milestone", dna: { founder: 3 } },
      { t: "Landing a great property / a cash-flow milestone", dna: { steward: 3 } },
      { t: "Being recognized as the best or the trusted authority", dna: { artisan: 3 } },
      { t: "A creation taking off — selling out, going viral", dna: { originator: 3 } },
    ],
  },
  {
    id: "ifnoobject", q: "If money were no object, you'd build:",
    why: "Strip away constraints and the true Design shows itself.",
    opts: [
      { t: "Companies and systems", dna: { founder: 3 } },
      { t: "A real estate / asset empire", dna: { steward: 3 } },
      { t: "Unmatched mastery or influence + a great life around it", dna: { artisan: 3 } },
      { t: "A body of work, products, or art that outlives you", dna: { originator: 3 } },
    ],
  },
  {
    id: "teamrole", q: "Your natural role on a team:",
    why: "The seat you take without being asked is the one you're wired for.",
    opts: [
      { t: "The driver / dealmaker / team-builder", dna: { founder: 3 } },
      { t: "The steady operator who manages the assets", dna: { steward: 3 } },
      { t: "The specialist or advisor everyone relies on", dna: { artisan: 3 } },
      { t: "The creative who generates the ideas and output", dna: { originator: 3 } },
    ],
  },
  {
    id: "fiveyears", q: "Five years out, where's your energy going?",
    why: "Where you're heading matters as much as where you are.",
    opts: [
      { t: "Growing an enterprise", dna: { founder: 3 } },
      { t: "Building an asset base", dna: { steward: 3 } },
      { t: "Becoming elite at my craft or guidance + converting income into assets", dna: { artisan: 3 } },
      { t: "Creating and monetizing original work", dna: { originator: 3 } },
    ],
  },
  {
    id: "risk", q: "How would you describe your relationship to risk day to day?",
    why: "Sets the horizontal starting point inside your pyramid.",
    risk: true,
    opts: [
      { t: "Protect first — I want to sleep at night", risk: 0 },
      { t: "Mostly cautious, some calculated bets", risk: 1 },
      { t: "Balanced — offense and defense", risk: 2 },
      { t: "Growth-leaning, I can stomach swings", risk: 3 },
      { t: "Aggressive — fortune favors conviction", risk: 4 },
    ],
  },
  {
    id: "reality", q: "Where do you actually live today?",
    why: "Design says who you're becoming. This says what you need now.",
    reality: true,
    opts: [
      { t: "I actively invest in real estate", reality: "steward", active: true },
      { t: "I run a business with real revenue", reality: "founder", active: true },
      { t: "I earn strong income from my profession or advisory work", reality: "artisan", active: true },
      { t: "I actively invest in the markets", reality: "growth", active: true },
      { t: "I'm building something not yet earning", reality: "originator", active: false },
      { t: "None of these — I'm just getting started", reality: "none", active: false },
    ],
  },
];

// Scoring + routing. Returns { primary, secondary, scores, risk, riskLabel,
// reality, path, route }.
window.l180ScoreDNA = function (answers) {
  const scores = { founder: 0, steward: 0, artisan: 0, originator: 0 };
  let risk = 2, reality = "none", realityActive = false;
  L180_DNA_QUESTIONS.forEach((Q) => {
    const choice = answers[Q.id];
    if (choice == null) return;
    const opt = Q.opts[choice];
    if (!opt) return;
    if (opt.dna) for (const k in opt.dna) scores[k] += opt.dna[k];
    if (Q.risk && typeof opt.risk === "number") risk = opt.risk;
    if (Q.reality) { reality = opt.reality; realityActive = !!opt.active; }
  });
  const ranked = Object.keys(scores).sort((a, b) => scores[b] - scores[a]);
  const primary = ranked[0];
  const secondary = ranked[1];
  const dna = L180_DNA[primary];

  // Path logic (A–D). Steward is the one Design whose engine is a distinct
  // asset ladder, so it opens its own sub-pyramid; Founder, Artisan and
  // Originator build on the main pyramid with Design-specific emphasis (the
  // Lens). Everyone reaches the shared Growth Layer for the portfolio piece.
  let path, route, pathNote;
  const matchesReality = reality === primary;
  if (primary === "steward") {
    path = "A"; route = "steward";
    pathNote = matchesReality
      ? "Active or aspiring Steward — entering the Real Estate sub-pyramid at your current capacity."
      : "Steward Design. We'll enter the Real Estate sub-pyramid and calibrate the entry level to where you are today.";
  } else if (realityActive && (reality === "founder" || reality === "artisan")) {
    path = "B"; route = "lens";
    pathNote = `${dna.name} with an active engine — staying on the main pyramid with ${dna.short}-specific emphasis at Tiers 2, 3, and 5.`;
  } else if (reality === "growth") {
    path = "C"; route = "lens";
    pathNote = `${dna.name} who already invests in the markets — we'll build the ${dna.short} engine on the main pyramid and calibrate your Growth Layer to the portfolio you already hold.`;
  } else {
    path = "D"; route = "lens";
    const dmap = {
      founder: "The Founder without a business yet — we serve you as an Artisan today; your foundation asset becomes future startup capital.",
      artisan: "The Artisan — a light-touch setup until income stabilizes, then we scale.",
      originator: "The Originator without output yet — we serve you as an Artisan today; your foundation asset funds the creative leap.",
    };
    pathNote = dmap[primary] || "We'll serve you where you live today and honor where you're heading.";
  }

  return {
    primary, secondary, scores, risk,
    riskLabel: L180_BRAND.riskLabels[risk],
    reality, realityActive, path, route, pathNote,
  };
};
