Keep core content server-rendered and independent of WebGL
Search engines and AI answer engines need immediate, unambiguous HTML—not a blank canvas waiting on client-side hydration. Every heading, skill pill, work history entry, and case study on this site renders on the server via Next.js App Router.
The two interactive 3D stages—the hero torus-knot sculpture and the About section's extruded dc. orbital monogram—live strictly inside client islands wrapped by Stage3D. When JavaScript is disabled, WebGL context is lost, or the page is still painting, resolution-independent CSS and SVG fallbacks occupy the exact stage container dimensions with zero Cumulative Layout Shift (CLS).
Defer hero WebGL past initial paint and pause offscreen loops
Bundling three, @react-three/fiber, and @react-three/drei exceeds 1 MB of JavaScript before gzip. Downloading and compiling WebGL shaders immediately on load competes with fonts, stylesheets, and Lighthouse's Total Blocking Time (TBT) window on mobile devices.
Stage3D gates the hero Canvas on window load completion plus requestIdleCallback (or immediate pointer/touch/focus interaction) while keeping below-the-fold scenes dormant until IntersectionObserver approaches them. Once mounted, frameloop switches from 'always' to 'demand' whenever the container scrolls offscreen or the user toggles Pause motion.
Viewport-gated Canvas with demand frameloop, low-power WebGL, and context guard
// Stage3D pauses offscreen loops and scales motion under reduced-motion
<Canvas
dpr={[1, 1.5]}
camera={{ position: [0, 0, 6.6], fov: 36 }}
frameloop={paused ? "demand" : "always"}
gl={{ antialias: true, alpha: true, powerPreference: "low-power" }}
fallback={<SculptureFallback />}
>
<WebGLContextGuard onContextLost={onContextLost} />
<StudioLighting design={design} resolution={64} />
<Form paused={paused} motionScale={motionScale} design={design} />
</Canvas>One semantic DOM, three frontend design perspectives
Maintaining separate URLs or duplicated markup for Editorial, Futuristic, and Minimal visual moods would dilute crawl equity and create duplicate content. Instead, a tiny pre-paint inline script sets data-design on <html> from localStorage before first paint.
Scoped CSS custom properties update palettes, border radii, typography pairing (Manrope + DM Serif Display), and Three.js physical material properties simultaneously without re-rendering semantic page text.
- Zero theme flash on reload thanks to synchronous pre-paint attribute hydration.
- Prefer reduced-motion media queries automatically scale 3D rotation velocity down to 25%.
- Dual-output architecture serves clean Markdown via Accept: text/markdown without altering browser UX.