## Context The production site is built as static output and served via nginx (Docker image). Lighthouse runs (mobile/desktop, light/dark/high-contrast) report repeated misses across Performance, SEO, Best Practices, and (in dark theme) Accessibility. Notable characteristics from the current system: - SEO is mostly static-file driven (`site/public/robots.txt`, sitemap output) and must be correct for the deployed domain. - Global styling is served from `site/public/styles/global.css`, which bypasses typical bundler optimizations (minification, pruning) unless explicitly piped through the build. - A service worker exists (`site/public/sw.js`) and is involved in caching shell assets; cache behavior must not cause stale critical assets after deploy. - The site uses environment-driven configuration and has multiple theme modes (light/dark/high-contrast) that must remain visually consistent and accessible. The goal is a deterministic, repeatable Lighthouse gate that can hit 100s in a clean run environment. ## Goals / Non-Goals **Goals:** - Reach 100 Lighthouse scores (Performance, Accessibility, Best Practices, SEO) for the defined set of URLs, form factors, and theme variants. - Fix SEO correctness issues that are unambiguous (e.g., `robots.txt` sitemap URL must be absolute for the production domain). - Ensure all user-visible navigational CTAs and modal actions are implemented as crawlable anchors (real `href`s) when they represent links. - Eliminate dark theme contrast regressions by tightening theme token choices and/or component-level styles. - Reduce initial render blocking work (fonts + CSS) to improve mobile performance. - Reduce CSS overhead by ensuring the global stylesheet is minified and sized appropriately for production. - Make Lighthouse runs deterministic (clean Chrome profile, fixed throttling/UA) and enforce a quality gate in CI or a scripted check. **Non-Goals:** - Redesigning the visual aesthetic. - Building a general-purpose CSS framework migration. - Perfect scores when Lighthouse is run with extensions or non-deterministic settings. - Solving third-party performance/caching issues by weakening metrics (the goal is to reduce third-party dependence where it blocks 100s, or scope the gate to first-party pages that can be made deterministic). ## Decisions ### 1) Define the Lighthouse gate upfront Decision: treat 100s as a contract under a specific, documented run configuration. - URLs: start with the production home page and any key landing/content pages that are stable and representative. - Variants: mobile/desktop x light/dark/high-contrast. - Run environment: headless Chrome in CI (no extensions), consistent throttling, at least N runs per variant with median selection. Rationale: Lighthouse scores are otherwise too sensitive to environment noise to serve as a reliable build gate. Alternative considered: manual Lighthouse checks. Rejected because it does not prevent regressions. ### 2) Fix SEO static outputs in `public/` Decision: keep `robots.txt` and sitemap-related outputs as static files, but ensure correctness for production. - Make the sitemap reference in `site/public/robots.txt` absolute (not a relative path). Rationale: This is required for Lighthouse SEO audits and is the least invasive change. Alternative considered: generate robots dynamically. Rejected as unnecessary complexity. ### 3) Enforce crawlable links in modal/CTA surfaces Decision: if an element semantically represents navigation (internal or outbound), it must be an ``. - For modal components, ensure the CTA is rendered as an anchor with a real destination URL when appropriate. - If the interaction is not navigation (e.g., close modal), use a `