<?php
require_once ROOT_PATH . '/modules/marketing/views/partials/icons.php';
$activeNav = 'home';
ob_start();
?>
<?php require __DIR__ . '/partials/header.php'; ?>

<!-- ============ HERO ============ -->
<section class="hx-hero">
    <div class="hx-hero-glow hx-hero-glow-1"></div>
    <div class="hx-hero-glow hx-hero-glow-2"></div>
    <div class="hx-container hx-hero-inner">
        <div>
            <span class="hx-eyebrow">For organisations that run work through other people</span>
            <h1>Every project,<br>on course.</h1>
            <p class="hx-lede">Projects, contractors, suppliers, budgets and invoices sit in one system — so you can see what every project is doing, what it has cost, and what needs a decision today.</p>
            <div class="hx-hero-ctas">
                <a href="<?= APP_URL ?>/signup" class="hx-btn hx-btn-white">Start free trial <span style="width:16px;height:16px;"><?= hxIcon('arrow-right') ?></span></a>
                <a href="<?= APP_URL ?>/pricing" class="hx-btn hx-btn-ghost">See pricing</a>
            </div>
            <p class="hx-hero-note"><strong>7-day free trial</strong> &nbsp;·&nbsp; No credit card required</p>
        </div>

        <div class="hx-mock" aria-hidden="true">
            <div class="hx-mock-bar">
                <div>
                    <div class="hx-mock-bar-title">Bridge</div>
                    <div class="hx-mock-bar-sub">12 active projects · 4 need a decision today</div>
                </div>
            </div>
            <div class="hx-mock-stats">
                <div class="hx-mock-stat">
                    <div class="hx-mock-stat-label">Committed</div>
                    <div class="hx-mock-stat-value">₦418.6m <span>· 12 projects</span></div>
                </div>
                <div class="hx-mock-stat">
                    <div class="hx-mock-stat-label">Invoiced</div>
                    <div class="hx-mock-stat-value">₦276.1m <span>· 66%</span></div>
                </div>
                <div class="hx-mock-stat">
                    <div class="hx-mock-stat-label">Awaiting approval</div>
                    <div class="hx-mock-stat-value">₦12.4m <span>· 7 invoices</span></div>
                </div>
            </div>
            <div class="hx-mock-rows">
                <div class="hx-mock-row">
                    <div>
                        <div class="hx-mock-row-name">Riverside Phase 2</div>
                        <div class="hx-mock-row-sub">Lekki · Bolaji O.</div>
                    </div>
                    <div class="hx-mock-row-right">
                        <span class="hx-mock-heading drifting">Drifting</span>
                        <div class="hx-mock-row-amount">₦61.2m / ₦96.0m</div>
                    </div>
                </div>
                <div class="hx-mock-row">
                    <div>
                        <div class="hx-mock-row-name">Marina Tower Fit-out</div>
                        <div class="hx-mock-row-sub">Victoria Island · Ada N.</div>
                    </div>
                    <div class="hx-mock-row-right">
                        <span class="hx-mock-heading on-course">On course</span>
                        <div class="hx-mock-row-amount">₦118.4m / ₦142.5m</div>
                    </div>
                </div>
                <div class="hx-mock-row">
                    <div>
                        <div class="hx-mock-row-name">Ikeja Depot Refit</div>
                        <div class="hx-mock-row-sub">Ikeja · Chidi E.</div>
                    </div>
                    <div class="hx-mock-row-right">
                        <span class="hx-mock-heading off-course">Off course</span>
                        <div class="hx-mock-row-amount">₦41.9m / ₦58.0m</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- ============ PILLARS ============ -->
