/* Layout: single column page, sticky section nav, label column + content column on wide screens. */
@font-face { font-family: "Crimson Pro"; src: url("fonts/crimson-pro-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("fonts/crimson-pro-400-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-400-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-700.woff") format("woff"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff") format("woff"); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  --paper: #f4f7f7;
  --paper-2: #e9eff0;
  --ink: #13222a;
  --muted: #56656c;
  --rule: #d2dcde;
  --accent: #1d5c86;
  --accent-soft: #dce8f0;
  --signal: #b0601b;
  --cov-press-bg: #dce8f0; --cov-press-ink: #1d4e70;
  --cov-video-bg: #f4e4d3; --cov-video-ink: #7c4313;
  --cov-podcast-bg: #dbece3; --cov-podcast-ink: #275f47;
  --cov-interview-bg: #e6e1f0; --cov-interview-ink: #4f4176;
  --display: "Crimson Pro", "Iowan Old Style", "Charter", Georgia, serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.32rem;
  --step-2: 1.7rem;
  --step-3: 2.4rem;
  --step-4: clamp(2.8rem, 6.5vw, 4.6rem);
  --maxw: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1518; --paper-2: #141e22; --ink: #e2e9ea; --muted: #97a6ab;
    --rule: #26343a; --accent: #7fb5dc; --accent-soft: #1b2d39; --signal: #e39a55;
    --cov-press-bg: #1a2c38; --cov-press-ink: #93c3e4;
    --cov-video-bg: #352719; --cov-video-ink: #f0b37c;
    --cov-podcast-bg: #1b3128; --cov-podcast-ink: #91d0b3;
    --cov-interview-bg: #29243b; --cov-interview-ink: #c3b5e8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1518; --paper-2: #141e22; --ink: #e2e9ea; --muted: #97a6ab;
  --rule: #26343a; --accent: #7fb5dc; --accent-soft: #1b2d39; --signal: #e39a55;
  --cov-press-bg: #1a2c38; --cov-press-ink: #93c3e4;
  --cov-video-bg: #352719; --cov-video-ink: #f0b37c;
  --cov-podcast-bg: #1b3128; --cov-podcast-ink: #91d0b3;
  --cov-interview-bg: #29243b; --cov-interview-ink: #c3b5e8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--paper);
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 48rem) {
  .wrap { padding-left: max(2rem, env(safe-area-inset-left, 0px)); padding-right: max(2rem, env(safe-area-inset-right, 0px)); }
}

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--paper); padding: 0.5rem 0.75rem; }

