diff --git a/docs-site/src/routes/api/index.tsx b/docs-site/src/routes/api/index.tsx
index 2c4eeb7..633be21 100644
--- a/docs-site/src/routes/api/index.tsx
+++ b/docs-site/src/routes/api/index.tsx
@@ -1,5 +1,7 @@
+import { useEffect, useMemo, useState } from 'react'
import { createFileRoute, Link } from '@tanstack/react-router'
import { ApiReferenceReact } from '@scalar/api-reference-react'
+import { useTheme } from 'next-themes'
// @scalar/api-reference-react@0.9.47's entry does NOT import its own stylesheet
// (and doesn't inject it at runtime), so we must ship it ourselves or the
// reference renders unstyled. Load it as a route-scoped (same pattern as
@@ -23,44 +25,47 @@ export const Route = createFileRoute('/api/')({
}),
})
-// The full punktfunk theme rolled out onto Scalar — the same dark-violet
-// product chrome as the management console (bg #141019 / cards #1c1530, the
-// violet lens brand, Geist). Scalar is locked to dark mode below; the palette
-// maps every Scalar token (surfaces, text, sidebar, links, buttons, method
-// colours). Scalar ignores unknown custom-property names, so this is forward-safe.
+// The full punktfunk theme rolled out onto Scalar — the same dark-violet (and
+// light-lavender) product chrome as the docs/management console.
+//
+// IMPORTANT: Scalar toggles `.light-mode` / `.dark-mode` on `document.body`,
+// and it renders our `customCss` *before* its own built-in theme preset in the
+// SAME