/* ==========================================================================
   mtsfj.github.io · the site's charter.
   The street at night, told the way the best product sites tell things: a deep
   ground, large soft light, a fine film grain, glass surfaces, big quiet type.
   The pixel font is the accent that ties every page to the street: titles,
   small labels, never running text.
   Every page links this file (after assets/fonts/fonts.css) and keeps in its own
   <style> only what is its own: the home's street, an article's widgets.
   ========================================================================== */

/* ---- tokens ---- */
:root {
  color-scheme: dark;
  --ground: #0e0b1e;           /* the page: the street's sky, past midnight */
  --night: #17132c;            /* (the street's own night: hero foot, panels' base) */
  --night-deep: #0f0c22;
  --panel: #1e1838;  --panel-2: #241d44;
  --paper: #f4efe9;            /* headings, the lead */
  --text: #cdc6dc;             /* running text */
  --paper-dim: #9b94b2;        /* secondary text */
  --pink: #ff8ad1; --coral: #ff7a63; --sodium: #ffc36b; --violet: #9d7bff;
  --cyan: #5ee6ff; --green: #3ee08a;   /* data only (charts, widgets) */
  --rule: rgba(255,255,255,.08);
  --rule-2: rgba(255,255,255,.16);
  --glass: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  --glass-edge: inset 0 1px 0 rgba(255,255,255,.07);
  --shadow: 0 30px 60px -30px rgba(0,0,0,.6);
  --glow-pink: 0 0 10px rgba(255,138,209,.45), 0 0 26px rgba(255,138,209,.18);
  --sans: "Inter Tight", system-ui, sans-serif;
  --pixel: "Silkscreen", monospace;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --measure: 66ch;
  --gutter: clamp(20px, 4vw, 64px);
  --wide: 1200px;
  --radius: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--paper); text-decoration-color: rgba(255,138,209,.55); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color .2s, text-decoration-color .2s; }
