/* linkedwallets.github.io — one person as a node: a flat map of the network, a zoom into the
   site's node, then a small server, rendered live, taken apart by scroll, after ghost.ai. Warm
   grey paper with grain, black hairline tables, one orange.
   Switzer + Gambetta load from Fontshare's CDN (the ITF licence forbids hosting the files here).
   Commit Mono (OFL) is self-hosted. Typed graph nodes from the pass after andrewtrousdale.com. */

@font-face {
  font-family: "Commit Mono";
  src: url("/assets/fonts/CommitMono-400-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #e4e2dd;
  --fill: rgba(247, 246, 243, 0.8);
  --idle: rgba(247, 246, 243, 0.5);
  --ink: #141413;
  --mute: #66645f;
  --faint: #9a9892;
  --rule: rgba(20, 20, 19, 0.16);
  --orange: #ff5a1f;
  --blue: #7d86d6;
  --on-orange: #141413;
  --edge: rgba(20, 20, 19, 0.45);
  --idle-ink: rgba(20, 20, 19, 0.55);
  --sheet: #f4f3f0;
  --veil: rgba(228, 226, 221, 0.78);
  --shade: rgba(20, 20, 19, 0.14);
  --dots: #5f69cf;
  --points: rgba(20, 20, 19, 0.55);
  --sans: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --serif: "Gambetta", Georgia, serif;
  --mono: "Commit Mono", ui-monospace, monospace;
  --pad: clamp(1rem, 3.2vw, 2.25rem);
  --head-h: 3.75rem;
  --grain: 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%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* dark: warm near-black paper, light ink, a lighter blue-violet, the same orange. Contrast on
   the paper: ink 14.5:1, mute 7.4:1, faint 5.7:1, orange 5.6:1. */
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1a1917;
  --fill: rgba(38, 36, 33, 0.82);
  --idle: rgba(38, 36, 33, 0.55);
  --ink: #ece9e2;
  --mute: #aca89f;
  --faint: #97938a;
  --rule: rgba(236, 233, 226, 0.16);
  --blue: #a3aaf0;
  --edge: rgba(236, 233, 226, 0.5);
  --idle-ink: rgba(236, 233, 226, 0.66);
  --sheet: #26241f;
  --veil: rgba(26, 25, 23, 0.78);
  --shade: rgba(0, 0, 0, 0.5);
  --dots: #8a93ec;
  --points: rgba(236, 233, 226, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--head-h); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }
body.pal-open { overflow: hidden; }

/* a fine grain over everything, like a print on paper */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.22;
}
html[data-theme="dark"] body::after { filter: invert(1); opacity: 0.1; }

::selection { background: var(--orange); color: var(--on-orange); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--orange); }
:focus-visible { outline: 1.5px solid var(--orange); outline-offset: 3px; }

.wrap { max-width: 88rem; margin: 0 auto; padding-inline: var(--pad); width: 100%; }

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 70;
}
.skip:focus { left: 0.5rem; }

