/* ./jerome{m} — the Deck, as a static site.
   Rules carried over from the Obsidian theme:
   yellow is an accent (links, marks, live state), never body copy;
   the dithered field sits behind content and never over it. */

@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk/SpaceGrotesk-Regular.ac074f2fa1.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk/SpaceGrotesk-Medium.d936a374fb.ttf") format("truetype"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono/JetBrainsMono-Regular.1e07100fe6.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono/JetBrainsMono-Bold.a4bc1d7520.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  --void: #000000;
  --panel: #050403;
  --raise: #0a0907;
  --accent: #f5d547;
  --accent-wash: rgba(245, 213, 71, .10);
  --paper: #ece8de;
  --dim: #9d968a;
  --faint: #5c574f;
  --red: #ff5c6c;
  --border: rgba(236, 232, 222, .13);
  --border-soft: rgba(236, 232, 222, .07);
  /* The same colours as triplets, for the translucent shades below. */
  --void-rgb: 0, 0, 0;
  --panel-rgb: 5, 4, 3;
  --raise-rgb: 10, 9, 7;
  --accent-rgb: 245, 213, 71;
  --paper-rgb: 236, 232, 222;
  --strong: #fff8e6;
  /* Generated art is drawn amber on black; other themes filter it. */
  --art-filter: none;
  --art-blend: normal;
  /* The background field, read by site.js: tone, accent, and whether it
     darkens a light page (ink) or lights a dark one. */
  --field-tone: 70, 64, 38;
  --field-accent: 245, 213, 71;
  --field-ink: 0;

  --display: "komet", "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bar: 44px;
  --status: 28px;
  --vault-w: 264px;
  --rail-w: 280px;
  color-scheme: dark;
}

/* ── themes: amber above; phosphor green and paper switch from ⌘K ── */
:root[data-theme="green"] {
  --void: #000; --panel: #020503; --raise: #060a07;
  --accent: #5cff8a; --accent-wash: rgba(92, 255, 138, .10);
  --paper: #d6f5dc; --dim: #86a88d; --faint: #4d6553;
  --border: rgba(214, 245, 220, .13); --border-soft: rgba(214, 245, 220, .07);
  --panel-rgb: 2, 5, 3; --raise-rgb: 6, 10, 7; --accent-rgb: 92, 255, 138; --paper-rgb: 214, 245, 220;
  --strong: #effff2;
  --art-filter: hue-rotate(80deg) saturate(1.3);
  --field-tone: 34, 72, 44; --field-accent: 92, 255, 138;
}
:root[data-theme="paper"] {
  --void: #f3efe4; --panel: #ebe6d8; --raise: #e4dece;
  --accent: #8a5d00; --accent-wash: rgba(138, 93, 0, .10);
  --paper: #1c1a15; --dim: #5a5447; --faint: #8c8576; --red: #b3261e;
  --border: rgba(28, 26, 21, .16); --border-soft: rgba(28, 26, 21, .08);
  --void-rgb: 243, 239, 228; --panel-rgb: 235, 230, 216; --raise-rgb: 228, 222, 206; --accent-rgb: 138, 93, 0; --paper-rgb: 28, 26, 21;
  --strong: #000;
  /* Inverting lightness keeps the hue: amber on black becomes ochre on paper. */
  --art-filter: invert(1) hue-rotate(180deg) saturate(1.6);
  --art-blend: multiply;
  --field-tone: 118, 98, 58; --field-accent: 138, 93, 0; --field-ink: 1;
  color-scheme: light;
}
/* Screens stay screens: code, islands and their overlays keep the dark
   tokens whatever the page around them does. */
:root[data-theme="paper"] :is(.prose figure.code, .prose pre, .island, .shell-drop, .map-dialog, .lost-life) {
  --void: #000; --panel: #050403; --raise: #0a0907;
  --accent: #f5d547; --accent-wash: rgba(245, 213, 71, .10);
  --paper: #ece8de; --dim: #9d968a; --faint: #5c574f;
  --border: rgba(236, 232, 222, .13); --border-soft: rgba(236, 232, 222, .07);
  --void-rgb: 0, 0, 0; --panel-rgb: 5, 4, 3; --raise-rgb: 10, 9, 7; --accent-rgb: 245, 213, 71; --paper-rgb: 236, 232, 222;
  --strong: #fff8e6;
  color-scheme: dark;
}
/* Generated art, filtered per theme; on paper its black prints as paper. */
.prose .dither .dithered, .sigil, .preview img, .prose img.embed[src$=".svg"] { filter: var(--art-filter); mix-blend-mode: var(--art-blend); }
/* The islands draw amber; under green, so do they, hue-turned. */
:root[data-theme="green"] :is(.island iframe, .shell-drop iframe, .map-dialog iframe) { filter: hue-rotate(80deg) saturate(1.2); }
/* A phosphor tube: scanlines over everything, and a little glow. */
:root[data-theme="green"] body::after { content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .18) 2px 3px); }
:root[data-theme="green"] :is(.prose h1, .prose h2, .prose h3, .brand, .prose mark) { text-shadow: 0 0 12px rgba(92, 255, 138, .35); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); scroll-padding-top: calc(var(--bar) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--paper);
  font: 400 17px/1.65 var(--display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--void); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--accent); color: var(--void); font: 600 13px var(--mono); }
.skip:focus { top: 8px; }

/* ── the dithered contour field (drawn by site.js) ─────────────── */
.field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  pointer-events: none;
  animation: field-in 900ms ease-out both;
}
@keyframes field-in { from { opacity: 0; } }

/* ── chrome: bar, deck, status ─────────────────────────────────── */
.bar, .deck, .status, .lost { position: relative; z-index: 1; }

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  min-height: var(--bar);
  border-bottom: 1px solid var(--border);
  background: rgba(var(--panel-rgb), .94);
  backdrop-filter: blur(6px);
  font: 12.5px/1 var(--mono);
}
.brand {
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-right: 1px solid var(--border);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .01em;
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 16px; overflow: hidden; white-space: nowrap; color: var(--paper); }
.crumbs a { color: var(--paper); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { overflow: hidden; text-overflow: ellipsis; }
.dim { color: var(--dim); }
.jump {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 10px 6px auto;
  padding: 0 12px;
  min-height: 32px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
}
.jump:hover { border-color: var(--accent); color: var(--paper); }
.shell-open { margin: 6px 10px 6px 0; min-width: 36px; min-height: 32px; padding: 0 9px; border: 1px solid var(--border); background: transparent; color: var(--accent); font: 600 12px var(--mono); cursor: pointer; }
.shell-open:hover, .shell-open:focus-visible { border-color: var(--accent); background: var(--accent-wash); outline: 0; }
/* No hardware keyboard, no terminal. */
@media (hover: none) { .shell-open { display: none; } }

/* ── jm shell ──────────────────────────────────────────────────── */
.shell-drop { position: fixed; z-index: 45; top: 0; left: 0; right: 0; height: min(58vh, 560px); border-bottom: 1px solid var(--accent); background: var(--void); box-shadow: 0 30px 80px rgba(0, 0, 0, .75), 0 0 40px rgba(var(--accent-rgb), .08); transform: translateY(-102%); visibility: hidden; transition: transform .24s steps(6), visibility 0s .24s; }
.shell-drop.open { transform: none; visibility: visible; transition: transform .24s steps(6); }
.shell-drop iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--void); }
kbd { font: 600 11px var(--mono); color: var(--accent); }
.menu { display: none; }

