@font-face { font-family: Jost; font-weight: 600; font-display: swap; src: url("/fonts/jost-600.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-hyperlegible-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-hyperlegible-700.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 400; font-display: swap; src: url("/fonts/courier-prime-400.woff2") format("woff2"); }

:root {
  --teal: #0e5c60;
  --teal-deep: #072f32;
  --teal-pale: #e4efee;
  --ink: #1c1c1c;
  --yellow: #ffd007;
  --white: #fff;
  --muted: #46575a;
  --muted-on-dark: #d5dcdc;
  --rule: #b9cccb;
  --heading: Jost, "Century Gothic", sans-serif;
  --body: "Atkinson Hyperlegible", Verdana, sans-serif;
  --code: "Courier Prime", Consolas, monospace;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.55; -webkit-text-size-adjust: 100%; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd, pre { margin: 0; }
h1, h2, h3 { font-family: var(--heading); font-weight: 600; }
h1 { font-size: clamp(35px, 5.6vw, 68px); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 24px; line-height: 1.2; }
p { max-width: 60ch; text-wrap: pretty; }
a { color: var(--teal); }
a:focus-visible, pre:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 3px var(--ink); }
.skip { position: absolute; left: 16px; top: -100px; z-index: 1; padding: 12px 18px; background: var(--yellow); color: var(--ink); font-weight: 700; }
.skip:focus { top: 12px; }

/* Stepped "pixel" corners: set --n to the step size */
.notch, .btn, .pic, .prose pre {
  --n: 6px;
  --n2: calc(var(--n) * 2);
  --e: calc(100% - var(--n));
  --e2: calc(100% - var(--n) * 2);
  clip-path: polygon(0 var(--n2), var(--n) var(--n2), var(--n) var(--n), var(--n2) var(--n), var(--n2) 0, var(--e2) 0, var(--e2) var(--n), var(--e) var(--n), var(--e) var(--n2), 100% var(--n2), 100% var(--e2), var(--e) var(--e2), var(--e) var(--e), var(--e2) var(--e), var(--e2) 100%, var(--n2) 100%, var(--n2) var(--e), var(--n) var(--e), var(--n) var(--e2), 0 var(--e2));
}
.pixelated, .pic { image-rendering: pixelated; }

/* Layout */
.wrap { max-width: 1136px; margin-inline: auto; }
.narrow { width: 100%; max-width: 720px; margin-inline: auto; display: flex; flex-direction: column; gap: 26px; }
.band { --pt: 88px; --pb: var(--pt); padding: clamp(calc(var(--pt) * 0.62), 7vw, var(--pt)) 24px clamp(calc(var(--pb) * 0.62), 7vw, var(--pb)); }
.band > .wrap { display: flex; flex-direction: column; gap: 36px; }
.band.pale { background: var(--teal-pale); }
.band.teal { background: var(--teal); color: var(--white); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack.tight { gap: 10px; }
.split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 24px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.grid { --min: 290px; --gap: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min)), 1fr)); gap: var(--gap); }
.lead { font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 16px; color: var(--teal); }
.ruled { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-top: 4px solid var(--teal); padding-top: 18px; }
.ruled h3 { font-size: 26px; }

/* Links and buttons */
.btn { --n: 4px; display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 18px; background: var(--yellow); color: var(--ink); font-weight: 700; text-decoration: none; }
.btn.white { background: var(--white); }
.btn.deep { background: var(--teal-deep); color: var(--white); }
.btn:hover { filter: brightness(1.12); text-decoration: underline; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: -9px; box-shadow: inset 0 0 0 6px var(--white); }
.link { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.split > .link { align-self: auto; }
.teal .link { color: var(--white); }
.teal .link.yellow { color: var(--yellow); }
.title-link { color: var(--ink); text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* Header and footer */
.site-header { background: var(--teal); color: var(--white); padding: 16px 24px 0; }
.site-header .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 28px; }
.site-header a { color: var(--white); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; font-family: var(--heading); font-size: 22px; font-weight: 600; }
.brand img { --n: 3px; width: 44px; height: 44px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 26px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 8px; }
.site-nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 4px; text-underline-offset: 8px; }
.site-footer { background: var(--ink); color: var(--white); padding: 28px 24px; }
.site-footer.hello { padding-top: 72px; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 56px; }
.site-footer .split { gap: 28px; }
.site-footer p { color: var(--muted-on-dark); }
.site-footer .legal { gap: 4px 28px; font-size: 16px; }
.site-footer .legal div { display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer .legal a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--white); text-underline-offset: 4px; }

