@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 100 900; font-display: swap; src: url('fonts/geist-variable.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; font-display: swap; src: url('fonts/dm-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 500; font-display: swap; src: url('fonts/dm-mono-500.woff2') format('woff2'); }

:root {
  --bg: #f2f1ee;
  --ink: #15120e; --soft: #5a5246; --rule: rgba(21, 18, 14, .16);
  --night: #15120e; --night-ink: #f2ece2; --night-soft: rgba(242, 236, 226, .6); --night-rule: rgba(242, 236, 226, .16);
  --accent: #d6342c; --label: #8f7ff0;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --g: clamp(18px, 4.4vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* grain: paper texture on light, a lighter dust on dark */
.grain { position: relative; isolation: isolate; }
.grain::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5; background-image: var(--grain); mix-blend-mode: multiply; opacity: .55; }
.night.grain::after { mix-blend-mode: screen; filter: contrast(6) brightness(.62); background-size: 160px; opacity: .42; }

/* ---------- header: sits on the page at the top, gathers into a floating panel once you scroll ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: flex-end; gap: 24px; padding: 14px var(--g); pointer-events: none; color: var(--ink); }
.top > * { pointer-events: auto; }
.brand { font: 400 1.6rem/1 var(--serif); text-decoration: none; letter-spacing: -.02em; opacity: 0; transform: translateY(-6px); transition: opacity .35s, transform .35s; }
.top.past .brand { opacity: 1; transform: none; }
.brand { padding: 8px 12px 9px; border: 1px solid var(--rule); background: rgba(242, 241, 238, .78); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); box-shadow: 0 6px 24px -14px rgba(21, 18, 14, .35); }
.top.dark .brand { background: rgba(21, 18, 14, .72); border-color: var(--night-rule); }
.top nav { position: relative; display: flex; gap: 2px; padding: 5px; border: 1px solid transparent; background: transparent; transition: background .35s, border-color .35s, box-shadow .35s; }
.top.scrolled nav { background: rgba(242, 241, 238, .78); border-color: var(--rule); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); box-shadow: 0 6px 24px -14px rgba(21, 18, 14, .35); }
.top nav a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; font: 500 12px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: var(--soft); transition: color .2s, background .2s; }
.top nav a::before { content: ''; width: 6px; height: 6px; background: var(--label); transform: scale(0); transition: transform .25s; }
.top nav a:hover { color: var(--ink); }
.top nav a.on { color: var(--ink); }
.top nav a.on::before { transform: scale(1); }
.top nav a sup { font-size: .78em; color: var(--label); opacity: .8; }
.top.dark { color: var(--night-ink); }
.top.dark.scrolled nav { background: rgba(21, 18, 14, .72); border-color: var(--night-rule); }
.top.dark nav a { color: var(--night-soft); }
.top.dark nav a:hover, .top.dark nav a.on { color: var(--night-ink); }
.menu-btn { display: none; background: rgba(242, 241, 238, .78); border: 1px solid var(--rule); color: inherit; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; padding: 11px 14px; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top.dark .menu-btn { background: rgba(21, 18, 14, .72); border-color: var(--night-rule); }

/* ---------- kicker ---------- */
.k { display: inline-flex; align-items: center; gap: 9px; margin: 0; font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.k i { width: 7px; height: 7px; background: var(--label); display: block; }
.night .k { color: #b5a8fc; }

section { padding: clamp(52px, 5.2vw, 84px) var(--g); }
.sec-hd { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: clamp(18px, 2vw, 28px); margin-bottom: clamp(24px, 2.6vw, 40px); border-bottom: 1px solid var(--rule); }
.sec-hd h2 { margin: 14px 0 0; font: 400 clamp(44px, 5.4vw, 84px)/.98 var(--serif); letter-spacing: -.02em; }
.sec-hd .n { font: 400 12.5px/1 var(--mono); color: var(--soft); letter-spacing: .06em; }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; padding-top: clamp(64px, 6vw, 84px); padding-bottom: 0; }
.hero-meta { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.hero { position: relative; isolation: isolate; }
.hero-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero > :not(.hero-field) { position: relative; z-index: 1; }
.hero-mark { position: relative; margin: clamp(8px, 1.4vw, 20px) 0 0; color: var(--ink); font: 400 clamp(64px, 17vw, 320px)/1 var(--serif); letter-spacing: -.035em; white-space: nowrap; padding: .02em 0 .1em; }
.hero-mark .ht-label { color: transparent; }
.hero-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 5vw, 96px); align-items: end; padding: clamp(20px, 2.4vw, 36px) 0 clamp(28px, 3vw, 44px); }
.lede { margin: 0; max-width: 17em; font: 400 clamp(26px, 2.6vw, 40px)/1.12 var(--sans); letter-spacing: -.045em; text-wrap: balance; }
.cta { display: flex; flex-wrap: wrap; gap: 32px; margin-top: clamp(22px, 2.4vw, 34px); }
.cta a { font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.cta a span { color: var(--label); margin-left: 4px; }
.cta a:hover { color: var(--label); border-bottom-color: var(--label); }
.portrait { position: relative; aspect-ratio: 4 / 5; width: clamp(180px, 19vw, 290px); justify-self: end; margin: 0; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; filter: url(#duo-purple); }
.portrait { overflow: hidden; }
.portrait::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: var(--grain); mix-blend-mode: multiply; opacity: .6; }
.roles { list-style: none; margin: 0 calc(-1 * var(--g)); padding: 0 var(--g); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.roles li { display: flex; flex-direction: column; gap: 10px; padding: 20px clamp(14px, 1.6vw, 24px) 24px; border-left: 1px solid var(--rule); }
.roles li:first-child { border-left: 0; padding-left: 0; }
.roles code { font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.roles span { font: 400 clamp(19px, 1.6vw, 24px)/1.1 var(--sans); letter-spacing: -.035em; }

/* halftone boxes */
[data-ht] { position: relative; overflow: hidden; }
[data-ht] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.ht-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
[data-ht-reveal]:hover > img { opacity: 1; }
[data-ht-reveal]:hover .ht-cv { opacity: 0; transition: opacity .5s; }

/* ---------- bio ---------- */
.bio-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 110px); }
.bio-text p { margin: 0 0 1.15em; font-size: clamp(17px, 1.25vw, 19px); line-height: 1.6; letter-spacing: -.01em; color: #2f2a22; }
.bio-text p:first-child { font: 400 clamp(26px, 2.3vw, 36px)/1.22 var(--sans); letter-spacing: -.035em; color: var(--ink); margin-bottom: 1.1em; }
.acc { border-top: 1px solid var(--ink); align-self: start; }
.acc details { border-bottom: 1px solid var(--rule); }
.acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0 18px; font: 400 clamp(20px, 1.7vw, 26px)/1.1 var(--sans); letter-spacing: -.03em; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .n { font: 400 12px/1 var(--mono); color: var(--label); margin-right: 14px; letter-spacing: .04em; }
.acc summary b { font-weight: 400; flex: 1; }
.acc summary::after { content: ''; width: 13px; height: 13px; flex: none; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat; transition: transform .3s; }
.acc details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.acc summary:hover { color: var(--accent); }
.acc .body { padding: 0 0 26px; max-width: 88%; color: var(--soft); font-size: 15.5px; }
.acc .body p { margin: 0 0 .7em; }

/* ---------- press + talks ---------- */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 2.6vw, 40px); }
.feat { display: block; text-decoration: none; }
.feat .thumb { aspect-ratio: 16 / 9.6; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); }
.feat .meta { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; min-height: 118px; }
.feat .meta code { display: block; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--label); margin-bottom: 14px; }
.feat .meta span { display: block; font: 400 clamp(20px, 1.7vw, 25px)/1.15 var(--sans); letter-spacing: -.035em; }
.feat:hover .meta span { color: var(--accent); }
.feat .meta span::after { content: ' ↗'; font-family: var(--mono); font-size: .7em; color: var(--soft); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-direction: column; justify-content: flex-start; box-sizing: border-box; height: calc(19px + 2 * 1.4em + 22px); padding: 11px 0; border-bottom: 1px dashed var(--rule); font-size: 16.5px; line-height: 1.4; overflow: hidden; }
.list li > a, .list li > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.list b { display: block; font: 500 12px/15px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--label); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s; }
.list a:hover { background-size: 100% 1px; }

