The brief I gave myself

Four jobs, in tension. It has to make clear, to someone who will not read the source, what I do and what I have done. It has to serve as a professional profile. It has to be evidence of engineering standards for people who will read the source. And it has to still be pleasant to add a project to in three years.

Those pull in different directions. A site optimised purely for conversion tends to be thin; a site built to show off engineering tends to be slow and self-indulgent. The resolution was to keep the visible surface calm and put the engineering where it belongs: in the constraints.

Static by default, dynamic where it is earned

Every page is rendered to HTML at build time. Exactly one route is server-rendered — the enquiry form, because it accepts a POST. That single decision removes most of the interesting attack surface: there is no database, no session store, no user content, no admin interface, and nothing to inject into on the pages that make up the bulk of the site.

It also makes the container disposable. The build artefact is immutable, the running process holds no state worth preserving, and a rollback is a redeploy of the previous image.

The framework choice, briefly

The site is about 95% content, so the correct default is a framework that ships no JavaScript unless asked. Astro does that, and its content collections give schema-validated Markdown with typed queries and relationships — which is what makes adding a project a one-file change rather than an edit across the homepage and the work index.

There is no UI framework at all. A handful of small interactive features do not justify shipping a runtime for them, so the islands here are plain TypeScript that progressively enhances markup which already works without it. A page carries about 2.9 kB of it, compressed — 4.1 kB on the home page, which adds the hero canvas.

A content security policy that means something

The policy is default-src 'none' with an explicit allowance per resource type, no unsafe-inline, and no third-party origins of any kind. That is only possible because the build emits no executable inline script, no inline <style> and no style attributes — so stylesheets stay external, small scripts are never inlined into the document, and Markdown syntax highlighting is off, because it emits an inline style per token.

The theme switch is the interesting case. The standard way to apply a stored theme without a flash of the wrong palette is an inline script in the head, and that one script would force unsafe-inline on every page of the site. An external classic script does the same job: it still blocks parsing, so it still runs before the first paint, and it needs no hash. The cost is one extra request of a couple of hundred bytes.

The interesting part is that the policy is a build invariant rather than a promise: a test parses the production output and fails the build if an inline script or style appears. A policy nobody verifies degrades the first time somebody adds a snippet.

For the same reason there are no third-party scripts at all — no analytics, no tag manager, no font CDN, no embedded chat. Fonts are served from this origin. Nothing about a visitor is sent anywhere else.

Motion, and the two ways it goes wrong

Interfaces should move, but movement is where accessibility and performance quietly get traded away, so both constraints were set first.

The reveals as you scroll are CSS scroll-driven animations — animation-timeline: view() — so there is no IntersectionObserver, no scroll handler and no animation library. The compositor runs them off the main thread, and the whole system costs nothing in JavaScript. Page-to-page navigation uses cross-document view transitions, which is also pure CSS.

They animate position and not opacity, and that was not the first attempt. A scroll-linked fade can be parked anywhere simply by not scrolling, which leaves real text sitting at a fraction of its contrast for as long as the reader stays there — and an automated accessibility check reported exactly that, intermittently, which is how these things usually surface. Translating instead keeps every character at full contrast in every frame and still reads as settling into place. The hero heading does not fade for a second reason: it is the largest contentful paint, and an element that fades in is not counted as painted until it is opaque.

There was one more failure worth recording. The CSS minifier folded animation-timeline into the animation shorthand, producing animation: linear both reveal view() — syntax no browser accepts, so the declaration was dropped and every scroll animation stopped working. Only in the production build. Silently, with no error anywhere. It was found by testing the built artefact rather than the dev server, and there is now an invariant test asserting the declarations survive minification.

Confidentiality modelled in data, not in CSS

Much of my professional work happens in environments where the details cannot be published. That is a content-modelling problem, not a discipline problem, so every project carries a disclosure level — public, anonymised or restricted — and one module is the sole route from the content collection to a template. Restricted entries are filtered before rendering, and a build test asserts that nothing unpublished appears in the output.

The rule that matters is the boring one: material that cannot be published does not enter the repository in the first place. Hiding something with CSS is not hiding it.

What running it looks like

One container. Multi-stage build, non-root user, read-only root filesystem, all capabilities dropped, no Docker socket, no shell daemon, a health endpoint for the orchestrator and a real SIGTERM handler so in-flight requests finish before the process exits.

The server itself is deliberately small and dependency-light: it serves the static build, applies the security headers to every response including assets, resolves the client address, handles canonical redirects and health checks, and hands everything else to the framework. Its only third-party dependency is the static file server. The framework’s own runtime is bundled into the build output, so the image installs two packages rather than a build toolchain.

What I would do differently at scale

For a single author, Markdown in the repository is the right content store: versioned, reviewable, no extra service. If a non-technical editor needed to publish, that assumption changes and a headless CMS becomes the answer — which is why content access is behind one module rather than scattered through templates. That is the seam where the change would happen.