:root {
  --paper: #f4f2eb;
  --paper-raised: #fbfaf6;
  --ink: #25241f;
  --body: #49473f;
  --muted: #79766d;
  --line: #d8d5cb;
  --line-strong: #bcb8ac;
  --accent: #514e43;
  --accent-soft: #ece9df;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--body); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 5px; }
img,svg { display: block; max-width: 100%; }
h1,h2,h3 { color: var(--ink); text-wrap: balance; }
p,li { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.skip-link { position: absolute; top: 8px; left: 16px; padding: 8px 16px; background: var(--paper-raised); transform: translateY(-150%); z-index: 10; }
.skip-link:focus { transform: none; }
.shell { width: min(1080px, calc(100% - 96px)); margin-inline: auto; }
.nav-shell { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { font-family: var(--serif); font-size: 29px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand span { margin-left: 9px; font: 10px var(--mono); }
.site-nav { display: flex; align-items: center; gap: 30px; margin-left: auto; font-size: 12px; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.home,.painted { background-image: url("/assets/paper-grid.svg"); }
.hero { position: relative; padding-block: 106px 110px; }
.eyebrow,.section-label,.card-meta,.article-meta,.status-badge { font: 10px/1.5 var(--mono); text-transform: uppercase; font-weight: 400; color: var(--muted); }
.hero .eyebrow { margin: 0 0 30px; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(62px, 8vw, 104px); font-weight: 400; line-height: 1.02; }
.hero-subtitle { margin: 20px 0 0; font: 400 clamp(23px, 3vw, 34px)/1.3 var(--serif); color: var(--ink); }
.hero-copy { margin: 24px 0; font-size: 15px; line-height: 1.7; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 26px; font-size: 12px; text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 5px; color: var(--ink); }
.hero-index { position: absolute; right: 0; bottom: 116px; font: 10px var(--mono); color: var(--muted); }
/* Painted hero (home and articles): a painting as an inset picture at its own ~1.91:1 ratio; header and title sit on its dark left side. Pages set --hero-img. */
.painted { --panel: min(1280px, calc(100% - 48px)); --panel-pad: clamp(28px, 4.5vw, 64px); }
.painted .site-header { position: absolute; top: 24px; left: 0; right: 0; z-index: 2; }
.painted .site-header .shell { width: calc(var(--panel) - 2 * var(--panel-pad)); }
.painted .site-header .brand,.painted .site-header .site-nav a { color: #f3ebe6; }
.painted .hero { width: var(--panel); margin: 24px auto 72px; aspect-ratio: 1734 / 907; min-height: 540px; padding: 96px var(--panel-pad) 56px; box-sizing: border-box; display: flex; align-items: center; color: #f3ebe6; background: #1c1018 var(--hero-img, url("/assets/lilac-refrain.jpg")) 70% center / cover no-repeat; }
.painted .hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(28,16,24,.45) 0%, rgba(28,16,24,.15) 45%, rgba(28,16,24,0) 65%); pointer-events: none; }
.painted .hero-inner { position: relative; width: 100%; }
.painted .hero h1,.painted .hero-subtitle,.painted .text-link { color: #f3ebe6; }
.painted .hero-copy { color: rgba(243,235,230,.74); }
.painted .text-link { border-bottom-color: rgba(243,235,230,.5); }
.painted .hero-index { bottom: -32px; color: rgba(243,235,230,.6); }
.about-section { border-top: 1px solid var(--line-strong); padding-block: 43px 60px; display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.section-label { margin: 0; }
.about-section p { margin: 0 0 18px; max-width: 620px; font-size: 15px; }
.about-section p:first-child { font: 26px/1.4 var(--serif); color: var(--ink); }
.painted .site-header .button { color: #f3ebe6; border-color: rgba(243,235,230,.5); }
.painted .site-header .button:hover { background: rgba(243,235,230,.1); }
.article-hero .hero-inner { max-width: 640px; margin: 0; }
.article-hero h1 { margin: 18px 0 20px; font: 400 clamp(38px, 4.6vw, 64px)/1.08 var(--serif); }
.article-hero .status-badge,.article-hero .article-meta { color: rgba(243,235,230,.66); }
.article-hero .article-deck { margin: 0; font-size: 17px; color: rgba(243,235,230,.8); }
.article-hero .article-meta { margin-top: 26px; }
.painted .article-content { padding-top: 0; }

/* Writing cards: square painting, serif title, dek, kind and date. */
.cards-section { padding-block: 24px 40px; }
.cards-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 36px; }
.cards-heading h2 { margin: 0 0 10px; font: 400 30px/1.2 var(--serif); color: var(--ink); }
.cards-heading p { margin: 0; max-width: 560px; color: var(--muted); font-size: 15px; }
.pill { flex: none; padding: 9px 16px; border-radius: 999px; background: rgba(40,30,30,.07); font-size: 13px; text-decoration: none; color: var(--ink); }
.pill:hover { background: rgba(40,30,30,.12); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px; }
.card { text-decoration: none; color: inherit; }
.card-img { aspect-ratio: 1; background: #1a1418 var(--card-img) 76% center / cover no-repeat; }
.card h3 { margin: 20px 0 10px; font: 400 25px/1.2 var(--serif); color: var(--ink); }
.card p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.card-meta-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.card-meta-row b { font-weight: 400; color: var(--ink); }
.card-meta-row b::before { content: ""; display: inline-block; width: 4px; height: 12px; margin-right: 8px; background: var(--ink); vertical-align: -1px; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.card:hover .card-img { filter: brightness(1.06); }

/* Figures inside articles. */
.figure { margin: 40px 0; }
.figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.figure figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }
.fig-title { font: 600 12px var(--sans); fill: var(--ink); }
.fig-axis { font: 11px var(--sans); fill: var(--muted); }
.fig-grid { stroke: var(--line); stroke-width: 1; }
.fig-base { stroke: var(--line-strong); stroke-width: 1; }
.fig-line { fill: none; stroke: #855572; stroke-width: 2; stroke-linejoin: round; }
.fig-whisker { stroke: var(--ink, #1d1a17); stroke-width: 1.5; }
.fig-dot { fill: #855572; stroke: var(--paper); stroke-width: 2; }
.fig-note { font: 11px var(--sans); fill: var(--ink); }
.fig-hit { fill: transparent; }
.fig-hit:hover + .fig-dot,.fig-pt:hover .fig-dot { r: 6; }
.bar { fill: #c9c3b8; }
.bar-ours { fill: #855572; }
.fig-name { fill: var(--body); font-size: 12px; }
.fig-strong { font-weight: 600; fill: var(--ink); }
.fig-pt:hover .bar { fill: #b3ac9f; }
tr.row-ours td { font-weight: 600; color: var(--ink); }

/* Reading progress along the top edge of articles. */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; background: #855572; transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.math { margin: 26px 0; padding: 18px 22px; background: rgba(40,30,30,.04); border-left: 1px solid var(--line-strong); overflow-x: auto; font: 15px/1.9 var(--serif); color: var(--ink); white-space: nowrap; }
.math i { font-style: italic; }
.article-content ol.steps { padding-left: 22px; }
.article-content code { font: 13px var(--mono); }

/* "Inference that keeps learning": isometric scene on the left, accordion on the right. */
.loop-section { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(32px, 6vw, 88px); padding-block: 40px 96px; align-items: stretch; }
.loop-art { aspect-ratio: 1; background: linear-gradient(180deg, #cdb9d2 0%, #ddcfdc 45%, #efe7ea 100%); }
.loop-svg { display: block; width: 100%; height: 100%; }
.loop-copy { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.loop-copy h2 { margin: 0; font: 400 clamp(36px, 4.4vw, 56px)/1.08 var(--serif); color: var(--ink); }
.loop-text { border-top: 1px solid var(--line); padding-top: 28px; }
.loop-text p { margin: 0 0 18px; font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 46ch; }
.loop-text p:first-child { font: 400 clamp(22px, 2.2vw, 27px)/1.35 var(--serif); color: var(--ink); }
.loop-text .text-link { display: inline-block; margin-top: 6px; color: var(--ink); border-bottom-color: var(--line-strong); }
.iso-box polygon { stroke: rgba(80,58,78,.18); stroke-width: .6; stroke-linejoin: round; }
.iso-slab .f-top,.iso-tile .f-top { fill: #fbf8f4; }
.iso-slab .f-right,.iso-tile .f-right { fill: #e9e0dc; }
.iso-slab .f-left,.iso-tile .f-left { fill: #ddd2cf; }
.iso-inset .f-top { fill: #ece4e2; }
.iso-inset .f-right,.iso-inset .f-left { fill: #d6cbc9; }
.iso-accent .f-top { fill: #b8829f; }
.iso-accent .f-right { fill: #9a6684; }
.iso-accent .f-left { fill: #855572; }
.iso-shadow { fill: rgba(70,40,64,.14); filter: blur(6px); }
.iso-label { font: 15px var(--sans); letter-spacing: .5px; fill: #9b8f8c; }
.iso-guide { stroke: rgba(80,58,78,.35); stroke-width: 1; stroke-dasharray: 3 4; }
.iso-text { stroke: #cbbec2; stroke-width: 1.4; stroke-linecap: round; }
.edit-cell { animation: edit-lift 7.2s ease-in-out var(--d, 0s) infinite; }
.edit-tint { opacity: 0; animation: edit-tint 7.2s ease-in-out var(--d, 0s) infinite; }
.traj-fly { opacity: 0; animation: traj-fly 7.2s ease-in-out var(--d, 0s) infinite; }
@keyframes traj-fly { 0% { opacity: 0; transform: translate(0,0); } 4%,10% { opacity: 1; transform: translate(0,-6px); } 26% { opacity: 1; transform: translate(var(--dx),var(--dy)); } 32%,100% { opacity: 0; transform: translate(var(--dx),var(--dy)); } }
@keyframes edit-lift { 0%,24% { transform: translateY(0); } 32%,42% { transform: translateY(-14px); } 54%,100% { transform: translateY(0); } }
@keyframes edit-tint { 0%,28% { opacity: 0; } 36%,90% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .edit-cell,.traj-fly { animation: none; } .edit-tint { animation: none; opacity: 1; } }
.papers-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 22px; }
.papers-heading a,.archive-link { font-size: 11px; text-decoration: none; }
.paper-row { display: grid; grid-template-columns: 160px minmax(0,1fr) 100px; gap: 20px; padding: 30px 0; border-top: 1px solid var(--line); text-decoration: none; align-items: baseline; }
.paper-number,.paper-date { font: 10px/1.6 var(--mono); color: var(--muted); }
.paper-date { text-align: right; }
.paper-date span { margin-left: 14px; }
.paper-row h3 { font: 24px/1.3 var(--serif); margin: 0 0 8px; }
.paper-row p { font-size: 12px; color: var(--muted); margin: 0; }
.paper-row:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.archive-link { display: inline-block; margin-top: 25px; color: var(--muted); }
.site-footer { margin-top: 80px; }
.footer-shell { border-top: 1px solid var(--line); min-height: 100px; display: flex; align-items: center; gap: 30px; font-size: 11px; color: var(--muted); }
.footer-shell > a,.footer-shell > nav { margin-left: auto; }
.footer-shell p { margin: 0; }
.footer-shell nav { display: flex; gap: 24px; }
.footer-shell a { text-decoration: none; }
.footer-shell .brand { font-size: 20px; margin-left: 0; }
.button { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line-strong); text-decoration: none; font-size: 12px; color: var(--ink); }
.button:hover { background: var(--accent-soft); }
.blog-hero { padding-block: 80px 50px; max-width: 850px; }
.blog-hero h1 { font: 400 clamp(38px,5vw,60px)/1.12 var(--serif); }
.blog-hero p:not(.eyebrow) { max-width: 620px; color: var(--muted); }
.blog-list { margin: 0; padding: 0; list-style: none; }
.blog-list-item a { display: grid; grid-template-columns: 180px 1fr 24px; gap: 30px; padding: 32px 0; border-top: 1px solid var(--line); text-decoration: none; }
.blog-list-item h2 { font: 28px/1.3 var(--serif); margin: 0 0 12px; }
.blog-list-item p { margin: 0; font-size: 14px; color: var(--muted); }
.article-shell { width: min(760px, calc(100% - 48px)); margin-inline: auto; }
.article-header { padding: 70px 0 44px; border-bottom: 1px solid var(--line); }
.article-header h1 { font: 400 clamp(38px,5vw,60px)/1.12 var(--serif); margin: 24px 0; }
.article-deck { font-size: 18px; color: var(--muted); }
.article-meta { margin-top: 28px; }
.status-badge { display: block; }
.article-content { padding-block: 20px 50px; }
.article-content h2 { font: 32px/1.25 var(--serif); margin: 52px 0 20px; }
.article-content h3 { font: 25px/1.3 var(--serif); }
.article-content p,.article-content li { line-height: 1.85; }
.article-lede { font: 22px/1.65 var(--serif); color: var(--ink); }
.article-content li + li { margin-top: 12px; }
.article-content blockquote { margin: 38px 0; padding: 8px 0 8px 24px; border-left: 1px solid var(--ink); font: 24px/1.5 var(--serif); }
.thesis-steps { list-style: decimal-leading-zero; padding-left: 28px; margin-block: 35px; }
.thesis-steps strong,.thesis-steps span { display: block; }
.thesis-steps span { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th,td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 11px var(--mono); }
.article-callout { margin-top: 48px; padding-block: 28px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.article-callout h2 { margin-top: 16px; }
.article-callout .button { margin-top: 14px; }
.source-list { font-size: 14px; color: var(--muted); }
pre { overflow-x: auto; padding: 20px; background: var(--accent-soft); }
code,pre { font-family: var(--mono); }
@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }
  .nav-shell { min-height: 86px; gap: 18px; flex-wrap: wrap; padding-block: 16px; }
  .site-nav { gap: 18px; font-size: 11px; }
  .hero { padding-block: 74px 80px; }
  .hero h1 { font-size: clamp(56px,11vw,80px); }
  .hero-index { bottom: 36px; }
  .painted { --panel: calc(100% - 24px); --panel-pad: 22px; }
  .painted .site-header { top: 12px; }
  .painted .hero { margin: 12px auto 44px; aspect-ratio: auto; min-height: 0; padding-top: 110px; background-position: 64% center; }
  .painted .hero::before { background: linear-gradient(90deg, rgba(28,16,24,.7) 0%, rgba(28,16,24,.35) 75%, rgba(28,16,24,.15) 100%); }
  .painted .hero-index { bottom: -24px; }
  .cards-heading { flex-direction: column; align-items: flex-start; }
  .article-hero .hero-inner { max-width: none; }
  .loop-section { grid-template-columns: 1fr; padding-block: 20px 64px; }
  .about-section { grid-template-columns: 1fr; gap: 22px; padding-block: 30px 44px; }
  .paper-row { grid-template-columns: 1fr 75px; gap: 10px; padding-block: 24px; }
  .paper-number { grid-column: 1 / -1; }
  .paper-row h3 { font-size: 22px; }
  .paper-row p { font-size: 12px; }
  .footer-shell { flex-wrap: wrap; padding-block: 24px; gap: 18px; }
  .blog-list-item a { grid-template-columns: 1fr 20px; gap: 14px; }
  .blog-list-item .card-meta { grid-column: 1 / -1; }
  .article-header { padding-top: 40px; }
  .site-header .button-small { display: none; }
  .site-nav a { white-space: nowrap; }
}
@media (max-width: 420px) {
  .brand { font-size: 25px; }
  .site-nav { gap: 12px; }
  .desktop-break { display: none; }
  .hero-copy { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.article-cta { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line-strong); }
