/* univariate.org
   One container (1240px), one left edge. Geist Mono only. Black, white, one electric blue.
   Lists are a modular grid: three equal modules, no gutter, hairlines between cells and small
   registration crosses where they meet. Hover/focus on a cell: the "fast scan" (a short white-blue
   head runs the top edge and lays down a blue hairline; the cross at the far corner flashes).

   Cell position classes are written by tools/site.py, one per layout:
     c3-l / c3-m / c3-r   column in the three-module layout (> 960px)
     c2-l / c2-r          column in the two-module layout (681-960px)
     s3-N / s2-N          the cell spans N modules in that layout
   Below 681px everything is one module. */

@import url("/static/fonts/fonts.css");

:root {
  --bg: #000; --bg2: #0b0b0c; --ink: #f2f2f3; --text: #c4c4c9; --muted: #85858d; --dim: #47474d; --line: #1c1c1f; --line2: #2a2a2e;
  --tick: #55555c;
  --hi: #3b6cff; --hi-t: #7396ff; --sel: #1a3170;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --adv: .6; --lsb: .06; --cap: .7;
  --px: clamp(22px, 2vw, 28px);
  --m: clamp(20px, 4vw, 48px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.7 var(--mono); font-variant-ligatures: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--sel); color: #fff; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--hi-t); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: calc(1240px + 2 * var(--m)); margin: 0 auto; padding-inline: max(var(--m), env(safe-area-inset-left, 0px)) max(var(--m), env(safe-area-inset-right, 0px)); }
.s { color: var(--hi-t); }
.nw { white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--bg); color: var(--ink); padding: 6px 10px; }
.skip:focus { left: 8px; }

/* header */
.site-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; padding-block: 28px; font-size: 14px; }
.wordmark { color: var(--ink); font-weight: 500; }
.wordmark .t { color: var(--muted); font-weight: 400; }
nav { display: flex; gap: 28px; }
nav a { color: var(--muted); transition: color .2s; }
nav a .s { color: var(--dim); transition: color .2s; }
nav a:hover, nav a[aria-current] { color: var(--ink); }
nav a:hover .s, nav a[aria-current] .s { color: var(--hi-t); }

/* hero */
#intro { padding-top: clamp(80px, 14vh, 170px); }
.namebox { container-type: inline-size; }
#intro h1 { margin: 0 0 0 calc(var(--lsb) * -1em); white-space: nowrap; color: var(--ink); letter-spacing: 0;
  font: 300 calc(100cqw / (12 * var(--adv) - var(--lsb)) * .999)/.8 var(--mono); }