a:hover { color: #fff; text-decoration-color: var(--pink); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(255,138,209,.35); color: #fff; }
[hidden] { display: none !important; }
code, kbd, .mono { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: rgba(255,255,255,.07); padding: .12em .4em; border-radius: 6px; }
strong, b { color: var(--paper); font-weight: 600; }
.dim { color: var(--paper-dim); }
.small { font-size: 14px; color: var(--paper-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- the page under the street: a flat deep ground, the hero's foot fading into it; on a wide screen the street
   goes on in its margins (the walls) ---- */
.page { position: relative; isolation: isolate; overflow-x: clip; padding: 0 var(--gutter) 56px; background: linear-gradient(var(--night-deep), var(--ground) 320px); }
.page > .container { position: relative; }
/* the walls (site.js): a facade in each margin, sticky to the screen, fading toward the content */
.wall { position: absolute; top: 0; bottom: 0; z-index: -1; pointer-events: none; }
.wall-left { left: 0; } .wall-right { right: 0; }
.wall-in { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.wall canvas { position: absolute; top: 0; display: block; image-rendering: pixelated; will-change: transform; }
.wall-left canvas { left: 0; } .wall-right canvas { right: 0; }
.wall .wall-glow { filter: blur(7px); mix-blend-mode: screen; opacity: .9; image-rendering: auto; }
.wall-left .wall-in { -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent); mask-image: linear-gradient(90deg, #000 60%, transparent); }
.wall-right .wall-in { -webkit-mask-image: linear-gradient(270deg, #000 60%, transparent); mask-image: linear-gradient(270deg, #000 60%, transparent); }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.container { max-width: var(--wide); margin: 0 auto; }

/* ---- sections: room, a small pixel number, a large quiet title; no rule anywhere ---- */
.section { padding: 72px 0; position: relative; }
.section:first-child { padding-top: 112px; }
.section.tight { padding-top: 12px; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 64px; align-items: end; margin: 0 0 48px; }
.section-head > :first-child { display: flex; flex-direction: column; gap: 16px; }
.section-head .section-intro { margin: 0; max-width: 46ch; justify-self: start; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }
.section-num { font-family: var(--pixel); font-size: 12px; color: var(--pink); text-shadow: var(--glow-pink); letter-spacing: .04em; }
/* a section's title: large, tight, lit from above */
.section-title { font-family: var(--sans); font-weight: 600; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -.03em; margin: 0;
  background: linear-gradient(180deg, #fff 20%, #c9bfe0 120%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-grid { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 40px 64px; align-items: start; }
/* text on the left, an aside on the right; the aside follows the text on a phone */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 500px); gap: 48px 72px; align-items: start; }
.split .prose { max-width: var(--measure); }
@media (max-width: 760px) { .section { padding: 56px 0; } .section:first-child { padding-top: 72px; } .section-head { margin-bottom: 30px; } .section-grid, .split { grid-template-columns: 1fr; gap: 32px; } }

/* ---- type ---- */
.label { font-family: var(--pixel); font-size: 11px; color: var(--pink); display: block; margin-bottom: 12px; letter-spacing: .04em; }
.eyebrow { font-family: var(--pixel); font-size: 11px; color: var(--pink); margin: 0 0 16px; letter-spacing: .04em; text-shadow: var(--glow-pink); }
.display { font-family: var(--pixel); font-weight: 400; font-size: clamp(32px, 5vw, 60px); line-height: 1.05; margin: 0 0 18px; color: var(--paper); text-shadow: 0 0 26px rgba(255,138,209,.45); text-wrap: balance; }
.lede { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.5; color: var(--paper-dim); max-width: 40ch; margin: 0; }
.section-intro { color: var(--paper-dim); margin: 0 0 36px; max-width: 56ch; font-size: 18px; line-height: 1.5; }
/* the first paragraph of a text: larger, brighter, the reader's way in */
.lead { font-size: clamp(20px, 1.75vw, 24px); line-height: 1.5; letter-spacing: -.01em; color: var(--paper); }
.more { margin: 32px 0 0; font-size: 15px; }
.more a { text-decoration: none; color: var(--paper-dim); } .more a:hover { color: var(--paper); }

/* ---- the site bar: every page but the home (the home has its street) ---- */
.site-bar { position: sticky; top: 0; z-index: 50; padding: 16px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: 18px; font-size: 15px;
  background: rgba(14,11,30,.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 1px 0 var(--rule); }
.site-bar .brand { font-family: var(--pixel); font-size: 13px; color: var(--paper); text-decoration: none; text-shadow: var(--glow-pink); white-space: nowrap; }
.site-bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px; }
.site-bar nav a { text-decoration: none; color: var(--paper-dim); }
.site-bar nav a:hover, .site-bar nav a[aria-current] { color: var(--paper); }
@media (max-width: 560px) { .site-bar { flex-direction: column; align-items: flex-start; gap: 10px; } .site-bar nav { gap: 4px 18px; font-size: 14px; } }
.lang { font: inherit; font-family: var(--pixel); font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--rule-2); background: rgba(255,255,255,.04); color: var(--paper); cursor: pointer; transition: border-color .2s, background .2s; }
.lang:hover { border-color: var(--pink); background: rgba(255,138,209,.08); }

/* ---- a page's head (blog, a post): eyebrow, title, lede, its meta ---- */
.masthead { padding: 80px 0 40px; }
.masthead .chips { margin-top: 22px; }
.masthead.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: end; }
@media (max-width: 800px) { .masthead.split { grid-template-columns: 1fr; } .masthead { padding-top: 56px; } }

/* ---- glass: the one surface (cards, panels, projects) ----
   a faint fill, a 1 px edge, light on its top edge, a deep soft shadow; under the pointer a glow follows it
   (site.js sets --mx / --my on them) */
.glass, .panel, .entry, .project { position: relative; background: var(--glass); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--glass-edge), var(--shadow); }
.entry::before, .project::before, .panel.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255,138,209,.11), transparent 45%); }
.entry:hover::before, .project:hover::before, .panel.spot:hover::before { opacity: 1; }
.entry, .project { transition: border-color .35s, transform .35s var(--ease); }
.entry:hover, .project:hover { border-color: var(--rule-2); transform: translateY(-2px); }
.panel { padding: 26px 28px; }
.panel > .label:first-child { margin-bottom: 16px; }
.prose .panel { margin: 36px 0; }

/* ---- chips, badges, buttons: pills ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border: 1px solid var(--rule); border-radius: 999px; font-size: 13.5px; text-decoration: none; color: var(--text); background: rgba(255,255,255,.035); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sodium); box-shadow: 0 0 8px rgba(255,195,107,.7); }
a.chip:hover { border-color: var(--rule-2); color: var(--paper); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: 12px; font-weight: 500; color: var(--paper-dim); letter-spacing: .01em; }
.badge.live { background: rgba(255,195,107,.12); color: var(--sodium); }
.btns { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 1px solid var(--rule-2); border-radius: 999px; text-decoration: none; font: inherit; font-size: 15px; font-weight: 500; color: var(--paper); background: rgba(255,255,255,.04); cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease); }
.btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.28); color: #fff; transform: translateY(-1px); }
/* the main action: light on dark */
.btn.primary { background: var(--paper); color: var(--ground); border-color: transparent; box-shadow: 0 8px 30px -8px rgba(255,138,209,.55); }
.btn.primary:hover { background: #fff; color: var(--ground); }

/* ---- links in a row (an article's, a publication's): the main one in sodium ---- */
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; }
.links a { color: var(--paper-dim); text-decoration-color: var(--rule-2); } .links a:hover { color: var(--paper); text-decoration-color: var(--pink); }
.links .primary { color: var(--sodium); text-decoration-color: rgba(255,195,107,.5); }
.links .primary:hover { color: #ffd697; text-decoration-color: var(--sodium); }
.links button { font: inherit; color: var(--paper-dim); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 4px; }
.links button:hover { color: var(--paper); text-decoration-color: var(--pink); }

/* ---- the entry: a post's or an article's card ----
   <li class="entry"> <a class="entry-media" href> <img class="vignette"> or <canvas class="vignette" data-seed> </a>
   <div class="entry-body"> <p class="entry-meta">…</p> <h3 class="entry-title"><a href>…</a></h3> <p class="entry-text">…</p> <div class="links">…</div> </div> </li>
   .entries stacks them; .entries-grid lays them in columns (the home, the blog) */
.entries { margin: 0; padding: 0; list-style: none; max-width: 860px; display: flex; flex-direction: column; gap: 20px; }
.entries-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.entry { display: flex; gap: 24px; padding: 14px 14px 24px; overflow: hidden; }
.entries .entry { padding: 18px; }
.entries-grid .entry { flex-direction: column; gap: 20px; }
.entry-media { flex-shrink: 0; display: block; line-height: 0; position: relative; z-index: 1; }
.vignette { display: block; width: 168px; height: 112px; image-rendering: pixelated; border-radius: 12px; background: var(--night-deep); }
/* in a grid the vignette is shown at a whole multiple of its pixels (168 x 112 at 3, 96 x 64 at 5), centred on the night */
.entries-grid .entry-media { display: flex; justify-content: center; background: radial-gradient(120% 90% at 50% 0%, rgba(157,123,255,.18), var(--night-deep) 70%); border-radius: 14px; overflow: hidden; }
.entries-grid .vignette { width: min(100%, 504px); height: auto; aspect-ratio: 3 / 2; border-radius: 0; background: none; }
.entries-grid canvas.vignette { width: min(100%, 480px); }
.entry-body { min-width: 0; position: relative; z-index: 1; }
.entries-grid .entry-body { padding: 0 12px; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--paper-dim); }
.entry-title { margin: 0 0 10px; font-size: 22px; font-weight: 600; line-height: 1.22; letter-spacing: -.015em; color: var(--paper); text-wrap: balance; }
.entry-title a { text-decoration: none; color: inherit; }
.entry-title a::after { content: ""; position: absolute; inset: 0; }   /* (the whole card is the title's link) */
.entry .links, .entry .links a { position: relative; z-index: 2; }
.entry-text { margin: 0 0 16px; color: var(--paper-dim); max-width: 60ch; font-size: 16px; }
@media (max-width: 720px) { .entry { flex-direction: column; gap: 16px; } .vignette { width: 100%; height: auto; aspect-ratio: 3 / 2; } }

/* ---- rows: a list spaced, not ruled (publications) ---- */
.rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 26px; }
.row-title { font-weight: 600; color: var(--paper); }
.row-meta { font-weight: 500; color: var(--sodium); font-size: 14px; margin-left: 8px; }
.row-sub { color: var(--paper-dim); font-size: 15.5px; margin-top: 6px; max-width: 72ch; }
.row-note { margin-top: 12px; font-size: 15.5px; max-width: 72ch; }
.row-venue { color: var(--sodium); font-size: 15px; margin-top: 4px; }
.rows .links { margin-top: 12px; }
.pub .rows > li > div:first-child a { font-size: clamp(19px, 1.6vw, 22px); font-weight: 600; letter-spacing: -.01em; line-height: 1.3; text-decoration: none; }
.pub .rows > li > div:first-child a:hover { color: #fff; }
/* projects: glass cards in a grid */
.projects { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.project { padding: 24px 26px; overflow: hidden; }
.project > * { position: relative; }
.project .row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; font-size: 18px; letter-spacing: -.01em; }
.project .row-title a { text-decoration-color: var(--rule-2); }
.project .row-meta { margin-left: 0; }
.project .row-sub { margin-top: 0; }
.chips.tools { margin: 28px 0 0; padding: 0; list-style: none; }
/* a call to action: a large sentence, its buttons */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding: clamp(28px, 4vw, 48px); overflow: hidden;
  background: radial-gradient(80% 140% at 0% 0%, rgba(255,138,209,.14), transparent 60%), radial-gradient(70% 120% at 100% 100%, rgba(94,230,255,.08), transparent 60%), var(--glass); }