.label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* the node shapes of the transfer graph, reused as glyphs */
.sh {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--ink);
  vertical-align: 0.02em;
}
.sh.ci { border-radius: 50%; }
.sh.tr { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sh.hx { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.sh.bu {
  width: 11px;
  height: 11px;
  background: var(--orange);
  clip-path: polygon(50% 0, 61% 20%, 85% 15%, 80% 39%, 100% 50%, 80% 61%, 85% 85%, 61% 80%, 50% 100%, 39% 80%, 15% 85%, 20% 61%, 0 50%, 20% 39%, 15% 15%, 39% 20%);
}
.throb { animation: throb 1.8s ease-in-out infinite; }
@keyframes throb { 50% { opacity: 0.3; } }

/* tags: grey outlined when idle, solid orange when on (after the ghost.ai callouts) */
.pill {
  display: inline-flex;
  align-items: center;
  height: 1.9rem;
  padding: 0 0.75rem;
  border: 1px solid var(--edge);
  background: var(--idle);
  color: var(--idle-ink);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.pill.on, .call.on .pill { background: var(--orange); border-color: var(--ink); color: var(--on-orange); }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--head-h);
  max-width: none;
  padding-inline: max(var(--pad), calc((100% - 88rem) / 2 + var(--pad)));
  font-size: 0.8rem;
  background: var(--paper);
  border-bottom: 1px solid transparent;
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .site-head {
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}
.site-head.scrolled { border-bottom-color: var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; text-decoration: none; }
.chain { color: var(--mute); font-family: var(--mono); font-size: 0.72rem; }
.chain .sh { width: 6px; height: 6px; margin-right: 0.35rem; background: var(--orange); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
.site-nav a { text-decoration: none; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.74rem; }
.site-nav a[aria-current="page"] { text-decoration: underline; }

.k-btn {
  font: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--fill);
  border: 1px solid var(--ink);
  border-radius: 0;
  height: 1.9rem;
  padding: 0 0.7rem;
  cursor: pointer;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}
.k-btn:hover { background: var(--orange); color: var(--on-orange); }
.k-btn kbd { font-family: var(--mono); font-size: 0.7rem; color: var(--mute); text-transform: none; }
html[data-theme="dark"] .k-btn:hover kbd { color: var(--on-orange); }
.k-btn .short { display: none; }

/* the light/dark switch: shows the mode in use (main.js) */
.t-btn {
  font: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: none;
  border: 0;
  height: 1.9rem;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}
.t-btn:hover { color: var(--orange); }
.t-btn i { width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, transparent 50%, currentColor 50%); }
html[data-theme="dark"] .t-btn i { background: currentColor; }

/* ---------- panels with hairline rows ---------- */

.card {
  background: var(--fill);
  border: 1px solid var(--ink);
  padding: 1.1rem 1.4rem 0.6rem;
}

@keyframes fade { from { opacity: 0; transform: translateY(-3px); } }

.more { display: inline-block; margin: 0.4rem 0 1rem; font-size: 0.8rem; font-weight: 500; }

/* ---------- home: the map, then the node ----------
   A sticky stage holds the map (a canvas of dots under the graph's SVG) and a WebGL canvas.
   scene.js maps scroll to the stops: the map, the zoom into the closed node, panels out, all
   parts out, then one stop per part. Tags and callouts are HTML over the canvas. */

.nv { position: relative; }
.nv-stage { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.nv-gl { display: none; }

html.js .nv:not(.still) { height: calc(782vh - var(--head-h)); height: calc(782svh - var(--head-h)); }
html.js .nv:not(.still) .nv-stage {
  position: sticky;
  top: var(--head-h);
  height: calc(100vh - var(--head-h));
  height: calc(100svh - var(--head-h));
}
html.js .nv:not(.still) .nv-gl { display: block; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.nv-intro {
  order: -1;
  position: relative;
  z-index: 2;
  max-width: 26rem;
  padding: 5.5rem var(--pad) 1rem;
}
html.js .nv:not(.still) .nv-intro { position: absolute; left: 0; top: 50%; transform: translateY(-50%); padding: 0 var(--pad); }
.nv-intro h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4.2vw, 3.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}
.nv-intro .tag { margin: 0.45rem 0 1.2rem; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--mute); }
.nv-intro p { margin: 0 0 0.8rem; }
.nv-intro .lead { font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.35; }
.nv-intro .go { font-size: 0.88rem; color: var(--mute); }
.nv-intro .go em { color: var(--ink); }

.nv-cue { display: none; }
html.js .nv:not(.still) .nv-cue {
  display: block;
  position: absolute;
  left: 50%;
  bottom: 2.2rem;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mute);
  white-space: nowrap;
}
.nv-cue span { border-bottom: 1px dashed var(--mute); }

.nv-meter { display: none; }
html.js .nv:not(.still) .nv-meter {
  display: block;
  position: absolute;
  right: var(--pad);
  bottom: 2.2rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mute);
}

/* the map: a flat world in dots, the network's nodes, and the transfer graph (map.js) */
.nv-map { display: none; position: relative; margin: 0; }
html.js .nv-map { display: block; }
html.js .nv:not(.still) .nv-map { position: absolute; inset: 0; }
.nv.still .nv-map { aspect-ratio: 360 / 150; }
.nv-dots, .nv-map .graph { position: absolute; inset: 0; width: 100%; height: 100%; }
.nv-map .graph text { opacity: var(--words, 1); }
.nv-map figcaption {
  position: absolute;
  left: var(--pad);
  bottom: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mute);
}
.nv.still .nv-map figcaption { bottom: 0.4rem; }