<section class="hx-pillars hx-section">
    <div class="hx-container">
        <span class="hx-eyebrow">How Helmyx is organised</span>
        <h2>Steer. Plan. Deliver.</h2>
        <p style="max-width:560px;">Three jobs, one system: control and approvals, projects and budgets, execution and invoicing.</p>

        <div class="hx-pillar-grid">
            <div class="hx-pillar">
                <div class="hx-pillar-icon"><?= hxIcon('steer') ?></div>
                <span class="hx-pillar-word">Steer</span>
                <h3>Approvals &amp; oversight</h3>
                <p>See every project, contractor and supplier from one dashboard, and keep a full record of who approved what.</p>
                <ul>
                    <li><?= hxIcon('check') ?> Role-based permissions</li>
                    <li><?= hxIcon('check') ?> Two-factor authentication</li>
                    <li><?= hxIcon('check') ?> Immutable audit log</li>
                </ul>
            </div>
            <div class="hx-pillar">
                <div class="hx-pillar-icon"><?= hxIcon('plan') ?></div>
                <span class="hx-pillar-word">Plan</span>
                <h3>Projects &amp; budgets</h3>
                <p>Set up projects with milestones, categories and budgets, and onboard contractors and suppliers with their documents.</p>
                <ul>
                    <li><?= hxIcon('check') ?> Milestones &amp; categories</li>
                    <li><?= hxIcon('check') ?> Contractor &amp; supplier onboarding</li>
                    <li><?= hxIcon('check') ?> Document management</li>
                </ul>
            </div>
            <div class="hx-pillar">
                <div class="hx-pillar-icon"><?= hxIcon('deliver') ?></div>
                <span class="hx-pillar-word">Deliver</span>
                <h3>Invoicing &amp; reports</h3>
                <p>Track spend against budget, review and approve invoices, and collect daily progress reports from the field.</p>
                <ul>
                    <li><?= hxIcon('check') ?> Invoices, budgets &amp; expenses</li>
                    <li><?= hxIcon('check') ?> Daily progress reports with photos</li>
                    <li><?= hxIcon('check') ?> Custom report templates</li>
                </ul>
            </div>
        </div>
    </div>
</section>

<!-- ============ FEATURES ============ -->
<section class="hx-section" id="features">
    <div class="hx-container">
        <span class="hx-eyebrow">Everything in one place</span>
        <h2>Built for how the work actually happens.</h2>
        <p style="max-width:560px;">Every module your organisation needs to run projects through contractors and suppliers — nothing you have to bolt on later.</p>

        <div class="hx-feature-grid">
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('projects') ?></div>
                <h4>Projects</h4>
                <p>Create projects, break them into milestones, assign contractors and track status from kickoff to close-out.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('clients') ?></div>
                <h4>Clients</h4>
                <p>Keep every client's details, industry and contact history in one searchable record.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('contractors') ?></div>
                <h4>Contractors &amp; suppliers</h4>
                <p>Onboard partners with documents and approvals, and give each one their own portal login.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('finance') ?></div>
                <h4>Invoices &amp; budgets</h4>
                <p>Submit, review and approve invoices against budget, with a clear trail for every naira spent.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('reports') ?></div>
                <h4>Daily progress reports</h4>
                <p>Field teams log daily reports with photos; custom templates match how your organisation works.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('rbac') ?></div>
                <h4>Roles &amp; permissions</h4>
                <p>Give every person exactly the access their role needs — nothing more, nothing missing.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('notifications') ?></div>
                <h4>Notifications</h4>
                <p>In-app and email alerts for approvals, assignments and anything waiting on you.</p>
            </div>
            <div class="hx-feature">
                <div class="hx-feature-icon"><?= hxIcon('logbook') ?></div>
                <h4>Logbook</h4>
                <p>An immutable audit trail of every action — the record you'd hand an auditor.</p>
            </div>
        </div>
    </div>
</section>

<!-- ============ HOW IT WORKS ============ -->
<section class="hx-section hx-section-tight" id="how-it-works" style="background:var(--hx-mist);">
    <div class="hx-container">
        <span class="hx-eyebrow">Getting started</span>
        <h2>From sign-up to steering, in four steps.</h2>

        <div class="hx-steps">
            <div class="hx-step">
                <div class="hx-step-num">1</div>
                <h4>Create your organisation</h4>
                <p>Sign up and your 7-day free trial starts immediately — no card required.</p>
            </div>
            <div class="hx-step">
                <div class="hx-step-num">2</div>
                <h4>Invite your team</h4>
                <p>Add your team, contractors and suppliers, and set who can approve what.</p>
            </div>
            <div class="hx-step">
                <div class="hx-step-num">3</div>
                <h4>Set up your projects</h4>
                <p>Build out projects with milestones, budgets and categories that match how you work.</p>
            </div>
            <div class="hx-step">
                <div class="hx-step-num">4</div>
                <h4>Steer from Bridge</h4>
                <p>Track progress, approve invoices, and see what needs a decision today.</p>
            </div>
        </div>
    </div>