.cta-text { margin: 0; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -.02em; font-weight: 600; color: var(--paper); max-width: 22ch; }
/* key / value lines (a bio's facts): spaced, a faint line between */
.kv { margin: 36px 0 0; padding: 0; list-style: none; font-size: 15.5px; }
.kv li { padding: 11px 0; display: grid; grid-template-columns: 130px 1fr; gap: 18px; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); }
.kv li:last-child { box-shadow: none; }
.kv li > :first-child { color: var(--paper-dim); }
@media (max-width: 480px) { .kv li { grid-template-columns: 1fr; gap: 2px; } }
/* a dated list (news) */
.dated { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.dated li { display: grid; grid-template-columns: 6.5em 1fr; gap: 14px; }
.dated .d { color: var(--sodium); font-variant-numeric: tabular-nums; font-weight: 500; }
@media (max-width: 480px) { .dated li { grid-template-columns: 1fr; gap: 0; } }

/* ---- the chronology: lit dots on a soft wire, the last one in sodium ---- */
.chrono { margin: 22px 0 0; padding: 0; list-style: none; }
.chrono li { position: relative; padding: 0 0 22px 28px; }
.chrono li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; border-radius: 2px; background: linear-gradient(rgba(255,138,209,.45), rgba(255,138,209,.08)); }
.chrono li:last-child::before { display: none; }
.chrono li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px rgba(255,138,209,.12), 0 0 14px rgba(255,138,209,.7); }
.chrono li:last-child::after { background: var(--sodium); box-shadow: 0 0 0 4px rgba(255,195,107,.14), 0 0 14px rgba(255,195,107,.75); }
.chrono-date { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--sodium); display: block; margin-bottom: 2px; }
.chrono-label { display: block; font-size: 16.5px; font-weight: 600; line-height: 1.25; color: var(--paper); margin-bottom: 2px; }
.chrono-sub { display: block; font-size: 13.5px; color: var(--paper-dim); max-width: 26ch; }
.chrono-panel .chrono { margin-top: 6px; }
.chrono-panel .chrono-sub { max-width: none; }
@media (min-width: 761px) { .chrono-panel { position: sticky; top: 32px; } }

