:root {
  color-scheme: light;
  --background: #fff;
  --text: #25282b;
  --muted: #626870;
  --accent: #245e91;
  --rule: #e4e7ea;
  --surface: #f4f6f8;
  --protein-opacity: .3;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #151a20;
  --text: #e2e6eb;
  --muted: #a2adb9;
  --accent: #8bbcf2;
  --rule: #323a44;
  --surface: #212832;
  --protein-opacity: .2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #151a20;
    --text: #e2e6eb;
    --muted: #a2adb9;
    --accent: #8bbcf2;
    --rule: #323a44;
    --surface: #212832;
    --protein-opacity: .2;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; background: var(--background); color: var(--text); font: 1rem/1.65 var(--font); text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
a:focus-visible, .theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
.page { max-width: 920px; margin-inline: auto; padding: 0 2rem; }
.skip-link { position: absolute; top: -6rem; left: 1rem; padding: .65rem 1rem; background: var(--background); z-index: 1; }
.skip-link:focus { top: 1rem; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding-block: 1.3rem; border-bottom: 1px solid var(--rule); }
.site-title { margin: 0; font-size: 1.15rem; line-height: inherit; }
.site-name { color: var(--text); font-weight: 650; text-decoration: none; letter-spacing: -.02em; font-size: 1.15rem; }
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font: inherit; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
h1, h2, h3, h4 { line-height: 1.4; }
h1 { font-size: clamp(1.8rem, 4vw, 2.25rem); letter-spacing: -.035em; font-weight: 600; margin: 0 0 1.25rem; }
h2 { font-size: 1.35rem; letter-spacing: -.025em; margin: 0; font-weight: 600; }
p { margin: 0 0 1rem; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 216px; align-items: start; gap: 2rem; padding-block: 2rem; }
.intro-copy { min-width: 0; overflow-wrap: anywhere; }
.intro p { margin-bottom: .7rem; }
.intro-copy > :last-child { margin-bottom: 0; }
.headshot { display: block; width: 216px; max-width: 100%; height: auto; border-radius: 8px; }
.placeholder { color: var(--muted); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; border-bottom: 1px solid var(--rule); padding-bottom: .65rem; }
.section-link { color: var(--muted); font-size: .875rem; }
.year-group { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1.25rem; padding-top: 1.2rem; }
.year { color: var(--muted); font-size: .875rem; font-weight: 500; margin: .2rem 0 0; font-variant-numeric: tabular-nums; }
.paper { margin-bottom: 1.15rem; }
.paper h4 { font-size: 1.0625rem; font-weight: 550; margin: 0 0 .25rem; }
.paper h4 a { text-decoration: none; }
.paper h4 a:hover { text-decoration: underline; }
.authors { color: var(--muted); font-size: .875rem; line-height: 1.55; margin: 0 0 .2rem; }
.authors strong { color: var(--text); font-weight: 600; }
.venue { font-size: .875rem; margin: 0; }
.tag { color: var(--muted); white-space: nowrap; }
.tag::before { content: "· "; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--muted); border-top: 1px solid var(--rule); padding-block: 1rem 1.5rem; margin-top: 1rem; font-size: .875rem; }
.site-footer a { color: var(--muted); }
.blog-main { min-height: 55vh; padding-block: 3.5rem; }
.post-list { list-style: none; padding: 0; }
.post-list li { padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.post-list time, .post-date { display: block; font-size: .875rem; color: var(--muted); }
.post h2 { margin: 2rem 0 1rem; }
.post img { max-width: 100%; height: auto; }
.post pre { overflow-x: auto; padding: 1rem; background: var(--surface); }
.post blockquote { margin-inline: 0; padding-left: 1.25rem; border-left: 2px solid var(--rule); color: var(--muted); }
@media (max-width: 640px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .headshot { grid-row: 1; }
}
@media (max-width: 540px) {
  .page { padding-inline: 1.25rem; }
  .site-header { padding-block: 1rem; gap: 1rem; flex-wrap: wrap; }
  nav { gap: 1.1rem; }
  .blog-main { padding-block: 2.5rem; }
  .intro { padding-block: 1.5rem; }
  .year-group { grid-template-columns: 1fr; gap: .65rem; padding-top: 1rem; }
  .year { margin: 0; }
  .paper { margin-bottom: 1rem; }
}
@media (pointer: coarse) {
  .theme-toggle { width: 44px; height: 44px; }
}
