@charset "UTF-8";

:root {
	--ink: #2c352a;
	--ink-strong: #172319;
	--muted: #687064;
	--paper: #faf9f6;
	--panel: #fffdf8;
	--accent: #6f8f56;
	--accent-dark: #466a3d;
	--accent-soft: #e8eedc;
	--line: #ded8c9;
	--clay: #b8653f;
	--shadow: 0 22px 60px rgba(42, 49, 35, 0.1);
	--shadow-small: 0 10px 30px rgba(42, 49, 35, 0.08);
	--shell: 1080px;
	--header-height: 80px;
	--serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	--sans: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-decoration-color: #9aa98b; text-underline-offset: 0.22em; }
a:hover { color: var(--ink-strong); text-decoration-color: currentColor; }
img { display: block; max-width: 100%; }
button { color: inherit; font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 5px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink-strong); font-family: var(--serif); font-weight: 400; }
h1 { font-size: clamp(2.8rem, 5vw, 4rem); letter-spacing: -0.045em; line-height: 1.1; margin-bottom: 25px; }
h2 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 10px; }
h3 { font-size: 1.65rem; letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 14px; }
p { margin-bottom: 18px; }
.page-shell { width: calc(100% - 80px); max-width: var(--shell); margin: 0 auto; }
.skip-link { position: fixed; top: -80px; left: 20px; background: var(--panel); padding: 10px 16px; z-index: 1000; }
.skip-link:focus { top: 10px; }
.nowrap { white-space: nowrap; }

/* Masthead */
.site-header { height: var(--header-height); }
.nav-layout { position: relative; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.nav-portrait { display: none; }
.nav-portrait img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: var(--ink); font-size: 0.8rem; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px 0 10px 16px; cursor: pointer; font-size: 0.85rem; }
.post-page .nav-layout { justify-content: space-between; }
.post-page .nav-home { display: inline-flex; align-items: center; gap: 12px; color: var(--ink-strong); font-family: var(--serif); font-size: 1.05rem; text-decoration: none; }
.post-page .nav-home img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* Hero */
.hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; align-items: center; gap: 48px; padding: 22px 0 50px; }
.hero-copy { max-width: 650px; }
.hero-portrait { width: 200px; height: auto; aspect-ratio: 1; object-fit: cover; object-position: center; border-radius: 50%; }
.hero-context { font-size: 0.94rem; line-height: 1.8; }
.hero-links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 25px; font-size: 0.8rem; }

/* Sections: label in the left margin, entries share a single reading edge. */
.section > .page-shell { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 42px; border-top: 1px solid var(--line); padding-top: 36px; padding-bottom: 60px; }
.section-heading { grid-column: 1; grid-row: 1 / span 6; padding-top: 2px; }
.section-heading p { color: var(--muted); font-size: 0.73rem; line-height: 1.55; max-width: 140px; }
.section > .page-shell > :not(.section-heading) { grid-column: 2; min-width: 0; }
.entry-date, .research-venue, .timeline-time { color: var(--muted); font-size: 0.72rem; line-height: 1.5; margin-bottom: 10px; }

/* Projects (work) */
.work-feature + .work-feature { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--line); }
.work-story > p:last-child { font-size: 0.94rem; max-width: 650px; margin-bottom: 26px; }
.work-story h3 a { color: var(--ink-strong); text-decoration: none; }
.work-story h3 a:hover { text-decoration: underline; }
.product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.product-list a { display: flex; flex-direction: column; gap: 12px; text-decoration: none; }
.product-image { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.product-image .chart { width: 100%; height: 100%; }
.product-image img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.product-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }
.product-caption > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.product-list strong { font-size: 0.82rem; font-weight: 500; }
.product-list small { color: var(--muted); font-size: 0.7rem; }
.product-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.project-links { display: flex; flex-wrap: wrap; gap: 6px 17px; font-size: 0.72rem; margin-top: 18px; }