/* callouts: an orange tag joined to a small table of rows */
.nv-calls {
  list-style: none;
  margin: 0;
  padding: 1rem var(--pad) 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: 1.2rem;
}
.call { display: flex; align-items: flex-start; min-width: 0; }
.call .pill { flex: none; }
.spec { list-style: none; margin: 0 0 0 -1px; padding: 0; min-width: 0; font-size: 0.82rem; }
.spec li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  min-height: 1.9rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--ink);
  border-top-width: 0;
  background: var(--fill);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  line-height: 1.3;
}
.spec li:first-child { border-top-width: 1px; border-left-width: 0; }
.spec a { text-decoration: none; }
.spec a:hover { text-decoration: underline; color: var(--ink); }
.spec i { font-style: normal; font-family: var(--mono); font-size: 0.68rem; color: var(--mute); white-space: nowrap; }
.redact { letter-spacing: -0.05em; color: var(--ink); }

html.js .nv:not(.still) .nv-calls { position: absolute; inset: 0; padding: 0; display: block; pointer-events: none; z-index: 3; }
html.js .nv:not(.still) .call {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
}
html.js .nv:not(.still) .call.on { z-index: 2; }
html.js .nv:not(.still) .call .pill { pointer-events: auto; }
html.js .nv:not(.still) .call.on .spec { pointer-events: auto; }
html.js .nv:not(.still) .spec { white-space: nowrap; clip-path: inset(0 100% 0 0); transition: clip-path 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
html.js .nv:not(.still) .call.on .spec { clip-path: inset(-2px -2px -2px 0); }
html.js .nv:not(.still) .call:not(.on) .pill:hover { color: var(--ink); border-color: var(--ink); }

/* reduced motion: one drawing of the node apart, with every callout open under it */
.nv.still:not(.flat) .nv-gl { display: block; width: 100%; height: 72vh; }

/* ---------- home: the parts, in full, after the node ---------- */

.parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 4rem);
  padding-block: 3rem 4rem;
}
.parts > .fig { grid-column: 1 / -1; margin: 0 0 1.4rem; font-family: var(--mono); font-size: 0.68rem; color: var(--mute); }
.part-sec { padding: 1rem 0 1.6rem; border-top: 1px solid var(--ink); min-width: 0; }
.part-sec.wide { grid-column: 1 / -1; }
.part-tag { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.4rem; font-family: var(--mono); font-size: 0.68rem; color: var(--mute); }
.part-sec h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.9rem 0 0.6rem;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.part-sec h3 { display: flex; align-items: center; gap: 0.6rem; margin: 1.6rem 0 0.4rem; font-size: 1.1rem; font-weight: 500; }
.part-sec h2 .sh { width: 10px; height: 10px; }
.count { font-family: var(--mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0; color: var(--faint); }
.part-sec p { margin: 0 0 0.9rem; max-width: 38rem; }
.part-sec .links { font-size: 1rem; line-height: 1.9; }
.part-sec blockquote {
  margin: 0.6rem 0 0.4rem;
  padding-left: 1rem;
  border-left: 2px solid var(--orange);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.35;
  max-width: 34rem;
}
.part-sec .src { font-size: 0.85rem; color: var(--mute); }
.chainrow { font-family: var(--mono); font-size: 0.72rem; color: var(--mute); }
.chainrow .sh { width: 6px; height: 6px; margin-right: 0.45rem; background: var(--orange); }

.title-block {
  grid-column: 1 / -1;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(4, auto);
  margin: 1rem 0 0;
  border: 1px solid var(--ink);
  background: var(--fill);
  font-family: var(--mono);
  font-size: 0.66rem;
}
.title-block div { display: flex; border-left: 1px solid var(--ink); }
.title-block div:first-child { border-left: 0; }
.title-block dt { padding: 0.35rem 0.6rem; color: var(--faint); border-right: 1px solid var(--rule); }
.title-block dd { margin: 0; padding: 0.35rem 0.6rem; }

/* ---------- transfer graph ---------- */

.graph { display: block; width: 100%; height: auto; overflow: visible; }

.g-edge { stroke: var(--ink); stroke-width: 1; fill: none; }
.g-edge.peer { stroke-dasharray: 3 4; stroke: var(--mute); }

.g-pulse {
  stroke: var(--orange);
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 8 980;
  animation: transfer 8s linear infinite;
}
@keyframes transfer { to { stroke-dashoffset: -988; } }

.g-node { cursor: default; animation: pop 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) both; transform-box: fill-box; transform-origin: center; }
.g-node:nth-of-type(2) { animation-delay: 0.05s; }
.g-node:nth-of-type(3) { animation-delay: 0.1s; }
.g-node:nth-of-type(4) { animation-delay: 0.15s; }
.g-node:nth-of-type(5) { animation-delay: 0.2s; }
.g-node:nth-of-type(6) { animation-delay: 0.25s; }
.g-node:nth-of-type(7) { animation-delay: 0.3s; }
.g-node:nth-of-type(8) { animation-delay: 0.35s; }
.g-node:nth-of-type(9) { animation-delay: 0.4s; }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }

