:root { --bg: #fbfbfa; --fg: #1a1a1a; --muted: #6b6b6b; --line: #d6d6d2; --card: #fff; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d0f12; --fg: #ececea; --muted: #8f8f8c; --line: #33363a; --card: #16181c; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}


/* explicit size: a canvas ignores inset for sizing, so without this it renders at its pixel size and the glow drifts off the cursor */
#bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

nav { display: flex; gap: 20px; margin-bottom: 40px; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
nav a:hover, nav a[aria-current] { color: var(--fg); }

.lede { margin-top: 16px; }
.soon { font-size: 13px; color: var(--muted); }
.next { margin-top: 8px; padding: 18px; border-radius: 12px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.next h3 { font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.next p + p { margin-top: 10px; }
.notes .reveal p { padding-left: 0; }

main { max-width: 640px; margin: 0 auto; padding: 48px 20px 72px; }
h1 { font: 400 48px/1.1 "Instrument Serif", Georgia, serif; letter-spacing: -.01em; }
h2 { font: italic 400 28px/1.2 "Instrument Serif", Georgia, serif; margin: 72px 0 14px; }
p { color: var(--muted); }

.clocks { margin: 10px 0 24px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.clocks b { font-weight: 500; color: var(--fg); }

.status { margin-top: 20px; padding: 14px 16px; border-radius: 10px; background: color-mix(in srgb, var(--card) 70%, transparent); box-shadow: 0 0 0 1px var(--line); color: var(--fg); font-size: 16px; backdrop-filter: blur(6px); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: #22c55e; vertical-align: 2px; box-shadow: 0 0 0 0 #22c55e88; animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px #22c55e00; } 100% { box-shadow: 0 0 0 0 #22c55e00; } }

a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: text-decoration-color .2s; }
a:hover, a:focus-visible { text-decoration-color: var(--fg); }
a.out::after { content: "↗"; display: inline-block; margin-left: 3px; font-size: .75em; opacity: 0; transform: translate(-3px, 3px); transition: opacity .2s, transform .2s; }
a.out:hover::after, a.out:focus-visible::after { opacity: 1; transform: none; }

.links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 20px; }

/* work */
.item { padding: 12px 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.row > span:first-child { display: flex; align-items: center; gap: 12px; }
.row > span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.at { color: var(--muted); }
.logo { width: 28px; height: 28px; flex: none; border-radius: 7px; background: #fff; object-fit: contain; padding: 3px; box-shadow: 0 0 0 1px var(--line); transition: transform .25s; }
.item:hover .logo { transform: rotate(-6deg) scale(1.08); }

.reveal, .expand { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .35s ease, opacity .3s ease; }
.reveal > div, .expand > div { overflow: hidden; }
.reveal p { padding: 6px 0 0 40px; }
.expand p { padding-top: 12px; }
.item:hover > .reveal, .item:focus-within > .reveal, .open > .expand { grid-template-rows: 1fr; opacity: 1; }
@media (hover: none) { .reveal { grid-template-rows: 1fr; opacity: 1; } }

.more { margin-top: 10px; background: none; border: 0; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: color .2s; }
.more:hover, .more:focus-visible { color: var(--fg); }

/* projects: numbered grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { position: relative; padding: 18px; background: var(--bg); border-radius: 12px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .25s, transform .25s; }
.card:hover { box-shadow: 0 0 0 1px var(--fg); transform: translateY(-2px); }
.card .n { font: italic 400 22px/1 "Instrument Serif", Georgia, serif; color: var(--muted); }
.card h3 { font-size: 17px; font-weight: 500; margin: 10px 0 4px; }
.card h3 a::before { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card p { font-size: 15px; }
.card small { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }

/* hover website preview */
#pv { position: fixed; top: 0; left: 0; width: 320px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: var(--card);
      box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(0,0,0,.35); pointer-events: none; z-index: 10;
      opacity: 0; transform: scale(.94) translateY(6px); transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); }
#pv.on { opacity: 1; transform: none; }
#pv img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
#pv p { position: absolute; inset: auto 0 0; margin: 0; padding: 28px 12px 9px; font-size: 12px; color: #fff;
        background: linear-gradient(transparent, rgba(0,0,0,.65)); }
#pv p:empty { display: none; }

footer { margin-top: 80px; font-size: 14px; color: var(--muted); }

main > * { animation: up .7s ease both; }
main > :nth-child(2) { animation-delay: .06s } main > :nth-child(3) { animation-delay: .12s }
main > :nth-child(4) { animation-delay: .18s } main > :nth-child(5) { animation-delay: .24s }
main > :nth-child(6) { animation-delay: .3s }  main > :nth-child(n+7) { animation-delay: .36s }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* discovery */
.from { margin: -6px 0 8px; font-size: 14px; font-style: italic; }
.next .why { color: var(--fg); margin-bottom: 10px; }
.stack { display: flex; margin-bottom: 12px; }
.stack .logo + .logo { margin-left: -8px; }
.next:hover .stack .logo:nth-child(2) { transform: translateX(6px) rotate(6deg); }

/* discovery map */
.mapwrap { margin: 28px -20px 0; padding: 0 20px; overflow-x: auto; }
.map { display: block; width: 100%; min-width: 560px; height: auto; font: 13px ui-sans-serif, system-ui, sans-serif; }
.map .edge path { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s ease forwards; transition: stroke .2s, opacity .2s; }
.map .edge text { font-size: 11px; fill: var(--muted); font-style: italic; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; opacity: 0; transition: opacity .2s; }
.map .node { animation: up .5s ease both; cursor: pointer; transition: opacity .2s; }
.map .node text { fill: var(--fg); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.map .node circle { fill: var(--bg); stroke: var(--fg); stroke-width: 1.5; transition: r .2s; }
.map .node.p circle { fill: var(--fg); }
.map .node.p text { font: italic 17px "Instrument Serif", Georgia, serif; }
.map .node.n circle { fill: #22c55e; stroke: #22c55e; }
.map .node.n .ring { fill: none; transform-box: fill-box; transform-origin: center; animation: ring 2s ease-out infinite; }
.map .node:hover circle:first-of-type { r: 9; }
.map.focus .node:not(.hot) { opacity: .3; }
.map.focus .edge:not(.hot) path { opacity: .25; }
.map .edge.hot path { stroke: var(--fg); }
.map .edge.hot text { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(2.4); opacity: 0; } }

.legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; border: 1.5px solid var(--fg); }
.lg.p { background: var(--fg); } .lg.n { background: #22c55e; border-color: #22c55e; }

/* notes with mini diagrams */
.note { display: grid; grid-template-columns: 1fr 170px; gap: 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.note:target { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, #22c55e 12%, transparent); } }
@media (max-width: 560px) { .note { grid-template-columns: 1fr; } .note .fig { max-width: 220px; } }
.note h3 { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.note p { font-size: 16px; }
.leads { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.leads::before { content: "→ "; }
.fig { width: 100%; height: auto; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 1.2; overflow: visible; }
.fig text { fill: currentColor; stroke: none; font: 10px ui-sans-serif, system-ui, sans-serif; }
.fig .hot { fill: #22c55e; stroke: none; opacity: .85; }
.fig .hot-line { stroke: #22c55e; stroke-width: 1.8; }
.fig .thick { stroke-width: 4; stroke-linecap: round; }
.fig .bars rect { fill: currentColor; stroke: none; opacity: .35; }
.fig .flow { animation: flow 2.4s steps(6, jump-none) infinite; }
@keyframes flow { to { transform: translateX(80px); } }
.fig .seg { transform-box: fill-box; transform-origin: left; animation: fill 2.8s ease-in-out infinite; }
@keyframes fill { 0% { transform: scaleX(0); } 60%, 100% { transform: scaleX(1); } }
.fig .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2s ease .3s forwards; }
.fig.wide { margin: 14px 0 0; max-width: 420px; display: block; }
.cap { font-size: 13px; margin: 6px 0 12px; }
.blocks rect { fill: none; stroke: var(--line); transition: fill .3s; }
.blocks .r0 { fill: #22c55e; stroke: none; } .blocks .r1 { fill: var(--fg); stroke: none; opacity: .55; } .blocks .r2 { fill: var(--muted); stroke: none; opacity: .4; }

#views { opacity: 0; transition: opacity .6s; font-variant-numeric: tabular-nums; }
#views.on { opacity: 1; }

#tip { position: fixed; top: 0; left: 0; max-width: 240px; padding: 6px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4;
       background: var(--fg); color: var(--bg); pointer-events: none; z-index: 10; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
#tip.on { opacity: 1; transform: none; }
