/* Home, rebuilt. Quiet fixed chrome, one giant name, the painting as the centrepiece,
   and motion that follows the scroll. */

@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/assets/fonts/geist-mono-bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/assets/fonts/geist-mono-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --paper: #f3f1ec;
  --ink: #1a1915;
  --muted: #827f77;
  --rule: #dcd8cf;
  --night: #141311;
  --night-muted: #8d8a82;
  --night-rule: #2c2a26;
  --iris: #56697b;

  --gutter: clamp(16px, 2.5vw, 36px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --cream: #f3f1ec;  /* fixed light, for the always-dark footer */
  --stamp: #1d3f7a;  /* the halftone's ink, reused for the stamp */
  --grid: rgba(26, 25, 21, .02);         /* drafting grid: fine squares... */
  --grid-major: rgba(26, 25, 21, .045);  /* ...and heavier lines every fourth */
  color-scheme: light;
}
/* Dark mode, switched by the pull cord (toys.js). */
:root[data-theme="dark"] {
  --paper: #161512;
  --ink: #ece9e2;
  --muted: #8f8b83;
  --rule: #2e2c28;
  --night: #0c0b0a;
  --iris: #8ea3c4;
  --stamp: #9db4e0;
  --grid: rgba(236, 233, 226, .016);
  --grid-major: rgba(236, 233, 226, .04);
  color-scheme: dark;
}
body { transition: background-color .6s ease, color .6s ease; }
/* The drafting grid itself is drawn by grid.js (it warps, carries marks and coordinates). */
.gridcanvas { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
/* Colour drift under the grid: three very soft pools of colour from the plants (moss, sage,
   a warm amber) that wander slowly, blurred, with a fine grain over the top so the paper
   isn't one flat colour. Fixed to the window; hidden on the black landing. */
body::before, body::after { content: ''; position: fixed; z-index: 0; pointer-events: none; }
body::before {
  inset: -20vmax;
  background:
    radial-gradient(closest-side, var(--drift-a), transparent) 0 0 / 70vmax 70vmax no-repeat,
    radial-gradient(closest-side, var(--drift-b), transparent) 0 0 / 60vmax 60vmax no-repeat,
    radial-gradient(closest-side, var(--drift-c), transparent) 0 0 / 55vmax 55vmax no-repeat;
  animation: drift 90s ease-in-out infinite alternate;
  transition: opacity .6s ease;
}
body::after {
  inset: 0; opacity: var(--grain, .05); mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root { --drift-a: rgba(126, 160, 96, .16); --drift-b: rgba(214, 170, 96, .12); --drift-c: rgba(96, 140, 128, .12); }
:root[data-theme="dark"] { --drift-a: rgba(126, 160, 96, .10); --drift-b: rgba(214, 160, 80, .07); --drift-c: rgba(80, 130, 120, .08); --grain: .07; }
@keyframes drift {
  0%   { background-position: 8vmax 6vmax, 70vmax 40vmax, 30vmax 75vmax; }
  33%  { background-position: 40vmax 20vmax, 50vmax 70vmax, 75vmax 30vmax; }
  66%  { background-position: 60vmax 55vmax, 15vmax 30vmax, 45vmax 10vmax; }
  100% { background-position: 20vmax 70vmax, 80vmax 10vmax, 10vmax 40vmax; }
}
html.pre body::before, html.pre body::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; background-position: 20vmax 15vmax, 70vmax 50vmax, 35vmax 75vmax; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 'Geist', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px; border-radius: 2px; }
.dark :focus-visible { outline-color: var(--cream); }

.skip { position: fixed; left: var(--gutter); top: -60px; z-index: 60; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 13px; text-decoration: none; }
.skip:focus { top: 56px; }

.mono { font: 400 12px/1.5 'Geist Mono', ui-monospace, monospace; letter-spacing: .01em; color: var(--muted); }
.dark .mono { color: var(--night-muted); }

/* Rolling link text: home.js doubles the label, hover slides the copy up. */
.roll { display: inline-grid; overflow: hidden; vertical-align: top; line-height: 1.2; }
.roll > span { grid-area: 1 / 1; transition: transform .55s var(--ease); }
.roll > span + span { transform: translateY(105%); }
a:hover .roll > span:first-child, a:focus-visible .roll > span:first-child { transform: translateY(-105%); }
a:hover .roll > span + span, a:focus-visible .roll > span + span { transform: none; }

.pill {
  display: inline-flex; align-items: center; height: 42px; padding: 0 22px;
  border-radius: 999px; background: var(--ink); color: var(--paper);
  font: 400 14px/1 'Geist', sans-serif; text-decoration: none;
  transition: background .3s, color .3s, box-shadow .3s;
}
.pill:hover { background: var(--iris); }
.pill.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.pill.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- Fixed chrome ---------- */
.chrome { position: fixed; inset: 0; z-index: 40; pointer-events: none; mix-blend-mode: difference; color: #f3f1ec; }
.chrome a, .chrome p { pointer-events: auto; }
.chrome-home { position: absolute; left: var(--gutter); top: 22px; font: 700 16px/1 'Geist', sans-serif; letter-spacing: -.03em; text-decoration: none; }
.chrome-nav { position: absolute; right: var(--gutter); top: 22px; display: flex; gap: 24px; }
.chrome-nav a { font: 400 12px/1 'Geist Mono', monospace; text-decoration: none; }
.chrome-where { position: absolute; right: var(--gutter); bottom: 20px; margin: 0; display: flex; align-items: center; gap: 12px; color: inherit; }
.chrome-bar { position: relative; display: block; width: 64px; height: 1px; background: rgba(243, 241, 236, .3); }
.chrome-bar b { position: absolute; inset: 0; background: currentColor; transform-origin: left; transform: scaleX(var(--scroll, 0)); }

/* ---------- Hero: two hands, after Michelangelo ---------- */
.hero-track { position: relative; }
.hero { position: relative; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; touch-action: pan-y; }


/* Both arms keep their places from the fresco: the stage is fresco x 700–1900, y 560–860.
   It is centred on the gap between the fingertips (52.8% across). */
.hands {
  --sw: 140vw;  /* wide enough that both arms run off the screen edges */
  position: absolute; z-index: 2; top: 42svh; left: calc(50vw - .528 * var(--sw));
  width: var(--sw); aspect-ratio: 1200 / 300; transform: translateY(-50%);
}
.hand-adam {
  /* An engraving in white lines (detail lives in the alpha). Placed so its fingertip sits where the fresco's did. */
  position: absolute; left: 14.83%; top: 25.27%; width: 37.72%; height: auto; max-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40%); mask-image: linear-gradient(to right, transparent 0, #000 40%);
  filter: brightness(0); opacity: .86;  /* light page: the white lines become ink */
}
:root[data-theme="dark"] .hand-adam { filter: none; opacity: .95; }
/* God's engraving: the particles' source. Shown as-is only if the dust can't run. */
.hand-god {
  position: absolute; left: 54.473%; top: 20.805%; width: 37.784%; height: auto; max-width: none; pointer-events: none;
  filter: brightness(0); opacity: .86;
}
:root[data-theme="dark"] .hand-god { filter: none; opacity: .95; }
.hands.has-dust .hand-god { visibility: hidden; }
.dust { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }

/* The name on a split-flap board (flap.js). Eight tiles fit "lunarion"; "jamie" leaves three blank.
   The tiles sit in a dark housing; each is two flaps with a thin slot between them. */
.hero { --tw: clamp(40px, 7.6vw, 128px); }   /* tile width; the sound toggle uses it too */
.hero-name {
  --pad: calc(var(--tw) * .11);               /* housing padding */
  --slot: max(2px, calc(var(--tw) * .028));   /* the gap between top and bottom flap */
  --rad: calc(var(--tw) * .07);
  --housing: #0d0c0a; --flap-top-a: #2b2925; --flap-top-b: #23211d; --flap-bot-a: #1f1d1a; --flap-bot-b: #191815; --flap-ink: #eee8da;
  position: absolute; left: var(--gutter); bottom: 6vh; z-index: 3; margin: 0;
  font: 400 calc(var(--tw) * .9)/1 'Geist Mono', ui-monospace, monospace; letter-spacing: 0;
  cursor: default; outline: none;
}
:root[data-theme="dark"] .hero-name { --housing: #080807; --flap-top-a: #2e2c28; --flap-top-b: #262420; --flap-bot-a: #22201d; --flap-bot-b: #1b1a17; }
.board {
  display: flex; gap: calc(var(--tw) * .06); padding: var(--pad);
  background: var(--housing); border-radius: calc(var(--tw) * .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 -3px 8px rgba(0, 0, 0, .55), 0 22px 44px -22px rgba(0, 0, 0, .55);
  perspective: calc(var(--tw) * 7);
}
:root[data-theme="dark"] .board { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 -3px 8px rgba(0, 0, 0, .6); }
/* The 3D board (flap3d.js) draws over this one once it's running; the HTML tiles keep the layout. */
.flap3d { position: absolute; z-index: 1; pointer-events: none; }
.hero-name.is-3d .board { background: transparent; box-shadow: none; }
.hero-name.is-3d .flap-tile { visibility: hidden; }
.hero-name:focus-visible .board { outline: 2px solid var(--iris); outline-offset: 6px; }
.flap-tile { position: relative; display: block; width: var(--tw); height: calc(var(--tw) * 1.42); }
.flap-tile .half, .flap-tile .flap {
  position: absolute; left: 0; right: 0; height: calc(50% - var(--slot) / 2); overflow: hidden; color: var(--flap-ink); font-weight: inherit;  /* the halves are <b>, which browsers bold by default */
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flap-tile .top, .flap-tile .flap-top {
  top: 0; border-radius: var(--rad) var(--rad) calc(var(--rad) * .35) calc(var(--rad) * .35);
  background: linear-gradient(var(--flap-top-a), var(--flap-top-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -1px 0 rgba(0, 0, 0, .35);
}
.flap-tile .bottom, .flap-tile .flap-bottom {
  bottom: 0; border-radius: calc(var(--rad) * .35) calc(var(--rad) * .35) var(--rad) var(--rad);
  background: linear-gradient(var(--flap-bot-a), var(--flap-bot-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), inset 0 -1px 0 rgba(0, 0, 0, .4);
}
.flap-tile i {
  position: absolute; left: 0; right: 0; height: calc(200% + var(--slot)); display: flex; align-items: center; justify-content: center;
  font-style: normal; padding-bottom: calc(var(--tw) * .05); text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
.flap-tile .top i, .flap-tile .flap-top i { top: 0; }
.flap-tile .bottom i, .flap-tile .flap-bottom i { bottom: 0; }
/* Shading while a flap moves: the half below sits in its shadow; the newly revealed top starts dim. */
.flap-tile .half::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.flap-tile .bottom::after { background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .15)); }
.flap-tile .top::after { background: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .5)); }
.flap-tile:has(.flap-top) .bottom::after { animation: flap-shade calc(var(--flip-half, 100ms) * 2) ease-out; }
.flap-tile:has(.flap-top) .top::after { animation: flap-reveal var(--flip-half, 100ms) ease-out; }
@keyframes flap-shade { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flap-reveal { from { opacity: 1; } to { opacity: 0; } }
/* The flaps in motion: the old top falls away on its hinge, the new bottom swings down into place. */
.flap-tile .flap { z-index: 2; will-change: transform; }
.flap-tile .flap-top { transform-origin: 50% calc(100% + var(--slot) / 2); animation: flap-top var(--flip-half, 100ms) cubic-bezier(.55, .08, .86, .44) forwards; }
.flap-tile .flap-bottom { transform-origin: 50% calc(var(--slot) / -2); transform: rotateX(90deg); animation: flap-bottom var(--flip-half, 100ms) var(--flip-half, 100ms) cubic-bezier(.16, .6, .3, 1) forwards; }
@keyframes flap-top { to { transform: rotateX(-90deg); filter: brightness(.5); } }
@keyframes flap-bottom { 0% { transform: rotateX(90deg); filter: brightness(.45); } 80% { transform: rotateX(-6deg); filter: brightness(1.05); } 100% { transform: rotateX(0); filter: none; } }

.hero-intro { position: absolute; right: var(--gutter); bottom: 7vh; z-index: 3; width: min(320px, 26vw); }
.hero-intro p { margin: 0 0 24px; font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.hero-intro .hero-hint { margin: 36px 0 0; max-width: 34ch; font: 400 12px/1.5 'Geist Mono', ui-monospace, monospace; color: var(--muted); }
.hero-hint i { font-style: italic; }
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) { .hint-fine { display: none; } .hint-touch { display: inline; } }

/* Page-load: letters rise, the hands fade in. */
@media (prefers-reduced-motion: no-preference) {
  .js .hands { animation: settle 1.6s .1s var(--ease) both; }
  .js .hero-intro p, .js .hero-intro .pill, .js .hero-hint, .js .chrome { animation: fade .9s .75s ease both; }
}
@keyframes rise { from { transform: translateY(100%); clip-path: inset(0 0 100% 0); } to { transform: none; clip-path: inset(-20% -10% -20% -10%); } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
:root { --grain-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* ---------- Sections ---------- */
.section { padding: clamp(96px, 13vw, 190px) var(--gutter) 0; }
.section-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: end; margin-bottom: clamp(48px, 7vw, 96px); }
.section-title { grid-column: 1 / span 8; margin: 0; font: 700 clamp(48px, 8vw, 128px)/.88 'Geist', sans-serif; letter-spacing: -.06em; }
.section-note { grid-column: 10 / span 3; margin: 0; }

/* ---------- Work: gallery tiles at different depths ---------- */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: clamp(72px, 10vw, 150px); }
.tile { margin: 0; transform: translate3d(0, var(--ty, 0px), 0); will-change: transform; }
.tile:nth-child(1) { grid-column: 1 / span 7; }
.tile:nth-child(2) { grid-column: 9 / span 4; margin-top: 16vw; }
.tile:nth-child(3) { grid-column: 2 / span 4; margin-top: 6vw; }
.tile:nth-child(4) { grid-column: 7 / span 6; }

.tile a { display: block; text-decoration: none; }
.tile-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #0d0c0a; border-radius: 4px; }
.tile:nth-child(1) .tile-media, .tile:nth-child(4) .tile-media { aspect-ratio: 16 / 10; }
.tile:nth-child(2) .tile-media { aspect-ratio: 3 / 4; }
.tile-media .dustcard { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-media:has(.dustcard) { cursor: none; }   /* the glass lens is the cursor over a drawing */
.lens-label {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; opacity: 0;
  font: 400 11px/1 'Geist Mono', ui-monospace, monospace; letter-spacing: .04em; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
@media (hover: none), (pointer: coarse) { .tile-media:has(.dustcard) { cursor: auto; } .lens-label { display: none; } }
:root[data-theme="dark"] .tile-media { background: #0a0a09; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }

/* Reveal: each image wipes open once as it enters. */
.js .tile .tile-media { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease); }
.js .tile.in .tile-media { clip-path: inset(0); }

.tile-text { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 16px; }
.tile-title { margin: 0; font: 700 clamp(22px, 2.2vw, 32px)/1.1 'Geist', sans-serif; letter-spacing: -.04em; }
.tile-meta { margin: 0; white-space: nowrap; }
.tile-desc { margin: 6px 0 0; max-width: 46ch; color: var(--muted); font-size: 15px; }

.work-more { display: flex; justify-content: flex-end; margin-top: clamp(56px, 7vw, 96px); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 48px; align-items: start; padding-bottom: clamp(120px, 14vw, 200px); }
.about-label { grid-column: 1 / -1; margin: 0; }
.about-statement { grid-column: 1 / span 9; margin: 0; font: 700 clamp(30px, 4.2vw, 64px)/1.06 'Geist', sans-serif; letter-spacing: -.045em; text-wrap: pretty; }
.about-statement .w { opacity: .14; transition: opacity .35s ease; }
.about-statement .w.on { opacity: 1; }
.about-side { grid-column: 9 / span 4; }
.now { margin: 0 0 28px; padding: 0; }
.now div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.now div:last-child { border-bottom: 1px solid var(--rule); }
.now dt { margin: 0; }
.now dd { margin: 0; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.now dd small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Dark close: contact and friends ---------- */
.dark { position: relative; overflow: hidden; background: var(--night); color: var(--cream); }
.contact { padding: clamp(84px, 9vw, 140px) var(--gutter) 0; }
.contact-label { margin: 0 0 18px; font-size: 13px; }
.contact-big { display: inline-block; margin: 0 0 clamp(48px, 6vw, 80px); font: 700 clamp(36px, 7.4vw, 124px)/1 'Geist', sans-serif; letter-spacing: -.055em; text-decoration: none; overflow-wrap: anywhere; }
.contact-big .roll { line-height: 1.05; }
/* The email dial (dial.js): the address on per-letter drums, with a knurled thumbwheel beside it. */
.dial { display: flex; align-items: center; gap: .14em; margin: 0 0 clamp(48px, 6vw, 80px); font: 700 clamp(36px, 7.4vw, 124px)/1 'Geist', sans-serif; letter-spacing: -.055em; }
.dial .contact-big { margin: 0; font: inherit; letter-spacing: inherit; position: relative; }
.drums { display: inline-flex; white-space: pre; }
.drum { position: relative; display: inline-block; height: 1.05em; overflow: hidden; vertical-align: top; transition: width .42s cubic-bezier(.3, 1.2, .5, 1); }
.drum .face { position: absolute; left: 0; top: 0; line-height: 1.05; will-change: transform; }
.drum-measure { position: absolute; visibility: hidden; white-space: pre; pointer-events: none; left: 0; top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.knob {
  --turn: 0; --spin: 0px;
  position: relative; flex: none; font: inherit; width: .3em; height: .86em; margin: 0; padding: 0; border: 0; border-radius: .07em;
  cursor: ns-resize; touch-action: none; color: inherit;
  background: repeating-linear-gradient(to bottom, #d9d4c8 0 .035em, #4a4740 .035em .07em);
  background-position: 0 calc(var(--spin) + var(--turn) * -.3em);
  box-shadow: 0 0 0 .025em #080807, 0 0 0 .045em #2c2a26, 0 .06em .14em rgba(0, 0, 0, .6);
  transform: perspective(2em) rotateX(calc(var(--turn) * -14deg));
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), background-position .35s cubic-bezier(.3, 1.4, .5, 1);
}
/* Cylinder shading: dark at the top and bottom where the wheel turns away, a highlight across the middle. */
.knob i { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 8, 7, .9), rgba(8, 8, 7, .15) 30%, rgba(255, 255, 255, .12) 48%, rgba(8, 8, 7, .1) 62%, rgba(8, 8, 7, .9)); }
.knob.held { cursor: grabbing; transition: none; }
.knob.kick { animation: knob-kick .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes knob-kick { 40% { transform: perspective(2em) rotateX(-12deg); } }
.knob:focus-visible { outline: 2px solid var(--iris); outline-offset: .08em; }
.dialing, .dialing * { user-select: none; cursor: grabbing !important; }
.dial-count { color: var(--night-muted); }
@media (pointer: coarse) { .knob { min-width: 20px; min-height: 40px; } }   /* big enough to tap */
@media (prefers-reduced-motion: reduce) { .knob, .drum { transition: none; } .knob.kick { animation: none; } }
/* Channels: a bento of cards. Each grows its own small bed of plants from the bottom edge
   (plants.js, front layer), with the label, icon and handle up top. */
.channels { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: row dense; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ch.wide { grid-column: span 2; }
.ch a {
  position: relative; display: grid; grid-template-rows: auto auto 1fr; gap: 10px; min-height: 240px; height: 100%;
  box-sizing: border-box; padding: 18px 20px; border: 1px solid var(--night-rule); border-radius: 6px;
  background: radial-gradient(120% 80% at 50% 110%, rgba(126, 160, 96, .12), transparent 60%), #141311;
  color: var(--cream); text-decoration: none; overflow: hidden;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1), border-color .3s, box-shadow .45s;
}
.ch-top { display: flex; align-items: center; justify-content: space-between; }
.ch-top .mono { color: var(--night-muted); transition: color .3s; }
.ch-ico { width: 26px; height: 26px; fill: none; stroke: var(--cream); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .8; transition: opacity .3s; }
.ch-handle { font: 600 clamp(17px, 1.5vw, 22px)/1.15 'Geist', sans-serif; letter-spacing: -.025em; overflow-wrap: anywhere; }
.ch-go { position: absolute; right: 20px; bottom: 16px; color: var(--cream); opacity: 0; transform: translate(-6px, 6px); transition: opacity .25s, transform .35s cubic-bezier(.2, .9, .3, 1); }
.ch a:hover, .ch a:focus-visible { transform: translateY(-4px); border-color: rgba(243, 241, 236, .4); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .9); outline: none; }
.ch a:hover .ch-top .mono, .ch a:focus-visible .ch-top .mono { color: var(--cream); }
.ch a:hover .ch-ico { opacity: 1; }
.ch a:hover .ch-go, .ch a:focus-visible .ch-go { opacity: 1; transform: none; }
/* Each icon does one small thing on hover. */
.ch-ico * { transition: transform .5s cubic-bezier(.2, .9, .3, 1.3); transform-box: fill-box; transform-origin: center; }
.ch a:hover .cloud { transform: translateX(2px); }
.ch a:hover .br-l { transform: translateX(-2px); } .ch a:hover .br-r { transform: translateX(2px); }
.ch a:hover .dots, .ch a:hover .wave { animation: ch-blink 1s steps(2) infinite; }
.ch a:hover .bubble { transform: rotate(-6deg) scale(1.04); }
.ch a:hover .at { transform: rotate(40deg); }
.ch a:hover .flap { transform: scaleY(-1) translateY(2px); transform-origin: top; }
.ch a:hover .bit { transform: translateX(2px); } .ch a:hover .bow { transform: rotate(-30deg); }
@keyframes ch-blink { 50% { opacity: .2; } }

.legal { max-width: 62ch; margin: 28px 0 0; color: var(--night-muted); font: 400 12px/1.6 'Geist Mono', monospace; letter-spacing: .01em; }
.legal a { color: var(--cream); text-underline-offset: .2em; }

.friends { padding: clamp(72px, 8vw, 120px) var(--gutter) 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; }
.badges img { width: 88px; height: 31px; image-rendering: pixelated; }
.badges a { display: block; transition: transform .2s var(--ease); }
.badges a:hover { transform: translateY(-2px); }
.mine { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 24px; }
.mine button { padding: 0; border: 0; background: none; cursor: copy; }
.mine textarea { width: 100%; font: 12px/1.4 'Geist Mono', monospace; }
.foot-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin: 0; }

.foot-name {
  margin: clamp(24px, 4vw, 56px) 0 -.17em calc(var(--gutter) - .05em);
  font: 700 clamp(120px, 31vw, 520px)/.8 'Geist', sans-serif; letter-spacing: -.075em; white-space: nowrap;
  color: var(--cream);
}

/* ---------- Cursor label over work ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  display: grid; place-items: center; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%;
  background: var(--paper); color: var(--ink); font: 400 12px/1 'Geist Mono', monospace;
  transform: translate3d(var(--cx, -200px), var(--cy, -200px), 0) scale(var(--cs, 0));
  transition: scale .4s var(--ease);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } .tile a { cursor: pointer; } }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .chrome { position: absolute; bottom: auto; height: 64px; }
  .chrome-nav { gap: 16px; }
  .chrome-where { display: none; }
  .hero { min-height: 560px; }
  .hero-intro { top: 92px; bottom: auto; left: var(--gutter); right: var(--gutter); width: auto; max-width: 34ch; }
  .hands { --sw: 230vw; top: 56svh; }
  .hero { --tw: calc((100vw - 2 * var(--gutter)) / 8.64); }
  .hero-name { bottom: 4vh; }
  .hero-intro .hero-hint { margin-top: 28px; }

  .section-head, .work-grid, .about { grid-template-columns: 1fr; }
  .section-title, .section-note, .tile:nth-child(n), .about-statement, .about-side { grid-column: 1 / -1; margin-top: 0; }
  .section-note { margin-top: 16px; }
  .tile { transform: none; }
  .tile:nth-child(2) .tile-media { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .tile .tile-media { clip-path: none; }
  .about-statement .w { opacity: 1; }
}

/* ---------- Toys (toys.js) ---------- */

/* Pull cord: hangs from the top edge, tug it to switch the theme. */
.cord {
  position: absolute; left: 50%; top: 0; width: 36px; margin-left: -18px; padding: 0;
  height: calc(70px + var(--pull, 0px)); border: 0; background: none; color: inherit;
  cursor: grab; touch-action: none; pointer-events: auto;
  transform-origin: 50% 0; transform: rotate(var(--sway, 0deg));
}
.cord:active { cursor: grabbing; }
/* The bead is a tiny bulb: a metal cap, a pear of glass and a filament. Off in light mode;
   in dark mode it glows warm, and switching it on flickers like a filament catching. */
.cord-line { position: absolute; left: 50%; top: 0; bottom: 20px; width: 1px; background: currentColor; }
.cord-bead {
  position: absolute; left: 50%; bottom: 0; width: 12px; height: 16px; margin-left: -6px;
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 36% 34%, color-mix(in srgb, currentColor 35%, transparent) 0 22%, color-mix(in srgb, currentColor 80%, transparent) 70%);
  box-shadow: inset 0 0 0 1px currentColor;
  transform-origin: 50% 0;
  transition: transform .2s var(--ease), background .7s ease, box-shadow .7s ease;
}
.cord-bead::before { content: ''; position: absolute; left: 3px; top: -4px; width: 6px; height: 5px; border-radius: 1px 1px 2px 2px;
  background: repeating-linear-gradient(currentColor 0 1px, color-mix(in srgb, currentColor 55%, transparent) 1px 2px); }
.cord-bead::after { content: ''; position: absolute; left: 3.5px; top: 6px; width: 5px; height: 3px; border: 1px solid transparent; border-top-color: color-mix(in srgb, currentColor 30%, transparent); border-radius: 50%; transition: border-color .7s ease; }
.cord:hover .cord-bead, .cord:focus-visible .cord-bead { transform: scale(1.2); }
:root[data-theme="dark"] .cord-bead {
  background: radial-gradient(circle at 50% 45%, #fffbe8 0 18%, #ffd889 45%, #f2a54a 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 230, 170, .6), 0 0 6px 2px rgba(255, 200, 110, .75), 0 0 22px 8px rgba(255, 170, 70, .28);
}
:root[data-theme="dark"] .cord-bead::after { border-top-color: #fffdf2; }
.cord.flick .cord-bead { animation: bulb-flick .9s steps(1, end); }
@keyframes bulb-flick {
  0%, 14%, 30% { filter: brightness(.35); }
  8%, 22% { filter: brightness(1.25); }
  40% { filter: brightness(.7); }
  52%, 100% { filter: none; }
}
@media (prefers-reduced-motion: reduce) { .cord.flick .cord-bead { animation: none; } }

/* Record: drag to scratch it. */
.listening { display: flex; align-items: center; gap: 14px; }
.record {
  position: relative; flex: none; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
  background:
    conic-gradient(from 30deg, rgba(255,255,255,.0) 0 40deg, rgba(255,255,255,.16) 60deg, rgba(255,255,255,0) 90deg 220deg, rgba(255,255,255,.12) 240deg, rgba(255,255,255,0) 270deg),
    repeating-radial-gradient(circle, #1c1b18 0 1px, #2b2a26 1px 2px);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  cursor: grab; touch-action: none;
  transform: rotate(var(--rot, 0deg));
}
.record:active { cursor: grabbing; }
.record-label { position: absolute; inset: 14px; border-radius: 50%; background: var(--iris) center / cover; }
.record-label::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--paper); }

/* Stamp: thumped onto the page where you copied the email. */
.contact-help { margin: -36px 0 clamp(48px, 6vw, 80px); }
.contact-help a { color: inherit; }
.contact-big { cursor: copy; }
.stamp {
  position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none;
  padding: 8px 14px 7px; border: 3px solid currentColor; border-radius: 7px;
  color: #e4573f; text-align: center; text-shadow: 0 0 1px currentColor;
  font: 700 24px/1 'Geist', sans-serif; letter-spacing: .12em; text-transform: uppercase;
  -webkit-mask: var(--grain) center / 120px 120px; mask: var(--grain) center / 120px 120px;
  animation: thump .42s cubic-bezier(.3, 1.4, .5, 1) both, stamp-fade 1s 2.4s ease forwards;
}
.stamp small { display: block; margin-top: 4px; font: 400 10px/1 'Geist Mono', monospace; letter-spacing: .06em; }
@keyframes thump {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(1.9); }
  to { opacity: .95; transform: translate(-50%, -50%) rotate(var(--r)) scale(1); }
}
@keyframes stamp-fade { to { opacity: 0; } }
:root { --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.3 1.55'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Button pile: the 88×31s become physical. */
/* Friends' buttons as a site map on the grid (toys.js): pinned on whole cells, crop marks,
   cell references, and a dashed line from each to the next that inks in on hover. */
.badges.map {
  position: relative; display: block; margin: 0 0 28px;
  /* the drafting grid, drawn here because the dark close covers the page's own */
  background-image:
    linear-gradient(rgba(236, 233, 226, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 233, 226, .07) 1px, transparent 1px),
    linear-gradient(rgba(236, 233, 226, .028) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 233, 226, .028) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
}
.badges.map li { position: absolute; left: 0; top: 0; width: 88px; height: 31px; transition: opacity .3s var(--ease); }
.badges.map a { display: block; transition: transform .3s var(--ease); }
.badges.map a:hover { transform: none; }
.badges.map img { display: block; }
.badges img, .mine img { -webkit-user-drag: none; user-select: none; }
.map-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.map-dash { fill: none; stroke: rgba(236, 233, 226, .22); stroke-width: 1; stroke-dasharray: 3 4; }
.map-ink { fill: none; stroke: #ece9e2; stroke-width: 1.25; transition: stroke-dashoffset .7s var(--ease); }
.map-ink.on { stroke-dashoffset: 0 !important; }
.map-crop { fill: none; stroke: rgba(236, 233, 226, .35); stroke-width: 1; }
.map-ref { position: absolute; left: 0; top: 36px; font-size: 9px; letter-spacing: .04em; color: rgba(236, 233, 226, .4); transition: color .3s; }
.badges.map.tracing li:not(.on):not(.next) { opacity: .45; }
.badges.map li.on .map-ref, .badges.map li.next .map-ref { color: #ece9e2; }
@media (prefers-reduced-motion: reduce) { .map-ink { transition: none; } }

@media (max-width: 820px) {
  .cord { left: auto; right: 4px; margin-left: 0; width: 24px; height: calc(52px + var(--pull, 0px)); }
  .contact-help { margin-top: -28px; }
}
@media (prefers-reduced-motion: reduce) {
  .stamp { animation: stamp-fade 1s 2.4s ease forwards; transform: translate(-50%, -50%) rotate(var(--r)); opacity: .95; }
}

/* ---------- Creation: the black landing, the touch, the blast (creation.js) ---------- */

/* Landing: pitch black, only the hands. Everything else waits to be created. */
html.pre, html.pre body { background: #000; overflow: hidden; height: 100%; }
html.pre body { color: #f3f1ec; }
html.pre [data-form], html.pre main, html.pre footer, html.pre .chrome-where { opacity: 0; visibility: hidden; }
html.pre .hand-adam { filter: none; opacity: .95; }
html.pre .skip { background: #f3f1ec; color: #000; }
.hero { z-index: 2; }
.hero-ceiling { position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none; }   /* plants.js hangs leaves from here */
main, footer { position: relative; z-index: 2; }

/* The star between the fingertips: a bright core with four thin rays, glinting like light through a lens. */
.spark {
  position: absolute; left: 53.5%; top: 56%; z-index: 3;
  width: 56px; height: 56px; margin: -28px 0 0 -28px; padding: 0; border: 0; background: none;
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 1.8s ease;
}
.spark::before { content: ''; position: absolute; inset: -14px; }  /* a generous target */
.spark .boost, .spark .glint { position: absolute; inset: 0; }
.spark .boost { transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.spark .core {
  position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 5px 2px rgba(255, 255, 255, .95), 0 0 18px 5px rgba(255, 255, 255, .32);
}
.spark .ray {
  position: absolute; left: 50%; top: 50%; width: var(--len); height: 1.5px; margin: -.75px 0 0 calc(var(--len) / -2);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 50%, transparent);
  transform: rotate(var(--a));
}
.spark .ray-h { --len: 52px; --a: 0deg; }
.spark .ray-v { --len: 44px; --a: 90deg; }
.spark .ray-d1 { --len: 18px; --a: 45deg; opacity: .55; }
.spark .ray-d2 { --len: 18px; --a: -45deg; opacity: .55; }
html.pre.spark-on .spark { opacity: 1; pointer-events: auto; }
html.pre.spark-on .spark .glint { animation: glint 3.4s ease-in-out infinite; }
html.pre.spark-on .spark .core { animation: flicker 1.3s ease-in-out infinite; }
html:not(.pre) .spark { display: none; }
/* Hooked: the visitor has come close. The star swells and glints faster. */
html.pre.spark-on.hooked .spark .boost { transform: scale(1.5); }
html.pre.spark-on.hooked .spark .glint { animation-duration: 1.7s; }
.spark:focus-visible { outline: none; }
.spark:focus-visible .boost { transform: scale(1.5); }
@keyframes glint {
  0%, 100% { transform: rotate(-7deg) scale(.8); opacity: .8; }
  35% { transform: rotate(3deg) scale(1.15); opacity: 1; }
  50% { transform: rotate(5deg) scale(.95); opacity: .9; }
  70% { transform: rotate(-2deg) scale(1.08); opacity: 1; }
}
@keyframes flicker { 0%, 100% { transform: scale(.85); } 45% { transform: scale(1.25); } 60% { transform: scale(1); } }

/* The blast. */
.void { position: fixed; inset: 0; z-index: 1; background: #000; pointer-events: none;
  -webkit-mask: radial-gradient(circle at var(--ox) var(--oy), transparent var(--r, 0px), #000 calc(var(--r, 0px) + 160px));
  mask: radial-gradient(circle at var(--ox) var(--oy), transparent var(--r, 0px), #000 calc(var(--r, 0px) + 160px)); }
.flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; background: radial-gradient(circle at var(--ox) var(--oy), #fff 0, #ffffff 30%, rgba(255, 255, 255, .85) 70%);
  animation: flash .9s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes flash { 0% { opacity: 0; } 4% { opacity: 1; } 18% { opacity: .9; } 100% { opacity: 0; } }
/* Charge: the star swells then collapses to a point. Then a held beat. The arms never move. */
html.charging .spark .boost { animation: implode .42s cubic-bezier(.5, 0, .9, .3) forwards; }
@keyframes implode { 0% { transform: scale(1.5); } 55% { transform: scale(2.6) rotate(20deg); filter: brightness(1.6); } 100% { transform: scale(0) rotate(45deg); filter: brightness(3); } }
html.held .spark { opacity: 0 !important; transition: none; }

/* Shockwaves: a bright thin ring, a wide soft wave, and a faint late one. */
.shock { position: fixed; z-index: 59; left: var(--ox); top: var(--oy); width: 20px; height: 20px; margin: -10px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .95); box-shadow: 0 0 30px rgba(255, 255, 255, .6), inset 0 0 30px rgba(255, 255, 255, .4);
  animation: shock 1.1s cubic-bezier(.1, .8, .2, 1) forwards; will-change: transform, opacity; }
.shock-wide { border-width: 14px; border-color: rgba(255, 255, 255, .28); box-shadow: 0 0 60px rgba(255, 255, 255, .35); animation-duration: 1.5s; }
.shock-late { border-width: 1px; border-color: rgba(255, 255, 255, .5); animation-delay: .18s; animation-duration: 1.7s; }
@keyframes shock { from { transform: scale(.5); } to { transform: scale(170); opacity: 0; border-width: .2px; } }

/* Rays of light turning out of the touch. */
.rays { position: fixed; z-index: 58; left: var(--ox); top: var(--oy); width: 190vmax; height: 190vmax; margin: -95vmax 0 0 -95vmax; pointer-events: none; will-change: transform, opacity;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, .32) 1.5deg, rgba(255, 255, 255, 0) 4deg, rgba(255, 255, 255, 0) 11deg);
  -webkit-mask: radial-gradient(circle, transparent 1%, #000 4%, rgba(0, 0, 0, .6) 22%, transparent 45%);
  mask: radial-gradient(circle, transparent 1%, #000 4%, rgba(0, 0, 0, .6) 22%, transparent 45%);
  animation: rays 1.8s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes rays { 0% { opacity: 0; transform: rotate(0) scale(.6); } 6% { opacity: 1; } 100% { opacity: 0; transform: rotate(14deg) scale(1.15); } }

/* A warm glow that lingers where the fingers met. */
.afterglow { position: fixed; z-index: 57; left: var(--ox); top: var(--oy); width: 90vmin; height: 90vmin; margin: -45vmin 0 0 -45vmin; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), rgba(255, 255, 255, .18) 35%, transparent 70%);
  animation: afterglow 3.4s ease-out forwards; will-change: transform, opacity; }
@keyframes afterglow { 0% { opacity: 1; transform: scale(.4); } 20% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }

.burst { position: fixed; inset: 0; z-index: 58; width: 100%; height: 100%; pointer-events: none; }


/* Forming: each piece waits, invisible, while its dust flies in (creation.js), then solidifies. */
html.forming [data-form] { opacity: 0; }
html.forming [data-form].formed { opacity: 1; transition: opacity .45s ease; }
html.forming.calm [data-form] { opacity: 1; animation: fade .6s backwards; }
.assemble { position: fixed; inset: 0; z-index: 57; width: 100%; height: 100%; pointer-events: none; }
html.forming .hand-adam { transition: filter 1.2s ease .3s, opacity 1.2s ease .3s; }

@media (prefers-reduced-motion: reduce) {
  html.pre.spark-on .spark .glint, html.pre.spark-on .spark .core { animation: none; }
}

.hero-controls {
  position: absolute; z-index: 4; left: var(--gutter); bottom: calc(6vh + var(--tw) * 1.64 + 12px);
  display: flex; align-items: center; gap: 16px;
}
.hero-controls button:not([hidden]) {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none;
  color: var(--muted); font: 400 11px/1 'Geist Mono', ui-monospace, monospace; cursor: pointer;
}
.hero-controls button::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; }
.hero-controls button[aria-pressed="true"]::before { opacity: 1; background: var(--iris); }
.hero-controls button:hover:not([hidden]) { color: var(--ink); }
.hero-controls button:focus-visible { outline: 2px solid var(--iris); outline-offset: 4px; }
html.pre .hero-controls, html.forming .hero-controls { visibility: hidden; }
@media (max-width: 820px) { .hero-controls { bottom: calc(4vh + var(--tw) * 1.64 + 10px); } }

/* ---------- Dust that never settled (ambient.js) ---------- */
.ambient { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Construction lines (construct.js) ---------- */
.section { position: relative; }
.construct { position: absolute; left: 0; top: 0; z-index: 3; overflow: visible; pointer-events: none; }
.construct line, .construct path, .construct circle {
  stroke-width: 1; vector-effect: non-scaling-stroke; fill: none;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.6s var(--d, 0s) cubic-bezier(.6, .05, .25, 1);
}
.construct .ink { stroke: var(--ink); opacity: .22; }
.construct .lite { stroke: #f1eee7; opacity: .26; }
.construct .spiral { opacity: .38; transition-duration: 2.6s; }
.construct text { fill: var(--muted); font: 400 10px/1 'Geist Mono', ui-monospace, monospace; letter-spacing: .02em; opacity: 0; transition: opacity .8s calc(var(--d, 0s) + .4s) ease; }
.construct.drawn line, .construct.drawn path, .construct.drawn circle { stroke-dashoffset: 0; }
.construct.drawn text { opacity: .8; }
.construct.instant * { transition: none !important; }
@media (max-width: 820px) { .construct text { font-size: 9px; } }

/* Drafting annotations (construct.js): card callouts ride along with each card's parallax. */
.tile { position: relative; }
.tile > .construct { z-index: 4; }
.construct .tag { fill: none; }
.construct text.strong { fill: var(--ink); opacity: 0; }
.construct.drawn text.strong { opacity: .7; }
.construct .block { stroke: var(--ink); opacity: .3; }
.hands img, .hands canvas { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* ---------- Inline chips in the About statement ---------- */
/* A small glyph tile before a phrase; some open a card of related projects. They pop in as the
   word-by-word reveal reaches them. */
.chip { position: relative; white-space: nowrap; }
.chip-ico {
  /* An inline-block with no text has its baseline at its bottom edge, so baseline alignment
     stands the tile on the line, the same as the letters; .72em tall matches the cap height. */
  display: inline-block; width: .72em; height: .72em; margin: 0 .16em 0 .02em;
  border-radius: .2em; background: var(--ink); color: var(--paper); vertical-align: baseline;
  transform-origin: 50% 70%; transition: transform .55s cubic-bezier(.3, 1.7, .5, 1), opacity .25s ease;
}
.chip-ico svg { display: block; width: 66%; height: 66%; margin: 17%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.about-statement.split .chip .chip-ico { transform: scale(.2) rotate(-18deg); opacity: 0; }
.about-statement.split .chip.on .chip-ico { transform: none; opacity: 1; }
.chip-btn { all: unset; cursor: pointer; border-radius: .15em; }
.chip-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: .08em; }
.has-card .chip-text { text-decoration: underline dotted; text-decoration-thickness: .06em; text-underline-offset: .14em; text-decoration-color: color-mix(in srgb, var(--ink) 45%, transparent); transition: text-decoration-color .2s; }
.has-card:hover .chip-text, .has-card.open .chip-text { text-decoration-color: var(--ink); }

.chip-card {
  position: absolute; z-index: 30; top: calc(100% + 10px); left: var(--card-x, 0px);
  width: max-content; max-width: min(320px, calc(100vw - 32px)); padding: 6px;
  display: grid; gap: 2px; white-space: normal;
  background: #121110; color: #ece9e2; border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45);
  font: 400 13px/1.35 'Geist', sans-serif; letter-spacing: 0;
  opacity: 0; transform: translateY(6px) scale(.97); transform-origin: 20px 0; pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .9, .3, 1);
}
.chip-card::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }   /* hover bridge */
.has-card:hover .chip-card, .has-card.open .chip-card, .has-card:focus-within .chip-card { opacity: 1; transform: none; pointer-events: auto; }
.chip-card a { display: grid; gap: 2px; padding: 9px 11px; border-radius: 8px; color: inherit; text-decoration: none; }
.chip-card a:hover, .chip-card a:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.chip-card b { font-weight: 600; font-size: 14px; }
.chip-card span { font: 400 11px/1.4 'Geist Mono', ui-monospace, monospace; color: #9a968d; }
[data-theme="dark"] .chip-card { background: #ece9e2; color: #161512; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .7); }
[data-theme="dark"] .chip-card span { color: #6d6a63; }
[data-theme="dark"] .chip-card a:hover, [data-theme="dark"] .chip-card a:focus-visible { background: rgba(0, 0, 0, .06); }
@media (hover: none) { .has-card:hover .chip-card, .has-card:focus-within .chip-card { opacity: 0; pointer-events: none; } .has-card.open .chip-card { opacity: 1; pointer-events: auto; } }

@media (max-width: 820px) { .about { padding-bottom: 200px; } }   /* room for the drawing's title block */

/* Chip flair: each tile is a little keycap that presses down under the pointer, sends up a puff
   of dust as it pops in, and has one moving part of its own. */
.chip-ico {
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 80%, var(--paper)), var(--ink) 55%);
  box-shadow: inset 0 .035em 0 color-mix(in srgb, var(--paper) 22%, transparent),
              inset 0 -.05em 0 color-mix(in srgb, #000 35%, transparent),
              0 .05em 0 color-mix(in srgb, var(--ink) 70%, #000),
              0 .1em .16em -.05em rgba(0, 0, 0, .35);
}
.chip:hover .chip-ico, .chip.open .chip-ico {
  transform: translateY(.035em);
  box-shadow: inset 0 .035em 0 color-mix(in srgb, var(--paper) 22%, transparent),
              inset 0 -.04em 0 color-mix(in srgb, #000 35%, transparent),
              0 .015em 0 color-mix(in srgb, var(--ink) 70%, #000),
              0 .04em .08em -.04em rgba(0, 0, 0, .35);
  transition-duration: .12s;
}
.about-statement.split .chip.on:hover .chip-ico, .about-statement.split .chip.on.open .chip-ico { transform: translateY(.035em); }

/* A puff of dust as the tile lands. */
.chip-ico::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: .05em; height: .05em; border-radius: 50%;
  opacity: 0; pointer-events: none; color: var(--ink);
  box-shadow: 0 -.62em, .44em -.44em, .62em 0, .44em .44em, 0 .62em, -.44em .44em, -.62em 0, -.44em -.44em,
              .24em -.72em, .72em .24em, -.24em .72em, -.72em -.24em;
}
.about-statement.split .chip.on .chip-ico::after { animation: chip-puff .7s .08s ease-out both; }
@keyframes chip-puff {
  0%   { opacity: .9; transform: translate(-50%, -50%) scale(.45); }
  100% { opacity: 0;  transform: translate(-50%, -50%) scale(1.35); }
}

/* The moving parts. */
.chip-ico svg * { transform-box: fill-box; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.chip-ico .shackle { transform-origin: 100% 100%; }
.chip:hover .shackle, .chip.open .shackle { transform: translateY(-14%) rotate(-24deg); }     /* the lock opens */
.chip-ico .piece { transform-origin: 50% 60%; }
.chip:hover .piece, .chip.open .piece { animation: chip-wiggle .5s ease-in-out; }           /* the piece wiggles into place */
@keyframes chip-wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-12deg); } 60% { transform: rotate(8deg) translateY(-6%); } }
.chip:hover .prompt, .chip.open .prompt { transform: translateX(18%); }                  /* the prompt nudges forward */
.chip-ico .cursor { animation: chip-blink 1.1s steps(1) infinite; }                     /* and the cursor blinks */
@keyframes chip-blink { 50% { opacity: 0; } }
.chip-ico .ping { fill: currentColor; stroke: var(--ink); stroke-width: 1.3; transform-origin: 50% 50%; transform: scale(0); }
.chip:hover .ping, .chip.open .ping { transform: scale(1); }                             /* the phone gets a notification */
.chip[data-ico="phone"]:hover .chip-ico { animation: chip-buzz .32s linear 2; }
@keyframes chip-buzz { 0%, 100% { translate: 0 0; } 25% { translate: -.03em 0; } 75% { translate: .03em 0; } }
@media (prefers-reduced-motion: reduce) { .chip-ico .cursor { animation: none; } }

/* ---------- Guestbook: a ruled sheet of signatures, and a form like a title block ---------- */
.guestbook { padding-bottom: clamp(120px, 14vw, 200px); }
.gb { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 56px; align-items: start; position: relative; z-index: 2; }
.gb-sheet { grid-column: 1 / span 7; }
.gb-count { margin: 0 0 14px; }
.gb-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.gb-entry {
  display: grid; grid-template-columns: 3.2em 1fr; column-gap: 18px; row-gap: 6px;
  padding: 20px 0 18px; border-bottom: 1px solid var(--rule);
}
.gb-num { grid-row: 1 / span 2; padding-top: .45em; color: var(--muted); }
.gb-message { margin: 0; font: 500 clamp(18px, 1.6vw, 22px)/1.35 'Geist', sans-serif; letter-spacing: -.015em; overflow-wrap: anywhere; }
.gb-meta { margin: 0; }
.gb-name { color: var(--ink); }
.gb-entry.is-fresh { animation: gb-ink 1.2s ease both; }
@keyframes gb-ink { from { opacity: 0; transform: translateY(-8px); background: color-mix(in srgb, var(--ink) 6%, transparent); } 60% { opacity: 1; transform: none; background: color-mix(in srgb, var(--ink) 6%, transparent); } to { background: transparent; } }
.gb-more { margin-top: 24px; font-family: inherit; cursor: pointer; border: 0; }

.gb-form {
  grid-column: 9 / span 4; position: sticky; top: 110px;
  display: grid; gap: 0; border: 1px solid var(--ink); background: var(--paper);
}
.gb-form-title { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--ink); color: var(--ink); }
.gb-field { display: grid; grid-template-columns: 64px 1fr; border-bottom: 1px solid var(--rule); }
.gb-field > span { padding: 13px 0 0 14px; border-right: 1px solid var(--rule); }
.gb-field input, .gb-field textarea {
  min-width: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); padding: 11px 14px;
  font: 400 16px/1.45 'Geist', sans-serif; resize: vertical; outline: none;
}
.gb-field textarea { min-height: 7.5em; }
.gb-field:focus-within { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.gb-field:focus-within > span { color: var(--ink); }
.gb-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 14px; }
.gb-actions .pill { border: 0; cursor: pointer; font-family: inherit; }
.gb-actions .pill:disabled { opacity: .5; cursor: progress; }
.gb-status { margin: 0; padding: 0 14px; min-height: 0; }
.gb-status:not(:empty) { padding: 0 14px 12px; color: var(--ink); }
.gb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 820px) {
  .gb-sheet, .gb-form { grid-column: 1 / -1; }
  .gb-form { position: static; order: -1; }
}
.gb-form[hidden], .gb-more[hidden], .gb-entry[hidden] { display: none; }

/* ---------- Routes to the media page ---------- */
.about-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.media-teaser { padding-top: 0; position: relative; z-index: 2; }
.media-band {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(16px, 2.4vw, 32px);
  padding: clamp(18px, 2.4vw, 28px) clamp(16px, 2vw, 28px); border: 1px solid var(--ink); border-radius: 4px;
  color: var(--ink); text-decoration: none; background: var(--paper);
  transition: background .3s, color .3s;
}
.media-band:hover, .media-band:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.mb-disc {
  position: relative; width: clamp(56px, 6vw, 84px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: repeating-radial-gradient(circle, #171614 0 1.5px, #0f0e0d 1.5px 3px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset;
  animation: mb-spin 2.4s linear infinite; animation-play-state: paused;
}
.media-band.is-playing .mb-disc, .media-band:hover .mb-disc { animation-play-state: running; }
@keyframes mb-spin { to { transform: rotate(1turn); } }
.mb-disc i { width: 36%; aspect-ratio: 1; border-radius: 50%; background: #d9d5cc center / cover no-repeat; box-shadow: 0 0 0 2px #0c0b0a; }
.mb-text { display: grid; gap: 4px; min-width: 0; }
.media-band .mono { color: inherit; opacity: .7; }
.mb-title { font: 700 clamp(22px, 3vw, 44px)/1.02 'Geist', sans-serif; letter-spacing: -.045em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-go { white-space: nowrap; }
.mb-go i { display: inline-block; font-style: normal; transition: transform .3s cubic-bezier(.2, .9, .3, 1); }
.media-band:hover .mb-go i { transform: translateX(6px); }
@media (max-width: 820px) {
  .media-band { grid-template-columns: auto 1fr; }
  .mb-go { grid-column: 2; }
  .mb-title { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .mb-disc { animation: none; } }

/* Greenery (plants.js): one fixed canvas behind the page content, fading in once it's ready. */
.plants-layer { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.plants-layer.front { z-index: 3; }   /* above the footer, for beds inside it (contact cards) */
.plants-canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }
.plants-canvas.on { opacity: 1; }

/* Page transitions (transitions.js names the shared parts). The outgoing page breaks up into
   grains, sweeping across, while drifting slightly; the new page is already underneath. The
   record and the "media" title morph between the home and media pages. */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 1.15s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(root) {
  z-index: 2;
  -webkit-mask-image: url(/next/img/dust-mask.png); mask-image: url(/next/img/dust-mask.png);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: vt-dust 1.25s cubic-bezier(.45, .05, .55, .95) both, vt-drift 1.25s cubic-bezier(.4, 0, .7, .7) both;
}
::view-transition-new(root) { animation: vt-settle 1.2s cubic-bezier(.2, .8, .2, 1) both; }
/* The small nav word blurs when blown up, so let it go quickly and the crisp title take over. */
::view-transition-old(media-title) { animation-duration: .25s; }
::view-transition-new(media-title) { animation-duration: .45s; }
@keyframes vt-dust { from { -webkit-mask-position: 0 0; mask-position: 0 0; } to { -webkit-mask-position: 100% 0; mask-position: 100% 0; } }
@keyframes vt-drift { to { transform: translate(-28px, -8px); } }
@keyframes vt-settle { from { transform: scale(.992); } }
/* The nav normally inverts over the page; while it's morphing it needs its own ink colour. */
.vt-morph .chrome-nav a[href="/next/media/"] { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@media (max-width: 820px) {
  .channels { grid-template-columns: 1fr 1fr; }
  .ch a { min-height: 140px; }
}
@media (max-width: 520px) { .channels { grid-template-columns: 1fr; } .ch.wide { grid-column: auto; } }
@media (prefers-reduced-motion: reduce) { .ch a, .ch-ico * { transition: none; } .ch a:hover .dots, .ch a:hover .wave { animation: none; } }

/* The planter ledge along the bottom of the hero: it sits above both plant canvases and hides
   where the stems are cut off. A matte trough with a lit top lip and a little grain. */
.hero-planter {
  --lip: #d9d3c7; --face-a: #c7c0b2; --face-b: #b3ab9c;
  position: relative; z-index: 4; height: 44px; margin: -30px 0 -14px; pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(var(--lip) 0, var(--lip) 3px, var(--face-a) 5px, var(--face-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -10px 14px -8px rgba(0, 0, 0, .5), 0 -6px 14px -6px rgba(0, 0, 0, .55), 0 16px 26px -12px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"] .hero-planter { --lip: #2b2824; --face-a: #1c1a17; --face-b: #121110; }
html.pre .hero-planter { visibility: hidden; }

/* The loose screw on the flap board (flap3d.js): an invisible button over it. */
.screw-hit {
  position: absolute; z-index: 2; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.screw-hit:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; }
/* The wipe to the old site: a dark shutter drops over the page. */
.legacy-wipe {
  position: fixed; inset: 0; z-index: 10000; background: #0b0a09; pointer-events: all;
  transform: translateY(-101%); transition: transform .8s cubic-bezier(.7, 0, .25, 1);
  box-shadow: 0 2px 0 #f0b46a, 0 0 40px 6px rgba(240, 180, 106, .45);
}
.legacy-wipe.on { transform: none; }

/* The ruler scrollbar (ruler.js): the native bar is hidden and a measuring rule takes its place. */
html.has-ruler:not(.native-scroll) { scrollbar-width: none; }
html.has-ruler:not(.native-scroll)::-webkit-scrollbar { display: none; }
html.native-scroll .ruler:not(.command-palette .ruler) { display: none; }
.ruler { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: 34px; cursor: pointer; transition: opacity .6s ease; }
.ruler canvas { display: block; }
.ruler-thumb {
  position: absolute; top: 0; right: 6px; width: 9px; cursor: grab;
  border: 1px solid var(--ink); border-left: 0; opacity: .75; transition: opacity .2s ease;
}
.ruler-thumb::before { content: ''; position: absolute; left: -4px; right: 0; top: 50%; border-top: 1px solid var(--ink); }   /* centre mark */
.ruler:hover .ruler-thumb, .ruler.live .ruler-thumb { opacity: 1; }
.ruler.held .ruler-thumb { cursor: grabbing; }
.ruler-read {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font: 400 10px/1 'Geist Mono', ui-monospace, monospace; color: var(--ink);
  background: var(--paper); padding: 3px 5px; box-shadow: inset 0 0 0 1px var(--rule);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.ruler:hover .ruler-read, .ruler.live .ruler-read, .ruler.held .ruler-read { opacity: 1; }
html.pre .ruler { opacity: 0; pointer-events: none; }

/* The 404 wall (404.html, flapwall.js). */
.wall-page { overflow: hidden; height: 100svh; background: #080807; }
.flapwall { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; }
.wall-beds { position: fixed; inset: 0; pointer-events: none; }
.wall-bed-top { position: absolute; left: 0; right: 0; top: 0; height: 1px; }
.wall-bed-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; }
.wall-exit { position: fixed; z-index: 5; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 6px; }
.wall-exit:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px; }
.wall-fallback { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #eee8da; font: 400 clamp(80px, 20vw, 220px)/1 'Geist Mono', ui-monospace, monospace; }
.wall-fallback p { margin: 0; }
.wall-fallback a { font-size: 12px; color: #8f8b83; }
html.wall-on .wall-fallback { display: none; }