.g-node .s { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.g-node .s.solid { fill: var(--ink); }
.g-node .pip { fill: var(--paper); }
.g-node .hit { fill: transparent; stroke: none; pointer-events: all; }
.g-node text, .g-amount {
  font-family: var(--sans);
  font-size: 13px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.g-node text.n { font-size: 9px; stroke: none; }
.g-amount { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.g-node:hover .s, .g-node:focus .s { fill: var(--orange); stroke: var(--orange); }
.g-node:focus { outline: none; }

.g-center .burst { fill: var(--orange); }
.g-center .halo {
  fill: none;
  stroke: var(--orange);
  transform-box: fill-box;
  transform-origin: center;
  animation: halo 2.6s ease-out infinite;
}
@keyframes halo {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}
.g-center text { font-size: 14px; font-weight: 500; }
.g-center text.sub { font-family: var(--mono); font-size: 10px; fill: var(--faint); font-weight: 400; }

svg.focused .g-edge { opacity: 0.25; }
svg.focused .g-edge.hot { opacity: 1; stroke: var(--orange); stroke-width: 1.5; }
svg.focused .g-pulse:not(.hot) { opacity: 0.15; }
svg.focused .g-pulse.hot { animation-duration: 2.2s; }

/* ---------- transfer rows ---------- */

.tx-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.2rem 0.8rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.tx-row:last-child { border-bottom: 0; }
.tx-row .sh { width: 7px; height: 7px; transform: translateY(-1px); }
.tx-title { font-weight: 500; }
.tx-row:hover .tx-title { color: var(--orange); }
.tx-dek { grid-column: 2 / -1; color: var(--mute); font-size: 0.86rem; line-height: 1.45; }
.tx-meta, .tx-hash { font-family: var(--mono); font-size: 0.68rem; color: var(--faint); white-space: nowrap; }
.tx-hash { grid-column: 2 / -1; }

/* ---------- inner pages: each head is a sheet with the node, its part lit ---------- */

.page-head, .writing-head {
  position: relative;
  padding: clamp(1rem, 2.6vw, 1.8rem);
  border: 1px solid var(--ink);
  background: var(--fill);
}
.part { margin: 0; font-family: var(--mono); font-size: 0.68rem; color: var(--mute); }
.part b { font-weight: 400; color: var(--orange); }
.page-head > .part, .writing-head > .part { grid-column: 1 / -1; padding: 0; margin-right: 9rem; }
.writing-head > .part { margin-bottom: 0.9rem; }

.mininode { position: absolute; top: 0.9rem; right: 1rem; width: 8rem; height: auto; overflow: visible; }
.mininode .b { fill: none; stroke: var(--blue); stroke-width: 1; }
.mininode .on { fill: var(--orange); stroke: var(--ink); stroke-width: 1; }
.revert .card { position: relative; }
.revert > .graph { border: 1px solid var(--ink); background: var(--fill); padding: 1rem; }
.card .mininode { top: 1rem; right: 1.2rem; width: 6.4rem; }
.revert .part { padding: 0 0 0.4rem; margin-right: 7rem; }

.page { padding-block: clamp(1.5rem, 5vw, 3.5rem) 4rem; }

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.page-head h1 {
  margin: 0.4rem 0 0;
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.page-head .label { margin: 0; color: var(--mute); display: flex; gap: 0.6rem; align-items: center; }
.lede { margin: 0; max-width: 32rem; font-family: var(--serif); font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.4; }

.list-card { max-width: 52rem; }
.list-card .tx-row { padding: 1.1rem 0; }
.list-card .tx-title { font-size: 1.15rem; }
.list-card .tx-dek { font-size: 0.95rem; }

.contract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.contract { scroll-margin-top: calc(var(--head-h) + 1rem); padding-bottom: 1.3rem; }
.contract:target { box-shadow: inset 0 0 0 2px var(--orange); }
.contract-head { display: flex; align-items: center; gap: 0.8rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.8rem; }
.contract h2 { margin: 0; font-size: 1.1rem; font-weight: 500; }
.addr { display: block; margin: 0.8rem 0 0.6rem; font-family: var(--mono); font-size: 0.72rem; color: var(--mute); }
.contract p { margin: 0; }

.badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.badge.deployed::before { background: var(--orange); }
.badge.building::before { background: transparent; border: 1px solid var(--ink); }
.badge.experiment::before { background: transparent; border: 1px dashed var(--ink); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1rem 0 0; padding: 0; }
.tags li { font-family: var(--mono); font-size: 0.68rem; color: var(--mute); border: 1px solid var(--edge); padding: 0.05em 0.6em; }

/* ---------- essays (after kedzich.com) ---------- */

.writing-head { max-width: 56rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.backlink { font-size: 0.8rem; text-decoration: none; font-weight: 500; }
.writing-head h1 {
  margin: 1rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.essay {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 40rem);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}

.receipt { position: sticky; top: calc(var(--head-h) + 1rem); font-size: 0.78rem; padding-bottom: 0.4rem; }
.receipt::before {
  content: "transaction receipt";
  display: block;
  padding: 0.2rem 0 0.8rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.receipt-row { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr); gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.receipt-row:last-child { border-bottom: 0; }
.receipt .k { color: var(--faint); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.1rem; }
.receipt .v { font-family: var(--mono); font-size: 0.72rem; overflow-wrap: anywhere; }
.receipt .who { font-family: var(--sans); font-size: 0.8rem; font-weight: 500; }
.receipt .ok { color: var(--orange); }

.prose { font-family: var(--serif); font-size: 1.22rem; line-height: 1.6; }
.prose p { margin: 0 0 1.1em; }
.prose h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 2.2em 0 0.9em;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prose h2::before { content: ""; width: 9px; height: 9px; background: var(--ink); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.prose h2::after { content: ""; flex: 1; border-top: 1px solid var(--ink); }
.prose blockquote {
  margin: 1.8em 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--orange);
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.35;
}
.dropcap { text-indent: 1.6em; }

/* ---------- 404 ---------- */

.revert { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 26rem); gap: 2rem; align-items: center; padding-block: 2rem 4rem; }
.revert .card h1 { margin: 0.4rem 0 0.8rem; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.revert-panel { font-family: var(--mono); font-size: 0.75rem; line-height: 1.7; border-block: 1px solid var(--ink); padding: 0.8rem 0; overflow-wrap: anywhere; }
.err { color: var(--orange); }
.revert .hero-sub { font-family: var(--serif); font-size: 1.15rem; line-height: 1.4; margin: 1rem 0; }
.cta { display: inline-block; margin-bottom: 1rem; font-weight: 500; }

/* ---------- ⌘K explorer ---------- */

.palette {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 12vh var(--pad) 2rem;
  background: var(--veil);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.palette[hidden] { display: none; }
.pal-box {
  width: min(32rem, 100%);
  background: var(--sheet);
  border: 1px solid var(--ink);
  box-shadow: 0 18px 50px var(--shade);
  padding: 0.4rem 1.2rem 0.2rem;
  animation: fade 0.18s ease-out;
}
.pal-top, .pal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}
.pal-foot { border-top: 1px solid var(--rule); font-family: var(--mono); font-weight: 400; letter-spacing: 0.04em; }
.pal-x { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.pal-x:hover { color: var(--orange); }
.palette input {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 1.3rem;
  padding: 0.75rem 0;
  color: var(--ink);
  outline: none;
}
.palette input::placeholder { color: var(--faint); font-style: italic; }
.pal-list { list-style: none; margin: 0; padding: 0.3rem 0; max-height: 50vh; overflow: auto; border-top: 1px solid var(--rule); }
.pal-list a { display: flex; gap: 0.9rem; align-items: baseline; padding: 0.4rem; text-decoration: none; }
.pal-list a span { width: 2.4rem; font-family: var(--mono); font-size: 0.68rem; color: var(--faint); }
.pal-list a b { font-weight: 500; }
.pal-list a.sel, .pal-list a:hover { background: var(--orange); color: var(--on-orange); }
.pal-list a.sel span, .pal-list a:hover span { color: var(--on-orange); }
.pal-none { padding: 0.9rem 0.4rem; font-family: var(--mono); font-size: 0.75rem; color: var(--mute); }

/* ---------- footer ---------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  align-items: baseline;
  padding-block: 1.2rem 1.6rem;
  border-top: 1px solid var(--ink);
  font-size: 0.78rem;
  color: var(--mute);
}
.site-foot .foot-who { margin: 0; color: var(--ink); }
.site-foot nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-foot nav a { text-decoration: none; }
.site-foot .chainline { margin-left: auto; display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--mono); font-size: 0.68rem; }
.site-foot .chainline .sh { width: 6px; height: 6px; background: var(--orange); margin-right: 0.3rem; }

/* ---------- small screens ---------- */

@media (max-width: 960px) {
  .revert, .essay { grid-template-columns: minmax(0, 1fr); }
  .receipt { position: static; }
  .page-head { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .mininode { width: 6rem; }
  .page-head > .part, .writing-head > .part, .page-head .label { margin-right: 6.6rem; }
}

@media (max-width: 1100px) {
  html.js .nv:not(.still) .nv-map figcaption { bottom: 4.2rem; }
}

/* a tall screen: the intro sits on top, the map under it (map.js and scene.js switch below 4:5) */
@media (max-aspect-ratio: 4/5) {
  html.js .nv:not(.still) .nv-intro { top: 0.8rem; transform: none; }
}

@media (max-width: 760px) {
  .parts { grid-template-columns: minmax(0, 1fr); }
  html.js .nv:not(.still) .nv-intro { top: 0.8rem; transform: none; }
  html.js .nv:not(.still) .nv-map figcaption { bottom: 5.6rem; }
  .nv.still .nv-map { aspect-ratio: 230 / 170; }
  html.js .nv:not(.still) .nv-cue { bottom: 3.6rem; }
  html.js .nv:not(.still) .nv-meter { bottom: 1.4rem; }
  .nv-intro h1 { font-size: 2.3rem; }
  .nv-intro .tag { margin-bottom: 0.7rem; font-size: 1.05rem; }
  .nv-intro .lead { font-size: 1.05rem; }
  .nv-intro .go { display: none; }
  html.js .nv:not(.still) .nv-intro .go { display: none; }
  html.js .nv:not(.still) .call.on { flex-direction: column; width: calc(100vw - 2 * var(--pad)); }
  html.js .nv:not(.still) .call.on .spec { margin: -1px 0 0; width: 100%; white-space: normal; }
  html.js .nv:not(.still) .call.on .spec li:first-child { border-left-width: 1px; border-top-width: 1px; }
  .title-block { grid-template-columns: repeat(2, auto); justify-self: stretch; }
  .title-block div:nth-child(3) { border-left: 0; }
  .title-block div:nth-child(n + 3) { border-top: 1px solid var(--ink); }
}

@media (max-width: 640px) {
  .chain, .site-nav > a { display: none; }
  .k-btn kbd, .k-btn .long { display: none; }
  .k-btn .short { display: inline; }
  .t-btn span { display: none; }
  .nv-map figcaption .opt { display: none; }
  .nv-map .g-node text, .nv-map .g-amount { font-size: 11px; stroke-width: 4px; }
  .nv-map .g-node text.n { font-size: 8px; }
  .nv-map .g-center text { font-size: 12px; }
  .nv-map .g-center text.sub { font-size: 9px; }
  .revert .g-node .s, .revert .g-edge { stroke-width: 2; }
  .card { padding-inline: 1.1rem; }
  .contract-grid { grid-template-columns: minmax(0, 1fr); }
  .prose { font-size: 1.12rem; }
  .site-foot .chainline { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .g-pulse { display: none; }
}