.deck {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: var(--vault-w) minmax(0, 1fr) var(--rail-w);
  align-items: start;
}

.vault, .rail {
  position: sticky;
  top: var(--bar);
  /* Full height between the bar and the status line, even when short. */
  height: calc(100vh - var(--bar) - var(--status));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
  background: rgba(var(--panel-rgb), .9);
  font: 12.5px/1.45 var(--mono);
}
.vault { border-right: 1px solid var(--border); padding: 18px 10px 24px; }
.rail { border-left: 1px solid var(--border); padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 26px; }

.label, .rail h2 {
  margin: 0 0 10px;
  padding: 0 10px;
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.rail h2 { padding: 0; }
.vault ul { margin: 0; padding: 0; list-style: none; }
.vault li ul { margin: 2px 0 6px 16px; padding-left: 10px; border-left: 1px solid var(--border-soft); }
.vault a, .vault summary {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 10px;
  color: var(--dim);
}
.vault > ul > li > a, .vault summary { color: var(--paper); }
.vault a:hover { background: rgba(var(--paper-rgb), .06); color: var(--paper); }
.vault a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); }
.vault summary { cursor: pointer; list-style: none; gap: 8px; }
.vault summary::-webkit-details-marker { display: none; }
.vault summary::before { content: "▸"; color: var(--faint); font-size: 10px; transition: transform .15s; }
.vault details[open] > summary::before { transform: rotate(90deg); }
.count { margin-left: auto; color: var(--dim); }

.reader { min-width: 0; background: rgba(var(--void-rgb), .74); }
.reader-inner { max-width: 760px; margin: 0 auto; padding: 44px clamp(20px, 5vw, 64px) 96px; animation: develop 420ms ease-out both; }
/* No opacity: if the animation never runs (background tab, prerender), text stays readable. */
@keyframes develop { from { filter: contrast(1.6) brightness(.7); transform: translateY(4px); } }
.path { margin: 0 0 26px; font: 12px/1.5 var(--mono); color: var(--dim); }

.status {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  min-height: var(--status);
  border-top: 1px solid var(--border);
  background: rgba(var(--panel-rgb), .96);
  font: 11.5px/1 var(--mono);
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
}
.status > span { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-right: 1px solid var(--border); }
.status .mode { background: var(--accent); color: var(--void); font-weight: 700; text-transform: uppercase; border: 0; }
.status-path { overflow: hidden; text-overflow: ellipsis; }
.status-clock { margin-left: auto; border-left: 1px solid var(--border); border-right: 0 !important; color: var(--paper); font-variant-numeric: tabular-nums; }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
/* The glow fades on an element of its own: animating box-shadow, or anything
   on a pseudo-element, would repaint the page every frame. */
