@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --paper: #ffffff;
  --ink: #30382f;
  --muted: #6b7066;
  --line: #e1e4de;
  --accent: #a6382b;
  --accent-pale: #eee2da;
  --text: 16px;
  --title: 28px;
}
html[data-enamel="blue"] { --accent: #285c84; --accent-pale: #e0e8ea; }
html[data-enamel="black"] { --accent: #343c38; --accent-pale: #e3e4de; }
html[data-enamel="green"] { --accent: #386348; --accent-pale: #e2ebe1; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 var(--text)/1.7 'DM Sans', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--title); font-weight: 500; line-height: 1.3; letter-spacing: -.8px; }
h2, h3 { font-size: inherit; line-height: inherit; }
h2 { font-weight: 600; }
h3 { font-weight: 400; }
a { color: var(--accent); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: currentColor; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent-pale); }
.page { width: min(100% - 64px, 760px); margin: 76px auto 0; }
.site-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px 24px; }
.site-header > a { white-space: nowrap; }
.site-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.site-nav a { white-space: nowrap; }
.site-nav .nav-group { color: var(--accent); white-space: nowrap; }
.intro { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: center; gap: 30px; margin: 32px 0 47px; }
.notebook-desk { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 30px; }
.intro-copy { padding-bottom: 6px; }
.intro-copy p + p { margin-top: 18px; color: var(--muted); }
.desk-object { min-width: 0; }
.sharpener-view { position: relative; width: 100%; aspect-ratio: 1; }
.sharpener { display: block; width: 100%; height: auto; }
.sharpener-view canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.sharpener-view canvas:active { cursor: grabbing; }
.sharpener-view canvas[data-part] { cursor: pointer; }
.sharpener-view canvas[data-dragging="true"] { cursor: grabbing; }
.sharpener-view canvas[hidden] { display: none !important; }
.sharpener-view canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.sharpener-view.is-ready .sharpener { visibility: hidden; }
.sharpener-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 14px; color: var(--muted); }
.sharpener-controls[hidden] { display: none; }
.sharpener-controls > span { flex-basis: 100%; text-align: center; }
.sharpener-controls button { padding: 4px 0; min-height: 44px; border: 0; background: transparent; color: var(--accent); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.sharpener-controls button:hover, .sharpener-controls button[aria-pressed="true"] { text-decoration-color: currentColor; }
.sharpener-controls button:disabled { cursor: default; opacity: .6; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.enamel-picker { display: flex; align-items: center; justify-content: center; gap: 1px; margin-top: 2px; }
.enamel-picker > span { margin-right: 8px; color: var(--muted); }
.swatch { border: 0; width: 32px; height: 36px; border-radius: 50%; padding: 0; background: transparent; position: relative; display: grid; place-items: center; }
.swatch::before { content: ''; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #ffffff65, transparent 60%), var(--swatch); box-shadow: inset 0 0 0 1px #00000010; }
.swatch[aria-pressed="true"]::after { content: ''; position: absolute; width: 23px; height: 23px; border: 1px solid var(--swatch); border-radius: 50%; }
.swatch.red { --swatch: #a6382b; }
.swatch.blue { --swatch: #285c84; }
.swatch.black { --swatch: #343c38; }
.swatch.green { --swatch: #386348; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; }
.muted { color: var(--muted); }
.entries { margin-top: 21px; }
.entry + .entry { margin-top: 23px; }
.entry p { color: var(--muted); margin-top: 2px; }
#research, #talks, #patents, #auxiliary-publications { margin-top: 43px; }
#projects { margin-top: 43px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 21px; }
.project-card { border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow: hidden; transition: border-color .18s; }
.project-card:has(.project-link:hover), .project-card:focus-within { border-color: var(--accent); }
.project-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.project-card:has(.project-story) .project-link { height: auto; }
.project-link:focus-visible { outline-offset: -4px; border-radius: 11px; }
.project-logo { position: relative; width: 100%; aspect-ratio: 18 / 11; background: #fafaf6; }
.project-logo[data-project="rizome"] { background: #faf7f0; }
.project-logo img, .project-logo canvas { display: block; width: 100%; height: 100%; }
.project-logo canvas { position: absolute; inset: 0; pointer-events: none; }
.project-logo canvas[hidden] { display: none !important; }
.project-logo.is-ready img { visibility: hidden; }
.project-copy { padding: 18px 20px 20px; }
.project-copy h3 { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.project-link:hover h3 { text-decoration-thickness: 2px; }
.project-copy p { color: var(--muted); margin-top: 5px; }
.project-story { padding: 0 20px 20px; }
.project-story a { color: var(--muted); }
.projects { list-style: none; padding: 0; margin: 18px 0 0; }
.projects li + li { margin-top: 9px; }
.site-footer { margin-top: 55px; padding: 24px 0 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.site-footer a { color: inherit; }
.skip-link { position: fixed; top: 12px; left: 15px; z-index: 20; transform: translateY(-200%); background: var(--paper); padding: 8px 15px; border: 1px solid var(--ink); }
.skip-link:focus { transform: translateY(0); }
.noscript-note { max-width: 760px; margin: 20px auto; padding: 0 24px; color: var(--muted); }
.article-nav { margin-bottom: 48px; }
.article-nav > a:first-child { color: var(--ink); }
.post-header { margin-bottom: 24px; }
.post-header h1 { margin-top: 10px; }
.blog-post p + p { margin-top: 18px; }
.blog-post ul { margin: 18px 0 0; padding-left: 22px; }
.blog-post li + li { margin-top: 9px; }
.blog-post > section { margin-top: 38px; }
.blog-post > section > h2 { margin-bottom: 18px; }
.blog-post strong { font-weight: 600; }
.blog-post .math-display { margin: 22px 0; padding: 8px 0; overflow-x: auto; overflow-y: hidden; }
.blog-post .math-display:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.blog-post .math-display .katex-display { margin: 0; padding: 8px 2px; width: max-content; min-width: 100%; }
.blog-post .katex { font-size: 1.12em; }
.blog-post .katex-display > .katex { white-space: nowrap; }
.publication-list { margin-top: 30px; }
#auxiliary-publications .publication-list { margin-top: 21px; }
.cv-downloads { margin-top: 16px; color: var(--muted); }
.publication + .publication { margin-top: 30px; }
.publication h2, .publication h3 { font-weight: 500; }
#patents .publication { margin-top: 21px; }
.publication p { margin-top: 4px; }
.publication-authors { color: var(--muted); }
.publication-authors strong { color: var(--ink); font-weight: 500; }
.publication-meta { color: var(--muted); }
.research-figure { width: min(1200px, calc(100vw - 64px)); margin: 32px 0 30px 50%; transform: translateX(-50%); }
.figure-scroll { overflow-x: auto; }
.figure-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.figure-scroll > a { display: block; background: white; }
.research-figure img { display: block; width: 100%; height: auto; }
.research-figure figcaption { max-width: 760px; margin: 20px auto 0; color: var(--muted); }
.research-figure a, .post-sources a { text-decoration-color: currentColor; }
.results-table { overflow-x: auto; margin: 24px 0; }
.results-table:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.results-table table { width: 100%; min-width: 440px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.results-table caption { text-align: left; margin-bottom: 14px; color: var(--muted); }
.results-table th, .results-table td { padding: 11px 10px; text-align: right; border-bottom: 1px solid var(--line); font-weight: 400; }
.results-table thead th { font-weight: 600; }
.results-table th:first-child { text-align: left; padding-left: 0; }
.results-table td:last-child, .results-table th:last-child { padding-right: 0; }
.post-sources { margin-top: 36px; color: var(--muted); }
.panda-figure { width: min(960px, calc(100vw - 64px)); }
.panda-figure > a, .panda-panels > a { display: block; }
.panda-single { width: min(600px, calc(100vw - 64px)); }
.panda-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panda-figure a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 640px) {
  .page { width: calc(100% - 44px); margin-top: 38px; }
  .site-header { flex-wrap: wrap; gap: 10px 20px; }
  .intro { grid-template-columns: 1fr; gap: 12px; margin: 30px 0 35px; }
  .notebook-desk { grid-template-columns: 1fr; gap: 22px; }
  .intro-copy { padding: 0; }
  .desk-object { width: min(260px, 100%); justify-self: center; }
  #research, #talks, #patents, #auxiliary-publications { margin-top: 36px; }
  #projects { margin-top: 36px; }
  .project-grid { grid-template-columns: 1fr; gap: 20px; }
  .site-footer { margin-top: 40px; flex-direction: column; gap: 6px; padding-top: 21px; }
  .article-nav { margin-bottom: 32px; }
  .article-nav > a { white-space: normal; }
  .research-figure { width: 100%; margin-left: 0; transform: none; }
  .figure-scroll > a { width: 900px; }
  .panda-figure, .panda-single { width: 100%; }
  .panda-panels { grid-template-columns: 1fr; gap: 20px; }
  .blog-post .katex { font-size: 1.04em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