/* ---- numbers ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.tile { background: rgba(255,255,255,.04); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; }
.tile .v { font-family: var(--pixel); font-size: 20px; color: var(--sodium); text-shadow: 0 0 14px rgba(255,195,107,.35); }
.tile .l { font-size: 12.5px; color: var(--paper-dim); line-height: 1.35; margin-top: 4px; }
.codeblock, .prose pre { margin: 12px 0 0; padding: 14px 16px; font: 12.5px/1.6 var(--mono); color: var(--text); background: rgba(0,0,0,.28); border: 1px solid var(--rule); border-radius: 12px; white-space: pre; overflow-x: auto; }

/* ---- prose: running text (a bio, a post) ---- */
.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { font-size: clamp(26px, 2.8vw, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; color: var(--paper); margin: 2.2em 0 .6em; }
.prose h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--paper); margin: 1.8em 0 .4em; }
.prose ul, .prose ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--pink); }
.prose .dated, .prose .kv { padding: 0; } .prose .dated li, .prose .kv li { margin: 0; }   /* (lists that are components keep their own layout) */
.prose blockquote { margin: 1.6em 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--pink); color: var(--paper); font-size: 1.1em; font-style: italic; }
.prose hr { border: 0; height: 1px; margin: 3em 0; background: linear-gradient(90deg, transparent, var(--rule-2), transparent); }
.prose figure { margin: 2em 0; }
.prose figure img, .prose figure canvas, .prose figure svg { display: block; max-width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--rule); }
.prose .vignette { width: 100%; height: auto; aspect-ratio: 3 / 2; }
.prose .tiles { margin: 2em 0; }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--paper-dim); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 1.2em 0 1.6em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; box-shadow: inset 0 -1px 0 var(--rule); vertical-align: top; }
.prose th { font-weight: 500; color: var(--paper-dim); font-size: 13px; }
/* a takeaway: one thing to keep */
.takeaway { margin: 1.8em 0; padding: 18px 22px; border-radius: 16px; background: linear-gradient(90deg, rgba(255,195,107,.10), rgba(255,195,107,.02)); border: 1px solid rgba(255,195,107,.22); }
.takeaway > :last-child { margin-bottom: 0; }