.pulse > span { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 10px var(--accent); animation: glow 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes glow { 50% { opacity: 0; } }

/* ── rail ──────────────────────────────────────────────────────── */
.outline, .backlinks, .islands { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.outline a, .backlinks a { color: var(--dim); }
.outline a:hover, .backlinks a:hover { color: var(--accent); }
.outline .level-3 { padding-left: 12px; }
.backlinks .more { color: var(--dim); }
.islands li { display: flex; align-items: center; gap: 8px; color: var(--paper); }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.recent { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.recent li { display: flex; flex-direction: column; gap: 1px; }
.recent a { color: var(--paper); }
.recent a:hover { color: var(--accent); }
.recent time { font: 10.5px/1.4 var(--mono); letter-spacing: .06em; color: var(--faint); }
.rail .feed { margin: 14px 0 0; font: 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.rail .feed a { color: var(--dim); }
.rail .feed a::before { content: "◉ "; color: var(--accent); }
.rail .feed a:hover { color: var(--accent); }
.chip { padding: 2px 7px; border: 1px solid var(--border); color: var(--dim); font: 11.5px/1.5 var(--mono); }
a.chip, .prose a.chip { border: 1px solid var(--border); color: var(--dim); }
a.chip:hover, a.chip:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }

/* ── tags ──────────────────────────────────────────────────────── */
.prose .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.prose .tag-cloud .chip { padding: 4px 9px; font-size: 12.5px; }
.prose .tag-cloud .chip b { margin-left: 4px; color: var(--accent); font-weight: 600; }
.prose .tag-cloud .chip.once { opacity: .55; }
.prose .tag-cloud .chip.once:hover { opacity: 1; }
.tag-list .prose > ul { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; }
.tag-list .prose > ul > li { padding-left: 16px; border-left: 2px solid var(--border); transition: border-color .2s steps(3); }
.tag-list .prose > ul > li:hover { border-left-color: var(--accent); }
.tag-meta { margin-left: 8px; font: 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.tag-desc { color: var(--dim); font-size: .94em; }

/* ── prose ─────────────────────────────────────────────────────── */
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--display); font-weight: 500; letter-spacing: -.015em; line-height: 1.12; }
.prose h1 { margin: 0 0 .3em; font-size: clamp(2.3rem, 5vw, 3.4rem); line-height: .98; letter-spacing: -.025em; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 1.75em; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 1.3em; }
.prose h4 { margin: 1.6em 0 .4em; font-size: 1.08em; }
.prose h2::before { content: "## "; color: var(--faint); font: .55em var(--mono); vertical-align: .35em; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote, .prose figure { margin: 0 0 1.35em; }
.prose .doc-sub { margin: 0 0 2.2em; font: 13px/1.5 var(--mono); color: var(--dim); }
.prose mark { background: var(--accent); color: var(--void); padding: 0 .14em; }
/* Highlighted headings wrap with each piece padded. A browser paints each
   line's yellow after the text of the line before, so the yellow of a
   wrapped line covers the descenders above it; site.js stacks two copies
   (.hl): the lower draws only the yellow, the upper only the letters. */
.prose :is(h1, h2, h3, h4) mark { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.prose h1:has(mark) { line-height: 1.1; }
.prose .hl { display: grid; }
.prose .hl > span { grid-area: 1 / 1; }
.prose .hl-under, .prose .hl-under * { color: transparent; text-shadow: none; -webkit-user-select: none; user-select: none; }
.prose .hl-over mark { background: transparent; }
.prose h2.hl::before { content: none; }
.prose h2.hl > span::before { content: "## "; color: var(--faint); font: .55em var(--mono); vertical-align: .35em; }
.prose h2.hl > .hl-under::before { color: transparent; }
.prose strong { font-weight: 600; color: var(--strong); }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--faint); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }
.prose font { font: 12.5px/1.6 var(--mono) !important; color: var(--dim); }

.prose a { border-bottom: 1px solid rgba(var(--accent-rgb), .35); }
.prose a:hover { border-color: var(--paper); }
.prose a.wikilink::before { content: "[["; color: var(--faint); font: .8em var(--mono); }
.prose a.wikilink::after { content: "]]"; color: var(--faint); font: .8em var(--mono); }
.prose a.external::after { content: " ↗"; font-size: .8em; }
.wikilink.broken { color: var(--red); border-bottom: 1px dashed var(--red); }

.prose code { padding: .1em .35em; border: 1px solid var(--border); background: var(--raise); font: .84em/1.5 var(--mono); color: var(--paper); }
.prose pre { position: relative; padding: 18px 20px; overflow-x: auto; border: 1px solid var(--border); background: rgba(var(--raise-rgb), .92); font: 13.5px/1.65 var(--mono); }
.prose pre code { padding: 0; border: 0; background: none; font: inherit; }

/* Code: terminal chrome, line gutter, build-time highlighting (hl-*). */
.prose figure.code { margin: 0 0 1.5em; border: 1px solid var(--border); background: rgba(var(--raise-rgb), .94); }
.prose figure.code figcaption { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border); font: 10.5px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.code-dots { width: 32px; height: 8px; background: radial-gradient(circle at 4px 4px, var(--faint) 3px, transparent 3.5px) 0 0 / 12px 8px repeat-x; }
.code-copy { margin-left: auto; padding: 2px 10px; border: 1px solid var(--border); background: transparent; color: var(--dim); font: inherit; letter-spacing: inherit; cursor: pointer; }
.code-copy:hover, .code-copy.copied { border-color: var(--accent); color: var(--accent); }
.prose figure.code pre { display: grid; grid-template-columns: auto 1fr; margin: 0; padding: 14px 20px 16px 0; border: 0; background: none; }
.gutter { padding: 0 14px; margin-right: 16px; border-right: 1px solid var(--border-soft); color: #4f4b44; text-align: right; white-space: pre; user-select: none; }
.prose figure.code code { white-space: pre; }
.hl-comment { color: #847d71; font-style: italic; }
.hl-string { color: #d9c896; }
.hl-keyword, .hl-storage { color: var(--accent); }
.hl-constant { color: #ffb454; }
.hl-entity.hl-name, .hl-support.hl-function { color: #fff3c4; }
.hl-support.hl-type, .hl-entity.hl-name.hl-type { color: #e9cf6d; }
.hl-punctuation { color: #9d968a; }
.hl-invalid { color: var(--red); }

/* As in the Obsidian theme: display italic on a faint yellow wash. */
.prose blockquote { margin: 2em 0; padding: 18px 24px; border-left: 2px solid var(--accent); background: rgba(var(--accent-rgb), .06); font: italic 400 1.16em/1.55 var(--display); color: var(--paper); }
.prose blockquote > :last-child { margin-bottom: 0; }
/* The attribution line: `― <cite>Author, Work</cite>` stays one mono line. */
.prose blockquote p:has(> cite) { margin-top: 1em; font: normal 12.5px/1.5 var(--mono); color: var(--dim); }
.prose blockquote cite { font-style: normal; }

.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: .92em; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--raise); font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }

.prose img, .prose video { display: block; max-width: 100%; height: auto; margin: 1.4em 0; border: 1px solid var(--border); background: var(--raise); }
/* Ordered-dither twin first; the real image fades in on hover or focus. */
.prose .dither { position: relative; display: block; margin: 1.4em 0; border: 1px solid var(--border); background: var(--void); line-height: 0; cursor: crosshair; }
.prose .dither img { display: block; width: 100%; height: auto; margin: 0; border: 0; background: none; }
.prose .dither .dithered { image-rendering: pixelated; }
.prose .dither .original { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s steps(6); }
.prose .dither:hover .original, .prose .dither:focus-visible .original { opacity: 1; }
/* Embeds on consecutive lines share a paragraph and become a two-up gallery. */
.prose p:has(> .dither + .dither) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 1.4em 0 .5em; }
.prose p:has(> .dither + .dither) > .dither { margin: 0; }
.prose .math.display { display: block; margin: 1.4em 0; overflow-x: auto; text-align: center; }
.prose pre.mermaid { background: transparent; text-align: center; }

/* ── Home's signal board ─────────────────────────────────────────── */
.dash { --off: rgba(var(--paper-rgb), .07); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 10px; margin: 2.2em 0; font: 12px/1.5 var(--mono); }
.dash-tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); background: rgba(var(--panel-rgb), .82); color: var(--paper); }
.dash-activity, .dash-available { grid-column: 1 / -1; }
.dash-label { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.prose .dash p { margin: 0; }
/* Newest weeks first on a narrow screen: the scroller starts at its end. */
.heat-scroll { overflow-x: auto; direction: rtl; scrollbar-width: none; }
.heat-scroll::-webkit-scrollbar { display: none; }
.heat-wrap { direction: ltr; width: max-content; }
.heat-months, .heat { display: grid; grid-template-columns: repeat(var(--weeks), 9px); gap: 2px; }
.heat-months { height: 15px; font-size: 9.5px; line-height: 1; color: var(--faint); }
.heat-months span { white-space: nowrap; }
.heat { grid-template-rows: repeat(7, 9px); grid-auto-flow: column; }
/* Four levels as ordered dither: one pixel in four, half, three in four, solid. */
.heat i, .heat-legend i { display: block; background: var(--off); }
.heat .l1, .heat-legend .l1 { background: conic-gradient(var(--accent) 0 25%, var(--off) 0) 0 0 / 2px 2px; }
.heat .l2, .heat-legend .l2 { background: repeating-conic-gradient(var(--accent) 0 25%, var(--off) 0 50%) 0 0 / 2px 2px; }
.heat .l3, .heat-legend .l3 { background: conic-gradient(var(--off) 0 25%, var(--accent) 0) 0 0 / 2px 2px; }
.heat .l4, .heat-legend .l4 { background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), .35); }
.heat i[title]:hover { outline: 1px solid var(--paper); }
.dash-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 6px !important; color: var(--dim); }
.heat-legend { display: inline-flex; align-items: center; gap: 2px; color: var(--faint); font-size: 10.5px; }
.heat-legend i { width: 9px; height: 9px; }
.prose a.dash-now { border: 1px solid var(--border); text-decoration: none; transition: border-color .15s, transform .15s; }
.prose a.dash-now:hover { border-color: var(--accent); transform: translateY(-2px); }
.dash-title { font: 500 1.35em/1.25 var(--display); color: var(--paper); }
.dash-desc { color: var(--dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dash-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; color: var(--faint); }
.dash-list { display: flex; flex-direction: column; gap: 6px; margin: 0 !important; padding: 0; list-style: none; }
.dash-list li { display: flex; justify-content: space-between; gap: 10px; margin: 0; }
.dash-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; color: var(--paper); }
.dash-list a:hover { color: var(--accent); }
.dash-list time { flex: none; color: var(--faint); }
.dash-totals { margin-top: auto !important; padding-top: 8px; border-top: 1px dashed var(--border); color: var(--dim); }
.prose a.dash-available { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--accent); background: var(--accent-wash); color: var(--accent); text-decoration: none; font-weight: 600; }
.dash-available-cta { margin-left: auto; color: var(--paper); font-weight: 400; }
@media (max-width: 680px) { .dash { grid-template-columns: minmax(0, 1fr); } }

/* ── footnotes: in the margin when the reader has room, else at the end ── */
.reader { container: reader / inline-size; }
.prose sup.fn { line-height: 0; font: 600 .68em var(--mono); }
.prose sup.fn a { padding: 0 .2em; border: 0; color: var(--accent); }
.prose sup.fn a:hover, .prose sup.fn a:focus-visible, .prose sup.fn.lit a { background: var(--accent); color: var(--void); outline: 0; }
.sidenote { display: none; }
.footnotes { margin: 3em 0 0; padding-top: 14px; border-top: 1px solid var(--border); font: 12px/1.6 var(--mono); color: var(--dim); }
.footnotes-label { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.footnotes ol { margin: 0; padding-left: 2.2em; }
.footnotes li::marker { color: var(--accent); }
.footnotes li:target { color: var(--paper); }
.footnotes a { overflow-wrap: anywhere; }
.fn-back { margin-left: .6em; border: 0; color: var(--faint); }
.fn-back:hover { color: var(--accent); }
/* Tap a number where there is no margin: the note opens under it. */
.fn-pop { position: absolute; z-index: 35; width: min(340px, calc(100vw - 24px)); padding: 10px 12px; border: 1px solid var(--accent); background: rgba(var(--panel-rgb), .97); box-shadow: 0 18px 40px rgba(0, 0, 0, .6); font: 12px/1.55 var(--mono); color: var(--paper); overflow-wrap: anywhere; }
.fn-pop::before { content: attr(data-n); margin-right: 8px; color: var(--accent); font-weight: 700; }
/* A margin from a 720px reader up, so 1280px laptops get one too: the
   note column is fixed, the text moves left and keeps its 632px measure
   where it fits, narrowing to about 500px where it does not. */
@container reader (min-width: 720px) {
  .reader-inner:has(.sidenote) { --sn-width: 160px; --sn-gap: 20px; max-width: 856px; padding-left: 28px; padding-right: calc(var(--sn-width) + var(--sn-gap) + 16px); }
  .sidenote { display: block; float: right; clear: right; position: relative; width: var(--sn-width); margin: .35em calc(-1 * (var(--sn-width) + var(--sn-gap))) .8em 0; padding-left: 10px; border-left: 1px solid var(--border); font: 400 11.5px/1.5 var(--mono); font-style: normal; letter-spacing: 0; text-align: left; text-transform: none; color: var(--dim); overflow-wrap: anywhere; transition: color .15s, border-color .15s; }
  /* A blockquote's padding sits between its text and the margin. */
  .prose blockquote .sidenote { margin-right: calc(-1 * (var(--sn-width) + var(--sn-gap) + 24px)); }
  .sidenote.lit, .sidenote:hover { border-left-color: var(--accent); color: var(--paper); }
  .sidenote-n { margin-right: 6px; color: var(--accent); font-weight: 700; }
  .sidenote a { border: 0; color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
  .sidenote a:hover { color: var(--accent); }
  .reader-inner:has(.sidenote) .footnotes { display: none; }
}
@container reader (min-width: 896px) {
  .reader-inner:has(.sidenote) { --sn-width: 180px; --sn-gap: 24px; max-width: 896px; padding-left: 40px; padding-right: 224px; }
}

/* ── diagrams: drawn by jm at build time (vault/src/diagram.rs) ── */
/* Laid out twice; the column shows the left-to-right one only when it
   fits at full size, else the top-to-bottom one, which scrolls sideways
   rather than shrinking below 80%. */
.diagram, .prose .diagram { container: diagram / inline-size; position: relative; margin: 2em 0; padding: 18px 16px 14px; border: 1px solid var(--border); background: radial-gradient(circle at 1px 1px, rgba(var(--paper-rgb), .085) 1px, transparent 1.4px) 0 0 / 18px 18px, rgba(var(--panel-rgb), .82); }
.dg-stage { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; cursor: zoom-in; }
.diagram .dg-svg { display: block; margin: 0 auto; width: 100%; max-width: var(--w); min-width: calc(var(--w) * .8); height: auto; }
.diagram .dg-wide { display: none; }
@container diagram (min-width: 600px) {
  .diagram[data-fits] .dg-wide { display: block; }
  .diagram[data-fits] .dg-tall { display: none; }
}
/* A wide diagram on a narrow screen fades at the edge it scrolls towards. */
.dg-scrolls:not(.dg-end) .dg-stage { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
.dg-caption { display: flex; align-items: center; gap: 10px; margin: 12px -16px -14px; padding: 7px 12px; border-top: 1px solid var(--border); font: 11px/1.4 var(--mono); color: var(--dim); }
.dg-tag { padding: 2px 8px; background: var(--accent); color: var(--void); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dg-tip-touch { display: none; }
@media (hover: none) { .dg-tip-hover { display: none; } .dg-tip-touch { display: inline; } }
.dg-open { margin-left: auto; padding: 3px 9px; border: 1px solid var(--border); background: none; color: var(--dim); font: inherit; cursor: pointer; transition: color .15s, border-color .15s; }
.dg-open:hover, .dg-open:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }

.dg-svg text { font: 12px var(--mono); font-style: normal; letter-spacing: 0; text-transform: none; fill: var(--paper); text-anchor: middle; dominant-baseline: central; }
.dg-node rect, .dg-node polygon, .dg-node circle { fill: rgb(var(--raise-rgb)); stroke: rgba(var(--accent-rgb), .5); stroke-width: 1; transition: fill .15s, stroke .15s; }
.dg-diamond polygon { fill: rgba(var(--accent-rgb), .08); stroke: var(--accent); }
.dg-node.lit rect, .dg-node.lit polygon, .dg-node.lit circle { fill: rgba(var(--accent-rgb), .14); stroke: var(--accent); }
.dg-node.lit text { fill: var(--strong); }
.dg-line { fill: none; stroke: rgba(var(--paper-rgb), .34); stroke-width: 1.3; transition: stroke .15s; }
.dg-dotted .dg-line { stroke-dasharray: 3 4; }
.dg-thick .dg-line { stroke-width: 2.6; }
.dg-head { fill: rgba(var(--paper-rgb), .5); transition: fill .15s; }
.dg-edge.lit .dg-line { stroke: var(--accent); }
.dg-edge.lit .dg-head { fill: var(--accent); }
/* Data flowing along the arrows, only while the diagram is on screen. */
.dg-flow { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1.5 22; opacity: 0; }
.dg-live .dg-flow, .dg-viewer .dg-flow { opacity: .75; animation: dg-flow 1.4s linear infinite; }
@keyframes dg-flow { to { stroke-dashoffset: -23.5; } }
.dg-elabel rect { fill: rgb(var(--panel-rgb)); stroke: rgba(var(--paper-rgb), .1); }
.dg-elabel text { font-size: 11px; fill: var(--dim); }
.dg-elabel.lit text { fill: var(--accent); }
.dg-group rect { fill: rgba(var(--accent-rgb), .035); stroke: rgba(var(--accent-rgb), .35); stroke-dasharray: 4 3; }
.dg-group text { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; fill: var(--faint); text-anchor: start; }
/* Hover a box: it, its arrows and its neighbours stay; the rest steps back. */
.dg-node, .dg-edge, .dg-elabel { transition: opacity .15s; }
.dg-focus :is(.dg-node, .dg-edge, .dg-elabel):not(.lit) { opacity: .18; }

/* Full screen: pan, zoom, pinch, and either layout. */
.dg-viewer[open] { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: rgb(var(--void-rgb)); color: var(--paper); }
.dg-viewer::backdrop { background: rgba(0, 0, 0, .7); }
.dg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: rgb(var(--panel-rgb)); font: 12px var(--mono); }
.dg-bar button { min-width: 34px; min-height: 32px; padding: 0 10px; border: 1px solid var(--border); background: none; color: var(--dim); font: inherit; cursor: pointer; }
.dg-bar button:hover, .dg-bar button:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }
.dg-bar button[hidden] { display: none; }
.dg-zoom { min-width: 52px; text-align: center; color: var(--paper); font-variant-numeric: tabular-nums; }
.dg-hint { margin-left: 8px; color: var(--faint); }
.dg-bar .dg-close { margin-left: auto; }
.dg-viewport { position: relative; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: radial-gradient(circle at 1px 1px, rgba(var(--paper-rgb), .085) 1px, transparent 1.4px) 0 0 / 18px 18px; }
.dg-viewport.dragging { cursor: grabbing; }
.dg-canvas { position: absolute; top: 0; left: 0; }
.dg-canvas .dg-svg { display: block; }
@media (max-width: 640px) { .dg-hint { display: none; } }
@media print {
  .diagram { background: none; break-inside: avoid; }
  .dg-caption, .dg-flow, .dg-viewer { display: none !important; }
  .dg-stage { -webkit-mask-image: none !important; mask-image: none !important; }
}

/* ── islands: gpui embeds in iframes ───────────────────────────── */
.island { margin: 2em 0; border: 1px solid rgba(var(--accent-rgb), .45); background: var(--void); box-shadow: 0 0 0 1px var(--void), 0 0 40px rgba(var(--accent-rgb), .06); }
.island-frame { position: relative; }
.island-frame::before {
  content: "booting island…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 12px var(--mono);
  letter-spacing: .08em;
  color: var(--dim);
}
.island iframe { position: relative; display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: normal; pointer-events: none; }
/* Click to activate: until then the wheel scrolls the article, not the island. */
.island.active iframe { pointer-events: auto; }
.island-activate { position: absolute; inset: 0; z-index: 1; display: grid; place-items: end center; padding: 0 0 14px; border: 0; background: transparent; cursor: pointer; }
.island-activate span { padding: 5px 10px; border: 1px solid var(--accent); background: rgba(var(--void-rgb), .85); font: 11.5px var(--mono); color: var(--accent); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.island-activate:hover span, .island-activate:focus-visible span { opacity: 1; transform: none; }
.island.active .island-activate { display: none; }
.island figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border-top: 1px solid var(--border); font: 11.5px/1.4 var(--mono); color: var(--dim); }
.island-tag { padding: 2px 8px; background: var(--accent); color: var(--void); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.island figcaption a { margin-left: auto; border: 0; }
.island-share { margin-left: auto; padding: 0; border: 0; background: none; color: var(--dim); font: inherit; cursor: pointer; }
.island-share:hover, .island-share:focus-visible { color: var(--accent); outline: 0; }
.island-share:not([hidden]) + a { margin-left: 0; }

/* ── Experiments: the card index (cssclasses: list-cards) ──────── */
.list-cards .prose > ul { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.list-cards .prose > ul > li { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--panel); transition: border-color .15s, transform .15s; }
.list-cards .prose > ul > li:hover { border-color: var(--accent); transform: translateY(-2px); }
/* Blank lines between items make a loose list: `li > p > (a + img)`.
   `display: contents` lets the link and cover join the card's flex row. */
.list-cards .prose > ul > li > p { display: contents; }
.list-cards .prose > ul > li > p > .dither { order: 1; margin: 0; border: 0; border-bottom: 1px solid var(--border); }
.list-cards .prose > ul > li > p > .dither img { aspect-ratio: 16 / 9; object-fit: cover; }
.list-cards .prose > ul > li:hover .original { opacity: 1; }
.list-cards .prose > ul > li > p > a:first-child { order: 2; margin: 14px 16px 4px; border: 0; font-size: 1.2em; font-weight: 500; color: var(--paper); }
.list-cards .prose > ul > li > p > a:first-child::before, .list-cards .prose > ul > li > p > a:first-child::after { content: none; }
.list-cards .prose > ul > li > ul { order: 3; margin: 0; padding: 0 16px 16px; list-style: none; font-size: .9em; color: var(--dim); }
.list-cards .prose > ul > li > ul code { font-size: .8em; }

/* ── ⌘K palette ────────────────────────────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 40; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(0, 0, 0, .6); }
.palette[hidden] { display: none; }
.palette-box { width: min(660px, 100%); border: 1px solid var(--accent); background: var(--raise); box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 40px rgba(var(--accent-rgb), .12); font: 13px/1.4 var(--mono); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--accent); font-size: 16px; }
.palette-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--paper); font: inherit; }
.palette-count { font-size: 11px; color: var(--dim); }
.palette-results { max-height: 50vh; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.palette-results a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; color: var(--paper); }
.palette-results [aria-selected="true"] a { background: var(--accent-wash); }
.palette-results [aria-selected="true"] .palette-title { color: var(--accent); }
.palette-results .palette-meta { margin-left: auto; font-size: 11px; color: var(--dim); white-space: nowrap; }
.palette-results b { color: var(--accent); font-weight: 700; }
.palette-results .palette-glyph { width: 10px; color: var(--accent); }
.palette-action .palette-title { color: var(--dim); }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--status) + 18px); transform: translateX(-50%); padding: 8px 14px; border: 1px solid var(--accent); background: var(--raise); color: var(--accent); font: 12px var(--mono); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); animation: toast 1.8s steps(8) both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 6px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ── image viewer ─────────────────────────────────────────────── */
.prose .dither.viewable { cursor: zoom-in; }
.prose .dither.viewable::after { content: "view ⤢"; position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 4px 7px; background: var(--accent); color: var(--void); font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; opacity: 0; transition: opacity .2s steps(3); pointer-events: none; }
.prose .dither.viewable:hover::after, .prose .dither.viewable:focus-visible::after { opacity: 1; }

html:has(.viewer[open]) { overflow: hidden; }
.viewer { --gutter: clamp(12px, 5vw, 72px); position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: transparent; color: var(--paper); overflow: hidden; }
.viewer:not([open]) { display: none; }
.viewer[open] { animation: viewer-in .24s steps(4) both; }
@keyframes viewer-in { from { opacity: 0; } }
.viewer::backdrop { background: rgba(0, 0, 0, .93); backdrop-filter: blur(3px); }

.viewer-bar { display: flex; align-items: center; gap: 16px; min-height: 44px; padding-left: 16px; border-bottom: 1px solid var(--border); background: rgba(var(--panel-rgb), .9); font: 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.viewer-count { color: var(--accent); white-space: nowrap; }
.viewer.loading .viewer-count::after { content: " · decoding"; color: var(--dim); animation: pulse 1s steps(2) infinite; }
.viewer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .02em; text-transform: none; color: var(--paper); }
.viewer-size { white-space: nowrap; }
.viewer-open { margin-left: auto; color: var(--dim); white-space: nowrap; }
.viewer-open:hover, .viewer-open:focus-visible { color: var(--accent); outline: 0; }
.viewer-close { align-self: stretch; min-width: 44px; padding: 0 16px; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--paper); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.viewer-close:hover, .viewer-close:focus-visible { background: var(--accent); color: var(--void); outline: 0; }

/* The stage is a size container, so the frame fits both ways at its file's aspect. */
.viewer-stage { position: relative; display: flex; min-height: 0; padding: 22px var(--gutter); overflow: hidden; container-type: size; touch-action: pinch-zoom; }
.viewer-frame { position: relative; flex: none; margin: auto; aspect-ratio: var(--ar, 16 / 9); width: min(100cqw, 100cqh * var(--ar, 1.7778)); }
.viewer-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viewer-dither { image-rendering: pixelated; }
.viewer.loading .viewer-image { visibility: hidden; }
.viewer-image.develop { animation: 560ms linear both vt-dither; mask-size: 32px 32px; mask-repeat: repeat; }
/* HUD corner brackets around the frame. */
.viewer-frame::after {
  content: ""; position: absolute; inset: -8px; pointer-events: none;
  --c: linear-gradient(var(--accent), var(--accent));
  background:
    var(--c) top left / 16px 2px, var(--c) top left / 2px 16px,
    var(--c) top right / 16px 2px, var(--c) top right / 2px 16px,
    var(--c) bottom left / 16px 2px, var(--c) bottom left / 2px 16px,
    var(--c) bottom right / 16px 2px, var(--c) bottom right / 2px 16px;
  background-repeat: no-repeat;
}
.viewer.zoomable .viewer-frame { cursor: zoom-in; }
.viewer.zoomed .viewer-stage { padding: 0; overflow: auto; touch-action: auto; }
.viewer.zoomed .viewer-frame { width: var(--nw); cursor: zoom-out; }
.viewer.zoomed .viewer-frame::after { display: none; }

.viewer-nav { position: absolute; top: 50%; z-index: 1; display: grid; place-items: center; width: 44px; height: 64px; margin-top: -32px; border: 1px solid var(--border); background: rgba(var(--panel-rgb), .82); color: var(--paper); font: 18px/1 var(--mono); cursor: pointer; }
.viewer-prev { left: max(6px, calc(var(--gutter) / 2 - 22px)); }
.viewer-next { right: max(6px, calc(var(--gutter) / 2 - 22px)); }
.viewer-nav:hover, .viewer-nav:focus-visible { border-color: var(--accent); color: var(--accent); outline: 0; }
.viewer.single .viewer-nav, .viewer.zoomed .viewer-nav { display: none; }

.viewer-caption { min-height: 1.5em; margin: 0; padding: 4px var(--gutter) 18px; text-align: center; font-size: 15px; line-height: 1.5; color: var(--dim); }
.palette-keys { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--dim); }

/* The note's contour sigil: generated at build time from its key. */
.sigil { display: block; width: 100%; height: 200px; margin: -20px 0 18px; object-fit: cover; object-position: bottom; pointer-events: none; -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); animation: sigil-in 1.1s ease-out both; }
@keyframes sigil-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } }

/* Scroll-spy: the section being read lights up in the outline. */
.outline a { position: relative; transition: color .2s; }
.outline a.active { color: var(--accent); }
.outline a.active::before { content: "›"; position: absolute; left: -12px; color: var(--accent); }
.status-progress { color: var(--paper); font-variant-numeric: tabular-nums; }

/* Link previews */
.preview { position: fixed; z-index: 35; width: 320px; border: 1px solid var(--accent); background: var(--raise); box-shadow: 0 20px 60px rgba(0, 0, 0, .8), 0 0 30px rgba(var(--accent-rgb), .08); pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity .14s, transform .14s; }
.preview.show { opacity: 1; transform: none; }
.preview img { display: block; width: 100%; height: 132px; object-fit: cover; image-rendering: pixelated; background: #000; border-bottom: 1px solid var(--border); }
.preview-body { padding: 10px 14px 13px; }
.preview-meta { font: 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.preview-title { margin: 4px 0 6px; font: 500 17px/1.25 var(--display); color: var(--paper); }
.preview-desc { margin: 0; font: 13.5px/1.5 var(--display); color: var(--dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* The link map: a gpui island, loaded on demand. */
.map-open { width: 100%; min-height: 40px; border: 1px dashed var(--border); background: transparent; color: var(--dim); font: inherit; cursor: pointer; }
.map-open:hover { border-color: var(--accent); color: var(--accent); }
/* ── the constellation (link map) ─────────────────────────────── */
html:has(.map-dialog[open]) { overflow: hidden; }
.map-dialog { width: min(1280px, 94vw); height: min(860px, 88vh); max-width: none; max-height: none; padding: 0; border: 1px solid var(--accent); background: var(--void); color: var(--paper); box-shadow: 0 30px 90px rgba(0, 0, 0, .8), 0 0 50px rgba(var(--accent-rgb), .08); }
.map-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: viewer-in .24s steps(4) both; }
.map-dialog::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(2px); }
.map-bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding-left: 14px; border-bottom: 1px solid var(--border); font: 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.map-close { align-self: stretch; padding: 0 14px; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--paper); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.map-close:hover, .map-close:focus-visible { background: var(--accent); color: var(--void); outline: 0; }
.map-dialog iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--void); }