/* Research (papers) */
.research-grid { display: grid; gap: 30px; }
.research-card { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; gap: 28px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.research-card:last-child { padding-bottom: 0; border-bottom: 0; }
.research-image { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; padding: 6px; background: #fff; }
.research-image .chart { width: 100%; height: 100%; }
.research-copy h3 { font-size: 1.3rem; line-height: 1.35; margin-bottom: 10px; }
.research-copy h3 a { color: var(--ink-strong); text-decoration: none; }
.research-copy h3 a:hover { text-decoration: underline; }
.research-authors { color: var(--muted); font-size: 0.72rem; line-height: 1.6; margin-bottom: 10px; }
.research-authors strong { color: var(--ink); font-weight: 600; }
.research-copy .project-links { margin-top: 0; }
.project-links a { padding: 3px 0; }

/* Nuggets */
.nugget-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; gap: 32px; }
.nugget-card h3 { font-size: 1.3rem; line-height: 1.35; margin-bottom: 10px; }
.research-summary { font-size: 0.8rem; line-height: 1.65; margin-bottom: 12px; }
.demo { background: #fff; border: 1px solid var(--line); padding: 22px 22px 18px; }
.demo-toggle { display: inline-flex; padding: 3px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.demo-toggle button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 0.74rem; font-weight: 500; cursor: pointer; }
.demo-toggle button[aria-pressed="true"] { background: var(--accent-dark); color: #fff; }
.demo-bars { display: grid; gap: 13px; }
.demo [hidden] { display: none; }
.demo-row { display: grid; gap: 5px; transition: opacity 0.35s ease; }
.demo-row[hidden] { display: none; }
.demo-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.74rem; }
.demo-label strong { color: var(--ink-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-track { height: 26px; overflow: hidden; border-radius: 4px; background: #efece3; }
.demo-fill { display: flex; align-items: center; justify-content: flex-end; height: 100%; width: 0; padding-right: 9px; border-radius: 4px; color: #fff; font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.demo-fill.is-a { background: var(--accent-dark); }
.demo-fill.is-b { background: var(--clay); }
.demo-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; color: var(--muted); font-size: 0.72rem; }
.demo-legend span { display: inline-flex; align-items: center; gap: 7px; }
.demo-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--accent-dark); }
.demo-legend i.is-b { background: var(--clay); }
.demo-caption { margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.78rem; line-height: 1.6; }
.demo-caption strong { color: var(--ink-strong); font-weight: 600; }
.demo-source { margin: 12px 0 0; color: var(--muted); font-size: 0.68rem; }
.demo-fill.is-n { background: var(--muted); }
.demo .table-wrap { margin: 16px 0 0; }
.demo .result-table { min-width: 360px; font-size: 0.74rem; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.demo-chips button { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 0.72rem; font-weight: 500; cursor: pointer; }
.demo-chips button[aria-pressed="true"] { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; }
.demo-range { margin-bottom: 20px; }
.demo-range label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.76rem; }
.demo-range label strong { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.demo-range input { width: 100%; accent-color: var(--accent-dark); }
.demo-note { margin: 14px 0 0; color: var(--muted); font-size: 0.74rem; }
.demo.is-live .demo-fill { transition-duration: 0.25s; }

/* Case studies: first one open, the rest behind an expand control */
.case-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.45s ease; }
.case-more.is-open { grid-template-rows: 1fr; opacity: 1; }
html:not(.js) .case-more { grid-template-rows: 1fr; opacity: 1; }
html:not(.js) .case-toggle { display: none; }
.case-more-inner { min-height: 0; overflow: hidden; }
.case-more-inner > .nugget-card { margin-top: 40px; padding-top: 36px; border-top: 1px solid var(--line); }
.case-toggle { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 30px; padding: 14px 18px; border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; transition: border-color 0.25s, background 0.25s; }
.case-toggle:hover { border-color: var(--accent); background: #fff; }
.case-toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.case-toggle-label { color: var(--ink-strong); font-size: 0.84rem; font-weight: 500; }
.case-toggle-peek { color: var(--muted); font-size: 0.72rem; }
.case-toggle[aria-expanded="true"] .case-toggle-peek { display: none; }
.case-dot { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-dark); }
.case-toggle.is-pulsing { animation: case-glow 2s ease-in-out infinite; }
.case-toggle.is-pulsing .case-dot::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--accent); border-radius: 50%; animation: case-ping 1.6s ease-out infinite; }
.case-chevron { flex: none; width: 9px; height: 9px; margin-left: auto; border-right: 2px solid var(--accent-dark); border-bottom: 2px solid var(--accent-dark); transform: rotate(45deg); transition: transform 0.3s ease; }
.case-toggle.is-pulsing .case-chevron { animation: case-nudge 1.6s ease-in-out infinite; }
.case-toggle[aria-expanded="true"] .case-chevron { transform: rotate(-135deg); }
@keyframes case-ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.3); opacity: 0; } }
@keyframes case-nudge { 0%, 100% { transform: translateY(-2px) rotate(45deg); } 50% { transform: translateY(2px) rotate(45deg); } }
@keyframes case-glow { 0%, 100% { border-color: var(--line); } 50% { border-color: var(--accent); } }

