Răsfoiți Sursa

feat: home-screen drag, motion system, and Fraunces display type

Drag to rearrange
- New layout engine (lib/bento-layout.ts): explicit cells per tier, packed
  first-fit like CSS `row dense` so the server renders the same layout.
- While dragging, the held card claims the cell under it and the rest
  re-pack around it in the order they had when the drag began: no
  oscillation, no holes. A ghost well shows where it will land.
- DOM order never changes, so moving cards never restart animations.
- Touch: press and hold to lift (quick swipes still scroll), the page
  stops scrolling under the finger, and it auto-scrolls near the edges.

Motion
- Three springs (snap, glide, wobble) shared by CSS and WAAPI.
- Cards condense in reading order with a rim glint; press and lift
  states; glass buttons squash and wobble back.
- Hero headline weight and softness melt toward the cursor.

Type
- Fraunces (SOFT axis) for display text with SF Pro / Figtree for body.
  The display face loads after first paint and is remembered for return
  visits, so it never sits on the critical path.

Fixes
- Photo deck gestures move the whole photo, not the image inside it.
- Card content is clipped to the rounded corners during transitions.
- Toolbox sphere sizes itself to the tile and thins out on phones.
- Steadier nav glass light, focus rings only for keyboard focus.
- New SecondSelf screenshot; footer terrain credit removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEPoSHwHCYMNpm2iKxY9hL
Claude 1 lună în urmă
părinte
comite
d54e174563

+ 1 - 1
app/error.tsx

