Task: Enable play.phalanxduel.com Homepage Iframe Embed

Goal

Allow phalanxduel.com (this marketing/docs site) to embed a playable Phalanx Duel experience from https://play.phalanxduel.com in an <iframe> on the homepage.

This task is for the other project (the app served at play.phalanxduel.com).

Why This Matters

Current State (in this repo)

Scope (other project: play.phalanxduel.com)

Implement iframe support safely for embedding from https://phalanxduel.com.

Requirements

1. Allow Framing by https://phalanxduel.com

The app must allow being framed by the parent site.

Required behavior:

Do not rely on X-Frame-Options: SAMEORIGIN for this use case.

2. Support an Embed-Friendly Entry Route (Recommended)

Provide a dedicated route for embedding, e.g.:

Recommended route behavior:

If a dedicated route is not created, the root route must still embed cleanly and not break inside an iframe.

3. Iframe Compatibility (Runtime)

The embedded app should function inside an iframe without requiring top-level navigation for core flow:

If the app intentionally opens links in new tabs/windows (for share flows), behavior should remain clear and not trap the user.

If cookies or storage are used for player/session state:

Preferred:

5. Embed Security Posture

Document which browser capabilities the embed actually needs so the homepage iframe sandbox can be minimized.

Current homepage sandbox proposal (in this repo):

The app project should confirm:

Define a minimal postMessage contract for better homepage UX.

Examples:

This is not required for initial launch, but it will improve analytics and UX polish.

Acceptance Criteria (other project)

Deliverables From Other Project (handoff back to this repo)

Please provide all of the following when this task is completed:

Resume Work in This Repo (phalanxduel.com site)

After the app project is ready, resume here to complete homepage embed launch:

  1. Set _data/homepage.yml active_variant to embed_conversion_v1 (or create embed_conversion_v2)
  2. Update the iframe src in _data/homepage.yml to the final embed URL (e.g. /embed)
  3. Tighten iframe sandbox flags in _data/homepage.yml to the confirmed minimum
  4. Verify copy and CTAs match actual embed behavior (Create Match, join flow, spectator link availability)
  5. Add analytics instrumentation for:
    • Create Match CTA clicks
    • iframe section visibility
    • outbound Open Full App clicks
  6. Test homepage on desktop + mobile
  7. Ship

Notes for I18n / Translation Readiness

This site now keeps homepage copy in _data/homepage.yml to prepare for internationalization.

When finalizing iframe-related text, keep strings:

This will make translation extraction and locale variants easier later.