/* Page tops */
.hero { background: var(--teal); color: var(--white); padding: clamp(32px, 4.6vw, 60px) 24px 0; }
.hero .wrap { display: flex; flex-direction: column; gap: 28px; }
.hero-body { display: flex; flex-wrap: wrap; gap: 36px 48px; align-items: flex-end; }
.hero-text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 26px; padding-bottom: clamp(0px, 4vw, 56px); }
.hero-art { flex: 2 1 320px; min-width: 0; max-width: 834px; width: 100%; }
.hero-figure { flex: 0 1 640px; min-width: 0; max-width: 640px; width: 100%; margin-left: auto; }
.contact-hero .hero-text { flex-basis: 320px; gap: 18px; padding-bottom: clamp(0px, 5vw, 72px); }
.contact-hero .hero-art { flex: 1.2 1 320px; max-width: 620px; }
.page-title { --pt: 64px; }
.page-title p { color: var(--teal-pale); }
.portrait { display: flex; flex-wrap: wrap; gap: 36px 72px; align-items: center; }
.portrait > img { flex: 0 1 300px; width: 300px; }
.portrait > .stack { flex: 1 1 320px; }
.about-hero { --pt: 64px; --pb: 80px; }
.about-hero .portrait > img { flex-basis: 380px; width: 380px; }

/* Highlights strip on Home */
.highlights { background: var(--ink); color: var(--white); padding: 32px 24px; }
.highlights ul { --min: 230px; --gap: 24px; padding: 0; list-style: none; }
.highlights li { display: flex; align-items: center; gap: 14px; }
.highlights img { width: 56px; height: 56px; flex: none; }
.highlights strong { display: block; font-family: var(--heading); font-size: 20px; line-height: 1.2; font-weight: 600; }
.highlights span { display: block; margin-top: 2px; font-size: 16px; line-height: 1.35; color: var(--muted-on-dark); }

/* Projects */
.pic { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ink); }
.pic.wide { aspect-ratio: 21 / 9; object-fit: contain; }
.card { display: flex; flex-direction: column; gap: 16px; }
.card > div { display: flex; flex-direction: column; gap: 8px; }
.card h3 { font-size: 26px; }
.more .card h3 { font-size: 24px; }
.feature { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; }
.feature-pic { flex: 1.5 1 360px; min-width: min(100%, 300px); }
.feature-text { flex: 1 1 300px; display: flex; flex-direction: column; gap: 14px; }
.feature h3 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; text-wrap: balance; }
.feature .title-link { text-decoration-thickness: 3px; text-underline-offset: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; }
.facts dt { font-size: 16px; color: var(--muted); }
.facts dd { margin-top: 4px; font-family: var(--heading); font-size: 22px; line-height: 1.25; font-weight: 600; }
.chapter { display: flex; flex-wrap: wrap; gap: 10px 48px; border-top: 2px solid var(--rule); padding-top: 28px; }
.chapter h2 { flex: 1 1 240px; }
.chapter p { flex: 2 1 320px; font-size: 20px; }

/* Lists of posts, jobs and talks */
.list { border-bottom: 2px solid var(--rule); }
.list > * { display: flex; flex-wrap: wrap; gap: 6px 40px; padding: 24px 0; border-top: 2px solid var(--rule); }
.list .when { flex: 0 0 200px; color: var(--teal); font-size: 16px; line-height: 1.8; font-weight: 700; }
.list .what { flex: 1 1 280px; display: flex; flex-direction: column; gap: 6px; }
.posts .when { flex-basis: 120px; }
.posts .what { flex-basis: 270px; }
.posts .date { flex: 0 0 110px; font-size: 16px; line-height: 1.8; color: var(--muted); }
.plain { padding-left: 22px; line-height: 1.75; color: var(--muted); }

/* Blog post */
.prose > * { margin: 0; max-width: none; }
.prose { font-size: 20px; line-height: 1.65; }
.prose ul, .prose ol { padding-left: 28px; }
.prose li + li { margin-top: 8px; }
.prose h2 { margin-top: 12px; }
.prose a { text-underline-offset: 3px; }
.prose blockquote { border-left: 6px solid var(--yellow); padding-left: 22px; }
.prose code { font-family: var(--code); font-size: 0.95em; }
.prose :not(pre) > code { background: var(--teal-pale); padding: 2px 6px; }
.prose pre { padding: 26px; background: var(--ink); color: var(--white); font-size: 16px; line-height: 1.55; overflow-x: auto; }
.prose pre code { font-size: inherit; }
.author { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.author img { --n: 4px; width: 112px; height: 112px; flex: none; }
.author .stack { flex: 1 1 260px; gap: 4px; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Contact uses h2 for its short sections, at the size of a card title */
.contact-hero ~ .band h2 { font-size: 28px; line-height: 1.2; letter-spacing: 0; }