/* the glass's edge lights up where the pointer is */
.entry::after, .project::after, .cta::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255,138,209,.85), rgba(157,123,255,.35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.entry:hover::after, .project:hover::after, .cta:hover::after { opacity: 1; }
/* a section's title: a sheen crosses it once as it arrives */
.section-head.reveal .section-title { background-image: linear-gradient(100deg, #fff 0%, #fff 42%, #ffd3ee 50%, #fff 58%, #fff 100%), linear-gradient(180deg, transparent, rgba(201,191,224,.0)); background-size: 260% 100%; background-position: 100% 0; }
.section-head.reveal.in .section-title { animation: sheen 1.8s .25s var(--ease) both; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }
/* the chronology draws itself: its wire grows, its dots light one after the other */
.chrono.reveal { opacity: 1; transform: none; }
.chrono.reveal li::before { transform: scaleY(0); transform-origin: top; transition: transform .5s var(--ease) calc(var(--i, 0) * 140ms + 200ms); }
.chrono.reveal li::after { transform: scale(0); transition: transform .45s cubic-bezier(.3, 1.6, .5, 1) calc(var(--i, 0) * 140ms + 120ms); }
.chrono.reveal li > * { opacity: 0; transform: translateX(-6px); transition: opacity .5s var(--ease) calc(var(--i, 0) * 140ms + 160ms), transform .5s var(--ease) calc(var(--i, 0) * 140ms + 160ms); }
.chrono.reveal.in li::before, .chrono.reveal.in li::after { transform: none; }
.chrono.reveal.in li > * { opacity: 1; transform: none; }

/* ---- a figure (FIG. 01): a labelled visual, the way the references show their ideas ----
   <figure class="fig"><span class="fig-label">FIG. 01</span><canvas class="fig-map" data-seed></canvas><figcaption>…</figcaption></figure> */
.fig { margin: 0; position: relative; }
.fig-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: radial-gradient(120% 100% at 50% 0%, rgba(157,123,255,.12), rgba(15,12,34,.9) 70%); border: 1px solid var(--rule); box-shadow: var(--glass-edge), var(--shadow); }
.fig-label { display: block; padding: 14px 18px 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--paper-dim); }
.fig-map { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; padding: 14px 18px 18px; image-rendering: pixelated; }
.fig figcaption { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--paper-dim); max-width: 46ch; }
.fig figcaption b { color: var(--text); font-weight: 500; }

