:root {
  --bg: #fafaf8;
  --surface: #f2f1ed;
  --text: #1b1b1a;
  --muted: #5f5e59;
  --faint: #73726c;
  --line: #e4e2dc;
  --link-line: #8e8c85;
  --accent: #2e6150;
  --accent-soft: #e3eee9;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1a1a19;
    --text: #ecebe7;
    --muted: #a09f99;
    --faint: #85847e;
    --line: #2a2a28;
    --link-line: #6f6d67;
    --accent: #84c2ab;
    --accent-soft: #1d2e28;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 600; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--text); color: var(--bg); padding: .4rem .7rem; z-index: 10; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 56px; }
.top .mark { font-weight: 600; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.top nav { display: flex; gap: 1.25rem; }
.top nav a { font-size: .875rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.top nav a:hover { color: var(--text); }

/* Intro */
.intro { padding: 72px 0 56px; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }
.intro .eyebrow { display: inline-flex; align-items: center; gap: .55rem; font: 500 .8125rem/1 var(--mono); color: var(--muted); margin-bottom: 1.25rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: none; }
.intro h1 { font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 600; }
.intro .lede { margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.55; color: var(--muted); max-width: 34em; }
.intro .lede strong { color: var(--text); font-weight: 500; }
.portrait { width: 152px; height: 152px; border-radius: 50%; object-fit: cover; background: var(--surface); filter: grayscale(.15); }

.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; }
.links a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .875rem; text-decoration: none; color: var(--text);
}
.links a:hover { border-color: var(--text); color: var(--text); }
.links a.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.links a.primary:hover { opacity: .85; }
.links svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Sections */
.section { display: grid; grid-template-columns: 168px 1fr; gap: 32px; padding: 48px 0; border-top: 1px solid var(--line); }
.section > h2 { font: 500 .8125rem/1.9 var(--mono); color: var(--muted); letter-spacing: .02em; }
.section > h2 .n { color: var(--faint); margin-right: .5rem; }

/* Now */
.now { display: grid; gap: 1.5rem; }
.now-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { padding: 18px 20px; background: var(--surface); border-radius: 12px; }
.card .k { font: 500 .75rem/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card .v { margin-top: .6rem; font-weight: 500; line-height: 1.35; }
.card .s { margin-top: .25rem; font-size: .875rem; color: var(--muted); line-height: 1.45; }
.updates li { display: grid; grid-template-columns: 76px 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .9375rem; }
.updates li:last-child { border-bottom: 0; }
.updates time { font: .8125rem/1.75 var(--mono); color: var(--faint); }

/* Generic entries */
.entries { display: grid; gap: 2.25rem; }
.entry .meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font: .8125rem/1.5 var(--mono); color: var(--faint); margin-bottom: .35rem; }
.entry h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.entry .org { color: var(--muted); }
.entry p { margin-top: .45rem; color: var(--muted); font-size: .9375rem; }
.badge { display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem; padding: .2rem .55rem; font-size: .8125rem; color: var(--accent); background: var(--accent-soft); border-radius: 6px; }
.badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.refs { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .7rem; font-size: .875rem; }
.refs a { color: var(--muted); }
.refs a:hover { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.tags span { font: .75rem/1 var(--mono); padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }

.subhead { font: 500 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 2.5rem 0 1rem; }
.subhead:first-child { margin-top: 0; }

/* Compact lists (talks, media, more projects) */
.list li { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; }
.list .sub { display: block; color: var(--muted); font-size: .875rem; margin-top: .1rem; }

/* Publications */
.pubs li { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.pubs li:first-child { padding-top: 0; }
.pubs li:last-child { border-bottom: 0; }
.pubs .t { font-weight: 500; line-height: 1.4; text-decoration: none; }
.pubs .t:hover { text-decoration: underline; }
.pubs .a { display: block; font-size: .875rem; color: var(--muted); margin-top: .2rem; }
.pubs .a b { color: var(--text); font-weight: 500; }
.pubs .v { display: block; font-size: .8125rem; color: var(--faint); margin-top: .1rem; }
.pubs .v em { font-style: normal; color: var(--accent); }

details.all { margin-top: 1.75rem; }
details.all summary {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none;
  padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 999px; font-size: .875rem;
}
details.all summary::-webkit-details-marker { display: none; }
details.all summary:hover { border-color: var(--text); }
details.all summary .chev { transition: transform .2s; }
details.all[open] summary .chev { transform: rotate(180deg); }
details.all .less { display: none; }
details.all[open] .more { display: none; }
details.all[open] .less { display: inline; }

/* Two-column facts */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2rem; }
.facts h3 { font-size: .9375rem; font-weight: 600; }
.facts p { font-size: .875rem; color: var(--muted); margin-top: .2rem; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: .875rem; color: var(--faint); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }

/* Responsive */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 40px; }
  .intro picture { grid-row: 1; }
  .portrait { width: 96px; height: 96px; }
  .section { grid-template-columns: 1fr; gap: 1.25rem; padding: 40px 0; }
  .now-grid, .facts { grid-template-columns: 1fr; }
  .top .mark { display: none; }
  .top .wrap { height: auto; min-height: 56px; padding-block: 8px; }
  .top nav { flex-wrap: wrap; gap: 4px 1.1rem; }
  .updates li { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .top, .links, details.all summary { display: none; }
  .entry, .card, .pubs li, .list li, .facts > div { break-inside: avoid; }
}

@media print {
  details.all::details-content { content-visibility: visible; }
}
