/* portfolio-store.jsx — Personal Engineering Platform · v4
   Adds: Engineering Principles (7), Frameworks (6), Learning Portal episodes,
   Download Center, Journey timeline. */

const STORAGE_KEY = "lb_portfolio_v4";

const DEFAULT_DATA = /*EDITMODE-BEGIN*/{
  "settings": {
    "theme": "light",
    "accent": "navy",
    "fontPair": "inter-instrument",
    "density": "comfortable",
    "heroVariant": "split",
    "productCardStyle": "grid",
    "resumeVariant": "product-eng",
    "showSections": {
      "capabilities": true,
      "process":      true,
      "principles":   true,
      "products":     true,
      "evolution":    true,
      "frameworks":   true,
      "learning":     true,
      "showcase":     true,
      "stack":        true,
      "cases":        true,
      "downloads":    true,
      "social":       true,
      "journey":      true,
      "resumeEngine": true,
      "contact":      true
    }
  },
  "config": {
    "ai": {
      "provider": "openai",
      "model": "",
      "fallbackProvider": "",
      "tokenLimit": 4000,
      "budgetTokens": 0,
      "timeoutMs": 60000,
      "note": "Keys are NEVER stored here — set OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY in your environment. tokenLimit = hard per-call output cap; budgetTokens = cumulative soft/hard budget (0 = off)."
    },
    "portfolio": { "ownerName": "Lakshman Bazarla", "tagline": "Operational Intelligence & AI-Assisted Systems Engineer" },
    "publishing": { "defaultStatus": "draft", "showOnPublic": ["published"] },
    "ingestion": { "defaultStatus": "draft", "defaultRole": "Automation Engineer" },
    "resume": { "defaultVariant": "product-eng", "pdfFile": "LAKSHMAN_OPTIMIZED_RESUME_2026.html" },
    "tone": { "styleFile": "tools/ingest/knowledge/style.json" },
    "deployment": { "canonicalUrl": "https://lakshmanbazarla.com", "ogImage": "assets/og-card.png", "syncMeta": true },
    "analytics": { "provider": "", "plausibleDomain": "" },
    "backup": { "lastSnapshotAt": "" }
  },
  "hero": {
    "name": "Lakshman Bazarla",
    "avatar": "",
    "kicker": "Open to senior automation & AI-systems roles · India",
    "subtitle": "Operational Intelligence & AI-Assisted Systems Engineer",
    "intro": "Building scalable operational systems by combining business workflow understanding, automation engineering, and AI-assisted product development.",
    "stats": [
      { "num": "7+",   "lab": "Years of operational engineering" },
      { "num": "$3M+", "lab": "Cost savings unlocked" },
      { "num": "50K+", "lab": "Records normalized" },
      { "num": "6",    "lab": "Frameworks published" }
    ]
  },
  "capabilities": {
    "title": "The signature: three disciplines, one practice.",
    "lead": "Operational intelligence isn't a job title — it's the synthesis of business understanding, automation engineering, and AI-assisted product development applied to the same problem at the same time.",
    "domains": [
      { "label": "Procurement",      "code": "PROC" },
      { "label": "Accounts Payable", "code": "AP"   },
      { "label": "Supply Chain",     "code": "SC"   },
      { "label": "Logistics",        "code": "LOG"  },
      { "label": "Human Resources",  "code": "HR"   },
      { "label": "Finance Ops",      "code": "FIN"  },
      { "label": "Operations",       "code": "OPS"  },
      { "label": "Manufacturing",    "code": "MFG"  }
    ],
    "venn": {
      "left":   { "title": "Business & Operational Intelligence", "icon": "compass", "color": "#1e3a8a", "tags": ["Workflow understanding", "Operational analytics", "Governance thinking", "Problem decomposition", "Workflow optimization", "Business-to-system translation"] },
      "right":  { "title": "Automation Engineering",              "icon": "bolt",    "color": "#2563eb", "tags": ["Python engineering", "VBA & Excel automation", "Power BI", "Workflow orchestration", "Data transformation", "Reporting pipelines", "Operational tooling"] },
      "bottom": { "title": "AI-Assisted Product Development",     "icon": "spark",   "color": "#0c4a6e", "tags": ["AI-assisted engineering", "Prompt engineering", "AI-guided prototyping", "Windows applications", "Android applications", "Product system evolution", "Scalable app workflows"] },
      "center": { "title": "AI-Assisted Operational Systems",     "sub": "The synthesis point" }
    }
  },
  "process": {
    "title": "How I build systems.",
    "lead": "A single repeatable pipeline that converts conceptual identity into practical engineering work — from a workflow conversation to a system in production.",
    "steps": [
      { "icon": "compass",   "title": "Business Problem",        "body": "Listen for the operational pain — frequency, cost, who pays for it, what 'good' looks like." },
      { "icon": "chart",     "title": "Workflow Analysis",       "body": "Decompose the existing process. Map inputs, decisions, handoffs, exceptions. Locate the leverage points." },
      { "icon": "blueprint", "title": "Automation Architecture", "body": "Design modular pipelines with separation of concerns, audit logging, and governance baked in from day one." },
      { "icon": "spark",     "title": "AI-Assisted Engineering", "body": "Use Claude / ChatGPT / Gemini as design partners for failure-mode analysis and rapid prototyping — engineer stays in the loop." },
      { "icon": "layers",    "title": "Operational System",      "body": "Ship to real operators with dashboards, exception queues, and human-validation gates. Real workflow, not a demo." },
      { "icon": "bolt",      "title": "Scalable Execution",      "body": "Tune for 10× scale: caching, batch, retry semantics, observability. The system stays operable as it grows." }
    ]
  },
  "principles": {
    "title": "Engineering principles.",
    "lead": "Seven tenets I bring to every system. They're not preferences — they're the difference between a script that works once and a system that survives operations.",
    "items": [
      { "icon": "blueprint", "title": "Deterministic by Design",       "body": "Same inputs, same outputs. Surprises live in tests, not in production." },
      { "icon": "stack",     "title": "Config-Driven",                  "body": "Business rules live in versioned config, not buried in code. Non-engineers tune behaviour safely." },
      { "icon": "check",     "title": "Human-Governed",                 "body": "Automation never bypasses domain expertise. Confidence scores and escalation paths are built in, not bolted on." },
      { "icon": "shield",    "title": "Auditable by Default",           "body": "Every transformation logs its input, output, and rule. Rollbacks are a feature, not a recovery scramble." },
      { "icon": "spark",     "title": "AI-Assisted by Choice",          "body": "AI for design validation and failure-mode exploration. Engineer stays in the loop — never the prompt." },
      { "icon": "layers",    "title": "Scalable Through Structure",     "body": "Modularity, separation of concerns, governance. 50 records or 50K — same shape, same operability." },
      { "icon": "compass",   "title": "Transparent Systems Thinking",   "body": "Diagrams before code. If a domain expert can't follow it, the system isn't ready." }
    ]
  },
  "projects": [
    {
      "id": "ap-invoice",
      "name": "AP Invoice Automation",
      "category": "Accounts Payable · Automation",
      "status": "Production",
      "tagline": "OCR-driven invoice extraction with 3-way match, validation rules, and exception routing.",
      "description": "End-to-end Accounts Payable automation: invoices arrive via email or scan, an OCR + parser layer extracts structured fields, business rules run a 3-way match against PO and goods receipts, exceptions get routed back to AP analysts with context.",
      "bullets": ["OCR + template extraction pipeline", "3-way match engine with tolerance rules", "Exception routing with classified reasons", "Audit-logged transformations with rollback", "Pluggable validators — currency, tax, GL coding"],
      "stack": ["Python", "OCR", "Pandas", "VBA", "SQL Server", "Outlook COM"],
      "metrics": [{ "num": "70%", "lab": "Touchless processing" }, { "num": "4×", "lab": "Throughput" }, { "num": "95%", "lab": "Match accuracy" }],
      "tags": ["Python", "VBA", "Automation Architecture", "Validation", "Operational Intelligence"],
      "links": {}, "thumb": "", "featured": true,
      "caseStudy": {
        "problem": "AP team buried in manual invoice keying and 3-way matching, with high error rates and 14-day average processing time per invoice.",
        "workflow": "Invoice in → OCR extract → field validation → 3-way match → exception routing → posting → audit log → reconciliation.",
        "architecture": "Modular pipeline: extractor (OCR), normalizer (vendor + tax rules), matcher (PO/GRN lookup), router (exception classifier), poster (ERP-bound).",
        "implementation": "Python + OCR + Pandas for the core; VBA + Outlook COM for inbox capture; SQL Server for matcher lookups; structured JSON audit logs at every stage transition.",
        "impact": [{ "num": "70%", "lab": "Invoices auto-cleared" }, { "num": "11d→2d", "lab": "Avg processing time" }, { "num": "95%+", "lab": "Match accuracy" }],
        "lessons": ["OCR confidence scores are non-negotiable.", "Vendor masters are dirty by default; normalize at extraction.", "Exception classifiers earn their keep — generic 'review' queues drown analysts."]
      }
    },
    {
      "id": "parcel-intel",
      "name": "Parcel Intelligence Platform",
      "category": "Logistics · Production",
      "status": "Live",
      "tagline": "Multi-source cost intelligence — anomaly detection, vendor concentration, auto-narrative.",
      "description": "Python pipeline that unifies shipments, invoices, services, and carriers into a single executive-grade cost-intelligence layer.",
      "bullets": ["Shipment ↔ invoice bridge with variance flags", "Vendor concentration analytics", "Dynamic English narrative generation", "Excel-safe export framework", "Risk-flagging engine with severity tiers"],
      "stack": ["Python", "Pandas", "SQL", "Excel"],
      "metrics": [{ "num": "50+", "lab": "Stakeholders" }, { "num": "40%", "lab": "Inquiry drop" }, { "num": "100K+", "lab": "Records / run" }],
      "tags": ["Python", "Operational Intelligence", "Analytics", "Logistics"],
      "links": {}, "thumb": "", "featured": true,
      "caseStudy": {
        "problem": "Procurement leadership getting parcel cost reports as raw tables — too much data, no story, no risk surfacing.",
        "workflow": "Ingest carriers → bridge invoices → enrich geo → flag anomalies → generate narrative → export board pack.",
        "architecture": "Modular ETL with shipment-invoice relationship inference, anomaly detection on variance percentiles, narrative engine pattern-matches data to English sentences.",
        "implementation": "Python + Pandas core; SQL backing store; Excel-safe export framework (formula-aware, named ranges); narrative templates configurable by audience tier.",
        "impact": [{ "num": "40%+", "lab": "Inquiry reduction" }, { "num": "50+", "lab": "Exec stakeholders" }, { "num": "100K+", "lab": "Records per cycle" }],
        "lessons": ["Executives read narrative before tables.", "Variance ≠ anomaly; tier by % AND $ impact.", "Excel exports break if you forget the formula-bar; native formulas trump pasted values."]
      }
    },
    {
      "id": "tsp-logistics", "name": "TSP Logistics Automation", "category": "Workflow · Automation", "status": "Live",
      "tagline": "Outlook → Python ETL with fuzzy duplicate detection and business-rule tagging.",
      "description": "Modular automation merging Outlook email extraction, attachment processing, and a Python ETL with fuzzy-match duplicate detection and rule-based tagging.",
      "bullets": ["VBA email/attachment auto-extraction", "Fuzzy-match duplicate detection", "Business-rule tagging and multi-level grouping", "TSP Master + Email Master outputs", "8+ hours/week saved"],
      "stack": ["VBA", "Python", "Outlook COM", "Pandas"],
      "metrics": [{ "num": "8h", "lab": "Weekly saved" }, { "num": "95%", "lab": "Error drop" }, { "num": "Modular", "lab": "Pipeline" }],
      "tags": ["VBA", "Python", "Workflow Systems", "Automation Architecture"],
      "links": {}, "thumb": "", "featured": true
    },
    {
      "id": "maatru-sankalpam", "name": "Maatru Sankalpam", "category": "Social Impact · AI-Assisted App", "status": "MVP",
      "tagline": "Community-focused mobile platform — AI-assisted design for maternal & family wellness.",
      "description": "Personal initiative — a mobile app combining maternal/family wellness content with structured guidance, built using AI-assisted architecture and design.",
      "bullets": ["Mobile-first, offline-friendly content delivery", "AI-assisted UX and component architecture", "Modular content engine", "Privacy-first local storage", "Designed for non-technical contributors to author content"],
      "stack": ["Flutter", "Riverpod", "SQLite", "Firebase", "AI-Assisted"],
      "metrics": [{ "num": "MVP", "lab": "Phase" }, { "num": "Offline", "lab": "Capable" }, { "num": "Solo", "lab": "Built" }],
      "tags": ["Flutter", "AI-Assisted Engineering", "Social Impact"],
      "links": {}, "thumb": "", "featured": true
    },
    {
      "id": "finwise", "name": "FinWise", "category": "Fintech · AI-Assisted Architecture", "status": "In Build",
      "tagline": "Personal financial intelligence — offline-first, OCR-aware, risk-radar driven.",
      "description": "Mobile-first platform helping individuals and business owners understand loan products, optimise credit, and act on data-driven financial decisions.",
      "bullets": ["Loan Intelligence Engine", "Financial Risk Radar with rule-based scoring", "OCR document understanding", "Offline-first SQLite + Firebase sync", "Modular Riverpod state architecture"],
      "stack": ["Flutter", "Riverpod", "SQLite", "Firebase", "OCR"],
      "metrics": [{ "num": "6", "lab": "Modules" }, { "num": "MVP", "lab": "Phase" }, { "num": "100%", "lab": "Offline-ready" }],
      "tags": ["Flutter", "AI-Assisted Engineering", "Fintech", "Offline-First"],
      "links": {}, "thumb": "", "featured": true,
      "caseStudy": {
        "problem": "Personal-finance products give answers but not understanding. Users can't model 'should I close loan A or refinance loan B?' without expertise.",
        "workflow": "Onboarding → document capture (OCR) → loan-by-loan modelling → risk radar → action recommendations → tracked outcomes.",
        "architecture": "Offline-first Flutter app, Riverpod for reactive state, SQLite + Firebase sync, per-domain feature modules.",
        "implementation": "Architecture validated with Claude as design partner; OCR via on-device model; financial logic in pure Dart functions for testability; rule-engine for risk scoring.",
        "impact": [{ "num": "6", "lab": "Domain modules" }, { "num": "Offline-first", "lab": "Architecture" }, { "num": "AI-assisted", "lab": "Design loop" }],
        "lessons": ["Financial UX is calculator-first, content-second.", "Offline-first changes everything — every sync conflict needs a deterministic rule.", "AI design partners caught failure modes I'd have shipped."]
      }
    },
    {
      "id": "carrier-rate", "name": "Carrier Rate Intelligence Engine", "category": "Pricing · Analytics", "status": "Live",
      "tagline": "FedEx & DHL rate-card extraction — unstructured PDFs → structured pricing intelligence.",
      "description": "Converts carrier rate-card PDFs into queryable pricing datasets with zone mapping and service-level breakdowns.",
      "bullets": ["Multi-carrier PDF parsing", "Zone + service mapping", "$2M+ negotiated savings enabled", "500K+ rate combinations analysable"],
      "stack": ["Python", "PDF parsing", "Pandas"],
      "metrics": [{ "num": "$2M+", "lab": "Negotiated" }, { "num": "500K+", "lab": "Combinations" }, { "num": "2", "lab": "Carriers" }],
      "tags": ["Python", "Analytics", "Logistics"],
      "links": {}, "thumb": "", "featured": false
    },
    {
      "id": "supplier-norm", "name": "Global Supplier Normalization Engine", "category": "Data Quality · Entity Resolution", "status": "Live",
      "tagline": "50K+ supplier records standardised across languages and translation variants.",
      "description": "Rule-based entity resolution platform standardising global supplier records across translation variants and inconsistent formats.",
      "bullets": ["Multi-language cleaning (EN, PT, ES, DE)", "String-based bucketing", "Audit logging with rollback", "Cross-company consolidation enabled"],
      "stack": ["Python", "Pandas", "Regex", "Rule engine"],
      "metrics": [{ "num": "50K+", "lab": "Records" }, { "num": "95%", "lab": "Accuracy gain" }, { "num": "4", "lab": "Languages" }],
      "tags": ["Python", "Entity Resolution", "Operational Intelligence"],
      "links": {}, "thumb": "", "featured": false
    }
  ],
  "frameworks": {
    "title": "Engineering frameworks.",
    "lead": "Reusable shapes I apply across automation, analytics, and AI-assisted product work. Each framework is connected to real production implementations.",
    "items": [
      { "id": "sae",  "name": "Structured Automation Engineering",   "icon": "blueprint", "summary": "A repeatable nine-section shape for every VBA + Python automation: Config → Imports → Business Rules → Main Engine → Validation → Debug/Trace → Output → Audit → Execution Summary.", "pillars": ["9 sections", "Audit at every transition", "Modular per-domain"], "linkedTo": "AP Invoice Automation · TSP Logistics", "tags": ["VBA", "Python", "Automation Architecture"], "poster": "assets/sae-framework-poster.png", "posterCaption": "Full framework poster — 9 standard sections, end-to-end process flow, system architecture, AI-assisted development workflow, logging strategy, and best practices." },
      { "id": "cda",  "name": "Config-Driven Architecture",          "icon": "stack",     "summary": "Move business rules out of code into versioned config. Non-engineers tune behaviour safely; engineers ship without re-deploys.",                  "pillars": ["Rule files in Git", "Schema-validated", "Hot-reloadable"],     "linkedTo": "Parcel Intelligence Platform · Supplier Normalization",     "tags": ["Config Driven", "Python", "Operational Intelligence"] },
      { "id": "vls",  "name": "Validation & Logging Systems",        "icon": "shield",    "summary": "A single validator-and-log primitive used across pipelines. Failures explain themselves before they reach an operator.",                            "pillars": ["Structured logs", "Confidence scoring", "Replay-able errors"],"linkedTo": "AP Invoice Automation · TSP Logistics",                    "tags": ["Validation", "Logging", "Auditability"] },
      { "id": "ag",   "name": "Auditability & Governance",           "icon": "check",     "summary": "JSON audit trails, rollbacks, and approval gates baked into the data layer — explainability as a product feature.",                                "pillars": ["Rollback-by-default", "Diffable history", "Approval gates"],   "linkedTo": "Supplier Normalization · Carrier Rate",                     "tags": ["Auditability", "Governance"] },
      { "id": "aiw",  "name": "AI-Assisted Development Workflow",    "icon": "spark",     "summary": "Using Claude / ChatGPT / Gemini as design partners for architecture validation and failure-mode analysis — not as code printers.",              "pillars": ["Design partner ≠ code printer", "Prompt patterns", "Failure-mode review"],"linkedTo": "FinWise · Maatru Sankalpam",                  "tags": ["AI-Assisted Engineering", "Architecture"] },
      { "id": "ois",  "name": "Operational Intelligence Systems",    "icon": "compass",   "summary": "Multi-source data → narrative insights → action loop. Anomaly detection, human-in-the-loop overrides, and exec-grade storytelling.",          "pillars": ["Source ingest", "Anomaly tiering", "Auto-narrative"],          "linkedTo": "Parcel Intelligence Platform · AP Invoice",                "tags": ["Operational Intelligence", "Analytics", "Python"] }
    ]
  },
  "learning": {
    "title": "Learning portal.",
    "lead": "Episode-style walkthroughs of how I designed and shipped real systems — every framework backed by a working example.",
    "episodes": [
      { "id": "ep-01", "number": "01", "title": "How I Designed the AP Invoice Matcher",         "framework": "Structured Automation Engineering",  "duration": "12 min read", "summary": "From a 14-day manual matching cycle to 70% touchless invoices. The nine sections, the failure modes, and the operator handoffs — walking through the SAE framework end-to-end.",                                  "tags": ["VBA", "Python", "Automation Architecture", "Validation"],                       "thumb": "assets/sae-framework-poster.png" },
      { "id": "ep-02", "number": "02", "title": "Config-Driven Excel Automation in VBA",         "framework": "Config-Driven Architecture",         "duration": "9 min read",  "summary": "How to externalise business rules so finance teams can edit a JSON file instead of opening the VBA editor. Includes schema-validation pattern.",                  "tags": ["VBA", "Config Driven", "Excel"],                                                "thumb": "" },
      { "id": "ep-03", "number": "03", "title": "AI-Assisted Architecture Validation with Claude","framework": "AI-Assisted Development Workflow",   "duration": "11 min read", "summary": "The prompt patterns I use when I want a design partner, not a code printer — including the FinWise failure-mode review that saved a refactor.",                  "tags": ["AI-Assisted Engineering", "Architecture", "Prompts"],                           "thumb": "" },
      { "id": "ep-04", "number": "04", "title": "Auditable ETL: Logging Every Transformation",    "framework": "Validation & Logging Systems",       "duration": "10 min read", "summary": "The structured-log schema I reuse across all pipelines, with the replay tool that turns a failed run into a debuggable timeline.",                              "tags": ["Logging", "Auditability", "Python"],                                            "thumb": "" }
    ]
  },
  "showcase": [
    { "id": "win-ap",     "type": "windows",   "title": "AP Automation Console", "category": "Windows Desktop", "description": "Operator control panel for the AP Invoice Automation pipeline — queue health, exception handling, audit log.", "image": "", "lines": [{ "k": "Status", "v": "Pipeline · OPERATIONAL", "tone": "ok" }, { "k": "Inbox queue", "v": "12 invoices · 3 pending OCR" }, { "k": "Match success", "v": "94.2%", "tone": "ok" }, { "k": "Exceptions", "v": "4 routed to AP-EU desk", "tone": "warn" }, { "k": "Last cycle", "v": "12:42 · 142 invoices processed" }, { "k": "Next reconcile", "v": "13:00 · in 8 minutes" }] },
    { "id": "phone-mat",  "type": "phone",     "title": "Maatru Sankalpam",      "category": "Android · AI-Assisted", "description": "Wellness companion screen — gentle weekly cadence, structured guidance, offline-first storage.", "image": "", "head": "This week", "rows": [{ "lab": "Nutrition log", "val": "5 / 7 days", "tone": "pos" }, { "lab": "Wellness check", "val": "On track", "tone": "pos" }, { "lab": "Reminders", "val": "2 pending", "tone": "neg" }, { "lab": "Guidance", "val": "3 new", "tone": "pos" }], "cta": "Open today's plan" },
    { "id": "dash-parcel","type": "dashboard", "title": "Parcel Intelligence",   "category": "Executive Dashboard", "description": "Board-grade view of carrier costs, anomaly counts, and concentration risk — auto-generated narrative inline.", "image": "", "kpis": [{ "v": "$1.42M", "l": "Spend / month" }, { "v": "94", "l": "Anomalies flagged", "tone": "signal" }, { "v": "3", "l": "Carriers in scope" }], "chartTitle": "Cost variance · last 12 weeks", "bars": [40, 55, 48, 62, 51, 68, 58, 72, 64, 85, 70, 92] },
    { "id": "flow-tsp",   "type": "workflow",  "title": "TSP Pipeline Architecture", "category": "Workflow Diagram", "description": "Modular automation: Outlook capture → attachment processing → Python ETL → validated dual-output.", "image": "", "nodes": [{ "label": "Outlook", "sub": "VBA capture" }, { "label": "Attach", "sub": "Queue + retry" }, { "label": "ETL", "sub": "Python · Pandas" }, { "label": "Validate", "sub": "Rule engine" }, { "label": "Master", "sub": "TSP + Email" }] }
  ],
  "techStack": [
    { "category": "Automation",              "icon": "bolt",     "items": ["VBA", "Outlook COM", "Excel Automation", "Power Query", "Python Scripting", "Cron / Scheduled Tasks"] },
    { "category": "AI Tools",                "icon": "spark",    "items": ["Claude", "ChatGPT", "Gemini", "Prompt-driven design", "AI-augmented code review"] },
    { "category": "Data Engineering",        "icon": "database", "items": ["ETL Pipelines", "Entity Resolution", "Normalization", "Validation Frameworks", "Audit Logging"] },
    { "category": "Analytics",               "icon": "chart",    "items": ["Power BI", "Pandas", "NumPy", "Spend Analytics", "Geo-Analytics", "PDF Extraction"] },
    { "category": "Application Development", "icon": "layers",   "items": ["Flutter", "Riverpod", "Windows Desktop", "Android UI", "OCR Integration"] },
    { "category": "Database",                "icon": "stack",    "items": ["PostgreSQL", "MySQL", "MS SQL Server", "SQLite", "MS Access"] },
    { "category": "Workflow Tools",          "icon": "blueprint","items": ["Outlook Integration", "Excel Pipelines", "Governance Frameworks", "Documentation SOPs"] }
  ],
  "downloads": {
    "title": "Download center.",
    "lead": "Templates, framework PDFs, and reference materials lifted directly from real production work. Free to use — credit if you ship.",
    "items": [
      { "id": "dl-01", "name": "Structured Automation Engineering · Framework Poster", "type": "PNG",       "size": "1.4 MB",  "description": "The full SAE framework on one page — nine code sections, end-to-end process flow, system architecture, AI-assisted dev workflow, and logging strategy.", "tags": ["Automation Architecture", "Poster"],   "file": "assets/sae-framework-poster-branded.png" },
      { "id": "dl-02", "name": "ETL Validation Checklist",                      "type": "PDF",       "size": "640 KB",  "description": "Pre-flight validation checks I run before any pipeline goes near production data.",     "tags": ["Validation", "Operational Intelligence"],"file": "#" },
      { "id": "dl-03", "name": "AI-Assisted Architecture Prompts",              "type": "Markdown",  "size": "32 KB",   "description": "The prompt patterns I use with Claude for architecture validation and failure-mode review.","tags": ["AI-Assisted Engineering", "Prompts"],  "file": "#" },
      { "id": "dl-04", "name": "Audit Log · JSON Schema Sample",                "type": "Code",      "size": "8 KB",    "description": "A reusable JSON schema for transformation audit trails, with one full sample record.", "tags": ["Auditability", "Logging"],               "file": "#" },
      { "id": "dl-05", "name": "Config-Driven Rule Engine · Python Skeleton",   "type": "Code",      "size": "16 KB",   "description": "A minimal Python rule-engine that loads validated YAML configs and runs ordered rules.", "tags": ["Python", "Config Driven"],            "file": "#" }
    ]
  },
  "journey": {
    "title": "Journey.",
    "lead": "How I evolved from operational reporting into AI-assisted systems engineering — eight years across HR, procurement, logistics, fintech, and personal product work.",
    "milestones": [
      { "year": "2018", "title": "HRIS · MIS Reporting Analyst",          "where": "Orion India Systems",                  "summary": "Enterprise HR analytics on SAP HANA, Crystal Reports, SAP BI. First taste of report standardisation and the cost of un-automated workflows." },
      { "year": "2019", "title": "Analyst · Data Migration & Automation", "where": "Orion India Systems (Deloitte project)","summary": "Zero-loss enterprise migration. First VBA + Outlook automation. SOPs as a deliverable, not an afterthought." },
      { "year": "2020", "title": "Procurement Analyst · Reporting & Automation", "where": "Deloitte Support Services",      "summary": "Built Excel + Power Query pipelines at 100K–400K record scale. Migrated MS Access to SQL Server. First $1M+ client-savings contributions." },
      { "year": "2023", "title": "Started AI-Assisted Engineering",       "where": "Personal practice",                    "summary": "Discovered AI tools as design partners. Started using Claude / ChatGPT for architecture review, not code generation — changed how I designed systems." },
      { "year": "2025", "title": "Automation & Data Pipeline Engineer",   "where": "Carrier Technologies India",           "summary": "Logistics intelligence, supplier normalization, carrier rate extraction. Architected at 50K–500K record scale with audit + governance from day one." },
      { "year": "2026", "title": "Personal Engineering Platform",         "where": "FinWise · Maatru Sankalpam · Frameworks","summary": "Publishing frameworks and shipping AI-assisted operational systems as a personal platform. Operational Intelligence meets Practical Product Engineering." }
    ]
  },
  "resume": {
    "title": "Lakshman Bazarla · Resume 2026",
    "subline": "Two-page, ATS-friendly resume covering the full 7-year arc — operational engineering, automation systems, fintech architecture, AI-assisted product work.",
    "version": "v2026.05", "updated": "May 2026", "file": "LAKSHMAN_OPTIMIZED_RESUME_2026.html", "pages": "2"
  },
  "contact": {
    "headline": "Let's talk about your operations problem.",
    "subline": "Open to senior automation / analytics engineering roles, fintech & operational product architecture, and short-form consulting engagements.",
    "channels": [
      { "type": "email",    "label": "Email",    "value": "bazaralalakshman@yahoo.com", "href": "mailto:bazaralalakshman@yahoo.com" },
      { "type": "phone",    "label": "Phone",    "value": "+91 86862 06428",            "href": "tel:+918686206428" },
      { "type": "linkedin", "label": "LinkedIn", "value": "bazarla-lakshman",           "href": "https://linkedin.com/in/bazarla-lakshman-714a1659" },
      { "type": "github",   "label": "GitHub",   "value": "BazarlaLakshman",            "href": "https://github.com/BazarlaLakshman" },
      { "type": "location", "label": "Based in", "value": "Hyderabad, India",           "href": "" }
    ]
  },

  "products": {
    "title": "Product ecosystem.",
    "lead": "Seven evolving operational engineering platforms — built end-to-end, designed as systems, governed from day one. Not side projects: these are the architectural surface where business problems meet AI-assisted execution.",
    "statuses": {
      "active-development":    { "label": "Active Development",    "tone": "blue",   "dot": "#2563eb" },
      "internal-prototype":    { "label": "Internal Prototype",    "tone": "violet", "dot": "#7c3aed" },
      "research-architecture": { "label": "Research & Architecture","tone": "gray",  "dot": "#6b7280" },
      "operational-pilot":     { "label": "Operational Pilot",     "tone": "amber",  "dot": "#b45309" },
      "framework-phase":       { "label": "Framework Phase",       "tone": "teal",   "dot": "#0d9488" },
      "production-ready":      { "label": "Production Ready",      "tone": "green",  "dot": "#15803d" }
    },
    "items": [
      {
        "id": "finwise",
        "name": "FinWise",
        "kicker": "Financial intelligence platform",
        "tagline": "Offline-first personal & business financial intelligence — loans, risk radar, OCR-aware decisioning.",
        "status": "active-development",
        "domain": "Fintech · Mobile",
        "logo": "FW",
        "color": "#2563eb",
        "screenshotSlot": "fw-screen",
        "hero": "Mobile-first platform helping individuals and business owners understand loan products, optimise credit, and act on data-driven financial decisions. Architecture validated with Claude as a design partner; financial logic in pure Dart functions for testability.",
        "businessProblem": "Personal-finance tools answer 'how much' but never 'why'. Users can't model 'should I close loan A or refinance loan B?' without an advisor. Underserved markets need clarity before they need calculators.",
        "operationalWorkflow": "Onboarding → document capture (OCR) → loan-by-loan modelling → risk radar scoring → action recommendations → outcome tracking.",
        "engineeringGoals": ["Offline-first SQLite + Firebase sync", "Rule-engine for risk scoring", "Per-domain modular Riverpod state", "OCR document understanding on-device", "Auditable financial logic in pure Dart"],
        "stack": ["Flutter", "Riverpod", "SQLite", "Firebase", "OCR", "AI-Assisted Design"],
        "metrics": [{ "num": "6", "lab": "Domain modules" }, { "num": "100%", "lab": "Offline-ready" }, { "num": "Solo", "lab": "Architected" }],
        "roadmap": [
          { "phase": "Now",     "item": "Loan intelligence engine + risk radar MVP" },
          { "phase": "Next",    "item": "OCR document understanding + offline sync rules" },
          { "phase": "Later",   "item": "Multi-user advisor workflow + audit reports" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": true,
        "frameworks": ["Config-Driven Architecture", "AI-Assisted Development Workflow", "Auditability & Governance"]
      },
      {
        "id": "maatru-sankalpam",
        "name": "Maatru Sankalpam",
        "kicker": "Family & maternal wellness platform",
        "tagline": "Community-focused mobile platform — AI-assisted design for structured maternal & family wellness guidance.",
        "status": "internal-prototype",
        "domain": "Social Impact · Mobile",
        "logo": "MS",
        "color": "#7c3aed",
        "screenshotSlot": "ms-screen",
        "hero": "Personal initiative combining maternal/family wellness content with structured weekly guidance. Designed mobile-first and offline-friendly so non-technical contributors can author content without touching code.",
        "businessProblem": "Family wellness content is fragmented across blogs and apps — none built for the cultural context Indian households actually navigate. Caregivers need structure, not feeds.",
        "operationalWorkflow": "Content authoring (non-technical) → modular delivery → weekly cadence → reminders → offline-first storage → progress tracking.",
        "engineeringGoals": ["Mobile-first, offline-friendly", "AI-assisted UX + component architecture", "Modular content engine", "Privacy-first local storage", "Non-technical content authoring"],
        "stack": ["Flutter", "Riverpod", "SQLite", "Firebase", "AI-Assisted Design"],
        "metrics": [{ "num": "MVP", "lab": "Phase" }, { "num": "Offline", "lab": "Capable" }, { "num": "Solo", "lab": "Built" }],
        "roadmap": [
          { "phase": "Now",     "item": "Wellness module + weekly cadence MVP" },
          { "phase": "Next",    "item": "Content authoring CMS for contributors" },
          { "phase": "Later",   "item": "Pilot with maternal-care network in Telangana" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": true,
        "frameworks": ["AI-Assisted Development Workflow", "Config-Driven Architecture"]
      },
      {
        "id": "fbos-mobile",
        "name": "FBOS · Mobile",
        "kicker": "Field Business Operating System",
        "tagline": "AI-assisted operational business management — workflow visibility, governance, execution tracking on mobile.",
        "status": "operational-pilot",
        "domain": "Operational Intelligence · Mobile",
        "logo": "FB",
        "color": "#0d9488",
        "screenshotSlot": "fbm-screen",
        "hero": "FBOS is the operational business OS — a mobile-first surface where field teams, supervisors, and operations leads share workflow visibility, governance signals, and execution tracking. The mobile app is the day-to-day interface.",
        "businessProblem": "Business operations are run on WhatsApp threads and Excel sheets. Field execution, approvals, and exception handling have no shared surface — only retroactive spreadsheets.",
        "operationalWorkflow": "Field capture → workflow routing → approval gates → exception escalation → audit log → leadership dashboard sync.",
        "engineeringGoals": ["Real-time field-to-leadership sync", "Workflow rules in versioned config", "Audit trail on every action", "Offline-tolerant operation", "Pluggable industry modules"],
        "stack": ["Flutter", "Firebase", "Python", "Rule Engine", "Cloud Functions"],
        "metrics": [{ "num": "Pilot", "lab": "Stage" }, { "num": "3", "lab": "Industry verticals scoped" }, { "num": "Real-time", "lab": "Sync target" }],
        "roadmap": [
          { "phase": "Now",     "item": "Operational pilot with 2 small businesses" },
          { "phase": "Next",    "item": "Industry-module template (logistics + retail)" },
          { "phase": "Later",   "item": "Multi-tenant deployment + role-based governance" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": true,
        "frameworks": ["Operational Intelligence Systems", "Auditability & Governance", "Config-Driven Architecture"]
      },
      {
        "id": "fbos-web",
        "name": "FBOS · Web",
        "kicker": "Operations command surface",
        "tagline": "Browser-based command surface for FBOS — dashboards, governance views, multi-team workflow orchestration.",
        "status": "active-development",
        "domain": "Operational Intelligence · Web",
        "logo": "FW",
        "color": "#2563eb",
        "screenshotSlot": "fbw-screen",
        "hero": "The web counterpart to FBOS Mobile — built for leadership and operations teams who need the wide view: cross-team dashboards, governance configuration, and workflow orchestration across all field modules.",
        "businessProblem": "Mobile is for field execution. Leadership needs the lens — multi-team status, exception trends, governance configuration, and the ability to tune workflow rules without a developer.",
        "operationalWorkflow": "Dashboard ingest → exception triage → rule tuning → approval routing → governance reporting → integration sync.",
        "engineeringGoals": ["Multi-tenant data model from day one", "Workflow visual editor (config-driven)", "Real-time exception triage", "Embeddable governance reports", "Role-based access control"],
        "stack": ["React", "TypeScript", "Firebase", "Python API", "Rule Engine"],
        "metrics": [{ "num": "Build", "lab": "Phase" }, { "num": "Multi-tenant", "lab": "Architecture" }, { "num": "Config", "lab": "Driven" }],
        "roadmap": [
          { "phase": "Now",     "item": "Dashboard scaffolding + auth + first workflow" },
          { "phase": "Next",    "item": "Visual workflow editor + governance dashboard" },
          { "phase": "Later",   "item": "Marketplace of industry workflow templates" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": true,
        "frameworks": ["Operational Intelligence Systems", "Config-Driven Architecture", "Auditability & Governance"]
      },
      {
        "id": "ai-architect",
        "name": "AI Architect",
        "kicker": "AI-assisted engineering framework",
        "tagline": "Framework platform for AI-assisted operational workflows, scalable system architecture, and governed dev practices.",
        "status": "framework-phase",
        "domain": "Engineering Framework",
        "logo": "AI",
        "color": "#b45309",
        "screenshotSlot": "ai-screen",
        "hero": "AI Architect is the framework substrate behind every other product — the patterns, templates, and prompt libraries I use to ensure AI-assisted engineering stays governed, deterministic, and explainable. It's the methodology layer.",
        "businessProblem": "AI tools have made code easy and architecture sloppy. Teams ship plausible-looking systems that nobody can reason about. The discipline AI removed needs to come back as framework.",
        "operationalWorkflow": "Pattern capture → prompt template → architecture validation → failure-mode review → governance checklist → production handoff.",
        "engineeringGoals": ["Codified prompt patterns for architecture review", "Failure-mode checklist library", "AI-as-design-partner protocol", "Governance gates that survive the prompt era", "Reusable scaffolding for every project"],
        "stack": ["Markdown", "Python", "Claude", "ChatGPT", "Notion-style content engine"],
        "metrics": [{ "num": "12+", "lab": "Patterns captured" }, { "num": "6", "lab": "Projects validated" }, { "num": "Living", "lab": "Document" }],
        "roadmap": [
          { "phase": "Now",     "item": "Pattern library + prompt templates published" },
          { "phase": "Next",    "item": "Interactive failure-mode workbook" },
          { "phase": "Later",   "item": "Team workshops + cohort-based delivery" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": true,
        "frameworks": ["AI-Assisted Development Workflow", "Structured Automation Engineering", "Auditability & Governance"]
      },
      {
        "id": "ap-anatomy",
        "name": "AP Anatomy",
        "kicker": "Accounts Payable operational intelligence",
        "tagline": "Process visibility, validation systems, automation governance, and execution optimization for AP teams.",
        "status": "research-architecture",
        "domain": "Operational Intelligence · Finance",
        "logo": "AP",
        "color": "#6b7280",
        "screenshotSlot": "apa-screen",
        "hero": "AP Anatomy is the deep-dive companion to the AP Invoice Automation case study — a research-and-architecture platform that maps the anatomy of an AP process and the precise points where automation, validation, and governance pay off.",
        "businessProblem": "Most AP automation projects fail because nobody first mapped the workflow's anatomy. Vendors sell touchless processing into operations that have six escalation paths, four exception types, and no audit trail.",
        "operationalWorkflow": "Workflow capture → exception-type taxonomy → validation gate inventory → governance checklist → automation candidate scoring.",
        "engineeringGoals": ["Canonical AP workflow taxonomy", "Exception classifier patterns", "Validation gate library", "Governance audit template", "Automation readiness scorecard"],
        "stack": ["Research", "Python", "Markdown", "Diagrams"],
        "metrics": [{ "num": "Research", "lab": "Phase" }, { "num": "1 case", "lab": "Anchored in production work" }, { "num": "Living", "lab": "Reference" }],
        "roadmap": [
          { "phase": "Now",     "item": "Taxonomy + canonical workflow map" },
          { "phase": "Next",    "item": "Validation gate library + classifier patterns" },
          { "phase": "Later",   "item": "Companion tooling — AP readiness scorecard" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": false,
        "frameworks": ["Operational Intelligence Systems", "Validation & Logging Systems", "Structured Automation Engineering"]
      },
      {
        "id": "itg-crm",
        "name": "ITG CRM & Website",
        "kicker": "Elite travel operations system",
        "tagline": "End-to-end CRM and web presence for a travel-management business — booking workflow, vendor governance, guide ops.",
        "status": "production-ready",
        "domain": "Operational CRM · Web",
        "logo": "IT",
        "color": "#15803d",
        "screenshotSlot": "itg-screen",
        "hero": "ITG is the production deployment that anchors the whole stack — a dark-first, gold-accented CRM and marketing site that runs an elite travel-management business end-to-end. Booking workflow, vendor governance, and guide operations live in one product.",
        "businessProblem": "Boutique travel operators run on disconnected tools: WhatsApp for guides, Excel for vendors, email for clients. The hand-offs leak — bookings get lost, vendors get overpaid, and there's no shared truth.",
        "operationalWorkflow": "Inquiry capture → quote workflow → booking → guide assignment → vendor PO → trip execution → reconciliation → analytics.",
        "engineeringGoals": ["Single source of truth for bookings + vendors", "Guide-app integration via WhatsApp deep-link", "Role-based access (sales / ops / leadership)", "Audit trail on every state change", "Dark-first design system"],
        "stack": ["React", "TypeScript", "Tailwind", "Firebase", "WhatsApp API"],
        "metrics": [{ "num": "Live", "lab": "Production" }, { "num": "End-to-end", "lab": "CRM coverage" }, { "num": "1 ops team", "lab": "Running on it" }],
        "roadmap": [
          { "phase": "Shipped", "item": "Full CRM + marketing site live" },
          { "phase": "Now",     "item": "Guide operations module + vendor ledger" },
          { "phase": "Next",    "item": "Analytics dashboard + multi-region rollout" }
        ],
        "links":   { "github": "", "demo": "", "pdf": "" },
        "assets":  [],
        "featured": true,
        "frameworks": ["Operational Intelligence Systems", "Auditability & Governance", "Config-Driven Architecture"]
      }
    ]
  },

  "evolution": {
    "title": "My engineering evolution.",
    "lead": "Eight years across six phases — each one expanding the surface area of what 'engineering' meant. The thread: every phase taught the next how to think about systems.",
    "phases": [
      { "id": "ph-vba",       "label": "VBA Automation",         "years": "2018 – 2019", "summary": "Excel macros + Outlook automation. Learned that a script that runs on Monday is a system by Friday — and a maintenance problem by month two.",                       "exemplars": "Contract tracking VBA · Outlook capture · MIS reporting",            "icon": "bolt" },
      { "id": "ph-wf",        "label": "Workflow Engineering",   "years": "2020 – 2022", "summary": "Power Query + SQL migrations + structured pipelines. Moved from 'a script' to 'a workflow that other people depend on'. Began separating concerns on purpose.",       "exemplars": "Access → SQL migration · Spend pipelines · 100K–400K records",       "icon": "stack" },
      { "id": "ph-oi",        "label": "Operational Intelligence","years": "2022 – 2024","summary": "Multi-source ETL, anomaly detection, narrative generation. Engineering stopped being 'reports' and started being 'a system that tells leaders what to do.'",        "exemplars": "Parcel Intelligence · Supplier Normalization · Carrier Rate",        "icon": "compass" },
      { "id": "ph-ai",        "label": "AI-Assisted Engineering","years": "2023 – 2025", "summary": "Claude/ChatGPT/Gemini as design partners — never code-printers. Architecture validation, failure-mode review, prompt patterns as deliverables.",               "exemplars": "FinWise architecture · Maatru content engine · AI Architect",         "icon": "spark" },
      { "id": "ph-prod",      "label": "Product Platforms",      "years": "2024 – 2026", "summary": "Crossed over from 'systems inside companies' to 'products as platforms.' FinWise, Maatru, FBOS — each a product ecosystem, not a side project.",              "exemplars": "FinWise · Maatru Sankalpam · FBOS Mobile + Web",                       "icon": "layers" },
      { "id": "ph-framework", "label": "Framework Systems",      "years": "2025 → now",  "summary": "Capturing the patterns under the products: SAE, Config-Driven, AI-Assisted Workflow, AP Anatomy. Framework as deliverable, not afterthought.",                  "exemplars": "AI Architect · AP Anatomy · SAE Framework Poster",                    "icon": "blueprint" }
    ]
  },

  "resumeEngine": {
    "title": "Dynamic resume engine.",
    "lead": "One source of truth, five resumes. Each variant pulls from the same products, projects, and experience data — then re-emphasises and re-orders for the audience it's written for.",
    "selectedVariant": "product-eng",
    "shared": {
      "name": "Lakshman Bazarla",
      "headline": "AI-Assisted Operational Systems Engineer",
      "location": "Hyderabad, India",
      "contact": { "email": "bazaralalakshman@yahoo.com", "phone": "+91 86862 06428", "linkedin": "bazarla-lakshman-714a1659", "github": "BazarlaLakshman" },
      "education": "BTech · Engineering · 2018",
      "yearsExperience": "7+"
    },
    "variants": [
      {
        "id": "ats",
        "name": "ATS Resume",
        "kicker": "Plain · Keyword-dense · Recruiter-safe",
        "audience": "Recruiters · Job boards · ATS scanners",
        "layout": "ats-plain",
        "summary": "Automation & Systems Architect with 7+ years designing enterprise-scale data pipelines, modular automation platforms, and analytics systems across logistics, procurement, and fintech. Specialised in rule-based normalisation, end-to-end ETL, config-driven validation, and AI-assisted product architecture.",
        "emphasis": ["Years of experience", "Keyword density", "Reverse-chronological roles", "Hard skills tiers", "Quantified outcomes"],
        "outputs": ["LAKSHMAN_OPTIMIZED_RESUME_2026.html"],
        "color": "#3a3a42"
      },
      {
        "id": "product-eng",
        "name": "Product Engineering Resume",
        "kicker": "Visual · Product-led · Outcome-first",
        "audience": "Product companies · Engineering managers · Founders",
        "layout": "product-cards",
        "summary": "Engineer who ships product ecosystems — not feature lists. Architected FinWise, FBOS, Maatru, and AI Architect end-to-end using AI-assisted methodology. Operational intelligence × automation engineering × product surfaces.",
        "emphasis": ["Products owned", "Decisions made", "Architecture diagrams", "Cross-stack range", "Shipping cadence"],
        "outputs": ["LAKSHMAN_OPTIMIZED_RESUME_2026.html"],
        "color": "#2563eb"
      },
      {
        "id": "operational-intel",
        "name": "Operational Intelligence Resume",
        "kicker": "Workflow-led · Business-impact framed",
        "audience": "Operations leaders · COO offices · Consultancies",
        "layout": "workflow-impact",
        "summary": "Operational Intelligence Engineer — turns workflow friction into governed automation. $3M+ unlocked across logistics, procurement, and AP. The signature: business problem → workflow analysis → automation architecture → operational system.",
        "emphasis": ["Business outcomes", "Workflow domains", "$ saved / time reclaimed", "Cross-functional translation", "Governance posture"],
        "outputs": ["LAKSHMAN_OPTIMIZED_RESUME_2026.html"],
        "color": "#b45309"
      },
      {
        "id": "architecture",
        "name": "Architecture Resume",
        "kicker": "Systems-led · Diagram-heavy · Pattern-aware",
        "audience": "Architects · Tech leads · CTO offices",
        "layout": "architecture-deep",
        "summary": "Systems Architect — separation of concerns, audit at every transition, modular shapes that survive scale. Frameworks (SAE, Config-Driven, Validation & Logging, Governance) anchored in production work.",
        "emphasis": ["Frameworks authored", "Architecture diagrams", "Scale numbers (50K–500K records)", "Reusable shapes", "Pattern reuse across projects"],
        "outputs": ["LAKSHMAN_OPTIMIZED_RESUME_2026.html"],
        "color": "#0d9488"
      },
      {
        "id": "ai-assisted",
        "name": "AI-Assisted Engineering Resume",
        "kicker": "Methodology-led · Prompt-pattern aware",
        "audience": "AI-native teams · Modern dev orgs · Tooling companies",
        "layout": "ai-method",
        "summary": "AI-Assisted Engineer — Claude / ChatGPT / Gemini as design partners, not code printers. Built FinWise, Maatru, and AI Architect using prompt-driven architecture validation, failure-mode review, and governed AI-assisted workflows.",
        "emphasis": ["Prompt patterns", "AI-assisted decisions", "Failure-mode rigor", "Human-in-the-loop posture", "Methodology over output"],
        "outputs": ["LAKSHMAN_OPTIMIZED_RESUME_2026.html"],
        "color": "#7c3aed"
      }
    ],
    "atsBody": {
      "skillTiers": [
        { "tier": "TIER 1 · Expertise", "items": ["ETL Pipeline Architecture", "Data Normalization & Entity Resolution", "Python (Pandas, NumPy, Geopy)", "VBA + Outlook Automation", "SQL (Postgres, MySQL, SQL Server)", "Modular Architecture", "Audit Logging", "Governance Frameworks"] },
        { "tier": "TIER 2 · Proficient", "items": ["Power BI · Power Query", "Logistics Analytics", "PDF Extraction", "Geo-APIs (Mapbox, Google)", "Fuzzy Matching", "Multi-source Integration"] },
        { "tier": "TIER 3 · AI-Assisted", "items": ["Claude / ChatGPT / Gemini as design partners", "Prompt-driven development", "AI-assisted prototyping", "Architecture validation workflows"] },
        { "tier": "TIER 4 · Working knowledge", "items": ["R", "Tableau", "SAP HANA (AO Query)", "SAP Ariba", "SharePoint"] }
      ],
      "experience": [
        { "role": "Automation & Data Pipeline Engineer", "where": "Carrier Technologies India", "when": "Feb 2025 – Present", "bullets": ["Architected Python pipeline integrating multi-source logistics data into unified cost intelligence (Parcel Intelligence Platform)", "Engineered FedEx/DHL rate-card extraction enabling $2M+ in negotiated savings (500K+ rate combinations)", "Designed 4-tier geo-enrichment system for 100K+ invoice records; 60% manual-validation reduction", "Built TSP automation eliminating 8+ hours weekly manual processing; 95% error reduction", "Architected entity-resolution platform for 50K+ global supplier records across 4 languages"] },
        { "role": "Procurement Analyst · Reporting & Automation", "where": "Deloitte Support Services", "when": "Apr 2020 – Dec 2023", "bullets": ["Designed procurement analytics pipelines on daily/weekly/quarterly cadence for global clients", "Migrated MS Access to SQL Server — performance + reliability uplift", "Built Power Query data-quality tools across 4 years, 100K–400K records per set", "Contributed to client savings exceeding $1M through improved data visibility"] },
        { "role": "Analyst · Data Migration & Automation", "where": "Orion India Systems (Deloitte project)", "when": "2019 – 2020", "bullets": ["Zero-loss enterprise data migration", "First VBA + Outlook automation modules; SOPs as deliverable, not afterthought"] },
        { "role": "HRIS · MIS Reporting Analyst", "where": "Orion India Systems", "when": "2018 – 2019", "bullets": ["Enterprise HR analytics on SAP HANA, Crystal Reports, SAP BI", "First exposure to report-standardisation cost"] }
      ]
    }
  },

  "social": {
    "title": "Social studio.",
    "lead": "Reusable share-ready blocks — engineering insights, framework snippets, automation diagrams, and operational visuals. Drop one into a screenshot tool, post it; everything is sized for LinkedIn (1200×630).",
    "cards": [
      { "id": "sc-01", "kind": "insight",   "headline": "Automation never bypasses domain expertise.",                "body": "Confidence scores and escalation paths are designed in — never bolted on later. Human-in-the-loop is the floor, not the fallback.", "tag": "Engineering Principle",      "channel": "LinkedIn · Twitter" },
      { "id": "sc-02", "kind": "framework", "headline": "The SAE 9-section shape.",                                     "body": "Config → Imports → Business Rules → Main Engine → Validation → Debug/Trace → Output → Audit → Execution Summary. Every VBA + Python automation, the same skeleton.", "tag": "Framework Poster",     "channel": "LinkedIn" },
      { "id": "sc-03", "kind": "diagram",   "headline": "Source → Bridge → Anomaly → Narrative → Action.",               "body": "The Operational Intelligence loop. Five steps; one of them is human. The one that isn't can break — that's why audit lives between every arrow.",   "tag": "Architecture Diagram",     "channel": "LinkedIn · WhatsApp" },
      { "id": "sc-04", "kind": "stat",      "headline": "$3M+ unlocked across logistics, procurement, AP.",              "body": "Numbers travel further than résumés. Each one is anchored in a workflow you can read about in the case studies below.",            "tag": "Track Record",              "channel": "All" },
      { "id": "sc-05", "kind": "insight",   "headline": "AI is a design partner. Not a code printer.",                  "body": "Claude / ChatGPT / Gemini earn their keep on architecture review and failure-mode exploration. Engineering stays in the loop — always.",   "tag": "AI-Assisted Engineering",  "channel": "LinkedIn · Twitter" },
      { "id": "sc-06", "kind": "diagram",   "headline": "Variance ≠ Anomaly.",                                            "body": "Tier by % AND $ impact. The fastest way to drown an analyst is to forward every variance as an alert. Anomaly is variance × consequence.",   "tag": "Analytics Pattern",        "channel": "LinkedIn" }
    ]
  },
}/*EDITMODE-END*/;

function deepClone(obj) { return JSON.parse(JSON.stringify(obj)); }

// Deep-merge that's gentle on the existing shape: objects are merged
// key-by-key (so new defaults shine through), arrays are taken from
// `over` if present (so user edits to lists are preserved).
function deepMerge(base, over) {
  if (over === undefined || over === null) return base;
  if (Array.isArray(base) || Array.isArray(over)) return over !== undefined ? over : base;
  if (typeof base !== "object" || typeof over !== "object") return over;
  const out = { ...base };
  for (const k of Object.keys(over)) {
    out[k] = (k in base) ? deepMerge(base[k], over[k]) : over[k];
  }
  // also pull any keys present in base but missing in over (already done by spread)
  return out;
}

// ── Operationalization (Phase 4.5) ─────────────────────────────────────────
// Public source of truth = committed content/content.json (the PUBLISHED state).
// localStorage is the ADMIN's private working draft only — written/read solely
// in an admin session, so a public visitor NEVER sees stale local state and
// always renders the published content. Theme is persisted separately so a
// visitor's light/dark choice sticks without polluting content.
const ADMIN_KEY = "lb_admin";
const THEME_KEY = "lb_theme";
const CONTENT_URL = "content/content.json";

function isAdminSession() {
  try {
    if (new URLSearchParams(location.search).get("admin") === "1") return true;
    return localStorage.getItem(ADMIN_KEY) === "1";
  } catch { return false; }
}
function setAdminSession() { try { localStorage.setItem(ADMIN_KEY, "1"); } catch {} }
function readLocalRaw() { try { const r = localStorage.getItem(STORAGE_KEY); return r ? JSON.parse(r) : null; } catch { return null; } }
function loadTheme() { try { return localStorage.getItem(THEME_KEY) || null; } catch { return null; } }
function saveTheme(t) { try { localStorage.setItem(THEME_KEY, t); } catch {} }

// First paint (synchronous): defaults, plus the admin working draft if we're in
// an admin session. Public visitors get clean defaults until published content
// hydrates in (see buildState).
function loadStore() {
  const base = deepClone(DEFAULT_DATA);
  if (isAdminSession()) { const local = readLocalRaw(); if (local) return deepMerge(base, local); }
  return base;
}
// Storage seam — all persistence routes through the adapter (foundations/
// storage-adapter.js) so a future CloudAdapter is a config swap, not a rewrite.
// Falls back to a direct fetch if the adapter script isn't present.
let _adapter = null;
function storage() {
  if (_adapter) return _adapter;
  _adapter = (typeof getStorageAdapter === "function") ? getStorageAdapter() : null;
  return _adapter;
}
// Async fetch of the committed published content (null if not yet published).
async function loadPublished() {
  const a = storage();
  if (a) return a.load();
  try { const r = await fetch(CONTENT_URL + "?t=" + Date.now(), { cache: "no-store" }); if (!r.ok) return null; return await r.json(); }
  catch { return null; }
}
// Merge order: DEFAULT_DATA (schema floor) ← published (public truth) ← admin
// working draft (admin only). Visitors stop at published; no local pollution.
function buildState(published) {
  let base = deepMerge(deepClone(DEFAULT_DATA), published || {});
  if (isAdminSession()) { const local = readLocalRaw(); if (local) base = deepMerge(base, local); }
  return base;
}
// saveStore reports outcome (quota etc.) AND only persists in an admin session,
// so visitor renders never write content to localStorage.
function saveStore(data) {
  if (!isAdminSession()) return { ok: true, skipped: true };
  try {
    localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
    return { ok: true, bytes: (localStorage.getItem(STORAGE_KEY) || "").length };
  } catch (e) {
    const quota = e && (e.name === "QuotaExceededError" || e.code === 22 || e.code === 1014);
    return { ok: false, reason: quota ? "quota" : "error", message: e?.message || String(e) };
  }
}
// Publish the current state to the committed content store. Locally (serve.py)
// this writes content/content.json on disk; on a static host it falls back to a
// download you commit. Never silent — returns the mode used.
// Publish routes through the storage adapter (LocalAdapter today; CloudAdapter
// later) — no direct persistence here, keeping the swap configuration-driven.
async function publishContent(data) {
  const a = storage();
  if (a) return a.save(data);
  downloadJSON("content.json", data);
  return { ok: true, mode: "download" };
}
// Save operational config to content/settings.json (mirror for tooling + git).
async function publishSettings(config) {
  const a = storage();
  if (a) return a.saveSettings(config);
  downloadJSON("settings.json", config);
  return { ok: true, mode: "download" };
}
function downloadJSON(name, obj) {
  const blob = new Blob([JSON.stringify(obj, null, 2)], { type: "application/json" });
  const a = document.createElement("a");
  a.href = URL.createObjectURL(blob); a.download = name; a.click();
  setTimeout(() => URL.revokeObjectURL(a.href), 1000);
}
function resetStore() { localStorage.removeItem(STORAGE_KEY); return deepClone(DEFAULT_DATA); }
function uid(prefix = "id") { return prefix + "-" + Math.random().toString(36).slice(2, 9); }
// Rough byte size of a base64 data URL payload (used to block oversized media
// before it silently fills the store). Returns bytes.
function dataUrlBytes(str) {
  if (typeof str !== "string") return 0;
  const i = str.indexOf(",");
  const b64 = i >= 0 ? str.slice(i + 1) : str;
  return Math.floor(b64.length * 0.75);
}
function fileToDataURL(file) {
  return new Promise((resolve, reject) => {
    const r = new FileReader();
    r.onload = () => resolve(r.result);
    r.onerror = reject;
    r.readAsDataURL(file);
  });
}

Object.assign(window, {
  DEFAULT_DATA, loadStore, saveStore, resetStore, deepClone, deepMerge, uid, fileToDataURL, dataUrlBytes,
  loadPublished, buildState, publishContent, publishSettings, downloadJSON, isAdminSession, setAdminSession, loadTheme, saveTheme,
});