/* Experience & education */
.timeline-item + .timeline-item { margin-top: 20px; }
.timeline-copy { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 22px; }
.timeline-time { grid-row: 1 / span 2; margin: 3px 0 0; font-variant-numeric: tabular-nums; }
.timeline-copy h3 { font-family: var(--sans); font-size: 0.86rem; font-weight: 500; line-height: 1.6; letter-spacing: 0; margin-bottom: 2px; }
.timeline-copy > p:last-child:not(.timeline-time) { grid-column: 2; color: var(--muted); font-size: 0.75rem; margin-bottom: 0; }
.background-card { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 28px; }
.background-card h3 { font-size: 1.3rem; }
.teaching-details ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin: 0; padding: 0; }
.teaching-details li { display: flex; flex-direction: column; font-size: 0.73rem; line-height: 1.6; }
.teaching-details small { color: var(--muted); font-size: 0.68rem; margin-top: 3px; }

/* Footer */
.site-footer { padding-bottom: 28px; }
.footer-layout { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--line); padding-top: 26px; }
.footer-email { font-size: 0.85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.75rem; }
.footer-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.68rem; margin-top: 30px; }
.footer-meta a { color: inherit; }

/* Charts */
.chart { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.product-image .chart-svg { height: 100%; }
.chart-svg text { fill: var(--muted); font-size: 12px; }
.chart-svg .c-title { fill: var(--ink-strong); font-size: 15px; font-weight: 600; }
.chart-svg .c-axis-title { font-size: 12.5px; }
.chart-svg .c-label { fill: var(--ink); font-size: 12px; }
.chart-svg .c-value { fill: var(--ink-strong); font-size: 12px; font-weight: 600; }
.chart-svg .c-note { fill: var(--muted); font-size: 11.5px; }
.chart-svg.is-compact text { font-size: 13px; }
.chart-svg.is-compact .c-title { font-size: 15.5px; }
.chart-svg .c-grid { stroke: #ebe7dc; stroke-width: 1; }
.chart-svg .c-axis { stroke: #cfc9ba; stroke-width: 1; }
.chart-svg .c-hover-line { stroke: var(--ink-strong); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
.chart-tip { position: absolute; z-index: 5; min-width: 150px; padding: 8px 10px; border: 1px solid var(--line); background: rgba(255, 253, 248, 0.97); box-shadow: var(--shadow-small); color: var(--ink); font-size: 0.72rem; line-height: 1.5; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.chart-tip.is-on { opacity: 1; }
.chart-tip strong { display: block; color: var(--ink-strong); font-weight: 600; margin-bottom: 2px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.replay { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--accent-dark); font-size: inherit; text-decoration: underline; text-decoration-color: #9aa98b; text-underline-offset: 0.22em; cursor: pointer; }
.replay:hover { color: var(--ink-strong); }

/* ---------- Project pages ---------- */
.post { padding: 10px 0 20px; }
.post-col { width: calc(100% - 48px); max-width: 720px; margin-left: auto; margin-right: auto; }
.post-back { color: var(--muted); font-size: 0.8rem; text-decoration: none; }
.post-back:hover { text-decoration: underline; }
.post-kicker { margin: 28px 0 12px; color: var(--muted); font-size: 0.73rem; }
.post h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); letter-spacing: -0.04em; margin-bottom: 18px; }
.post-lede { margin-bottom: 30px; font-family: var(--serif); font-size: 1.25rem; line-height: 1.55; color: var(--ink-strong); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 30px; }
.stat-tile { padding: 16px 18px; border: 1px solid var(--line); background: var(--accent-soft); }
.stat-num { font-family: var(--serif); font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; color: var(--accent-dark); }
.stat-label { margin-top: 5px; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.prose > p { font-size: 0.95rem; line-height: 1.8; }
.prose p.aside { color: var(--muted); font-size: 0.86rem; }
.prose .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }
.part { margin-top: 46px; padding-top: 34px; border-top: 1px solid var(--line); }
.part-label { margin: 0 0 6px; color: var(--clay); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.part h2 { font-size: 1.7rem; letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 16px; }
.part > p:not([class]) { font-size: 0.95rem; line-height: 1.8; }
.part > p.aside { color: var(--muted); font-size: 0.86rem; }
.figure { margin: 26px 0 30px; }
.figure.is-wide { width: min(880px, calc(100vw - 48px)); margin-left: calc((100% - min(880px, calc(100vw - 48px))) / 2); }
.figure .chart { padding: 18px 18px 8px; border: 1px solid var(--line); background: #fff; }
.figure .shot { display: block; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.figure .shot img { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
.table-wrap { overflow-x: auto; margin: 18px 0 22px; }
.result-table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.result-table th { color: var(--muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.result-table td strong { color: var(--ink-strong); font-weight: 600; }
.result-table tr:last-child td { border-bottom: 0; }
.limitations { display: flex; flex-direction: column; gap: 10px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.84rem; line-height: 1.7; }
.limitations strong { color: var(--ink-strong); font-weight: 600; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); }
.post-nav a { display: flex; flex-direction: column; gap: 3px; text-decoration: none; }
.post-nav small { color: var(--muted); font-size: 0.7rem; }
.post-nav span { color: var(--ink-strong); font-family: var(--serif); font-size: 1.1rem; line-height: 1.35; }
.post-nav a:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-nav .is-next { text-align: right; }
.post-page .site-footer { margin-top: 60px; }

@media (max-width: 980px) {
	.section > .page-shell { grid-template-columns: 130px minmax(0, 1fr); column-gap: 30px; }
	.timeline-copy { grid-template-columns: 95px minmax(0, 1fr); gap: 0 18px; }
	.nugget-card { grid-template-columns: minmax(0, 1fr); gap: 22px; }
	.research-card { gap: 22px; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}

@media (max-width: 760px) {
	.nav-portrait { display: block; flex: 0 0 32px; margin-right: auto; border-radius: 50%; overflow: hidden; }
	:root { --header-height: 70px; }
	.page-shell { width: calc(100% - 40px); }
	.hero-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 18px 0 36px; }
	.hero-portrait { display: none; }
	.hero-context { font-size: 0.86rem; }
	.section > .page-shell { grid-template-columns: minmax(0, 1fr); padding-top: 25px; padding-bottom: 40px; }
	.section-heading { grid-column: 1; grid-row: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 26px; }
	.section-heading h2 { margin-bottom: 0; }
	.section-heading p { max-width: none; text-align: right; margin-bottom: 0; }
	.section > .page-shell > :not(.section-heading) { grid-column: 1; }
	.figure .chart { padding: 10px 8px 4px; }
}

@media (max-width: 520px) {
	.nav-toggle { display: inline-flex; }
	.js .site-nav { display: none; position: absolute; right: 0; top: calc(100% - 1px); z-index: 100; flex-direction: column; align-items: stretch; gap: 0; min-width: 180px; padding: 8px; background: var(--panel); border: 1px solid var(--line); }
	.js .site-nav.is-open { display: flex; }
	.site-nav a { padding: 10px 12px; }
	.hero-copy h1 { font-size: clamp(2.1rem, 8.5vw, 2.8rem); margin-bottom: 24px; }
	.hero-links { margin-top: 20px; }
	.product-list { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.research-card { grid-template-columns: 1fr; gap: 20px; }
	.timeline-copy { grid-template-columns: 1fr; }
	.timeline-time { grid-row: auto; margin-bottom: 4px; }
	.timeline-copy > p:last-child:not(.timeline-time) { grid-column: 1; }
	.teaching-details ul { grid-template-columns: 1fr; }
	.footer-layout { align-items: start; flex-direction: column; }
	.stat-grid, .post-nav { grid-template-columns: minmax(0, 1fr); }
	.post-nav .is-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