/* Page transitions: the next page develops through an ordered dither. */
@view-transition { navigation: auto; }
.bar { view-transition-name: bar; }
.status { view-transition-name: status; }
::view-transition-old(root) { animation: 200ms ease-in both vt-out; }
::view-transition-new(root) { animation: 420ms linear both vt-dither; mask-size: 32px 32px; mask-repeat: repeat; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-dither {
  0.0% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  12.5% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  25.0% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  37.5% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  50.0% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  62.5% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  75.0% { mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%220%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%224%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%221%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%222%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%225%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%226%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22/%3E%3C/svg%3E"); }
  87.5% { mask-image: none; }
}

/* hover-decode keeps width steady while glyphs scramble */
.decoding { font-variant-numeric: tabular-nums; }

/* ── 404 ───────────────────────────────────────────────────────── */
.lost { max-width: 720px; margin: 20vh auto; padding: 0 24px; }
.lost h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 500; line-height: 1; }
.lost mark { background: var(--accent); color: var(--void); padding: 0 .1em; }
.lost-life { display: block; width: 100%; height: 300px; margin-top: 32px; border: 1px solid rgba(var(--accent-rgb), .45); background: #000; }

/* ── narrower screens ──────────────────────────────────────────── */
@media (max-width: 1240px) {
  .deck { grid-template-columns: var(--vault-w) minmax(0, 1fr); }
  .rail { position: static; grid-column: 2; height: auto; max-height: none; border-left: 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 24px clamp(20px, 5vw, 64px) 40px; }
}
@media (max-width: 860px) {
  :root { --bar: 52px; }
  .deck { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-column: 1; }
  .menu { display: grid; place-items: center; width: 52px; border: 0; border-right: 1px solid var(--border); background: transparent; color: var(--paper); cursor: pointer; }
  .brand { border-right: 0; padding: 0 12px; }
  .crumbs { display: none; }
  .jump-label { display: none; }
  .vault { position: fixed; z-index: 30; top: var(--bar); bottom: 0; left: 0; width: min(320px, 86vw); height: auto; max-height: none; transform: translateX(-102%); transition: transform .2s ease; background: rgba(var(--panel-rgb), .98); }
  .vault-open .vault { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, .7); }
  .vault a, .vault summary { min-height: 44px; }
  .status-path, .status-count { display: none; }
  .reader-inner { padding-top: 28px; }
  .prose p:has(> .dither + .dither) { grid-template-columns: minmax(0, 1fr); }
  .viewer-name, .viewer-size { display: none; }
  .viewer-stage { padding-bottom: 72px; }
  .viewer-nav { top: auto; bottom: 14px; height: 44px; margin-top: 0; }
  .viewer-prev { left: calc(50% - 52px); }
  .viewer-next { right: calc(50% - 52px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ── aug vision ─────────────────────────────────────────────────── */
html.aug .prose .dither .original { opacity: 1; }
html.aug .prose :is(.dither img, img.embed, video) { filter: url(#aug-edges); mix-blend-mode: normal; }
html.aug .prose :is(h1, h2, h3) { color: transparent; -webkit-text-stroke: 1px var(--accent); text-shadow: 0 0 14px rgba(var(--accent-rgb), .45); }
html.aug .prose mark { background: transparent; color: var(--accent); outline: 1px solid var(--accent); }
html.aug .prose { color: rgba(var(--accent-rgb), .78); }
.aug-hud { position: fixed; inset: 0; z-index: 55; pointer-events: none; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: radial-gradient(ellipse at center, transparent 58%, rgba(var(--accent-rgb), .09) 100%); animation: aug-in .45s steps(5) both; }
@keyframes aug-in { from { opacity: 0; filter: brightness(3); } }
.aug-corner { position: absolute; width: 42px; height: 42px; border: 2px solid var(--accent); }
.aug-corner.tl { top: calc(var(--bar) + 10px); left: 10px; border-right: 0; border-bottom: 0; }
.aug-corner.tr { top: calc(var(--bar) + 10px); right: 10px; border-left: 0; border-bottom: 0; }
.aug-corner.bl { bottom: calc(var(--status) + 10px); left: 10px; border-right: 0; border-top: 0; }
.aug-corner.br { bottom: calc(var(--status) + 10px); right: 10px; border-left: 0; border-top: 0; }
.aug-label { position: absolute; display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: rgba(var(--void-rgb), .7); }
.aug-label.tl { top: calc(var(--bar) + 18px); left: 60px; }
.aug-label.tr { top: calc(var(--bar) + 18px); right: 60px; }
.aug-label.bl { bottom: calc(var(--status) + 18px); left: 60px; }
.aug-label.br { bottom: calc(var(--status) + 18px); right: 60px; }
.aug-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s steps(2) infinite; }
.aug-cells { display: inline-flex; gap: 3px; }
.aug-cells i { width: 7px; height: 12px; border: 1px solid var(--accent); }
.aug-cells i.on { background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), .6); }
.aug-sound { pointer-events: auto; border: 1px solid var(--accent); color: var(--accent); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.aug-sound:hover { background: var(--accent); color: var(--void); }
.aug-scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent); box-shadow: 0 0 18px 2px rgba(var(--accent-rgb), .5); opacity: .55; animation: aug-scan 3s linear infinite; }
@keyframes aug-scan { from { transform: translateY(var(--bar)); } to { transform: translateY(calc(100vh - var(--status))); } }
.aug-marks { position: absolute; top: 0; left: 0; z-index: 25; pointer-events: none; }
.aug-mark { position: absolute; border: 1px solid rgba(var(--accent-rgb), .5); background: linear-gradient(var(--accent), var(--accent)) 0 0 / 12px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 0 / 2px 12px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 100% / 12px 2px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 100% / 2px 12px no-repeat; }
.aug-mark b { position: absolute; top: -18px; left: -1px; padding: 2px 6px; background: var(--accent); color: var(--void); font: 700 10px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 640px) {
  .aug-label.tr { display: none; }
  .aug-label.br { top: calc(var(--bar) + 18px); bottom: auto; }
  .aug-cells i { width: 5px; }
}
@media (prefers-reduced-motion: reduce) { .aug-scan { display: none; } }
@media print { .aug-hud, .aug-marks { display: none !important; } }

/* ── paper: print and the résumé PDF ───────────────────────────── */
/* The skills are one line each in the vault, as Obsidian shows them. */
.page-resume .prose h2#skills + p { white-space: pre-line; }
.resume-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 28px; font: 12px var(--mono); }
.resume-actions a, .resume-actions button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border: 1px solid var(--accent); background: var(--accent-wash); color: var(--accent); font: inherit; cursor: pointer; }
.resume-actions button { border-color: var(--border); background: transparent; color: var(--dim); }
.resume-actions a:hover, .resume-actions button:hover { background: var(--accent); color: var(--void); }