</section>

<!-- ============ TRUST ============ -->
<section class="hx-section hx-trust">
    <div class="hx-container">
        <span class="hx-eyebrow">Built for accountability</span>
        <h2>Every action, on the record.</h2>
        <p>Helmyx keeps a full history of who approved what, and keeps every organisation's data locked to itself.</p>

        <div class="hx-trust-grid">
            <div class="hx-trust-item">
                <?= hxIcon('lock') ?>
                <h4>Two-factor authentication</h4>
                <p>Protect every account with TOTP-based 2FA and backup codes.</p>
            </div>
            <div class="hx-trust-item">
                <?= hxIcon('rbac') ?>
                <h4>Role-based permissions</h4>
                <p>Every person gets exactly the access their role needs.</p>
            </div>
            <div class="hx-trust-item">
                <?= hxIcon('logbook') ?>
                <h4>Immutable audit log</h4>
                <p>A complete, unchangeable record of every action — the Logbook.</p>
            </div>
            <div class="hx-trust-item">
                <?= hxIcon('layers') ?>
                <h4>Multi-tenant isolation</h4>
                <p>Each organisation's data is fully separated from every other.</p>
            </div>
        </div>
    </div>
</section>

<!-- ============ PRICING TEASER ============ -->
<?php $publicPricing = \Core\Pricing::resolvePublicPlans(); $teaserPlan = $publicPricing['plans'][0] ?? null; ?>
<section class="hx-section">
    <div class="hx-container" style="text-align:center;">
        <span class="hx-eyebrow">Simple, transparent pricing</span>
        <h2>Priced for where you are.</h2>
        <p style="max-width:520px;margin:0 auto 32px;">Pricing is shown in your local currency automatically, and set by Helmyx — start free for 7 days, no card required.</p>

        <?php if ($teaserPlan): ?>
            <div style="font-family:var(--hx-font-display);font-weight:700;font-size:44px;color:var(--hx-navy-900);">
                <?= htmlspecialchars(formatCurrency((float)$teaserPlan['amount'], $publicPricing['currency'])) ?>
                <span style="font-family:var(--hx-font-sans);font-weight:500;font-size:15px;color:var(--hx-slate-400);">/ <?= htmlspecialchars($teaserPlan['plan']['billing_type']) ?></span>
            </div>
            <p style="color:var(--hx-slate-500);margin-bottom:28px;">Starting price for the <?= htmlspecialchars($teaserPlan['plan']['name']) ?> plan</p>
        <?php endif; ?>

        <a href="<?= APP_URL ?>/pricing" class="hx-btn hx-btn-primary">See full pricing</a>
    </div>
</section>

<!-- ============ CTA ============ -->
<section class="hx-cta">
    <div class="hx-container">
        <h2>Start steering your projects today.</h2>
        <p>7-day free trial. No credit card required. Cancel anytime.</p>
        <div class="hx-cta-ctas">
            <a href="<?= APP_URL ?>/signup" class="hx-btn hx-btn-white">Start free trial</a>
            <a href="<?= APP_URL ?>/pricing" class="hx-btn hx-btn-ghost">See pricing</a>
        </div>
    </div>
</section>

<?php require __DIR__ . '/partials/footer.php'; ?>
<?php
$content = ob_get_clean();
$pageTitle = 'Helmyx — Steer. Plan. Deliver.';
$metaDescription = 'Helmyx is a project management platform for organisations that run work through other people. Projects, contractors, suppliers, budgets and invoices — one system, so you always know what needs a decision today.';
require ROOT_PATH . '/modules/shared/views/layouts/marketing.php';
?>