@@ -16,7 +16,7 @@ export default function Error({
   return (
     <div className="flex min-h-[60vh] flex-col items-center justify-center gap-4 px-4 text-center">
       <p className="eyebrow">Something went wrong</p>
-      <h1 className="text-4xl font-semibold tracking-tight">
+      <h1 className="font-display text-4xl font-semibold tracking-[-0.015em]">
         We hit a crevasse.
       </h1>
       <button

+ 15 - 2
app/layout.tsx

@@ -8,7 +8,8 @@ import { Backdrop } from "@/components/backdrop/backdrop";
 import { CursorLens } from "@/components/glass/cursor-lens";
 import { SiteNav } from "@/components/nav/site-nav";
 import { SiteFooter } from "@/components/site-footer";
-import { fontInter } from "@/config/fonts";
+import { FontLoader } from "@/components/font-loader";
+import { deferredFaces, fontDisplay, fontName, fontText } from "@/config/fonts";
 import { siteConfig } from "@/config/site";
 
 export const metadata: Metadata = {
@@ -103,8 +104,19 @@ export default function RootLayout({
   children: React.ReactNode;
 }) {
   return (
-    <html suppressHydrationWarning className={fontInter.variable} lang="en">
+    <html
+      suppressHydrationWarning
+      className={`${fontText.variable} ${fontDisplay.variable} ${fontName.variable}`}
+      lang="en"
+    >
       <head>
+        {/* Returning visitors have the display face cached: use it from the first frame. */}
+        <script
+          dangerouslySetInnerHTML={{
+            __html:
+              'try{localStorage.getItem("ff")&&document.documentElement.classList.add("ff")}catch(e){}',
+          }}
+        />
         <script
           dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
           type="application/ld+json"
@@ -134,6 +146,7 @@ export default function RootLayout({
           <SiteFooter />
           <CursorLens />
         </ThemeProvider>
+        <FontLoader faces={deferredFaces} />
         <Analytics />
       </body>
     </html>

+ 1 - 1
app/not-found.tsx

@@ -4,7 +4,7 @@ export default function NotFound() {
   return (
     <div className="flex min-h-[60vh] flex-col items-center justify-center gap-5 px-4 text-center">
       <p className="eyebrow">Error 404</p>
-      <h1 className="text-[clamp(4rem,14vw,8rem)] leading-none font-semibold tracking-[-0.06em]">
+      <h1 className="font-display text-[clamp(4rem,14vw,8rem)] leading-none font-semibold tracking-[-0.03em]">
         Lost<span className="text-glacier">.</span>
       </h1>
       <p className="max-w-[40ch] text-[15px] text-ink-2">

+ 79 - 19
app/page.tsx

@@ -1,3 +1,4 @@
+import secondselfShot from "@/assets/projects/secondself.webp";
 import { BentoGrid, type BentoItem } from "@/components/bento/bento-grid";
 import { ArtifactsCard } from "@/components/cards/artifacts";
 import { EmojiCard } from "@/components/cards/emoji";
@@ -20,7 +21,8 @@ export const revalidate = 3600;
 export default async function Page() {
   const [home, posts] = await Promise.all([getHomeData(), getLatestPosts()]);
 
-  // Order matters: the grid packs densely in this order. On desktop (4 columns):
+  // Order matters: cards pack first-fit in this order. Sizes are columns × rows
+  // on phones (2 columns), tablets, and desktops (4 columns). On desktop:
   //   [hero      ][finops    ]
   //   [hero      ][artifacts ]
   //   [sky][globe][secondself]
@@ -33,7 +35,11 @@ export default async function Page() {
       id: "hero",
       tags: ["about"],
       label: "About Eric",
-      className: "col-span-2 row-span-3 sm:row-span-3 lg:row-span-2",
+      size: [
+        [2, 3],
+        [2, 3],
+        [2, 2],
+      ],
       still: true,
       content: <HeroCard avatarUrl={home.avatarUrl} dogUrl={home.dogUrl} />,
     },
@@ -41,42 +47,60 @@ export default async function Page() {
       id: "finops",
       tags: ["work"],
       label: "AWS FinOps Agent",
-      className: "col-span-2 row-span-2 sm:row-span-1",
+      size: [
+        [2, 2],
+        [2, 1],
+        [2, 1],
+      ],
       content: <FinOpsCard />,
     },
     {
       id: "artifacts",
       tags: ["work"],
       label: "Amazon Q artifacts",
-      className: "col-span-2 row-span-2 sm:row-span-1",
+      size: [
+        [2, 2],
+        [2, 1],
+        [2, 1],
+      ],
       content: <ArtifactsCard />,
     },
     {
       id: "sky",
       tags: ["about"],
       label: "Seattle sky and theme switch",
-      className: "col-span-1 row-span-1",
+      size: [
+        [1, 1],
+        [1, 1],
+        [1, 1],
+      ],
       content: <SkyCard />,
     },
     {
       id: "globe",
       tags: ["about"],
       label: "Purdue, UCLA, Seattle",
-      className: "col-span-1 row-span-1",
+      size: [
+        [1, 1],
+        [1, 1],
+        [1, 1],
+      ],
       content: <GlobeCard />,
     },
     {
       id: "secondself",
       tags: ["projects"],
       label: projects.secondself.name,
-      className: "col-span-2 row-span-1",
+      size: [
+        [2, 1],
+        [2, 1],
+        [2, 1],
+      ],
       content: (
         <ProjectCard
-          height={1280}
-          image={home.secondselfUrl}
+          image={secondselfShot}
           look="secondself"
           project={projects.secondself}
-          width={2259}
         />
       ),
     },
@@ -84,21 +108,33 @@ export default async function Page() {
       id: "packbook",
       tags: ["projects"],
       label: "PackBook",
-      className: "col-span-2 row-span-2 sm:col-span-1",
+      size: [
+        [2, 2],
+        [1, 2],
+        [1, 2],
+      ],
       content: <PackBookCard />,
     },
     {
       id: "photos",
       tags: ["about"],
       label: "Photos",
-      className: "col-span-2 row-span-2",
+      size: [
+        [2, 2],
+        [2, 2],
+        [2, 2],
+      ],
       content: <PhotoDeck photos={home.photos} />,
     },
     {
       id: "webagent",
       tags: ["projects"],
       label: projects.webagent.name,
-      className: "col-span-1 row-span-2",
+      size: [
+        [1, 2],
+        [1, 2],
+        [1, 2],
+      ],
       content: (
         <ProjectCard
           height={800}
@@ -113,7 +149,11 @@ export default async function Page() {
       id: "chatbot",
       tags: ["projects"],
       label: projects.chatbot.name,
-      className: "col-span-2 row-span-1",
+      size: [
+        [2, 1],
+        [2, 1],
+        [2, 1],
+      ],
       content: (
         <ProjectCard
           height={1280}
@@ -128,28 +168,44 @@ export default async function Page() {
       id: "tech",
       tags: ["about", "work"],
       label: "Toolbox",
-      className: "col-span-1 row-span-1",
+      size: [
+        [1, 1],
+        [1, 1],
+        [1, 1],
+      ],
       content: <TechSphere />,
     },
     {
       id: "mini",
       tags: ["about"],
       label: "Mini Cooper",
-      className: "col-span-1 row-span-1",
+      size: [
+        [1, 1],
+        [1, 1],
+        [1, 1],
+      ],
       content: <MiniCard />,
     },
     {
       id: "emoji",
       tags: ["projects"],
       label: "Text to emoji",
-      className: "col-span-1 row-span-1",
+      size: [
+        [1, 1],
+        [1, 1],
+        [1, 1],
+      ],
       content: <EmojiCard />,
     },
     {
       id: "paper",
       tags: ["projects", "work"],
       label: projects.paper.name,
-      className: "col-span-1 row-span-1",
+      size: [
+        [1, 1],
+        [1, 1],
+        [1, 1],
+      ],
       content: (
         <ProjectCard
           height={1280}
@@ -164,7 +220,11 @@ export default async function Page() {
       id: "writing",
       tags: ["about"],
       label: "Latest writing",
-      className: "col-span-2 row-span-2 sm:row-span-1",
+      size: [
+        [2, 2],
+        [2, 1],
+        [2, 1],
+      ],
       content: <WritingCard posts={posts} />,
     },
   ];

+ 93 - 0
assets/fonts/OFL.txt

@@ -0,0 +1,93 @@
+Copyright 2018 The Fraunces Project Authors (https://github.com/undercasetype/Fraunces)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
assets/fonts/fraunces-italic-eric.woff2


BIN
assets/projects/secondself.webp


+ 15 - 44
components/backdrop/topo-canvas.tsx

@@ -102,43 +102,27 @@ function drawContours(
 
 /**
  * Real contour lines of Mount Rainier (Tahoma), the mountain I'm training to
- * climb, drawn once after the page is idle. A second, brighter copy is masked
- * to a soft circle around the cursor, like a headlamp on a map.
+ * climb, drawn once after the page is idle and again only on resize or theme
+ * change, so the glass above it never has to re-blur a moving background.
  */
 export function TopoCanvas() {
   const wrapRef = useRef<HTMLDivElement>(null);
-  const baseRef = useRef<HTMLCanvasElement>(null);
-  const litRef = useRef<HTMLCanvasElement>(null);
+  const canvasRef = useRef<HTMLCanvasElement>(null);
 
   useEffect(() => {
     let topo: Topo | null = null;
     let disposed = false;
     let resizeTimer = 0;
-    let frame = 0;
-    const fine = window.matchMedia(
-      "(hover: hover) and (pointer: fine)",
-    ).matches;
+    let lastWidth = 0;
 
     const paint = () => {
-      if (!topo || disposed) return;
+      const canvas = canvasRef.current;
+
+      if (!topo || disposed || !canvas) return;
       const css = getComputedStyle(document.documentElement);
 
-      if (baseRef.current) {
-        drawContours(
-          baseRef.current,
-          topo,
-          css.getPropertyValue("--topo").trim(),
-          1,
-        );
-      }
-      if (fine && litRef.current) {
-        drawContours(
-          litRef.current,
-          topo,
-          css.getPropertyValue("--topo-lit").trim(),
-          1.25,
-        );
-      }
+      lastWidth = canvas.clientWidth;
+      drawContours(canvas, topo, css.getPropertyValue("--topo").trim(), 1);
       wrapRef.current?.setAttribute("data-ready", "true");
     };
 
@@ -155,17 +139,11 @@ export function TopoCanvas() {
 
     const onResize = () => {
       window.clearTimeout(resizeTimer);
-      resizeTimer = window.setTimeout(paint, 160);
-    };
-    const onMove = (e: PointerEvent) => {
-      if (e.pointerType === "touch" || frame) return;
-      const { clientX, clientY } = e;
-
-      frame = requestAnimationFrame(() => {
-        frame = 0;
-        wrapRef.current?.style.setProperty("--cx", `${clientX}px`);
-        wrapRef.current?.style.setProperty("--cy", `${clientY}px`);
-      });
+      resizeTimer = window.setTimeout(() => {
+        // Mobile toolbars change only the height; the backdrop is sized to the
+        // large viewport, so only a width change needs a redraw.
+        if (canvasRef.current?.clientWidth !== lastWidth) paint();
+      }, 160);
     };
     const themeObserver = new MutationObserver(paint);
 
@@ -174,16 +152,13 @@ export function TopoCanvas() {
       attributeFilter: ["class"],
     });
     window.addEventListener("resize", onResize);
-    if (fine) window.addEventListener("pointermove", onMove, { passive: true });
 
     return () => {
       disposed = true;
       cancelIdle();
       window.clearTimeout(resizeTimer);
-      cancelAnimationFrame(frame);
       themeObserver.disconnect();
       window.removeEventListener("resize", onResize);
-      window.removeEventListener("pointermove", onMove);
     };
   }, []);
 
@@ -192,11 +167,7 @@ export function TopoCanvas() {
       ref={wrapRef}
       className="absolute inset-0 opacity-0 transition-opacity duration-1000 data-[ready=true]:opacity-100"
     >
-      <canvas ref={baseRef} className="absolute inset-0 size-full" />
-      <canvas
-        ref={litRef}
-        className="absolute inset-0 size-full [mask-image:radial-gradient(circle_220px_at_var(--cx,-999px)_var(--cy,-999px),#000,transparent_75%)]"
-      />
+      <canvas ref={canvasRef} className="absolute inset-0 size-full" />
     </div>
   );
 }

+ 341 - 152
components/bento/bento-grid.tsx

@@ -12,8 +12,18 @@ import {
   type ReactNode,
 } from "react";
 
-import { spring } from "@/lib/motion";
-import { cn } from "@/lib/utils";
+import {
+  pack,
+  placeAt,
+  readingOrder,
+  sameLayout,
+  tierFor,
+  TIERS,
+  type Cell,
+  type Size,
+} from "@/lib/bento-layout";
+import { springs } from "@/lib/motion";
+import { prefersReducedMotion } from "@/lib/utils";
 import {
   isView,
   onBeforeViewChange,
@@ -25,8 +35,8 @@ import {
 export type BentoItem = {
   id: string;
   tags: View[];
-  /** Grid span classes, e.g. "col-span-2 row-span-2". */
-  className: string;
+  /** Columns × rows on phones, tablets, and desktops. */
+  size: readonly [Size, Size, Size];
   label: string;
   content: ReactNode;
   /** Skip the entrance animation (keep it off the LCP card). */
@@ -36,19 +46,52 @@ export type BentoItem = {
 type Drag = {
   id: string;
   el: HTMLElement;
+  touch: boolean;
   startX: number;
   startY: number;
+  /** Where the card was grabbed, relative to its top-left corner. */
   grabX: number;
   grabY: number;
+  /** Latest pointer position (client coordinates). */
   x: number;
   y: number;
   active: boolean;
-  lastSwap: number;
+  frame: number;
+  hold: number;
+  /** Layout tier and grid metrics, fixed for the life of the drag. */
+  tier: number;
+  cols: number;
+  /** The cell the card was last placed in. */
+  cell: { x: number; y: number } | null;
+  /** Reading order when the drag began: the others always re-pack in this order. */
+  base: string[];
 };
 
 // Pointer-downs on these never start a card drag.
 const INTERACTIVE =
   "a,button,input,textarea,select,label,canvas,[data-nodrag],[contenteditable=true]";
+/** Press and hold this long before a touch drag starts (quicker moves scroll). */
+const HOLD_MS = 380;
+/** Holding a card this close to the top or bottom of the viewport scrolls. */
+const EDGE = 72;
+/** The spotlight and rim light reach this far from the cursor. */
+const LIGHT_REACH = 280;
+
+/** A card's slot in the grid: layout only, untouched by transforms or animations. */
+const slotOf = (el: HTMLElement) => ({
+  left: el.offsetLeft,
+  top: el.offsetTop,
+  width: el.offsetWidth,
+  height: el.offsetHeight,
+});
+
+/** Keep the dragged card under the pointer, wherever its slot is now. */
+function glue(grid: HTMLElement, d: Drag) {
+  const g = grid.getBoundingClientRect();
+  const s = slotOf(d.el);
+
+  d.el.style.transform = `translate3d(${d.x - g.left - d.grabX - s.left}px, ${d.y - g.top - d.grabY - s.top}px, 0)`;
+}
 
 export function BentoGrid({ items }: { items: BentoItem[] }) {
   const view = useView();
@@ -63,16 +106,38 @@ export function BentoGrid({ items }: { items: BentoItem[] }) {
 
     return [...order.filter(hit), ...order.filter((id) => !hit(id))];
   }, [order, view, byId]);
+  // Layouts the visitor arranged by dragging, per view and tier.
+  const [custom, setCustom] = useState<Record<string, Cell[]>>({});
+  const [ghost, setGhost] = useState<Cell | null>(null);
+  const layouts = useMemo(
+    () =>
+      TIERS.map(
+        (t, i) =>
+          custom[`${view}:${i}`] ??
+          pack(display, (id) => byId.get(id)?.size[i] ?? [1, 1], t.cols),
+      ),
+    [custom, display, view, byId],
+  );
 
   const wrapRef = useRef<HTMLDivElement>(null);
+  const gridRef = useRef<HTMLUListElement>(null);
   const nodes = useRef(new Map<string, HTMLElement>());
   const before = useRef<Map<string, DOMRect> | null>(null);
   const drag = useRef<Drag | null>(null);
-  const displayRef = useRef(display);
-  const pointer = useRef({ x: 0, y: 0, frame: 0 });
+  const layoutsRef = useRef(layouts);
+  const byIdRef = useRef(byId);
+  const viewRef = useRef(view);
+  const pointer = useRef({
+    x: 0,
+    y: 0,
+    frame: 0,
+    lit: new Set<HTMLElement>(),
+  });
 
   useLayoutEffect(() => {
-    displayRef.current = display;
+    layoutsRef.current = layouts;
+    byIdRef.current = byId;
+    viewRef.current = view;
   });
 
   const snapshot = useCallback(() => {
@@ -105,26 +170,23 @@ export function BentoGrid({ items }: { items: BentoItem[] }) {
     return () => window.removeEventListener("hashchange", fromHash);
   }, []);
 
-  const glueDragged = (d: Drag) => {
-    d.el.style.transform = "none";
-    const home = d.el.getBoundingClientRect();
-
-    d.el.style.transform = `translate(${d.x - d.grabX - home.left}px, ${d.y - d.grabY - home.top}px)`;
-  };
-
+  // FLIP: every card that changed slots glides from where it was.
   useLayoutEffect(() => {
     const first = before.current;
 
     before.current = null;
     if (!first) return;
-    const s = spring(180, 22);
+    const s = springs.glide();
+    const still = prefersReducedMotion();
+    const d = drag.current?.active ? drag.current : null;
 
     nodes.current.forEach((el, id) => {
-      if (drag.current?.id === id) return;
+      if (d?.id === id) return;
       const a = first.get(id);
 
       if (!a) return;
       el.getAnimations().forEach((anim) => anim.id === "flip" && anim.cancel());
+      if (still) return;
       const b = el.getBoundingClientRect();
       const dx = a.left - b.left;
       const dy = a.top - b.top;
@@ -132,175 +194,280 @@ export function BentoGrid({ items }: { items: BentoItem[] }) {
       if (Math.abs(dx) < 1 && Math.abs(dy) < 1) return;
       const anim = el.animate(
         [{ translate: `${dx}px ${dy}px` }, { translate: "0px 0px" }],
-        {
-          duration: s.duration,
-          easing: s.easing,
-        },
+        { duration: s.duration, easing: s.easing },
       );
 
       anim.id = "flip";
     });
-    if (drag.current?.active) glueDragged(drag.current);
-  }, [display]);
+    if (d && gridRef.current) glue(gridRef.current, d);
+  }, [layouts]);
+
+  /* ---------- Drag to rearrange: mouse, pen, or long-press on touch ---------- */
+
+  useEffect(() => {
+    const grid = gridRef.current;
 
-  /* ---------- Drag to rearrange (mouse and pen) ---------- */
+    if (!grid) return;
 
-  const onMove = useCallback(
-    (e: PointerEvent) => {
+    const frame = () => {
+      const d = drag.current;
+
+      if (!d?.active) return;
+      d.frame = 0;
+      // Scroll while the card is held near the top or bottom of the viewport.
+      const near =
+        d.y < EDGE
+          ? d.y - EDGE
+          : d.y > innerHeight - EDGE
+            ? d.y - (innerHeight - EDGE)
+            : 0;
+
+      if (near) {
+        window.scrollBy(
+          0,
+          Math.sign(near) * Math.min(22, (near / EDGE) ** 2 * 22),
+        );
+      }
+      glue(grid, d);
+
+      // Snap the card's top-left corner to the nearest cell.
+      const layout = layoutsRef.current[d.tier];
+      const held = layout.find((c) => c.id === d.id);
+
+      if (held) {
+        const g = grid.getBoundingClientRect();
+        const gap = parseFloat(getComputedStyle(grid).columnGap) || 0;
+        const pitch = (g.width + gap) / d.cols;
+        const x = Math.min(
+          Math.max(Math.round((d.x - g.left - d.grabX) / pitch), 0),
+          d.cols - held.w,
+        );
+        const y = Math.max(Math.round((d.y - g.top - d.grabY) / pitch), 0);
+
+        if (!d.cell || d.cell.x !== x || d.cell.y !== y) {
+          d.cell = { x, y };
+          const next = placeAt(
+            d.base,
+            (id) => byIdRef.current.get(id)?.size[d.tier] ?? [1, 1],
+            d.cols,
+            d.id,
+            x,
+            y,
+          );
+
+          if (!sameLayout(next, layout)) {
+            const key = `${viewRef.current}:${d.tier}`;
+
+            before.current = snapshot();
+            setCustom((c) => ({ ...c, [key]: next }));
+            if (viewRef.current === "all") setOrder(readingOrder(next));
+          }
+          setGhost(next.find((c) => c.id === d.id) ?? null);
+        }
+      }
+      if (near) d.frame = requestAnimationFrame(frame);
+    };
+
+    const activate = (d: Drag) => {
+      d.active = true;
+      d.el.removeAttribute("data-pressed");
+      d.el.getAnimations().forEach((a) => a.cancel());
+      const r = d.el.getBoundingClientRect();
+
+      // Measure the grab point again now that any in-flight animation is gone.
+      d.grabX = Math.min(Math.max(d.startX - r.left, 0), r.width);
+      d.grabY = Math.min(Math.max(d.startY - r.top, 0), r.height);
+      d.base = readingOrder(layoutsRef.current[d.tier]);
+      d.el.setAttribute("data-dragging", "true");
+      wrapRef.current?.setAttribute("data-dragging", "true");
+      setGhost(layoutsRef.current[d.tier].find((c) => c.id === d.id) ?? null);
+      document.documentElement.style.userSelect = "none";
+      window.getSelection()?.removeAllRanges();
+      if (d.touch) navigator.vibrate?.(8);
+      glue(grid, d);
+    };
+
+    const onMove = (e: PointerEvent) => {
       const d = drag.current;
 
       if (!d) return;
       d.x = e.clientX;
       d.y = e.clientY;
       if (!d.active) {
-        if (Math.hypot(d.x - d.startX, d.y - d.startY) < 7) return;
-        d.active = true;
-        d.el.setAttribute("data-dragging", "true");
-        d.el.getAnimations().forEach((a) => a.cancel());
-        document.documentElement.style.userSelect = "none";
-        window.getSelection()?.removeAllRanges();
-      }
-      glueDragged(d);
-
-      const now = performance.now();
-
-      if (now - d.lastSwap < 240) return;
-      let target: string | null = null;
-
-      nodes.current.forEach((node, id) => {
-        if (target || id === d.id) return;
-        const r = node.getBoundingClientRect();
-        const ix = Math.min(r.width * 0.22, 60);
-        const iy = Math.min(r.height * 0.22, 60);
-
-        if (
-          d.x > r.left + ix &&
-          d.x < r.right - ix &&
-          d.y > r.top + iy &&
-          d.y < r.bottom - iy
-        ) {
-          target = id;
+        const moved = Math.hypot(d.x - d.startX, d.y - d.startY);
+
+        // On touch a quick move is a scroll; with a mouse a small one starts the drag.
+        if (d.touch) {
+          if (moved > 10) end();
+        } else if (moved > 6) {
+          activate(d);
         }
-      });
-      if (!target) return;
-      const to = target as string;
-
-      d.lastSwap = now;
-      before.current = snapshot();
-      setOrder(() => {
-        // The dragged card takes the target's slot; everything between shifts by one.
-        const current = displayRef.current;
-        const next = current.filter((x) => x !== d.id);
-
-        next.splice(current.indexOf(to), 0, d.id);
-
-        return next;
-      });
-    },
-    [snapshot],
-  );
 
-  const onUp = useCallback(() => {
-    const d = drag.current;
+        return;
+      }
+      if (!d.frame) d.frame = requestAnimationFrame(frame);
+    };
 
-    drag.current = null;
-    window.removeEventListener("pointermove", onMove);
-    if (!d?.active) return;
-    document.documentElement.style.userSelect = "";
-    const from = d.el.style.transform;
+    // Once a touch drag is live, the page must not scroll under the finger.
+    const blockScroll = (e: TouchEvent) => {
+      if (drag.current?.active) e.preventDefault();
+    };
+    const blockMenu = (e: Event) => {
+      if (drag.current?.touch) e.preventDefault();
+    };
 
-    d.el.style.transform = "";
-    d.el.removeAttribute("data-dragging");
-    const s = spring(240, 22);
+    const end = () => {
+      const d = drag.current;
 
-    d.el.animate([{ transform: from }, { transform: "none" }], {
-      duration: s.duration,
-      easing: s.easing,
-    });
-    // Swallow the click that follows the drag.
-    const stop = (ev: MouseEvent) => {
-      ev.stopPropagation();
-      ev.preventDefault();
+      drag.current = null;
+      window.removeEventListener("pointermove", onMove);
+      window.removeEventListener("pointerup", end);
+      window.removeEventListener("pointercancel", end);
+      window.removeEventListener("touchmove", blockScroll);
+      window.removeEventListener("contextmenu", blockMenu);
+      if (!d) return;
+      window.clearTimeout(d.hold);
+      cancelAnimationFrame(d.frame);
+      d.el.removeAttribute("data-pressed");
+      if (!d.active) return;
+      document.documentElement.style.userSelect = "";
+      wrapRef.current?.removeAttribute("data-dragging");
+      setGhost(null);
+      const from = d.el.style.transform;
+
+      d.el.style.transform = "";
+      d.el.removeAttribute("data-dragging");
+      if (!prefersReducedMotion()) {
+        const s = springs.glide();
+
+        d.el.animate([{ transform: from }, { transform: "none" }], {
+          duration: s.duration,
+          easing: s.easing,
+        });
+      }
+      // Swallow the click that follows a drag.
+      const stop = (ev: MouseEvent) => {
+        ev.stopPropagation();
+        ev.preventDefault();
+      };
+
+      window.addEventListener("click", stop, { capture: true, once: true });
+      window.setTimeout(
+        () => window.removeEventListener("click", stop, { capture: true }),
+        0,
+      );
     };
 
-    window.addEventListener("click", stop, { capture: true, once: true });
-    window.setTimeout(
-      () => window.removeEventListener("click", stop, { capture: true }),
-      0,
-    );
-  }, [onMove]);
-
-  const startDrag = (id: string) => (e: ReactPointerEvent<HTMLElement>) => {
-    if (e.pointerType === "touch" || e.button !== 0) return;
-    if ((e.target as Element).closest(INTERACTIVE)) return;
-    const el = nodes.current.get(id);
-
-    if (!el) return;
-    const r = el.getBoundingClientRect();
-
-    drag.current = {
-      id,
-      el,
-      startX: e.clientX,
-      startY: e.clientY,
-      grabX: e.clientX - r.left,
-      grabY: e.clientY - r.top,
-      x: e.clientX,
-      y: e.clientY,
-      active: false,
-      lastSwap: 0,
+    const onDown = (e: PointerEvent) => {
+      if (drag.current || !e.isPrimary) return;
+      if (e.pointerType === "mouse" && e.button !== 0) return;
+      const target = e.target as Element;
+
+      if (target.closest(INTERACTIVE)) return;
+      const el = target.closest<HTMLElement>("[data-card]");
+
+      if (!el || !grid.contains(el)) return;
+      const r = el.getBoundingClientRect();
+      const d: Drag = {
+        id: el.dataset.card!,
+        el,
+        touch: e.pointerType === "touch",
+        startX: e.clientX,
+        startY: e.clientY,
+        grabX: e.clientX - r.left,
+        grabY: e.clientY - r.top,
+        x: e.clientX,
+        y: e.clientY,
+        active: false,
+        frame: 0,
+        hold: 0,
+        tier: tierFor(window.innerWidth),
+        cols: 0,
+        cell: null,
+        base: [],
+      };
+
+      d.cols = TIERS[d.tier].cols;
+
+      drag.current = d;
+      el.setAttribute("data-pressed", "");
+      window.addEventListener("pointermove", onMove, { passive: true });
+      window.addEventListener("pointerup", end);
+      window.addEventListener("pointercancel", end);
+      if (d.touch) {
+        window.addEventListener("touchmove", blockScroll, { passive: false });
+        window.addEventListener("contextmenu", blockMenu);
+        d.hold = window.setTimeout(() => {
+          if (drag.current === d) activate(d);
+        }, HOLD_MS);
+      }
     };
-    window.addEventListener("pointermove", onMove);
-    window.addEventListener("pointerup", onUp, { once: true });
-    window.addEventListener("pointercancel", onUp, { once: true });
-  };
 
-  useEffect(
-    () => () => {
-      window.removeEventListener("pointermove", onMove);
-      window.removeEventListener("pointerup", onUp);
-    },
-    [onMove, onUp],
-  );
+    grid.addEventListener("pointerdown", onDown);
 
-  /* ---------- Spotlight + tilt: one listener for the whole grid ---------- */
+    return () => {
+      grid.removeEventListener("pointerdown", onDown);
+      end();
+    };
+  }, [snapshot]);
+
+  /* ---------- Spotlight + tilt: one listener, only the cards near the cursor ---------- */
 
   const paintSpot = () => {
-    pointer.current.frame = 0;
-    const { x, y } = pointer.current;
-    const entries: [HTMLElement, DOMRect][] = [];
-
-    nodes.current.forEach((el) =>
-      entries.push([el, el.getBoundingClientRect()]),
-    );
-    for (const [el, r] of entries) {
-      el.style.setProperty("--mx", `${(x - r.left).toFixed(0)}px`);
-      el.style.setProperty("--my", `${(y - r.top).toFixed(0)}px`);
-      const inside = x >= r.left && x <= r.right && y >= r.top && y <= r.bottom;
+    const p = pointer.current;
+
+    p.frame = 0;
+    if (drag.current?.active) return;
+    const lit = new Set<HTMLElement>();
+
+    nodes.current.forEach((el) => {
+      const r = el.getBoundingClientRect();
+      const dx = Math.max(r.left - p.x, 0, p.x - r.right);
+      const dy = Math.max(r.top - p.y, 0, p.y - r.bottom);
+
+      if (Math.hypot(dx, dy) > LIGHT_REACH) return;
+      lit.add(el);
+      el.style.setProperty("--mx", `${(p.x - r.left).toFixed(0)}px`);
+      el.style.setProperty("--my", `${(p.y - r.top).toFixed(0)}px`);
+      const inside = dx === 0 && dy === 0;
 
       el.style.setProperty(
         "--tx",
-        inside ? (((x - r.left) / r.width) * 2 - 1).toFixed(3) : "0",
+        inside ? (((p.x - r.left) / r.width) * 2 - 1).toFixed(3) : "0",
       );
       el.style.setProperty(
         "--ty",
-        inside ? (((y - r.top) / r.height) * 2 - 1).toFixed(3) : "0",
+        inside ? (((p.y - r.top) / r.height) * 2 - 1).toFixed(3) : "0",
       );
-    }
+    });
+    // Cards the light just left go dark once, instead of repainting every frame.
+    p.lit.forEach((el) => {
+      if (lit.has(el)) return;
+      el.style.setProperty("--mx", "-999px");
+      el.style.setProperty("--my", "-999px");
+      el.style.setProperty("--tx", "0");
+      el.style.setProperty("--ty", "0");
+    });
+    p.lit = lit;
   };
 
   const onGridMove = (e: ReactPointerEvent) => {
     if (e.pointerType === "touch") return;
-    pointer.current.x = e.clientX;
-    pointer.current.y = e.clientY;
+    const p = pointer.current;
+
+    p.x = e.clientX;
+    p.y = e.clientY;
     wrapRef.current?.style.setProperty("--spot", "1");
-    if (!pointer.current.frame)
-      pointer.current.frame = requestAnimationFrame(paintSpot);
+    if (!p.frame) p.frame = requestAnimationFrame(paintSpot);
   };
 
   const onGridLeave = () => {
+    const p = pointer.current;
+
+    cancelAnimationFrame(p.frame);
+    p.frame = 0;
     wrapRef.current?.style.setProperty("--spot", "0");
-    nodes.current.forEach((el) => {
+    p.lit.forEach((el) => {
       el.style.setProperty("--tx", "0");
       el.style.setProperty("--ty", "0");
     });
@@ -313,12 +480,25 @@ export function BentoGrid({ items }: { items: BentoItem[] }) {
       onPointerLeave={onGridLeave}
       onPointerMove={onGridMove}
     >
-      <ul className="bento">
-        {display.map((id) => {
+      <ul ref={gridRef} className="bento">
+        {/* DOM order never changes (moving nodes would restart their animations
+            and reload iframes); each card's cell comes from the layout. */}
+        {items.map(({ id }) => {
           const item = byId.get(id);
 
           if (!item) return null;
           const dim = view !== "all" && !item.tags.includes(view);
+          const place: Record<string, number> = { "--i": item.n };
+
+          layouts.forEach((layout, t) => {
+            const c = layout.find((cell) => cell.id === id);
+
+            if (!c) return;
+            place[`--c${t}`] = c.x + 1;
+            place[`--r${t}`] = c.y + 1;
+            place[`--w${t}`] = c.w;
+            place[`--h${t}`] = c.h;
+          });
 
           return (
             <li
@@ -332,19 +512,28 @@ export function BentoGrid({ items }: { items: BentoItem[] }) {
                 };
               }}
               aria-label={item.label}
-              className={cn("card", item.className)}
+              className="card"
               data-card={id}
               data-dim={dim ? "true" : undefined}
               data-enter={item.still ? undefined : ""}
               id={`card-${id}`}
-              style={{ "--i": item.n } as CSSProperties}
-              onPointerDown={startDrag(id)}
+              style={place as CSSProperties}
             >
-              {item.content}
+              <div className="card-body">{item.content}</div>
               <span aria-hidden className="card-rim" />
             </li>
           );
         })}
+        {ghost && (
+          <li
+            aria-hidden
+            className="bento-ghost"
+            style={{
+              gridColumn: `${ghost.x + 1} / span ${ghost.w}`,
+              gridRow: `${ghost.y + 1} / span ${ghost.h}`,
+            }}
+          />
+        )}
       </ul>
     </div>
   );

+ 1 - 1
components/blog/blog-list.tsx

@@ -21,7 +21,7 @@ export function BlogList({ blogPosts }: { blogPosts: Post[] }) {
     <div className="pb-6">
       <header className="mb-8 flex flex-col items-start gap-3 pt-2 sm:mb-10">
         <Eyebrow>Writing · {blogPosts.length} posts</Eyebrow>
-        <h1 className="text-[clamp(2.2rem,5vw,3.4rem)] leading-[1] font-semibold tracking-[-0.04em]">
+        <h1 className="font-display text-[clamp(2.3rem,5.2vw,3.6rem)] leading-[1.02] font-semibold tracking-[-0.02em]">
           Notes from the trail &amp; the terminal.
         </h1>
         <p className="max-w-[56ch] text-[15px] text-ink-2">

+ 1 - 1
components/blog/notion-page.tsx

@@ -127,7 +127,7 @@ export const NotionPage = ({
             })}
           </time>
         )}
-        <h1 className="mt-3 text-[clamp(2rem,4.6vw,3rem)] leading-[1.05] font-semibold tracking-[-0.035em] text-balance">
+        <h1 className="mt-3 font-display text-[clamp(2.1rem,4.8vw,3.2rem)] leading-[1.06] font-semibold tracking-[-0.018em] text-balance">
           {title}
         </h1>
       </header>

+ 4 - 2
components/cards/globe.tsx

@@ -193,12 +193,14 @@ export function GlobeCard() {
   return (
     <div className="relative h-full overflow-hidden">
       <div className="absolute top-4 left-5 z-10 leading-tight sm:top-5">
-        <p className="text-[15px] font-semibold">Purdue → UCLA → Seattle</p>
+        <p className="font-display text-[15px] leading-snug font-semibold tracking-[-0.005em] sm:text-[17px]">
+          Purdue → UCLA → Seattle
+        </p>
         <p className="text-[12px] text-muted max-sm:hidden">Drag to spin</p>
       </div>
       <div
         ref={wrapRef}
-        className="absolute inset-x-[-14%] top-[24%] aspect-square sm:top-[12%]"
+        className="absolute inset-x-[-14%] top-[30%] aspect-square sm:top-[12%]"
       >
         <canvas
           ref={canvasRef}

+ 23 - 14
components/cards/hero-title.tsx

@@ -9,7 +9,9 @@ import { cn, prefersReducedMotion } from "@/lib/utils";
 const LEAD = "Hey, I'm ";
 const NAME = "Eric";
 const TEXT = `${LEAD}${NAME}.`;
-const BASE_WEIGHT = 700;
+const BASE_WEIGHT = 640;
+/** At rest the letters are fully soft; the wave sharpens what it passes and melts what it touches. */
+const REST = { fontWeight: BASE_WEIGHT, fontVariationSettings: "'SOFT' 100" };
 const FILTER_ID = "hero-droplet-lens";
 /** Matches the wrapper's px-1/py-1, so the clone inside the lens lines up with the title. */
 const PAD = 4;
@@ -19,7 +21,7 @@ const letter = (ch: string, i: number) => (
     key={i}
     className={cn("inline-block", ch === " " && "w-[0.24em]")}
     data-wave={i}
-    style={{ fontWeight: BASE_WEIGHT }}
+    style={REST}
   >
     {ch === " " ? " " : ch}
   </span>
@@ -30,7 +32,7 @@ function Title({ clone }: { clone?: boolean }) {
     <h1
       aria-hidden={clone || undefined}
       aria-label={clone ? undefined : TEXT}
-      className="text-[clamp(2.7rem,6.6vw,5rem)] leading-[1.03] tracking-[-0.04em] whitespace-nowrap"
+      className="font-display text-[clamp(2.8rem,6.8vw,5.2rem)] leading-[1.02] tracking-[-0.022em] whitespace-nowrap"
     >
       <span aria-hidden>
         {LEAD.split("").map(letter)}
@@ -41,7 +43,7 @@ function Title({ clone }: { clone?: boolean }) {
           className="inline-block"
           data-period={clone ? undefined : ""}
           data-wave={TEXT.length - 1}
-          style={{ fontWeight: BASE_WEIGHT }}
+          style={REST}
         >
           .
           {!clone && (
@@ -57,7 +59,7 @@ function Title({ clone }: { clone?: boolean }) {
 }
 
 /**
- * The headline. Letters swell under the cursor (variable font weight), and the
+ * The headline. Letters melt under the cursor (Fraunces' weight and SOFT axes), and the
  * period is a bead of liquid glass: pull it and it swells into a lens that
  * magnifies whatever it passes over, stretching with speed; let go and it
  * springs home and shrinks back into a period. The lens refracts a
@@ -89,7 +91,8 @@ export function HeroTitle() {
     ].filter((el) => !el.closest("[data-clone]"));
     let frame = 0;
 
-    const setWeights = (fx: (center: number) => number) => {
+    /** `fx` gives each letter's closeness to the wave (0 to 1), or null for rest. */
+    const setWeights = (fx: (center: number) => number | null) => {
       const centers = originals.map((el) => {
         const r = el.getBoundingClientRect();
 
@@ -97,17 +100,23 @@ export function HeroTitle() {
       });
 
       originals.forEach((el, i) => {
-        const w = String(Math.round(fx(centers[i])));
-
-        groups
-          .get(el.dataset.wave!)
-          ?.forEach((node) => (node.style.fontWeight = w));
+        const g = fx(centers[i]);
+        const weight = g === null ? REST.fontWeight : Math.round(500 + 400 * g);
+        const soft =
+          g === null
+            ? REST.fontVariationSettings
+            : `'SOFT' ${Math.round(20 + 80 * g)}`;
+
+        groups.get(el.dataset.wave!)?.forEach((node) => {
+          node.style.fontWeight = String(weight);
+          node.style.fontVariationSettings = soft;
+        });
       });
       // Heavier letters are wider: keep the bead on the period as it moves.
       relayout.current();
     };
     const near = (x: number) => (c: number) =>
-      560 + 320 * Math.exp(-((c - x) ** 2) / (2 * 60 ** 2));
+      Math.exp(-((c - x) ** 2) / (2 * 64 ** 2));
 
     const onMove = (e: PointerEvent) => {
       if (e.pointerType === "touch") return;
@@ -118,7 +127,7 @@ export function HeroTitle() {
     };
     const onLeave = () => {
       cancelAnimationFrame(frame);
-      frame = requestAnimationFrame(() => setWeights(() => BASE_WEIGHT));
+      frame = requestAnimationFrame(() => setWeights(() => null));
     };
 
     // One sweep on load so touch visitors see it too.
@@ -131,7 +140,7 @@ export function HeroTitle() {
         const r = wrap.getBoundingClientRect();
 
         if (t >= 1) {
-          setWeights(() => BASE_WEIGHT);
+          setWeights(() => null);
 
           return;
         }

+ 1 - 1
components/cards/mini-card.tsx

@@ -32,7 +32,7 @@ export function MiniCard() {
 
   return (
     <div className="relative h-full">
-      <p className="absolute top-4 left-5 z-10 text-[15px] font-semibold sm:top-5">
+      <p className="absolute top-4 left-5 z-10 font-display text-[17px] font-semibold tracking-[-0.005em] sm:top-5">
         My Mini
       </p>
       {show3D ? (

+ 118 - 71
components/cards/photo-deck.tsx

@@ -2,71 +2,113 @@
 
 import Image from "next/image";
 import {
+  useLayoutEffect,
   useRef,
   useState,
   type PointerEvent as ReactPointerEvent,
 } from "react";
 
-import { spring } from "@/lib/motion";
-import { cn } from "@/lib/utils";
+import { springs } from "@/lib/motion";
+import { cn, prefersReducedMotion } from "@/lib/utils";
 
 const DEPTH = 4;
 
 const tilt = (n: number) => (((n * 9301 + 49297) % 233280) / 233280 - 0.5) * 9;
 
-/** A deck of photos: hover to fan, fling the top one away, or step through. */
+type Gesture = {
+  x: number;
+  y: number;
+  dx: number;
+  dy: number;
+  t: number;
+  v: number;
+};
+
+/**
+ * A deck of photos: hover to fan it, fling the top photo away (or tap it),
+ * or step through with the buttons. Gestures move the whole card.
+ */
 export function PhotoDeck({ photos }: { photos: string[] }) {
   const [order, setOrder] = useState(() => photos.map((_, i) => i));
   const [seen, setSeen] = useState(0);
   const [fanned, setFanned] = useState(false);
   const topRef = useRef<HTMLDivElement>(null);
-  const drag = useRef<{
-    x: number;
-    y: number;
-    dx: number;
-    dy: number;
-    t: number;
-    v: number;
-  } | null>(null);
+  const gesture = useRef<Gesture | null>(null);
   const busy = useRef(false);
+  /** Set when the next render should slide a photo back onto the top. */
+  const returning = useRef(false);
+
+  // A photo stepped back onto the deck glides in from the left.
+  useLayoutEffect(() => {
+    const el = topRef.current;
+
+    if (!returning.current || !el) return;
+    returning.current = false;
+    if (prefersReducedMotion()) return;
+    const s = springs.glide();
 
-  const cycle = (dir: 1 | -1) =>
-    setOrder((o) =>
-      dir === 1 ? [...o.slice(1), o[0]] : [o[o.length - 1], ...o.slice(0, -1)],
+    el.animate(
+      [
+        { transform: "translate(-70%, -6%) rotate(-14deg)", opacity: 0 },
+        { transform: "none", opacity: 1 },
+      ],
+      { duration: s.duration, easing: s.easing },
     );
+  }, [order]);
 
+  const next = () => {
+    setOrder((o) => [...o.slice(1), o[0]]);
+    setSeen((s) => s + 1);
+  };
+
+  const previous = () => {
+    if (busy.current) return;
+    returning.current = true;
+    setOrder((o) => [o[o.length - 1], ...o.slice(0, -1)]);
+    setSeen((s) => (s - 1 + photos.length) % photos.length);
+  };
+
+  /** Throw the top photo off the deck, then bring the next one up. */
   const flyOut = (dx: number, dy: number) => {
     const el = topRef.current;
 
     if (!el || busy.current) return;
+    if (prefersReducedMotion()) {
+      el.style.transform = "";
+      next();
+
+      return;
+    }
     busy.current = true;
     const len = Math.hypot(dx, dy) || 1;
-    const tx = (dx / len) * 520;
-    const ty = (dy / len) * 520;
     const anim = el.animate(
       [
         { transform: el.style.transform || "none", opacity: 1 },
         {
-          transform: `translate(${tx}px, ${ty}px) rotate(${dx > 0 ? 24 : -24}deg)`,
+          transform: `translate(${(dx / len) * 560}px, ${(dy / len) * 560}px) rotate(${dx > 0 ? 26 : -26}deg)`,
           opacity: 0,
         },
       ],
-      { duration: 380, easing: "cubic-bezier(.4,0,.8,.4)", fill: "forwards" },
+      {
+        duration: 360,
+        easing: "cubic-bezier(.45,0,.85,.4)",
+        fill: "forwards",
+      },
     );
 
     anim.onfinish = () => {
+      // The thrown card leaves the visible deck with the reorder and unmounts,
+      // so its end state holds until then: no flash back on top.
       el.style.transform = "";
-      anim.cancel();
-      cycle(1);
-      setSeen((s) => s + 1);
+      next();
       busy.current = false;
     };
   };
 
   const onDown = (e: ReactPointerEvent<HTMLDivElement>) => {
-    if (busy.current) return;
+    if (busy.current || (e.pointerType === "mouse" && e.button !== 0)) return;
     e.currentTarget.setPointerCapture(e.pointerId);
-    drag.current = {
+    gesture.current = {
       x: e.clientX,
       y: e.clientY,
       dx: 0,
@@ -75,46 +117,59 @@ export function PhotoDeck({ photos }: { photos: string[] }) {
       v: 0,
     };
   };
+
   const onMove = (e: ReactPointerEvent<HTMLDivElement>) => {
-    const d = drag.current;
-
-    if (!d || !topRef.current) return;
-    const now = e.timeStamp;
-    const ndx = e.clientX - d.x;
-    const ndy = e.clientY - d.y;
-
-    d.v = Math.hypot(ndx - d.dx, ndy - d.dy) / Math.max(1, now - d.t);
-    d.dx = ndx;
-    d.dy = ndy;
-    d.t = now;
-    topRef.current.style.transform = `translate(${ndx}px, ${ndy}px) rotate(${ndx * 0.06}deg)`;
+    const g = gesture.current;
+    const el = topRef.current;
+
+    if (!g || !el) return;
+    const dx = e.clientX - g.x;
+    const dy = e.clientY - g.y;
+
+    g.v = Math.hypot(dx - g.dx, dy - g.dy) / Math.max(1, e.timeStamp - g.t);
+    g.dx = dx;
+    g.dy = dy;
+    g.t = e.timeStamp;
+    el.style.transform = `translate(${dx}px, ${dy}px) rotate(${dx * 0.05}deg)`;
   };
+
   const onUp = () => {
-    const d = drag.current;
+    const g = gesture.current;
     const el = topRef.current;
 
-    drag.current = null;
-    if (!d || !el) return;
-    if (Math.hypot(d.dx, d.dy) > 90 || d.v > 0.8) {
-      flyOut(d.dx || 1, d.dy);
+    gesture.current = null;
+    if (!g || !el) return;
+    const dist = Math.hypot(g.dx, g.dy);
+
+    if (dist > 90 || g.v > 0.8) {
+      flyOut(g.dx || 1, g.dy);
 
       return;
     }
-    if (Math.hypot(d.dx, d.dy) < 4) {
+    if (dist < 4) {
       flyOut(-1, -0.35);
 
       return;
     }
+    // Not far enough: settle back onto the deck.
     const from = el.style.transform;
-    const s = spring(260, 18);
 
     el.style.transform = "";
+    if (prefersReducedMotion()) return;
+    const s = springs.wobble();
+
     el.animate([{ transform: from }, { transform: "none" }], {
       duration: s.duration,
       easing: s.easing,
     });
   };
 
+  // The browser took the gesture (e.g. a vertical scroll): put the photo back.
+  const onCancel = () => {
+    gesture.current = null;
+    if (topRef.current) topRef.current.style.transform = "";
+  };
+
   if (!photos.length) return null;
   const current = (seen % photos.length) + 1;
 
@@ -125,7 +180,9 @@ export function PhotoDeck({ photos }: { photos: string[] }) {
       onPointerLeave={() => setFanned(false)}
     >
       <div className="absolute inset-x-0 top-0 z-20 flex items-center justify-between p-5">
-        <p className="text-[15px] font-semibold">Field notes</p>
+        <p className="font-display text-[17px] font-semibold tracking-[-0.005em]">
+          Field notes
+        </p>
         <span className="text-[13px] text-muted tabular-nums">
           {current} of {photos.length}
         </span>
@@ -146,12 +203,14 @@ export function PhotoDeck({ photos }: { photos: string[] }) {
             return (
               <div
                 key={photo}
+                ref={top ? topRef : undefined}
                 className={cn(
-                  "col-start-1 row-start-1 w-[80%] max-w-[500px] overflow-hidden rounded-2xl bg-card-2 shadow-[0_18px_40px_-18px_rgb(0_0_0/0.55)] ring-1 ring-black/5 transition-[translate,rotate,scale] duration-500 ease-[cubic-bezier(.3,1.3,.5,1)] select-none",
+                  "relative col-start-1 row-start-1 aspect-video w-[80%] max-w-[500px] overflow-hidden rounded-2xl bg-card-2 shadow-[0_18px_40px_-18px_rgb(0_0_0/0.55)] ring-1 ring-black/5 select-none [transition:translate_var(--dur-glide)_var(--ease-glide),rotate_var(--dur-glide)_var(--ease-glide),scale_var(--dur-glide)_var(--ease-glide),opacity_.5s_ease] starting:opacity-0",
                   top
-                    ? "cursor-grab touch-none active:cursor-grabbing"
+                    ? "cursor-grab touch-pan-y active:cursor-grabbing"
                     : "pointer-events-none",
                 )}
+                data-cursor={top ? "Fling or tap" : undefined}
                 style={{
                   zIndex: 10 - i,
                   translate: fanned
@@ -160,25 +219,19 @@ export function PhotoDeck({ photos }: { photos: string[] }) {
                   rotate: `${spread}deg`,
                   scale: String(1 - i * 0.035),
                 }}
+                onPointerCancel={top ? onCancel : undefined}
+                onPointerDown={top ? onDown : undefined}
+                onPointerMove={top ? onMove : undefined}
+                onPointerUp={top ? onUp : undefined}
               >
-                <div
-                  ref={top ? topRef : undefined}
-                  className="relative aspect-video w-full"
-                  data-cursor={top ? "Fling or tap" : undefined}
-                  onPointerCancel={top ? onUp : undefined}
-                  onPointerDown={top ? onDown : undefined}
-                  onPointerMove={top ? onMove : undefined}
-                  onPointerUp={top ? onUp : undefined}
-                >
-                  <Image
-                    fill
-                    alt="A photo from Eric's camera roll"
-                    className="pointer-events-none object-cover"
-                    draggable={false}
-                    sizes="(max-width: 640px) 80vw, 480px"
-                    src={photos[photo]}
-                  />
-                </div>
+                <Image
+                  fill
+                  alt="A photo from Eric's camera roll"
+                  className="pointer-events-none object-cover"
+                  draggable={false}
+                  sizes="(max-width: 640px) 80vw, 480px"
+                  src={photos[photo]}
+                />
               </div>
             );
           })}
@@ -189,15 +242,9 @@ export function PhotoDeck({ photos }: { photos: string[] }) {
           <button
             key={dir}
             aria-label={dir === 1 ? "Next photo" : "Previous photo"}
-            className="lg grid size-9 place-items-center rounded-full transition-[scale] hover:scale-105 active:scale-95"
+            className="lg grid size-9 place-items-center rounded-full"
             type="button"
-            onClick={() => {
-              if (dir === 1) flyOut(-1, -0.35);
-              else {
-                cycle(-1);
-                setSeen((s) => (s - 1 + photos.length) % photos.length);
-              }
-            }}
+            onClick={() => (dir === 1 ? flyOut(-1, -0.35) : previous())}
           >
             <span className="lg-caustic" />
             <svg

+ 7 - 10
components/cards/project.tsx

@@ -1,4 +1,4 @@
-import Image from "next/image";
+import Image, { type StaticImageData } from "next/image";
 
 import { ArrowUpRight } from "./ui";
 
@@ -51,19 +51,15 @@ export function ProjectCard({
 }: {
   project: Project;
   look: keyof typeof LOOKS;
-  image: string;
-  width: number;
-  height: number;
+  /** A local import (sized automatically) or a remote URL with its size. */
+  image: string | StaticImageData;
+  width?: number;
+  height?: number;
 }) {
   const l = LOOKS[look];
 
   return (
-    <div
-      className={cn(
-        "group relative h-full w-full overflow-hidden dark:bg-card",
-        l.bg,
-      )}
-    >
+    <div className={cn("group relative h-full w-full overflow-hidden", l.bg)}>
       <div
         className={cn("absolute rounded-full bg-blush dark:hidden", l.blob)}
       />
@@ -81,6 +77,7 @@ export function ProjectCard({
             l.img,
           )}
           height={height}
+          placeholder={typeof image === "string" ? "empty" : "blur"}
           quality={65}
           sizes={l.sizes}
           src={image}

+ 1 - 1
components/cards/sky.tsx

@@ -263,7 +263,7 @@ function Moon({
 }
 
 const DIGITS =
-  "text-[44px] font-bold tracking-[-0.045em] tabular-nums sm:text-[56px]";
+  "font-display text-[46px] font-semibold tracking-[-0.025em] tabular-nums sm:text-[58px]";
 
 /**
  * Clock digits made of glass, like the iOS 26 Lock Screen: a clear body that

+ 59 - 40
components/cards/tech-sphere.tsx

@@ -2,19 +2,12 @@
 
 import { useEffect, useRef, useState, type CSSProperties } from "react";
 import {
-  siCss,
-  siCypress,
   siDocker,
-  siExpress,
   siFigma,
   siFirebase,
   siGit,
   siGithub,
-  siGitlab,
-  siHtml5,
   siJavascript,
-  siJest,
-  siJira,
   siNextdotjs,
   siNodedotjs,
   siOpenjdk,
@@ -23,39 +16,34 @@ import {
   siPython,
   siReact,
   siTailwindcss,
-  siTestinglibrary,
   siThreedotjs,
   siTypescript,
   siVercel,
+  siVitest,
 } from "simple-icons";
 
+// Most-used first: phones show the first 12.
 const ICONS = [
   siTypescript,
   siReact,
   siNextdotjs,
   siPython,
-  siOpenjdk,
-  siJavascript,
   siNodedotjs,
-  siPostgresql,
   siDocker,
+  siPostgresql,
   siTailwindcss,
+  siOpenjdk,
+  siGithub,
+  siFigma,
+  siVercel,
+  siJavascript,
   siFirebase,
   siPrisma,
   siGit,
-  siGithub,
-  siExpress,
-  siVercel,
-  siJest,
-  siCypress,
-  siTestinglibrary,
-  siHtml5,
-  siCss,
-  siFigma,
-  siJira,
-  siGitlab,
   siThreedotjs,
+  siVitest,
 ];
+const PHONE_COUNT = 12;
 
 function luminance(hex: string) {
   const c = [0, 2, 4].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255);
@@ -77,14 +65,15 @@ const STYLED = ICONS.map((icon) => {
   };
 });
 
-// Even spread over a sphere (Fibonacci lattice).
-const POINTS = STYLED.map((_, i) => {
-  const y = 1 - (i / (STYLED.length - 1)) * 2;
-  const r = Math.sqrt(1 - y * y);
-  const a = i * Math.PI * (3 - Math.sqrt(5));
+/** An even spread of `n` points over a sphere (Fibonacci lattice). */
+const lattice = (n: number) =>
+  Array.from({ length: n }, (_, i) => {
+    const y = 1 - (i / (n - 1)) * 2;
+    const r = Math.sqrt(1 - y * y);
+    const a = i * Math.PI * (3 - Math.sqrt(5));
 
-  return [Math.cos(a) * r, y, Math.sin(a) * r] as const;
-});
+    return [Math.cos(a) * r, y, Math.sin(a) * r] as const;
+  });
 
 /** The toolbox as a sphere of brand marks: drag to spin, hover to read. */
 export function TechSphere() {
@@ -106,16 +95,35 @@ export function TechSphere() {
     let dragging = false;
     let lastX = 0;
     let lastY = 0;
+    let count = ICONS.length;
+    let points = lattice(count);
+
+    // Thin the sphere out on small tiles so the marks never crowd.
+    const fit = () => {
+      const next = stage.clientWidth < 200 ? PHONE_COUNT : ICONS.length;
+
+      if (next !== count) {
+        count = next;
+        points = lattice(count);
+      }
+      items.current.forEach((el, i) => {
+        if (el) el.style.display = i < count ? "" : "none";
+      });
+    };
 
     const render = () => {
-      // Fit the sphere (and its nearest, largest chips) inside the stage.
-      const radius = Math.min(stage.clientWidth, stage.clientHeight) * 0.34;
+      const chip = stage.clientWidth < 200 ? 26 : 34;
+      // Size the sphere to the space it has, leaving room for the nearest chips.
+      const radius = Math.max(
+        24,
+        Math.min(stage.clientWidth, stage.clientHeight) / 2 - chip * 0.62,
+      );
       const cx = Math.cos(rx);
       const sx = Math.sin(rx);
       const cy = Math.cos(ry);
       const sy = Math.sin(ry);
 
-      POINTS.forEach(([x, y, z], i) => {
+      points.forEach(([x, y, z], i) => {
         const el = items.current[i];
 
         if (!el) return;
@@ -126,10 +134,9 @@ export function TechSphere() {
         const z2 = y * sx + z1 * cx;
         const depth = (z2 + 1) / 2;
 
-        el.style.transform = `translate3d(${(x1 * radius).toFixed(1)}px, ${(y2 * radius).toFixed(1)}px, 0) scale(${(0.6 + depth * 0.55).toFixed(3)})`;
-        el.style.opacity = (0.5 + depth * 0.5).toFixed(2);
+        el.style.transform = `translate3d(${(x1 * radius).toFixed(1)}px, ${(y2 * radius).toFixed(1)}px, 0) scale(${(0.62 + depth * 0.5).toFixed(3)})`;
+        el.style.opacity = (0.45 + depth * 0.55).toFixed(2);
         el.style.zIndex = String(Math.round(depth * 100));
-        el.style.filter = depth < 0.3 ? "blur(0.6px)" : "";
       });
     };
     const loop = () => {
@@ -148,13 +155,19 @@ export function TechSphere() {
       if (!frame) frame = requestAnimationFrame(loop);
     };
 
+    fit();
     render();
     const io = new IntersectionObserver(([e]) => {
       visible = e.isIntersecting;
       if (visible) start();
     });
+    const ro = new ResizeObserver(() => {
+      fit();
+      render();
+    });
 
     io.observe(stage);
+    ro.observe(stage);
 
     const onDown = (e: PointerEvent) => {
       dragging = true;
@@ -188,6 +201,7 @@ export function TechSphere() {
     return () => {
       cancelAnimationFrame(frame);
       io.disconnect();
+      ro.disconnect();
       stage.removeEventListener("pointerdown", onDown);
       stage.removeEventListener("pointermove", onMove);
       stage.removeEventListener("pointerup", onUp);
@@ -197,10 +211,12 @@ export function TechSphere() {
 
   return (
     <div className="relative flex h-full flex-col p-4 sm:p-5">
-      <p className="text-[15px] font-semibold">Toolbox</p>
+      <p className="font-display text-[17px] font-semibold tracking-[-0.005em]">
+        Toolbox
+      </p>
       <div
         ref={stageRef}
-        className="relative my-2 min-h-0 flex-1 cursor-grab touch-none select-none active:cursor-grabbing"
+        className="relative my-1 min-h-0 flex-1 cursor-grab touch-none select-none active:cursor-grabbing"
         data-nodrag
       >
         {STYLED.map((icon, i) => (
@@ -209,7 +225,7 @@ export function TechSphere() {
             ref={(el) => {
               items.current[i] = el;
             }}
-            className="absolute top-1/2 left-1/2 -mt-[14px] -ml-[14px] grid size-7 place-items-center rounded-[9px] bg-card text-[var(--c)] shadow-[0_2px_8px_-2px_rgb(0_0_0/0.18)] ring-1 ring-line will-change-transform sm:-mt-[18px] sm:-ml-[18px] sm:size-9 sm:rounded-[11px] dark:bg-card-2 dark:text-[var(--cd)]"
+            className="absolute top-1/2 left-1/2 -mt-[13px] -ml-[13px] grid size-[26px] place-items-center rounded-[8px] bg-card text-[var(--c)] shadow-[0_2px_8px_-2px_rgb(0_0_0/0.18)] ring-1 ring-line will-change-transform sm:-mt-[17px] sm:-ml-[17px] sm:size-[34px] sm:rounded-[10px] dark:bg-card-2 dark:text-[var(--cd)]"
             data-cursor={icon.title}
             style={{ "--c": icon.light, "--cd": icon.dark } as CSSProperties}
             onPointerEnter={() => setActive(icon.title)}
@@ -217,7 +233,7 @@ export function TechSphere() {
           >
             <svg
               aria-label={icon.title}
-              className="size-[14px] sm:size-[18px]"
+              className="size-[14px] sm:size-[17px]"
               fill="currentColor"
               role="img"
               viewBox="0 0 24 24"
@@ -227,7 +243,10 @@ export function TechSphere() {
           </span>
         ))}
       </div>
-      <p aria-live="polite" className="h-4 text-center text-[12px] text-muted">
+      <p
+        aria-live="polite"
+        className="h-4 text-center text-[12px] text-muted max-sm:hidden"
+      >
         {active ?? "Drag to spin"}
       </p>
     </div>

+ 3 - 1
components/cards/writing.tsx

@@ -21,7 +21,9 @@ export function WritingCard({ posts }: { posts: PostSummary[] }) {
   return (
     <div className="flex h-full flex-col p-5 sm:p-6">
       <div className="flex items-center justify-between">
-        <p className="text-[15px] font-semibold">Writing</p>
+        <p className="font-display text-[17px] font-semibold tracking-[-0.005em]">
+          Writing
+        </p>
         <Link
           className="inline-flex items-center gap-1 text-[13px] font-medium text-glacier-ink hover:underline hover:underline-offset-4"
           data-cursor="All posts"

+ 38 - 0
components/font-loader.tsx

@@ -0,0 +1,38 @@
+"use client";
+
+import { useEffect } from "react";
+
+import { onIdle } from "@/lib/utils";
+
+/**
+ * Brings in the display face after the first paint, so it never holds up the
+ * first frame. Until then headings use a fallback with matching metrics, so
+ * nothing shifts when it swaps in. Returning visitors already have the font
+ * cached; an inline script in <head> switches it on before their first paint.
+ */
+export function FontLoader({ faces }: { faces: string[] }) {
+  useEffect(() => {
+    const root = document.documentElement;
+
+    if (root.classList.contains("ff")) return;
+    let live = true;
+    const cancel = onIdle(() => {
+      Promise.all(faces.map((face) => document.fonts.load(face)))
+        .then(() => {
+          if (!live) return;
+          root.classList.add("ff", "ff-in");
+          try {
+            localStorage.setItem("ff", "1");
+          } catch {}
+        })
+        .catch(() => {});
+    }, 800);
+
+    return () => {
+      live = false;
+      cancel();
+    };
+  }, [faces]);
+
+  return null;
+}

+ 1 - 0
components/glass/liquid-glass.tsx

@@ -35,6 +35,7 @@ function paintLight() {
   const vh = window.innerHeight;
 
   litElements.forEach((el) => {
+    if (el.hasAttribute("data-steady-light")) return;
     const r = el.getBoundingClientRect();
 
     if (r.bottom < -80 || r.top > vh + 80 || !r.width) return;

+ 4 - 1
components/nav/command-palette.tsx

@@ -225,6 +225,9 @@ export default function CommandPalette({
 
   useEffect(() => {
     const previous = document.activeElement as HTMLElement | null;
+    // Hand focus back only to someone navigating by keyboard; otherwise a
+    // mouse-clicked control would light up with a focus ring on close.
+    const restore = previous?.matches?.(":focus-visible") ?? false;
 
     inputRef.current?.focus();
     const onKey = (e: KeyboardEvent) => {
@@ -235,7 +238,7 @@ export default function CommandPalette({
 
     return () => {
       window.removeEventListener("keydown", onKey);
-      previous?.focus?.();
+      if (restore) previous?.focus?.();
     };
   }, [onClose]);
 

+ 4 - 3
components/nav/site-nav.tsx

@@ -12,7 +12,7 @@ import {
 } from "react";
 
 import { LiquidGlass, useGlassLight } from "@/components/glass/liquid-glass";
-import { spring } from "@/lib/motion";
+import { springs } from "@/lib/motion";
 import { switchTheme } from "@/lib/theme-transition";
 import { cn } from "@/lib/utils";
 import { setView, useView, type View } from "@/lib/view-store";
@@ -95,6 +95,7 @@ export function SiteNav() {
     <>
       <header className="pointer-events-none fixed inset-x-0 bottom-[max(14px,env(safe-area-inset-bottom))] z-50 flex justify-center px-3 sm:top-4 sm:bottom-auto">
         <LiquidGlass
+          data-steady-light
           className="pointer-events-auto flex items-center gap-1 rounded-full p-1.5 [--glass-tint:rgb(255_255_255/0.5)] dark:[--glass-tint:rgb(16_20_26/0.55)]"
           glass={{ chroma: 0.1, blur: 3, saturate: 1.8 }}
         >
@@ -156,7 +157,7 @@ function Tabs({
 
     const dist = Math.abs(activeIndex - from);
     const stretch = 1 + Math.min(0.55, dist * 0.22);
-    const s = spring(210, 19);
+    const s = springs.wobble();
 
     el.animate(
       [
@@ -235,7 +236,7 @@ function Tabs({
 
     if (el) {
       const current = el.style.transform;
-      const s = spring(260, 20);
+      const s = springs.wobble();
 
       el.style.transform = `translateX(${index * 100}%)`;
       el.animate([{ transform: current }, { transform: el.style.transform }], {

+ 0 - 12
components/site-footer.tsx

@@ -14,18 +14,6 @@ export function SiteFooter() {
           to explore
         </span>
       </p>
-      <p>
-        Background: Mount Rainier contours from{" "}
-        <a
-          className="underline decoration-line-strong underline-offset-2 hover:text-ink"
-          href="https://registry.opendata.aws/terrain-tiles/"
-          rel="noopener noreferrer"
-          target="_blank"
-        >
-          AWS Terrain Tiles
-        </a>{" "}
-        (USGS 3DEP)
-      </p>
     </footer>
   );
 }

+ 40 - 5
config/fonts.ts

@@ -1,10 +1,45 @@
-import { Inter } from "next/font/google";
+import { Figtree, Fraunces } from "next/font/google";
+import localFont from "next/font/local";
 
-// Apple devices render SF Pro straight from the system font stack (zero bytes).
-// Inter is the closest match elsewhere and only downloads when SF isn't available.
-export const fontInter = Inter({
+/**
+ * Text and interface: SF Pro on Apple devices (nothing to download), Figtree,
+ * a friendly geometric sans, everywhere else. Not preloaded, so Apple devices
+ * never fetch it.
+ */
+export const fontText = Figtree({
   subsets: ["latin"],
-  variable: "--font-inter",
+  variable: "--ff-text",
   display: "swap",
   preload: false,
 });
+
+/**
+ * Display: Fraunces, a soft variable serif. Its SOFT axis rounds the letters,
+ * so the headline can melt like liquid under the cursor. The optical-size
+ * axis is left out to keep the file small (about 60 KB).
+ */
+export const fontDisplay = Fraunces({
+  subsets: ["latin"],
+  axes: ["SOFT"],
+  variable: "--ff-display",
+  display: "swap",
+  // Loaded after the first paint by <FontLoader />.
+  preload: false,
+});
+
+/** The italic "Eric" in the headline: Fraunces Italic subset to four glyphs (4 KB). */
+export const fontName = localFont({
+  src: "../assets/fonts/fraunces-italic-eric.woff2",
+  style: "italic",
+  weight: "100 900",
+  variable: "--ff-name",
+  display: "swap",
+  preload: false,
+  adjustFontFallback: "Times New Roman",
+});
+
+/** What <FontLoader /> asks the browser to load once the page has painted. */
+export const deferredFaces = [
+  `600 1em ${fontDisplay.style.fontFamily.split(",")[0]}`,
+  `italic 600 1em ${fontName.style.fontFamily.split(",")[0]}`,
+];

+ 126 - 0
lib/bento-layout.ts

@@ -0,0 +1,126 @@
+/**
+ * Layout for the bento grid, in grid cells.
+ *
+ * The first layout packs cards in order exactly like CSS
+ * `grid-auto-flow: row dense` (first fit from the top-left), so the server can
+ * render it. While a card is dragged, it claims the cell under it and every
+ * other card re-packs tightly around it in the order they had when the drag
+ * began, like icons and widgets on a phone's home screen. The result depends
+ * only on where the card is held, so the grid never oscillates, and there are
+ * no holes left behind.
+ */
+
+export type Size = readonly [w: number, h: number];
+export type Cell = { id: string; x: number; y: number; w: number; h: number };
+
+/** Layout tiers: columns, and the viewport width where each starts. */
+export const TIERS = [
+  { cols: 2, min: 0 },
+  { cols: 4, min: 640 },
+  { cols: 4, min: 1024 },
+] as const;
+
+export const tierFor = (width: number) =>
+  width >= TIERS[2].min ? 2 : width >= TIERS[1].min ? 1 : 0;
+
+/** First fit from the top-left, in order (what CSS `row dense` does). */
+export function pack(
+  ids: readonly string[],
+  sizeOf: (id: string) => Size,
+  cols: number,
+): Cell[] {
+  const taken: boolean[][] = [];
+  const fits = (x: number, y: number, w: number, h: number) => {
+    for (let r = y; r < y + h; r++) {
+      for (let c = x; c < x + w; c++) if (taken[r]?.[c]) return false;
+    }
+
+    return true;
+  };
+
+  return ids.map((id) => {
+    const [sw, h] = sizeOf(id);
+    const w = Math.min(sw, cols);
+
+    for (let y = 0; ; y++) {
+      for (let x = 0; x + w <= cols; x++) {
+        if (!fits(x, y, w, h)) continue;
+        for (let r = y; r < y + h; r++) {
+          taken[r] ??= [];
+          for (let c = x; c < x + w; c++) taken[r][c] = true;
+        }
+
+        return { id, x, y, w, h };
+      }
+    }
+  });
+}
+
+/**
+ * Hold card `id` at (x, y) and pack every other card around it, first fit in
+ * `order`. If nothing is above the held card, it floats up to meet the rest.
+ */
+export function placeAt(
+  order: readonly string[],
+  sizeOf: (id: string) => Size,
+  cols: number,
+  id: string,
+  x: number,
+  y: number,
+): Cell[] {
+  const [sw, h] = sizeOf(id);
+  const w = Math.min(sw, cols);
+  const taken: boolean[][] = [];
+  const mark = (c: Cell, value: boolean) => {
+    for (let r = c.y; r < c.y + c.h; r++) {
+      taken[r] ??= [];
+      for (let col = c.x; col < c.x + c.w; col++) taken[r][col] = value;
+    }
+  };
+  const fits = (cx: number, cy: number, cw: number, ch: number) => {
+    for (let r = cy; r < cy + ch; r++) {
+      for (let col = cx; col < cx + cw; col++)
+        if (taken[r]?.[col]) return false;
+    }
+
+    return true;
+  };
+  const held: Cell = { id, x: Math.min(Math.max(x, 0), cols - w), y, w, h };
+
+  mark(held, true);
+  const others = order
+    .filter((o) => o !== id)
+    .map((o) => {
+      const [ow0, oh] = sizeOf(o);
+      const ow = Math.min(ow0, cols);
+
+      for (let cy = 0; ; cy++) {
+        for (let cx = 0; cx + ow <= cols; cx++) {
+          if (!fits(cx, cy, ow, oh)) continue;
+          const cell = { id: o, x: cx, y: cy, w: ow, h: oh };
+
+          mark(cell, true);
+
+          return cell;
+        }
+      }
+    });
+
+  // Don't leave the held card hanging below empty space.
+  mark(held, false);
+  while (held.y > 0 && fits(held.x, held.y - 1, w, 1)) held.y--;
+
+  return [held, ...others];
+}
+
+export const sameLayout = (a: Cell[], b: Cell[]) =>
+  a.length === b.length &&
+  a.every((c) => {
+    const d = b.find((x) => x.id === c.id);
+
+    return d && d.x === c.x && d.y === c.y;
+  });
+
+/** Reading order of a layout: top to bottom, left to right. */
+export const readingOrder = (cells: Cell[]) =>
+  [...cells].sort((a, b) => a.y - b.y || a.x - b.x).map((c) => c.id);

+ 3 - 6
lib/data.ts

@@ -11,7 +11,6 @@ export const getHomeData = cache(async () => {
     photos: "photos",
     avatar: "avatar/eric.jpg",
     dog: "avatar/dog.jpg",
-    secondself: "projects/secondself.jpg",
     webagent: "projects/webagent.jpg",
     chatbot: "projects/chatbot.jpg",
     paper: "projects/paper.jpg",
@@ -20,7 +19,6 @@ export const getHomeData = cache(async () => {
   const allPaths = [
     paths.avatar,
     paths.dog,
-    paths.secondself,
     paths.webagent,
     paths.chatbot,
     paths.paper,
@@ -38,10 +36,9 @@ export const getHomeData = cache(async () => {
     photos: photosResult,
     avatarUrl: urlResults[0],
     dogUrl: urlResults[1],
-    secondselfUrl: urlResults[2],
-    webagentUrl: urlResults[3],
-    chatbotUrl: urlResults[4],
-    paperUrl: urlResults[5],
+    webagentUrl: urlResults[2],
+    chatbotUrl: urlResults[3],
+    paperUrl: urlResults[4],
   };
 });
 

+ 29 - 2
lib/motion.ts

@@ -1,6 +1,24 @@
+/**
+ * The site's motion language: three springs, and everything that moves uses
+ * one of them. The same curves exist as CSS custom properties
+ * (`--ease-snap`, `--ease-glide`, `--ease-wobble` in styles/globals.css) so
+ * plain CSS transitions and script animations feel identical.
+ *
+ * - snap: feedback (presses, hovers, toggles). Quick and exact.
+ * - glide: layout (cards moving to new slots, drops, sheets). Smooth, with a
+ *   hair of overshoot.
+ * - wobble: liquid things (the nav droplet, glass beads). Visible, playful
+ *   overshoot, like a drop of water settling.
+ */
+export const SPRINGS = {
+  snap: [520, 42],
+  glide: [240, 25],
+  wobble: [300, 17],
+} as const;
+
 /**
  * Builds a CSS `linear()` easing that follows a damped spring, so plain CSS
- * transitions and WAAPI animations get physical, slightly bouncy motion.
+ * transitions and WAAPI animations get physical motion.
  */
 export function springEasing(
   stiffness = 170,
@@ -14,7 +32,7 @@ export function springEasing(
   const duration = settleTime(w0, zeta);
   const points: string[] = [];
 
-  for (let i = 0; i <= steps; i++) {
+  for (let i = 0; i < steps; i++) {
     const t = (i / steps) * duration;
     let x: number;
 
@@ -28,6 +46,8 @@ export function springEasing(
     }
     points.push(x.toFixed(4));
   }
+  // End exactly at rest so nothing jumps on the last frame.
+  points.push("1");
 
   return {
     easing: `linear(${points.join(", ")})`,
@@ -54,3 +74,10 @@ export function spring(stiffness?: number, damping?: number) {
 
   return supportsLinear ? s : { easing: fallback, duration: s.duration };
 }
+
+/** Easing and duration for one of the site's springs, ready for `el.animate()`. */
+export const springs = {
+  snap: () => spring(...SPRINGS.snap),
+  glide: () => spring(...SPRINGS.glide),
+  wobble: () => spring(...SPRINGS.wobble),
+};

+ 306 - 20
styles/globals.css

@@ -4,8 +4,10 @@
 
 @theme inline {
   --font-sans:
-    -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--font-inter),
-    system-ui, "Segoe UI", Roboto, sans-serif;
+    -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--ff-text),
+    ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
+  --font-display: var(--display-face);
+  --font-name: var(--name-face);
   --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
 
   --color-bg: var(--bg);
@@ -34,6 +36,29 @@
 
 /* ---------- Tokens ---------- */
 
+/* Display type: a metric-matched fallback until Fraunces arrives after the
+   first paint (components/font-loader.tsx), then Fraunces. */
+:root {
+  --display-face: "Fraunces Fallback", ui-serif, Georgia, serif;
+  --name-face: "Fraunces Fallback", ui-serif, Georgia, serif;
+}
+
+html.ff {
+  --display-face: var(--ff-display), ui-serif, Georgia, serif;
+  --name-face: var(--ff-name), var(--ff-display), ui-serif, Georgia, serif;
+}
+
+/* A gentle settle when the display face swaps in. */
+.ff-in :is(.font-display, .title, .hero-name) {
+  animation: ff-settle 0.5s ease both;
+}
+
+@keyframes ff-settle {
+  from {
+    opacity: 0.82;
+  }
+}
+
 :root {
   /* Neutrals: the original warm off-white with white cards. */
   --bg: #f6f2f2;
@@ -57,7 +82,6 @@
   --ember-ink: #c23668;
 
   --topo: rgb(110 92 104 / 0.1);
-  --topo-lit: rgb(42 134 221 / 0.42);
   --aurora-a: rgb(140 201 254 / 0.42);
   --aurora-b: rgb(255 191 209 / 0.5);
   --aurora-c: rgb(99 204 174 / 0.2);
@@ -76,6 +100,121 @@
   --rim-hi: rgb(255 255 255 / 1);
   --rim-lo: rgb(255 255 255 / 0.45);
   --rim-end: rgb(255 255 255 / 0.8);
+  --glint: rgb(255 255 255 / 1);
+  --card-lifted: rgb(255 255 255 / 0.94);
+
+  /* Motion: three springs (see lib/motion.ts). Everything that moves uses one. */
+  --ease-snap: linear(
+    0,
+    0.021,
+    0.075,
+    0.148,
+    0.23,
+    0.316,
+    0.401,
+    0.481,
+    0.555,
+    0.623,
+    0.682,
+    0.735,
+    0.781,
+    0.82,
+    0.853,
+    0.881,
+    0.904,
+    0.924,
+    0.94,
+    0.953,
+    0.963,
+    0.972,
+    0.979,
+    0.984,
+    0.988,
+    0.991,
+    0.994,
+    0.996,
+    0.997,
+    0.998,
+    0.999,
+    1
+  );
+  --dur-snap: 350ms;
+  --ease-glide: linear(
+    0,
+    0.025,
+    0.087,
+    0.173,
+    0.269,
+    0.369,
+    0.467,
+    0.559,
+    0.642,
+    0.715,
+    0.778,
+    0.831,
+    0.876,
+    0.912,
+    0.94,
+    0.963,
+    0.98,
+    0.992,
+    1.001,
+    1.007,
+    1.011,
+    1.013,
+    1.014,
+    1.014,
+    1.013,
+    1.012,
+    1.01,
+    1.009,
+    1.008,
+    1.006,
+    1.005,
+    1.004,
+    1.003,
+    1.002,
+    1.001,
+    1
+  );
+  --dur-glide: 560ms;
+  --ease-wobble: linear(
+    0,
+    0.067,
+    0.229,
+    0.436,
+    0.648,
+    0.837,
+    0.986,
+    1.089,
+    1.148,
+    1.17,
+    1.163,
+    1.138,
+    1.104,
+    1.068,
+    1.034,
+    1.007,
+    0.988,
+    0.976,
+    0.971,
+    0.972,
+    0.975,
+    0.981,
+    0.987,
+    0.993,
+    0.998,
+    1.001,
+    1.004,
+    1.005,
+    1.005,
+    1.004,
+    1.003,
+    1.002,
+    1.001,
+    1
+  );
+  --dur-wobble: 820ms;
   /* visionOS-style hover light */
   --spot-fill: rgb(140 201 254 / 0.1);
   --spot-rim: rgb(42 134 221 / 0.28);
@@ -106,7 +245,6 @@
   --ember-ink: #ff9fbd;
 
   --topo: rgb(140 201 254 / 0.07);
-  --topo-lit: rgb(140 201 254 / 0.5);
   --aurora-a: rgb(70 140 210 / 0.24);
   --aurora-b: rgb(255 150 190 / 0.12);
   --aurora-c: rgb(99 204 174 / 0.08);
@@ -120,6 +258,8 @@
   --rim-hi: rgb(255 255 255 / 0.3);
   --rim-lo: rgb(255 255 255 / 0.07);
   --rim-end: rgb(255 255 255 / 0.14);
+  --glint: rgb(255 255 255 / 0.6);
+  --card-lifted: rgb(30 36 45 / 0.95);
   --spot-fill: rgb(255 255 255 / 0.05);
   --spot-rim: rgb(255 255 255 / 0.3);
 
@@ -150,7 +290,7 @@
     background: var(--bg);
     color: var(--ink);
     font-family: var(--font-sans);
-    letter-spacing: -0.011em;
+    letter-spacing: -0.004em;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
     text-rendering: optimizeLegibility;
@@ -161,8 +301,13 @@
   }
 
   :focus-visible {
-    outline: 2px solid var(--glacier);
-    outline-offset: 3px;
+    outline: 2px solid color-mix(in oklab, var(--glacier) 85%, transparent);
+    outline-offset: 2px;
+  }
+
+  /* Inside glass, the ring sits within the control so it reads as part of it. */
+  .lg :focus-visible {
+    outline-offset: -2px;
   }
 }
 
@@ -178,10 +323,17 @@
     color: var(--muted);
   }
 
+  /* Display type: Fraunces with its softest corners. */
+  .font-display,
+  .title {
+    font-family: var(--font-display);
+    font-variation-settings: "SOFT" 100;
+  }
+
   .title {
     font-weight: 600;
-    letter-spacing: -0.022em;
-    line-height: 1.12;
+    letter-spacing: -0.012em;
+    line-height: 1.1;
     color: var(--ink);
   }
 
@@ -214,15 +366,52 @@
   .bento {
     --cols: 2;
     --gap: 10px;
+    position: relative;
     display: grid;
     grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
     grid-auto-rows: calc(
       (100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols)
     );
-    grid-auto-flow: row dense;
     gap: var(--gap);
   }
 
+  /* Every card sits in an explicit cell, computed per tier (lib/bento-layout.ts). */
+  .bento > .card {
+    grid-column: var(--c0) / span var(--w0);
+    grid-row: var(--r0) / span var(--h0);
+  }
+
+  @media (min-width: 640px) {
+    .bento > .card {
+      grid-column: var(--c1) / span var(--w1);
+      grid-row: var(--r1) / span var(--h1);
+    }
+  }
+
+  @media (min-width: 1024px) {
+    .bento > .card {
+      grid-column: var(--c2) / span var(--w2);
+      grid-row: var(--r2) / span var(--h2);
+    }
+  }
+
+  /* Where the held card will land: a soft, empty well of glass. */
+  .bento-ghost {
+    border-radius: 28px;
+    background: color-mix(in oklab, var(--glacier) 7%, transparent);
+    box-shadow:
+      inset 0 0 0 1.5px color-mix(in oklab, var(--glacier) 38%, transparent),
+      inset 0 10px 30px -12px rgb(0 0 0 / 0.12);
+    pointer-events: none;
+    animation: fade-in 0.25s ease both;
+  }
+
+  @media (max-width: 639px) {
+    .bento-ghost {
+      border-radius: 24px;
+    }
+  }
+
   @media (min-width: 640px) {
     .bento {
       --cols: 4;
@@ -238,15 +427,16 @@
 
   @media (max-width: 639px) {
     .card {
-      border-radius: 24px;
+      --card-radius: 24px;
     }
   }
 
   .card {
+    --card-radius: 28px;
     position: relative;
     isolation: isolate;
     overflow: hidden;
-    border-radius: 28px;
+    border-radius: var(--card-radius);
     background:
       linear-gradient(180deg, var(--card-sheen), transparent 36%),
       var(--card-glass);
@@ -256,9 +446,26 @@
     transition:
       opacity 0.45s ease,
       filter 0.45s ease,
-      box-shadow 0.4s ease,
-      scale 0.3s ease;
+      box-shadow var(--dur-glide) var(--ease-glide),
+      scale var(--dur-glide) var(--ease-glide);
     touch-action: pan-y;
+    -webkit-touch-callout: none;
+  }
+
+  @media (hover: hover) and (pointer: fine) {
+    .card {
+      cursor: grab;
+    }
+  }
+
+  /* Card content is clipped to the rounded shape even while layers animate
+     (overflow alone lets composited children show square corners). */
+  .card-body {
+    position: relative;
+    height: 100%;
+    border-radius: inherit;
+    overflow: hidden;
+    clip-path: inset(0 round var(--card-radius));
   }
 
   @media (hover: hover) {
@@ -308,20 +515,53 @@
     filter: saturate(0.35);
   }
 
+  /* Pressed: the glass gives a little, like a held drop. */
+  .card[data-pressed] {
+    scale: 0.985;
+    transition-duration: 0.45s, 0.45s, var(--dur-snap), var(--dur-snap);
+    transition-timing-function: ease, ease, var(--ease-snap), var(--ease-snap);
+  }
+
+  /* Lifted: drops its blur (cheap to move) and floats above the grid. */
   .card[data-dragging="true"] {
     z-index: 50;
-    scale: 1.025;
+    scale: 1.03;
+    background: var(--card-lifted);
+    -webkit-backdrop-filter: none;
+    backdrop-filter: none;
     box-shadow:
-      0 30px 60px -20px rgb(0 0 0 / 0.45),
-      0 0 0 1px var(--line-strong);
+      0 36px 70px -28px rgb(0 0 0 / 0.5),
+      0 14px 28px -14px rgb(0 0 0 / 0.28);
     cursor: grabbing;
   }
 
+  .bento-wrap[data-dragging] .card:not([data-dragging]) {
+    cursor: grabbing;
+  }
+
+  /* Entrance: each card condenses into place in reading order, and a glint of
+     light runs along its glass edge as it settles. */
   .card[data-enter] {
-    animation: var(--animate-rise);
+    animation: condense 0.8s var(--ease-glide) backwards;
     animation-delay: calc(var(--i, 0) * 45ms);
   }
 
+  /* The glint: a band of light swept across the rim once, on the compositor. */
+  .card[data-enter] .card-rim::after {
+    content: "";
+    position: absolute;
+    inset: 0 -60%;
+    background: linear-gradient(
+      108deg,
+      transparent 42%,
+      var(--glint) 50%,
+      transparent 58%
+    );
+    translate: -100% 0;
+    animation: glint 1.4s cubic-bezier(0.3, 0.6, 0.2, 1) both;
+    animation-delay: calc(var(--i, 0) * 45ms + 0.25s);
+  }
+
   /* The glass edge: brightest where the light comes from, catching again at the bottom. */
   .card-rim {
     position: absolute;
@@ -338,6 +578,7 @@
       var(--rim-lo) 84%,
       var(--rim-end)
     );
+    overflow: hidden;
     -webkit-mask:
       linear-gradient(#000 0 0) content-box,
       linear-gradient(#000 0 0);
@@ -378,6 +619,23 @@
     backdrop-filter: var(--lg-filter);
   }
 
+  :is(a, button).lg {
+    transition: scale var(--dur-wobble) var(--ease-wobble);
+  }
+
+  :is(a, button).lg:active {
+    scale: 0.94;
+    transition-duration: var(--dur-snap);
+    transition-timing-function: var(--ease-snap);
+  }
+
+  /* Long, thin glass (the nav bar) keeps a steady top light instead of a
+     cursor-chasing highlight. */
+  .lg[data-steady-light] {
+    --sheen: 0;
+    --la: 180deg;
+  }
+
   /* Specular sheen: follows the light (the cursor). */
   .lg::before {
     content: "";
@@ -388,8 +646,8 @@
     background:
       radial-gradient(
         120% 90% at var(--lx, 30%) var(--ly, -10%),
-        rgb(255 255 255 / 0.42),
-        rgb(255 255 255 / 0.06) 38%,
+        rgb(255 255 255 / var(--sheen, 0.42)),
+        rgb(255 255 255 / calc(var(--sheen, 0.42) * 0.15)) 38%,
         transparent 60%
       ),
       linear-gradient(
@@ -459,6 +717,23 @@
 
 /* ---------- Motion ---------- */
 
+@keyframes condense {
+  from {
+    opacity: 0;
+    scale: 0.965;
+    translate: 0 14px;
+  }
+}
+
+@keyframes glint {
+  from {
+    translate: -100% 0;
+  }
+  to {
+    translate: 100% 0;
+  }
+}
+
 @keyframes rise {
   from {
     opacity: 0;
@@ -584,6 +859,14 @@ html .notion {
   color: var(--ink);
 }
 
+html .notion-h,
+html .notion-title {
+  font-family: var(--font-display) !important;
+  font-variation-settings: "SOFT" 100;
+  font-weight: 600;
+  letter-spacing: -0.012em;
+}
+
 html .notion-page {
   padding-bottom: 6rem;
 }
@@ -630,6 +913,9 @@ html .notion-yt-lite {
 
 /* The name in the hero: a sky-to-blush gradient, Apple Intelligence style. */
 .hero-name {
+  font-family: var(--font-name);
+  font-style: italic;
+  padding-right: 0.06em;
   background-image: linear-gradient(
     100deg,
     var(--glacier) 5%,