@media print {
  @page { size: A4; margin: 14mm 16mm 16mm; }
  /* Ink on paper whatever the screen's theme, code included. */
  :root, :root[data-theme], :root[data-theme] :is(.prose figure.code, .prose pre) {
    --void: #fff; --panel: #fff; --raise: #fff; --accent: #000; --accent-wash: transparent;
    --paper: #111; --dim: #444; --faint: #777; --border: #ccc; --border-soft: #e6e6e6;
    --void-rgb: 255, 255, 255; --panel-rgb: 255, 255, 255; --raise-rgb: 255, 255, 255; --accent-rgb: 0, 0, 0; --paper-rgb: 17, 17, 17; --strong: #000;
    color-scheme: light;
  }
  html, body { background: #fff !important; color: #111; }
  body { display: block; font-size: 10.5pt; line-height: 1.45; }
  *, *::before, *::after { animation: none !important; transition: none !important; box-shadow: none !important; text-shadow: none !important; }
  body::after { content: none !important; }
  .prose .dither .original, .prose img.embed { filter: none; mix-blend-mode: normal; }
  .field, .skip, .bar, .vault, .rail, .status, .sigil, .path, .resume-actions, .shell-drop, .map-dialog, .viewer, .fn-pop,
  .island, .code-copy, .heat-legend, .sidenote, .fn-back { display: none !important; }
  .deck { display: block; }
  .reader { background: none; }
  .reader-inner, .reader-inner:has(.sidenote) { max-width: none; margin: 0; padding: 0; }
  .prose { color: #111; }
  .prose h1, .prose h2, .prose h3, .prose h4 { color: #000; break-after: avoid; }
  .prose h2 .anchor, .prose h2::before, .prose h3::before, .prose h2.hl > span::before { display: none; }
  .prose mark { background: none; color: inherit; padding: 0; font-weight: 600; }
  .prose strong { color: #000; }
  .prose a { border: 0; color: inherit; }
  .prose a.wikilink::before, .prose a.wikilink::after, .prose a.external::after { content: none; }
  .prose blockquote { background: none; border-left-color: #999; }
  .prose figure, .prose pre, .prose blockquote, .prose li, .prose tr, .dash-tile { break-inside: avoid; }
  .prose .dither { border: 0; background: none; }
  .prose .dither .dithered { display: none; }
  .prose .dither .original { position: static; opacity: 1; height: auto; }
  .prose pre, .prose code, .prose figure.code { background: #f6f6f4 !important; color: #111; }
  .prose :is(pre, figure.code) * { color: #111 !important; }
  .footnotes, .reader-inner:has(.sidenote) .footnotes { display: block; }

  /* The résumé fits two pages: tighter rhythm, the name as the header. */
  body.page-resume { font-size: 10pt; }
  .page-resume .prose h1 { display: none; }
  .page-resume .prose .doc-sub { margin: 0 0 8pt; font: 500 20pt/1.15 var(--display); color: #000; letter-spacing: -.01em; }
  .page-resume .prose > .doc-sub + p + ul { display: flex; flex-wrap: wrap; gap: 2pt 12pt; margin: 0 0 12pt; padding: 0; list-style: none; font: 9pt var(--mono); }
  .page-resume .prose > .doc-sub + p + ul li { margin: 0; }
  .page-resume .prose h2 { margin: 14pt 0 6pt; padding-bottom: 3pt; border-bottom: 1px solid #ccc; font-size: 13pt; }
  .page-resume .prose h3 { margin: 9pt 0 2pt; font-size: 11pt; }
  .page-resume .prose p, .page-resume .prose ul { margin: 0 0 6pt; }
  .page-resume .prose li { margin: 1pt 0; }
  .page-resume .prose font { font-size: 9pt !important; color: #444; }
  /* The way around the site stays on the site. */
  .page-resume .prose > hr, .page-resume .prose > hr ~ * { display: none; }
}