@supports not (width: 1cqw) { #intro h1 { font-size: calc((min(100vw, 1240px) - 2 * var(--m)) / (12 * var(--adv) - var(--lsb)) * .999); } }
.cursor { display: inline-block; width: calc((var(--adv) - var(--lsb)) * 1em); height: calc(var(--cap) * 1em); margin-left: calc(var(--lsb) * 1em); background: var(--hi); animation: blink 1.1s steps(1, end) .6s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ruler { position: relative; height: 1px; margin-top: 44px; background: var(--line2); }
.ruler i { position: absolute; top: -5px; width: 11px; height: 11px; margin-left: -5px;
  background: linear-gradient(var(--tick), var(--tick)) 5px 0 / 1px 100% no-repeat, linear-gradient(var(--tick), var(--tick)) 0 5px / 100% 1px no-repeat; }
.ruler i:nth-child(1) { left: 33.3333%; } .ruler i:nth-child(2) { left: 66.6667%; } .ruler i:nth-child(3) { left: 50%; display: none; }
.tagline .tl { display: block; }
.tagline { margin: 26px 0 0; max-width: 100%; text-wrap: pretty; font-size: clamp(15px, 1.25vw, 17px); line-height: 1.7; color: var(--text); letter-spacing: -.01em; }

/* sections */
.sec { padding-top: clamp(96px, 10vw, 150px); }
#writing { padding-top: clamp(80px, 8vw, 120px); }
.page-top { padding-top: clamp(64px, 9vw, 120px); }
.sec-head { margin: 0 0 26px; }
.sec-head h2, .sec-head h1 { margin: 0; font: 400 clamp(1.5rem, 2.2vw, 2rem)/1 var(--mono); letter-spacing: -.04em; color: var(--ink); }
.group { margin: 72px 0 18px; font: 400 clamp(1.15rem, 1.5vw, 1.35rem)/1 var(--mono); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.group:first-of-type { margin-top: 44px; }
.group b { font-weight: 400; }

/* the modular grid */
.mod { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.cell { --pl: var(--px); --pr: var(--px); --bl: 0; position: relative; min-width: 0; padding: 22px var(--pr) 34px var(--pl);
  border-top: 1px solid var(--line2); border-left: calc(var(--bl) * 1px) solid var(--line2); }
.c3-l { --pl: 0; --bl: 0; } .c3-m { --bl: 1; } .c3-r { --bl: 1; --pr: 0; }
.s3-2 { grid-column: span 2; } .s3-3 { grid-column: 1 / -1; }
.c3-l.s3-3 { --pr: 0; }
.lead.tall { grid-row: span 2; }

/* hover: the fast scan (see 124-fast-scan). The blue hairline grows from the left; a short head
   rides its leading end and sinks into the far corner; the cross there flashes blue once. */
.cell { --scan: .24s; --on: .31s; --ease: cubic-bezier(.2,.5,.5,.9); }
.lead { --scan: .25s; --on: .32s; }
.cell::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; z-index: 1; background: var(--hi); transform: scaleX(0); transform-origin: left; opacity: 0;
  transition: opacity .15s ease, transform 0s linear .15s; }
.cell:hover::before, .cell:focus-within::before { transform: scaleX(1); opacity: 1; transition: transform var(--scan) var(--ease), opacity 0s; }
.cell > .ti::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 11px; z-index: 2; pointer-events: none; opacity: 0;
  background:
    linear-gradient(#fff, #fff) right 0 top 4px / 2px 3px no-repeat,
    linear-gradient(90deg, rgba(59,108,255,0), var(--hi) 45%, #a9bfff 82%, #fff) right 0 top 5px / 28px 1px no-repeat,
    linear-gradient(90deg, rgba(115,150,255,0), rgba(115,150,255,.5)) right 2px top 4px / 12px 1px no-repeat,
    linear-gradient(90deg, rgba(115,150,255,0), rgba(115,150,255,.5)) right 2px top 6px / 12px 1px no-repeat,
    linear-gradient(90deg, rgba(115,150,255,0), rgba(115,150,255,.2)) right 0 top 3px / 5px 1px no-repeat,
    linear-gradient(90deg, rgba(115,150,255,0), rgba(115,150,255,.2)) right 0 top 7px / 5px 1px no-repeat; }
.cell:hover > .ti::before, .cell:focus-within > .ti::before { animation: scan var(--scan) var(--ease) both, sink 70ms linear var(--scan) both, on var(--on) linear; }
@keyframes scan { from { transform: translateX(-100%); clip-path: inset(0 0 0 100%); } to { transform: none; clip-path: inset(0); } }
@keyframes sink { from { background-position: right 0 top 4px, right 0 top 5px, right 2px top 4px, right 2px top 6px, right 0 top 3px, right 0 top 7px; }
  to { background-position: right -30px top 4px, right -30px top 5px, right -28px top 4px, right -28px top 6px, right -30px top 3px, right -30px top 7px; } }
@keyframes on { 0%, 100% { opacity: 1; } }
.cell > .m::before { content: ""; position: absolute; right: -6px; top: -6px; width: 11px; height: 11px; z-index: 3; pointer-events: none; opacity: 0;
  background:
    linear-gradient(#fff, #fff) 5px 5px / 1px 1px no-repeat,
    linear-gradient(var(--hi-t), var(--hi-t)) 5px 0 / 1px 11px no-repeat,
    linear-gradient(var(--hi-t), var(--hi-t)) 0 5px / 11px 1px no-repeat; }
.cell:hover > .m::before, .cell:focus-within > .m::before { animation: flash .15s linear var(--scan); }
@keyframes flash { 0%, 30% { opacity: 1; } 100% { opacity: 0; } }
/* no cross at the grid's right edge, so no flash there */
.c3-r > .m::before, .s3-3 > .m::before, .more > .m::before { content: none; }
/* registration crosses where a cell's left hairline meets the horizontals above and below it */
.cell::after { content: ""; position: absolute; left: -6px; top: -6px; bottom: -6px; width: 11px; pointer-events: none; opacity: var(--bl);
  background:
    linear-gradient(var(--tick), var(--tick)) 5px 0 / 1px 11px no-repeat, linear-gradient(var(--tick), var(--tick)) 0 5px / 11px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) 5px 100% / 1px 11px no-repeat, linear-gradient(var(--tick), var(--tick)) 0 calc(100% - 5px) / 11px 1px no-repeat; }

.cell .m { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell .m .sep { color: var(--dim); margin: 0 .8ch; }
.cell .m .draft { color: var(--hi-t); }
.cell .ti { display: block; margin: 0; font-size: 16px; line-height: 1.42; font-weight: 500; letter-spacing: -.025em; color: var(--ink); text-wrap: pretty; }
.cell a.ti::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.cell .ex { text-wrap: pretty; margin: 10px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); transition: color .2s; }
.cell:hover .ex, .cell:focus-within .ex { color: var(--text); }
.cell .links { position: relative; z-index: 2; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.cell .links a { color: var(--muted); transition: color .2s; }
.cell .links a:hover { color: var(--hi-t); }

.lead { padding-bottom: 40px; }
.lead .ti { font-size: clamp(1.6rem, 2.7vw, 2.35rem); line-height: 1.16; font-weight: 300; letter-spacing: -.05em; max-width: 32ch; text-wrap: balance; }
.lead .m { margin-bottom: 18px; }
.lead .ex { margin-top: 22px; font-size: 15px; line-height: 1.7; max-width: 60ch; color: var(--text); }
.lead:hover .ex, .lead:focus-within .ex { color: var(--ink); }

.p .cell { padding-bottom: 30px; }
.p .m { color: var(--hi-t); }
.p .ti { font-size: 14.5px; line-height: 1.45; }
.p .ex { font-size: 12.5px; line-height: 1.6; }

.more .ti { font-size: 14px; font-weight: 400; color: var(--muted); transition: color .2s; }
.more:hover .ti, .more:focus-within .ti { color: var(--ink); }

.empty { padding: 22px 0 34px; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.empty .ti { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 300; letter-spacing: -.045em; color: var(--ink); }
.empty .ex { margin: 14px 0 0; font-size: 14px; color: var(--muted); text-wrap: balance; }

/* article: same left edge; prose capped at a reading measure inside modules 1-2 */
article { padding-top: clamp(64px, 9vw, 120px); container-type: inline-size; }
.post-head { margin: 0 0 56px; }
.post-head .crumb { margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.post-head .crumb a:hover { color: var(--ink); }
.post-head h1 { margin: 0 0 22px; max-width: 24ch; font: 400 clamp(2rem, 4vw, 3.4rem)/1.08 var(--mono); letter-spacing: -.055em; color: var(--ink); text-wrap: balance; }
.meta { margin: 0; font-size: 13px; color: var(--muted); }
.meta .sep { color: var(--dim); margin: 0 .8ch; }
.meta .draft { color: var(--hi-t); }
.body { max-width: min(40rem, calc(66.6667% - var(--px))); font-size: 15.5px; line-height: 1.8; color: var(--text); }
.body > p, .body > ul, .body > ol { margin: 0 0 1.2em; text-wrap: pretty; }
.body > .lede { font-size: 17.5px; line-height: 1.7; color: var(--ink); }
.body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: .22em; transition: color .2s, text-decoration-color .2s; }
.body a:hover { color: var(--hi-t); text-decoration-color: currentColor; }
.body strong { color: var(--ink); font-weight: 600; }
.body ul, .body ol { padding-left: 1.6em; }
.body li { margin: .3em 0; }
.body li::marker { color: var(--dim); }
.body h2 { margin: 2.4em 0 .8em; font: 500 1.22rem/1.3 var(--mono); letter-spacing: -.035em; color: var(--ink); }
.body h2 .no { color: var(--hi-t); font-weight: 400; margin-right: 1.2ch; }
.body h3 { margin: 2em 0 .6em; font: 500 1rem/1.4 var(--mono); letter-spacing: -.02em; color: var(--ink); }
.body hr { border: 0; border-top: 1px solid var(--line2); margin: 2.4em 0; }
.body img { max-width: 100%; height: auto; }
.body code { font: 400 .92em var(--mono); color: var(--ink); background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; }
.body table { border-collapse: collapse; margin: 1.6em 0; font-size: 14px; display: block; overflow-x: auto; }
.body th, .body td { border-bottom: 1px solid var(--line2); padding: 8px 16px 8px 0; text-align: left; }
.body th { color: var(--ink); font-weight: 500; }
.theorem { margin: 1.2em 0 1em; padding: 4px 0 4px 20px; border-left: 2px solid var(--hi); }
.theorem > p, .proof > p { margin: 0 0 .8em; }
.theorem > :last-child, .proof > :last-child { margin-bottom: 0; }
.theorem > p { color: var(--ink); }
.theorem b.lbl { color: var(--hi-t); font-weight: 500; }
.proof { margin: 0 0 1.5em; padding-left: 22px; color: var(--muted); }
.proof i.lbl { color: var(--text); }
.qed { color: var(--hi-t); margin-left: .4em; }
.katex { font-size: 1.1em; color: var(--ink); }
.body .katex-display { overflow-x: auto; overflow-y: hidden; margin: 1.4em 0; padding: .6em 0; text-align: left; }
.body .katex-display > .katex { font-size: 1.15em; text-align: left; padding-left: 22px; }
@supports (width: 1cqw) { .body .katex-display { margin-right: min(0px, calc(100% - 66.6667cqw + var(--px))); } }
blockquote { margin: 2.2em 0; padding: 0; font: 300 clamp(1.3rem, 2vw, 1.7rem)/1.35 var(--mono); letter-spacing: -.045em; color: var(--ink); }
blockquote > p { margin: 0; }
blockquote > p:first-child::before { content: "“"; color: var(--hi-t); } blockquote > p:last-child::after { content: "”"; color: var(--hi-t); }
.code { margin: 2em 0; background: var(--bg2); border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.code pre { margin: 0; padding: 18px 18px 20px 0; overflow-x: auto; font: 400 14px/1.75 var(--mono); color: var(--ink); counter-reset: ln; }
.code pre code { font: inherit; background: none; border: 0; padding: 0; }
.code .ln { display: block; padding-left: 50px; position: relative; min-height: 1.75em; }
.code .ln::before { counter-increment: ln; content: counter(ln); position: absolute; left: 0; width: 30px; text-align: right; color: var(--dim); }
/* Pygments token classes */
.code .k, .code .kd, .code .kn, .code .kr, .code .kc, .code .kt, .code .kp, .code .ow { color: var(--hi-t); }
.code .nf, .code .nc, .code .fm { color: #fff; font-weight: 600; }
.code .nb, .code .bp, .code .mi, .code .mf, .code .mh, .code .mo, .code .il, .code .m { color: #a5b4fc; }
.code .s, .code .s1, .code .s2, .code .sa, .code .sb, .code .sc, .code .sd, .code .se, .code .sh, .code .si, .code .sx, .code .dl { color: #9fb4e6; }
.code .c, .code .c1, .code .cm, .code .cs, .code .ch, .code .cp, .code .cpf { color: var(--muted); font-style: italic; }
.code .o, .code .p { color: var(--muted); }
.code .err { color: inherit; background: none; }
.footnote { margin-top: 3em; padding-top: 1.2em; border-top: 1px solid var(--line2); font-size: 13.5px; color: var(--muted); }
.footnote hr { display: none; }
.footnote ol { padding-left: 1.4em; }
.footnote-ref { font-size: .8em; }
.body a.footnote-ref, .body a.footnote-backref { text-decoration: none; color: var(--hi-t); }
.post-foot-grid { margin-top: 88px; }

/* about: the same grid; bio across modules 1-2, contact in module 3. Not links, so no hover. */
.cell.static::before, .cell.static > .m::before, .cell.static > .ti::before { content: none; animation: none; }
/* bottom hairlines: the grid has no bottom border; each cell with nothing below it draws one
   (nb3 / nb2 / nb1, written per layout by the generator), on the pixel row where a following
   cell's top border would be. An unfinished last row therefore ends exactly where its cells end. */
.cell > .m::after { content: none; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--line2); }
.nb3 > .m::after { content: ""; }
/* the end marker after an unfinished last row: only the crosses where that row's lines end */
.filler { display: none; border: 0; padding: 0; }
.filler::after { opacity: 1; }
@media (min-width: 961px) { .filler.f3 { display: block; } }
@media (min-width: 681px) and (max-width: 960px) { .filler.f2 { display: block; } }
.ab .bio { margin: 0; text-wrap: pretty; font-size: 15.5px; line-height: 1.8; color: var(--text); }
.ab .ti { font-weight: 400; }

.notfound { padding-top: clamp(80px, 14vh, 180px); }
.notfound .code404 { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.notfound h1 { margin: 0; font: 300 clamp(2.4rem, 7vw, 5.5rem)/1 var(--mono); letter-spacing: -.05em; color: var(--ink); }
.notfound p { margin: 26px 0 0; color: var(--muted); }
.notfound a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: .22em; }

footer { margin-top: clamp(120px, 12vw, 180px); padding-block: 26px 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
footer p { margin: 0; }
footer a:hover { color: var(--ink); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tagline { animation: rise .5s cubic-bezier(.2,.7,.2,1) .15s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .tagline, .cell > .ti::before, .cell > .m::before { animation: none !important; }
  *, *::before, *::after { transition: none !important; }
}

/* two modules */
@media (max-width: 960px) {
  .ruler i:nth-child(1), .ruler i:nth-child(2) { display: none; }
  .ruler i:nth-child(3) { display: block; }
  .mod { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod > .cell { --pl: var(--px); --pr: var(--px); --bl: 0; grid-column: auto; grid-row: auto; }
  .mod > .c2-l { --pl: 0; --bl: 0; }
  .mod > .c2-r { --pr: 0; --bl: 1; }
  .mod > .s2-2 { grid-column: 1 / -1; --pl: 0; --pr: 0; --bl: 0; }
  .c3-r > .m::before { content: ""; }
  .c2-r > .m::before, .s2-2 > .m::before, .more > .m::before { content: none; }
  .nb3 > .m::after { content: none; }
  .nb2 > .m::after { content: ""; }
  .body { max-width: 44rem; }
}
/* one module */
@media (max-width: 680px) {
  .ruler i:nth-child(n) { display: none; }
  .mod { grid-template-columns: minmax(0, 1fr); }
  .mod > .cell { --pl: 0; --pr: 0; --bl: 0; grid-column: auto; }
  .mod > .cell > .m::before { content: none; }
  .cell { padding-bottom: 26px; }
  .more { padding-block: 18px 20px; }
  .more .m { height: 0; margin: 0; overflow: visible; }
  .nb2 > .m::after { content: none; }
  .nb1 > .m::after { content: ""; }
  .lead .ti { font-size: 1.55rem; }
  .lead .ex .x2 { display: none; }
  nav { gap: 16px; }
  .body { font-size: 15.5px; }
  .body .katex-display > .katex { padding-left: 0; }
  .code pre { font-size: 13px; }
}
