diff --git a/apps/docs/public/.htaccess b/apps/docs/public/.htaccess
index d310d5f..72e4826 100644
--- a/apps/docs/public/.htaccess
+++ b/apps/docs/public/.htaccess
@@ -33,7 +33,75 @@ ErrorDocument 404 /lossless/404.html
Header set X-Robots-Tag "noindex"
+ # Negotiated responses serve .md twins at canonical URLs: keep those indexable.
+ Header unset X-Robots-Tag env=REDIRECT_NEGOTIATED_MD
Header set X-Robots-Tag "noindex"
+
+# Agent discovery (isitagentready): Apache port of dist/_headers.
+# Apache ignores that file, so this is what actually ships headers under /lossless.
+
+ AddType application/json .json
+
+
+# Compound extension needs a filename match: AddType splits on dots.
+
+ ForceType application/gzip
+
+
+# Homepage Link header (RFC 8288 / RFC 9727 s3). Minimal form. Keep in sync with dist/_headers.
+
+ SetEnvIf Request_URI "^/lossless/$" IS_LOSSLESS_HOME
+ SetEnvIf Request_URI "^/lossless/index\.html$" IS_LOSSLESS_HOME
+
+
+ Header always set Link "; rel=\"api-catalog\"; type=\"application/linkset+json\", ; rel=\"ai-catalog\"; type=\"application/ai-catalog+json\", ; rel=\"service-desc\"; type=\"application/json\", ; rel=\"describedby\"; type=\"application/json\", ; rel=\"describedby\"; type=\"text/plain\", ; rel=\"alternate\"; type=\"text/markdown\"" env=IS_LOSSLESS_HOME
+ # Internal rewrites rename request env vars with a REDIRECT_ prefix.
+ Header always set Link "; rel=\"api-catalog\"; type=\"application/linkset+json\", ; rel=\"ai-catalog\"; type=\"application/ai-catalog+json\", ; rel=\"service-desc\"; type=\"application/json\", ; rel=\"describedby\"; type=\"application/json\", ; rel=\"describedby\"; type=\"text/plain\", ; rel=\"alternate\"; type=\"text/markdown\"" env=REDIRECT_IS_LOSSLESS_HOME
+
+
+# Extensionless file needs explicit type (else text/plain fails the scan).
+
+ ForceType 'application/linkset+json; profile="https://www.rfc-editor.org/info/rfc9727"'
+
+
+# Serve the catalog with its advertised media type (matches Link rel=ai-catalog).
+
+ ForceType application/ai-catalog+json
+
+
+
+
+ Header set Access-Control-Allow-Origin "*"
+
+
+
+# Pragmatic Accept: text/markdown (static-first, not strict RFC).
+# Subdir rules shadow the domain-root rewrite block, so both live here.
+
+RewriteEngine On
+
+RewriteCond %{REQUEST_URI} \.(css|js|mjs|map|png|jpe?g|webp|gif|svg|avif|ico|woff2?|ttf|otf|eot|xml|txt|json|pdf|mp4|webm|mp3|wav|ogg|zip)$ [NC]
+RewriteRule ^ - [L]
+RewriteCond %{REQUEST_URI} \.mdx?$ [NC]
+RewriteRule ^ - [L]
+
+# /lossless/ -> /lossless/index.md
+RewriteCond %{HTTP:Accept} text/markdown [NC]
+RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC]
+RewriteRule ^$ /lossless/index.md [L,T=text/markdown,E=NEGOTIATED_MD:1]
+
+# /lossless/index.html -> /lossless/index.md (same representation as /lossless/)
+RewriteCond %{HTTP:Accept} text/markdown [NC]
+RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC]
+RewriteRule ^index\.html$ /lossless/index.md [L,T=text/markdown,E=NEGOTIATED_MD:1]
+
+# /lossless/ -> twin .md
+RewriteCond %{HTTP:Accept} text/markdown [NC]
+RewriteCond %{HTTP:Accept} !text/markdown(?:\s*;\s*(?!q\s*=)[^;,]+)*\s*;\s*q\s*=\s*0(\.0*)?(\s*[;,]|\s*$) [NC]
+RewriteCond %{REQUEST_FILENAME} !\.md$ [NC]
+RewriteCond %{DOCUMENT_ROOT}/lossless/$1.md -f
+RewriteRule ^(.+?)/?$ /lossless/$1.md [L,T=text/markdown,E=NEGOTIATED_MD:1]
+