.bio-more { margin-top: 80px; }
/* ---- the game (FIG. 01, site.js): its board, its scores (colour, share, current goal, rounds won), its round ---- */
.game .fig-frame { padding-bottom: 16px; }
.game-board { display: block; margin: 12px 18px 0; width: calc(100% - 36px); height: auto; aspect-ratio: 24 / 16; image-rendering: pixelated; }
.game-score { margin: 16px 18px 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 13px; }
.game-score li { display: grid; grid-template-columns: 9px 4.2em minmax(0, 1fr) 2.8em 7.6em 1.4em; align-items: center; gap: 10px; color: var(--paper-dim); }
.game-score i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.g-name { color: var(--text); }
.g-bar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; }
.g-bar b { display: block; height: 100%; border-radius: 5px; background: var(--c); transition: width .25s linear; }
.g-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.g-goal { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-wins { text-align: right; font-family: var(--pixel); font-size: 11px; color: var(--sodium); }
.game-round { margin: 12px 18px 0; font-family: var(--pixel); font-size: 10.5px; letter-spacing: .04em; color: var(--c, var(--paper-dim)); }
@media (max-width: 480px) { .game-score li { grid-template-columns: 9px 4em minmax(0, 1fr) 2.8em 1.4em; } .g-goal { display: none; } }

/* ---- a cover: a post's generated picture, full width of its card ---- */
.entries-grid .entry-media.cover { display: block; background: var(--night-deep); border: 1px solid var(--rule); }
.entry-media.cover img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s var(--ease); }
.entry:hover .entry-media.cover img { transform: scale(1.03); }

/* ---- a metric: a project's number, on top of its card; a bar when the text gives two ---- */
.metric { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 14px; }
.metric-v { font-size: clamp(34px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.04em; line-height: 1; color: var(--paper); }
.metric-l { font-size: 14px; color: var(--paper-dim); }
.bars-mini { margin: 0 0 16px; display: grid; gap: 6px; font-size: 12.5px; color: var(--paper-dim); }
.bars-mini div { display: grid; grid-template-columns: 5.5em 1fr 3.5em; align-items: center; gap: 10px; }
.bars-mini i { display: block; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); transform-origin: left; }
.bars-mini i.hi { background: linear-gradient(90deg, var(--pink), var(--sodium)); }
.bars-mini b { font-weight: 500; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.reveal .bars-mini i, .project.reveal .bars-mini i { transform: scaleX(0); transition: transform 1s var(--ease) .35s; }
.project.reveal.in .bars-mini i { transform: none; }

/* ---- reveal: blocks come in as they are reached (site.js adds .reveal, then .in) ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- the skyline: a row of pixel roofs, lit windows, before the footer (drawn by site.js) ---- */
.skyline { line-height: 0; margin-top: 24px; background: linear-gradient(transparent 0, var(--night-deep) 100%); }
.skyline canvas { display: block; width: 100%; height: clamp(56px, 8vw, 110px); image-rendering: pixelated; }
.skyline + .site-footer { box-shadow: none; background: var(--night-deep); }

/* ---- the footer ---- */
.site-footer { padding: 36px var(--gutter) 44px; box-shadow: inset 0 1px 0 var(--rule); font-size: 14px; color: var(--paper-dim); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--paper-dim); } .site-footer a:hover { color: var(--paper); }
.site-footer .pixel { font-family: var(--pixel); font-size: 11px; }