/* Top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem; }
.brand { font-family: var(--display); font-size: var(--step-1); color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar nav { min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; justify-content: flex-end; }
.topbar nav a {
  display: block; padding: 1rem 0 0.9rem; white-space: nowrap; text-decoration: none;
  color: var(--muted); font-size: var(--step--1); letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
}
.topbar nav a:hover, .topbar nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 47.99rem) {
  .topbar-inner { flex-direction: column; align-items: stretch; gap: 0; padding-top: 0.6rem; }
  .topbar ul { justify-content: flex-start; }
  .topbar nav a { padding: 0.5rem 0 0.55rem; }
  html { scroll-padding-top: 6rem; }
}

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) 1.5rem; border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 52rem) { .hero-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 4rem; } }
.hero-text { display: grid; gap: 1rem; min-width: 0; }
.eyebrow, .mini, .count, .pub-year, .media-kicker, .cv-when {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.hero h1 { font-size: var(--step-4); font-weight: 400; letter-spacing: -0.015em; }
.role { font-family: var(--display); font-style: italic; font-size: var(--step-2); color: var(--accent); }
.tagline { max-width: 34rem; font-size: var(--step-1); line-height: 1.5; color: var(--ink); }
.social { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.social a {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule); border-radius: 999px; text-decoration: none;
  color: var(--ink); font-size: var(--step--1); background: var(--paper);
}
.social a:hover { border-color: var(--accent); color: var(--accent); }
.ico { width: 1rem; height: 1rem; fill: currentColor; flex: none; }
.portrait { justify-self: start; width: min(55%, 13rem); }
@media (min-width: 52rem) { .portrait { justify-self: center; width: min(100%, 22rem); } }
.portrait img, .monogram { aspect-ratio: 4 / 5; width: 100%; max-width: 100%; object-fit: cover; border-radius: 4px; }
.monogram {
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font-family: var(--display); font-size: clamp(4rem, 12vw, 7rem); font-style: italic;
}

/* Control chart */
.cc { margin: clamp(2rem, 5vw, 3.5rem) 0 0; display: grid; gap: 0.5rem; }
.cc svg { width: 100%; height: clamp(70px, 10vw, 110px); overflow: visible; }
.cc-path { fill: none; stroke: var(--muted); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0.6; }
.cc-dot { fill: var(--accent); }
.cc-hot { fill: var(--signal); }
.cc-limit { stroke: var(--muted); stroke-dasharray: 5 5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cc-mean { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cc-zone { fill: var(--signal); opacity: 0.08; }
.cc-key { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 0.9rem; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.cc-key i { display: inline-block; width: 1.4rem; border-top: 1px dashed var(--muted); }
.cc-key b { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--signal); }
.cc figcaption { font-size: var(--step--1); color: var(--muted); max-width: 46rem; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section.alt { background: var(--paper-2); }
.section h2 { font-size: var(--step-3); font-weight: 400; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 2rem; }
.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) { .two-col { grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; } }
.prose { display: grid; gap: 1.1rem; max-width: 42rem; min-width: 0; }
.mini { margin: 0 0 0.75rem; font-weight: 500; }
.interests { display: grid; gap: 1.5rem; margin-top: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
@media (min-width: 36rem) { .interests { grid-template-columns: 1fr 1fr; } }
.interests ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.interests li::before { content: "·"; color: var(--accent); margin-right: 0.5rem; }

/* Publications */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.chip {
  font: inherit; font-size: var(--step--1); cursor: pointer; padding: 0.35rem 0.85rem;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.pub { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; padding-block: 1.5rem; border-bottom: 1px solid var(--rule); }
@media (min-width: 52rem) { .pub { grid-template-columns: 14rem minmax(0, 1fr); gap: 3rem; } }
.pub-year { padding-top: 0.3rem; font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--ink); }
.pub-body { display: grid; gap: 0.3rem; max-width: 46rem; min-width: 0; }
.pub-title { font-size: var(--step-1); font-weight: 400; }
.pub-authors, .pub-venue, .pub-note { color: var(--muted); font-size: 0.98rem; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-award { font-size: var(--step--1); color: var(--signal); font-weight: 600; }
.pub-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; margin-top: 0.5rem; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.pill, .abstract summary {
  display: inline-block; padding: 0.2rem 0.7rem; border-radius: 4px; font-size: 0.82rem;
  font-family: var(--mono); letter-spacing: 0.02em; text-decoration: none;
  border: 1px solid var(--rule); color: var(--accent); background: var(--paper);
}
.pill:hover, .abstract summary:hover { border-color: var(--accent); }
.abstract[open] { flex-basis: 100%; }
.abstract summary { cursor: pointer; list-style: none; color: var(--ink); }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::after { content: " +"; }
.abstract[open] summary::after { content: " −"; }
.abstract p { margin-top: 0.75rem; font-size: 0.98rem; line-height: 1.65; max-width: 44rem; }
.pub[hidden] { display: none; }

.pub-license { margin-top: 1.25rem; max-width: 46rem; font-size: var(--step--1); color: var(--muted); }

/* Working papers */
.stack { display: grid; gap: 2.25rem; min-width: 0; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.plain li { display: grid; gap: 0.2rem; max-width: 46rem; }
.wp-title { font-family: var(--display); font-size: 1.22rem; }
.wp-meta { color: var(--muted); font-size: 0.95rem; }
.plain .pills { margin-top: 0.25rem; }

/* Media */
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.media-card { display: grid; grid-template-rows: auto 1fr; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.media-text { display: grid; align-content: start; gap: 0.5rem; padding: 1.1rem 1.2rem 1.3rem; }
.media-title { font-size: 1.3rem; }
.media-title a { color: var(--ink); text-decoration: none; }
.media-title a:hover { color: var(--accent); text-decoration: underline; }
.media-desc { color: var(--muted); font-size: 0.95rem; }
.media-frame { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; border: 0; display: block; }
.media-img { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; object-fit: cover; }
.media-audio { width: 100%; }

/* Media covers */
.cover {
  --cv-bg: var(--cov-press-bg); --cv-ink: var(--cov-press-ink); --cv-hot: var(--signal);
  position: relative; display: block; aspect-ratio: 16 / 9; width: 100%; max-width: 100%; overflow: hidden;
  border: 0; margin: 0; padding: 0; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  color: var(--cv-ink); background-color: var(--cv-bg);
  background-image: radial-gradient(color-mix(in srgb, var(--cv-ink) 16%, transparent) 1px, transparent 1.3px);
  background-size: 14px 14px; background-position: 7px 7px;
  border-bottom: 1px solid var(--rule);
}
.cover-video { --cv-bg: var(--cov-video-bg); --cv-ink: var(--cov-video-ink); --cv-hot: var(--accent); }
.cover-podcast { --cv-bg: var(--cov-podcast-bg); --cv-ink: var(--cov-podcast-ink); }
.cover-interview { --cv-bg: var(--cov-interview-bg); --cv-ink: var(--cov-interview-ink); }
.cover-top {
  position: absolute; top: 0.9rem; left: 1.1rem; right: 1.1rem; display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.07em; text-transform: uppercase;
}
.cover-outlet {
  position: absolute; left: 1.1rem; bottom: 0.9rem; max-width: calc(59% - 1.9rem);
  font-family: var(--display); font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.05; text-wrap: balance;
}
.cover-motif {
  position: absolute; right: 5%; bottom: 8%; height: 64%; width: auto; aspect-ratio: 1;
  fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s ease;
}
.cover-motif .h { stroke: var(--cv-hot); }
.cover-motif .hf { fill: var(--cv-hot); stroke: none; }
.cover-motif .th { stroke-width: 6; }
.cover-motif .d { stroke-dasharray: 5 6; opacity: 0.7; }
.media-card:hover .cover-motif { transform: translateY(-4px) rotate(-2deg); }
@media (prefers-reduced-motion: reduce) { .cover-motif { transition: none; } .media-card:hover .cover-motif { transform: none; } }
.cover-play { position: absolute; right: 5%; bottom: 8%; height: 64%; aspect-ratio: 1; display: grid; place-items: center; }
.cover-play .ico { width: 3rem; height: 3rem; padding: 0.75rem; border-radius: 50%; background: var(--cv-ink); fill: var(--cv-bg); box-shadow: 0 0 0 6px var(--cv-bg); }
.media-play:hover .cover-play .ico { transform: scale(1.07); }
.media-play .cover-motif { opacity: 0.35; }

.media-text .pills { margin-top: 0.35rem; }
.more-wrap { margin-top: 1.5rem; display: flex; justify-content: center; }
.more-btn {
  font: inherit; font-size: var(--step--1); cursor: pointer; padding: 0.5rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.more-btn:hover { background: var(--ink); color: var(--paper); }

/* Teaching */
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }

/* CV */
.cv-grid { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .cv-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.cv-grid .mini:not(:first-child) { margin-top: 2.25rem; }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.cv-list li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; }
.cv-when { font-variant-numeric: tabular-nums; padding-top: 0.15rem; color: var(--ink); text-transform: none; letter-spacing: 0.02em; }
.cv-what { display: block; }
.cv-where, .cv-note { display: block; color: var(--muted); font-size: 0.95rem; }
.plain-bullets { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.btn {
  display: inline-block; padding: 0.5rem 1rem; border-radius: 4px; text-decoration: none;
  background: var(--ink); color: var(--paper); font-size: var(--step--1);
}

/* Contact */
.contact { display: grid; gap: 1.25rem; font-size: var(--step-1); }
.contact address { font-style: normal; line-height: 1.6; }
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.email a { overflow-wrap: anywhere; }
.copy {
  font: inherit; font-size: var(--step--1); cursor: pointer; padding: 0.3rem 0.75rem;
  border-radius: 4px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
}
.copy:hover { border-color: var(--accent); }

.footer { border-top: 1px solid var(--rule); padding-block: 2rem; color: var(--muted); font-size: var(--step--1); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