/* ---------- publications ---------- */
.pubs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(22px, 2.6vw, 40px); }
.pub { padding: 22px 0 24px; border-top: 1px solid var(--rule); }
.pub-thumb { aspect-ratio: 16 / 9.6; margin: 0 0 18px; border: 1px solid var(--rule); background: var(--bg); }
.pub code { display: block; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--label); margin-bottom: 12px; }
.pub a { display: block; font: 400 clamp(19px, 1.55vw, 23px)/1.2 var(--sans); letter-spacing: -.03em; text-decoration: none; }
.pub p { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--soft); }

/* ---------- notebooks ---------- */
.notebooks { background: var(--night); color: var(--night-ink); padding: clamp(48px, 5vw, 80px) 0 clamp(64px, 7vw, 110px); overflow: hidden; }
.nb-hd { padding: 0 var(--g); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start; margin-bottom: clamp(32px, 3.6vw, 52px); }
.nb-hd h2 { margin: 14px 0 0; font: 400 clamp(44px, 5.4vw, 84px)/.98 var(--serif); letter-spacing: -.02em; }
.nb-hd > p { margin: 0; padding-top: 4px; font: 400 clamp(18px, 1.45vw, 22px)/1.45 var(--sans); letter-spacing: -.02em; color: var(--night-soft); }
.nb-hd > p a { color: var(--night-ink); }
.marquee { margin: clamp(32px, 3.6vw, 52px) 0 clamp(24px, 2.6vw, 36px); border-top: 1px solid var(--night-rule); border-bottom: 1px solid var(--night-rule); padding: 12px 0; white-space: nowrap; overflow: hidden; }
.marquee div { display: inline-flex; gap: 32px; animation: mq 46s linear infinite; font: italic 400 clamp(26px, 2.6vw, 38px)/1 var(--serif); letter-spacing: -.01em; color: var(--night-soft); }
.marquee div span::after { content: '✳'; font-style: normal; color: var(--accent); font-size: .5em; vertical-align: middle; margin-left: 32px; }
@keyframes mq { to { transform: translateX(-50%); } }
.nb-grid { padding: 0 var(--g); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.nb-grid figure { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; }
.nb-grid img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- contact / footer ---------- */
.contact { padding: clamp(52px, 5.2vw, 84px) var(--g) 0; overflow: hidden; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
.contact h2 { margin: 14px 0 0; font: 400 clamp(42px, 5vw, 80px)/1 var(--sans); letter-spacing: -.055em; }
.contact p { margin: 0; font: 400 clamp(19px, 1.6vw, 24px)/1.4 var(--sans); letter-spacing: -.025em; }
.contact p a { text-decoration-color: var(--accent); }
.critters { position: relative; height: 96px; margin: clamp(28px, 3vw, 44px) 0 0; color: var(--ink); cursor: pointer; }
.critters canvas { display: block; }
.mark { position: relative; margin: clamp(8px, 1vw, 16px) 0 0; color: var(--ink); font: 500 clamp(72px, 14.5vw, 240px)/1 var(--sans); letter-spacing: -.065em; white-space: nowrap; padding: .06em 0 .14em; }
.mark .ht-label { color: transparent; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0 28px; border-top: 1px solid var(--ink); font: 400 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { text-decoration: none; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .bio-grid, .nb-hd, .contact-grid { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
  .hero-main { grid-template-columns: 1fr auto; align-items: end; }
  .portrait { width: clamp(120px, 26vw, 220px); }

  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roles li:nth-child(3) { border-left: 0; padding-left: 0; }
  .roles li:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cols, .pubs { grid-template-columns: 1fr; }
  .feat .meta { min-height: 0; }
  .cols > div + div { margin-top: 24px; }
  .nb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .menu-btn { display: block; margin-left: auto; }
  .top nav { display: none; position: absolute; top: calc(100% - 4px); right: var(--g); flex-direction: column; min-width: 220px; background: rgba(242, 241, 238, .94) !important; border-color: var(--rule) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .top.dark nav { background: rgba(21, 18, 14, .94) !important; border-color: var(--night-rule) !important; }
  .top.open nav { display: flex; }
  .top nav a { padding: 14px 12px; }
  .nb-grid { grid-template-columns: 1fr; }
  .foot { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .marquee div { animation: none; } html { scroll-behavior: auto; } }