/* ---- the table of contents (the home): a pill that floats in once the street is passed; the section being read lit ---- */
.toc { position: fixed; z-index: 60; top: 14px; left: 50%; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 18px; border-radius: 999px; font-size: 14px;
  background: rgba(14,11,30,.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--rule); box-shadow: var(--glass-edge), 0 14px 34px -14px rgba(0,0,0,.7);
  opacity: 0; transform: translate(-50%, -14px); pointer-events: none; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.toc.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toc a { text-decoration: none; color: var(--paper-dim); white-space: nowrap; transition: color .2s, background .2s; }
.toc-brand { font-family: var(--pixel); font-size: 11px; color: var(--paper) !important; text-shadow: var(--glow-pink); margin-right: 10px; }
.toc-links { display: flex; align-items: center; gap: 2px; }
.toc-links a { position: relative; padding: 7px 11px; border-radius: 999px; }
.toc-links a:hover { color: var(--paper); }
.toc-links a.on { color: var(--paper); background: rgba(255,255,255,.07); }
.toc-links a.on::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; border-radius: 2px; transform: translateX(-50%); background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.toc-blog { padding: 7px 14px; border-radius: 999px; background: var(--paper); color: var(--ground) !important; font-weight: 500; margin-left: 6px; }
.toc-blog:hover { background: #fff; }
.page .section { scroll-margin-top: 72px; }
@media (max-width: 860px) {
  .toc { left: 10px; right: 10px; transform: translateY(-14px); padding: 5px; }
  .toc.on { transform: none; }
  .toc-brand, .toc-blog { display: none; }
  .toc-links { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
  .toc-links::-webkit-scrollbar { display: none; }
}

/* ---- copy the citation; subscribe (a small panel with the feed's address) ---- */
.links .bib-copy { font: inherit; color: var(--paper-dim); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 4px; }
.links .bib-copy:hover { color: var(--paper); text-decoration-color: var(--pink); }
.links .bib-copy.done { color: var(--green); text-decoration-color: transparent; }
.more { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.rss-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 15px; color: var(--paper-dim); background: none; border: 0; padding: 0; cursor: pointer; }
.rss-btn::before { content: ""; width: 11px; height: 11px; border-radius: 2px; background:
  radial-gradient(circle at 2px 9px, var(--ground) 1.6px, transparent 2.2px),
  radial-gradient(circle at 0 11px, transparent 4px, var(--ground) 4.6px, var(--ground) 5.6px, transparent 6.2px),
  radial-gradient(circle at 0 11px, transparent 7.6px, var(--ground) 8.2px, var(--ground) 9.2px, transparent 9.8px), var(--sodium); }
.rss-btn:hover { color: var(--paper); }
.rss-pop { position: absolute; z-index: 5; top: calc(100% + 10px); left: 0; width: min(440px, 100%); padding: 16px 18px; border-radius: 16px; background: rgba(20,16,40,.96); border: 1px solid var(--rule-2); box-shadow: var(--glass-edge), 0 24px 50px -20px rgba(0,0,0,.8); font-size: 14px; color: var(--text); }
.rss-pop p { margin: 0 0 10px; }
.rss-pop .row { display: flex; gap: 8px; }
.rss-pop input { flex: 1; min-width: 0; font: 13px var(--mono); color: var(--paper); background: rgba(0,0,0,.3); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; }
.rss-pop button { font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--paper); color: var(--ground); cursor: pointer; font-weight: 500; }
.rss-pop a { color: var(--paper-dim); }

/* ---- talks & teaching: three cards, their vignettes at x2 (whole pixels) ---- */
.talks .vignette { width: min(100%, 336px); }

/* ---- the library: a shelf of spines (a book's colour, its theme), lifted under the pointer; its details beneath ---- */
.library { position: relative; }
.shelf-unit { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.shelf { display: flex; align-items: flex-end; gap: 5px; margin: 0; padding: 28px 22px 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.shelf-cat-li { margin-left: 6px; line-height: 0; }
.shelf-cat { display: block; width: 42px; height: 36px; image-rendering: pixelated; }
.shelf::-webkit-scrollbar { display: none; }
.shelf li { flex: none; }
.book { position: relative; display: flex; align-items: center; justify-content: center; width: var(--w); height: var(--h); text-decoration: none; border-radius: 3px 3px 1px 1px;
  background:
    linear-gradient(to bottom, transparent 12px, rgba(14,11,30,.32) 12px 15px, transparent 15px 19px, rgba(14,11,30,.18) 19px 20px, transparent 20px calc(100% - 22px), rgba(14,11,30,.32) calc(100% - 22px) calc(100% - 18px), transparent calc(100% - 18px)),
    linear-gradient(90deg, var(--c2), var(--c) 28%, var(--c) 72%, var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset -2px 0 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.35);
  transition: transform .35s var(--ease), filter .35s; }
.book span { writing-mode: vertical-rl; transform: rotate(180deg); max-height: calc(var(--h) - 52px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: rgba(14,11,30,.86); }
.book.star::after { content: ""; position: absolute; top: -16px; left: 50%; width: 9px; height: 9px; transform: translateX(-50%); background: var(--sodium);
  clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); filter: drop-shadow(0 0 4px rgba(255,195,107,.9)); }
.book:hover, .book:focus-visible, .book.on { transform: translateY(-12px); filter: drop-shadow(0 0 12px var(--c)); }
.shelf-board { height: 12px; margin: 0; border-radius: 2px; background: linear-gradient(#6a4a3e, #3a2a2a 70%, #2a1e22); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 20px 46px -14px rgba(255,138,209,.35); }
.shelf-caption { min-height: 3.4em; margin: 22px 0 0; text-align: center; font-size: 15px; line-height: 1.5; color: var(--paper-dim); }
.shelf-caption b { color: var(--paper); font-weight: 600; }
.shelf-caption .yr { color: var(--sodium); }
.shelf-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 14px 0 0; font-size: 13px; color: var(--paper-dim); }
.shelf-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.shelf-legend .lg::before { content: ""; width: 8px; height: 12px; border-radius: 1px; background: var(--c); }
.shelf-legend .lg.star::before { width: 9px; height: 9px; background: var(--sodium); clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); }
@media (max-width: 760px) { .shelf-unit { width: auto; } }

/* ---- the library's kinds: a book (bound, gilt bands), a paper (a thin journal, its label), a video (a cassette, its
   label window), a series (a box set, an edge per episode), a course (a ring binder, its label pocket) ---- */
.book[data-kind="book"] { border-radius: 2px 2px 1px 1px;
  background: linear-gradient(to bottom, transparent 10px, rgba(255,214,140,.85) 10px 11px, transparent 11px 14px, rgba(255,214,140,.85) 14px 15px, transparent 15px calc(100% - 16px), rgba(255,214,140,.85) calc(100% - 16px) calc(100% - 15px), transparent calc(100% - 15px)),
    linear-gradient(90deg, var(--c2), var(--c) 22%, var(--c) 78%, var(--c2)); }
.book[data-kind="book"] span { white-space: normal; text-align: center; line-height: 1.12; font-size: 12px; max-height: calc(var(--h) - 40px); max-width: calc(var(--w) - 6px); }
.book[data-kind="paper"] { width: calc(var(--w) * .72); border-radius: 1px;
  background: linear-gradient(to bottom, rgba(244,239,233,.92) 0 34px, rgba(14,11,30,.25) 34px 35px, transparent 35px),
    linear-gradient(90deg, var(--c2), var(--c) 40%, var(--c)); }
.book[data-kind="paper"] span { font-size: 11.5px; font-weight: 500; }
.book[data-kind="video"], .book[data-kind="series"] { border-radius: 2px;
  background: linear-gradient(to bottom, #17141f 0 18px, var(--c) 18px calc(100% - 18px), #17141f calc(100% - 18px)),
    #17141f; box-shadow: inset 0 0 0 2px #17141f, inset 0 1px 0 4px rgba(255,255,255,.06), 0 0 0 1px rgba(0,0,0,.4); }
.book[data-kind="video"]::before, .book[data-kind="series"]::before { content: ""; position: absolute; top: 6px; left: 50%; width: 8px; height: 6px; transform: translateX(-50%); border-radius: 1px; background: rgba(255,255,255,.18); }
.book[data-kind="series"] { width: calc(var(--w) * 1.12);
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(14,11,30,.5) 9px 10px) top / 100% 18px no-repeat, repeating-linear-gradient(90deg, transparent 0 9px, rgba(14,11,30,.5) 9px 10px) bottom / 100% 18px no-repeat, repeating-linear-gradient(90deg, transparent 0 9px, rgba(14,11,30,.16) 9px 10px), linear-gradient(to bottom, #17141f 0 18px, var(--c) 18px calc(100% - 18px), #17141f calc(100% - 18px)); }
.book[data-kind="course"] { width: calc(var(--w) * 1.2); border-radius: 3px;
  background: radial-gradient(circle at 50% calc(100% - 20px), #120e26 0 4px, rgba(255,255,255,.55) 4px 5px, transparent 5.5px),
    linear-gradient(to bottom, transparent 14%, rgba(244,239,233,.9) 14% 78%, transparent 78%),
    linear-gradient(90deg, var(--c2), var(--c) 18%, var(--c) 82%, var(--c2)); }
.book[data-kind="course"] span { max-height: 60%; transform: rotate(180deg) translateX(0); margin-top: -18px; }
.shelf-plate { display: inline-block; margin: 0 0 0 18px; padding: 3px 8px; font: 10px var(--pixel); letter-spacing: .04em; color: var(--paper-dim); background: rgba(255,255,255,.05); border: 1px solid var(--rule); border-radius: 4px; transform: translateY(6px); }
.library .shelf-unit + .shelf-unit { margin-top: 26px; }

/* ---- touch screens: the small links and sliders get a finger-sized target (24 px and more), the same look: the extra padding is taken back by a negative margin ---- */
@media (pointer: coarse) {
  .site-bar nav a, .site-bar .brand { padding: 3px 4px; margin: -3px -4px; }
  input[type=range] { padding-block: 6px; margin-block: -6px; }
}
