/* Shared design tokens. Both the home page and blog use this stylesheet. */
:root {
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #f0efea;
  --text: #252b28;
  --muted: #666d67;
  --accent: #285d4b;
  --line: #dedfd7;
  --header: rgba(250, 249, 246, .94);
  --width: 980px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181c1a;
  --surface: #222824;
  --text: #e8eae4;
  --muted: #a7b0a8;
  --accent: #9bc8ad;
  --line: #343d36;
  --header: rgba(24, 28, 26, .94);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #181c1a; --surface: #222824; --text: #e8eae4;
    --muted: #a7b0a8; --accent: #9bc8ad; --line: #343d36;
    --header: rgba(24, 28, 26, .94);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 106px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
p { margin-bottom: 1.25rem; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -90px; left: 12px; z-index: 10; padding: 10px 18px; background: var(--bg); }
.skip-link:focus { top: 10px; }
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); background: var(--header); backdrop-filter: blur(12px); }
.header-inner { max-width: var(--width); margin: auto; min-height: 78px; display: flex; align-items: center; gap: 28px; padding: 0 24px; }
.wordmark { margin-right: auto; color: var(--text); font-size: 17px; font-weight: 650; letter-spacing: -.4px; text-decoration: none; white-space: nowrap; }
.wordmark-dot { color: var(--accent); }
nav { display: flex; gap: 29px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
nav a[aria-current], nav a:hover { color: var(--text); }
.theme-toggle { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; padding: 9px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--surface); }
.theme-toggle svg { grid-area: 1/1; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
.site-main { max-width: var(--width); margin: 0 auto; padding: 56px 24px 72px; min-height: calc(100vh - 180px); }
/* The portrait sits in the normal flow at the top, so it scrolls away and the
   sections below get the full page width. */
.intro { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 38px; align-items: start; margin-bottom: 52px; }
.portrait { width: 190px; height: 228px; object-fit: cover; object-position: center 40%; border-radius: 4px; background: var(--surface); }
.intro-text h1 { font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; line-height: 1.2; letter-spacing: -.6px; margin-bottom: 7px; }
.intro-role { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.intro-role a { color: inherit; text-decoration: none; }
.intro-role a:hover { color: var(--accent); }
.intro-text p:last-of-type { margin-bottom: 0; }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 20px; }
.social-link { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); border: 1px solid var(--line); border-radius: 50%; text-decoration: none; }
.social-link:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); text-decoration: none; }
.social-link.is-pending { color: var(--muted); opacity: .5; cursor: default; }
.social-link svg { width: 15px; height: 15px; fill: currentColor; }
.cv-icon { font-size: 10px; font-weight: 700; letter-spacing: -.4px; }
.research-section h2, .contact-section h2 { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; letter-spacing: -.2px; padding-bottom: 9px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.research-section { margin-bottom: 48px; }
.contact-section p:last-child { margin-bottom: 0; }
.publication { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; align-items: start; margin-bottom: 34px; }
.publication:last-child { margin-bottom: 0; }
/* Looping demo reel, not a player: no controls, and clicks pass through.
   No background colour — a fractional element height would otherwise leave a
   sliver of it showing as a line under the frame. */
.publication-media video { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: transparent; pointer-events: none; }
.publication h3 { font-size: 16px; line-height: 1.45; font-weight: 650; margin-bottom: 5px; }
.publication h3 a { color: var(--text); text-decoration: none; }
.publication h3 a:hover { color: var(--accent); }
.authors { font-size: 14.5px; line-height: 1.55; margin-bottom: 3px; }
.authors strong { font-weight: 650; }
.publication-venue { font-size: 14.5px; font-style: italic; color: var(--muted); margin-bottom: 3px; }
.paper-links { font-size: 14.5px; margin-bottom: 8px; }
.paper-links a { text-decoration: none; }
.publication-summary { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin-bottom: 0; }
.contact-section p { color: var(--muted); }
.site-footer { max-width: var(--width); margin: 0 auto; padding: 23px 24px 30px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 15px; font-size: 11px; color: var(--muted); }
.writing-page { max-width: 740px; margin: 0 auto; }
.eyebrow { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.page-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 5vw, 48px); font-weight: 400; letter-spacing: -1.4px; margin-bottom: 17px; }
.page-description { max-width: 560px; color: var(--muted); font-size: 17px; margin-bottom: 48px; }
.empty-state { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 45px 0; margin-bottom: 36px; }
.empty-state h2 { font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 400; margin-bottom: 12px; }
.empty-state p { color: var(--muted); margin: 0; }
.post-item { border-top: 1px solid var(--line); padding: 26px 0; }
.post-item time, .post-meta { font-size: 12px; color: var(--muted); }
.post-item h2 { font-size: 23px; margin: 9px 0; font-weight: 550; }
.post-item h2 a { color: var(--text); text-decoration: none; }
.post-item p { color: var(--muted); font-size: 15px; }
.back-link { display: inline-block; font-size: 13px; margin-bottom: 36px; text-decoration: none; }
.post-meta { margin: 18px 0 38px; }
.prose { overflow-wrap: anywhere; }
.prose h2 { font-size: 25px; margin-top: 40px; font-weight: 550; }
.prose h3 { margin-top: 28px; }
.prose blockquote { border-left: 2px solid var(--accent); margin: 30px 0; padding: 5px 0 5px 24px; color: var(--muted); }
.prose blockquote p { margin: 0; }
.prose pre { padding: 20px; background: var(--surface); overflow-x: auto; font-size: 13px; border-radius: 4px; }
.prose code { background: var(--surface); padding: 2px 5px; border-radius: 3px; font-size: .9em; }
.prose pre code { padding: 0; }
.prose img { border-radius: 4px; margin: 28px auto; height: auto; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); }
.cv-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.cv-heading h1 { margin: 0; font-size: 28px; }
.cv-viewer { display: block; width: 100%; height: 78vh; min-height: 500px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
@media (max-width: 900px) {
  .intro { grid-template-columns: 160px minmax(0, 1fr); gap: 30px; }
  .portrait { width: 160px; height: 192px; }
  .intro-text h1 { font-size: 27px; }
  .publication { grid-template-columns: 240px minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 90px; }
  .header-inner { min-height: 68px; padding: 0 20px; gap: 15px; }
  .wordmark { font-size: 14px; }
  nav { gap: 17px; }
  nav a { font-size: 12px; }
  .theme-toggle { width: 32px; height: 32px; padding: 6px; }
  .site-main { padding: 36px 24px 55px; }
  .intro { display: block; margin-bottom: 36px; }
  .portrait { width: 140px; height: 168px; margin-bottom: 20px; }
  .intro-text h1 { font-size: 26px; }
  .social-links { margin-top: 18px; }
  .publication { display: block; }
  .publication-media { margin-bottom: 14px; }
  .research-section { margin-bottom: 36px; }
  .site-footer { margin: 0 24px; padding: 20px 0; flex-direction: column; gap: 3px; }
}
@media (max-width: 360px) {
  .header-inner { gap: 10px; padding: 0 14px; }
  nav { gap: 12px; }
  .site-main { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .site-header, .site-footer, .social-links, video, .skip-link { display: none !important; }
  .site-main { padding: 0; }
  .intro { gap: 30px; }
  body { background: #fff; color: #000; }
}
