/* Self-hosted fonts (SIL Open Font License, see fonts/) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-ext-400.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-ext-500.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-ext-600.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-ext-400.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-ext-500.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #ffffff;
  --surface: #f7f9fc;
  --text: #0f1b2d;
  --muted: #52617a;
  --faint: #8a97ad;
  --line: #dde4ef;
  --accent: #1d4ed8;
  --accent-strong: #1e3a8a;
  --accent-soft: #e6eeff;
  --grid: rgba(29, 78, 216, 0.06);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2c;
  --text: #e6ecf5;
  --muted: #a3b1c7;
  --faint: #6b7a93;
  --line: #22304a;
  --accent: #6ea8ff;
  --accent-strong: #a8c8ff;
  --accent-soft: rgba(110, 168, 255, 0.16);
  --grid: rgba(110, 168, 255, 0.05);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center 60px; /* first line coincides with the header border */
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.mark { font-family: var(--mono); font-weight: 500; color: var(--text); }
.mark .path { color: var(--accent); }
nav a.active { color: var(--accent); }
.mark:hover { text-decoration: none; }
nav { display: flex; gap: 22px; font-size: 14px; }
nav a { color: var(--muted); }
nav a:hover { color: var(--accent); text-decoration: none; }
nav { align-items: center; }
.theme-toggle {
  display: grid; place-items: center; width: 32px; height: 32px; margin-left: 4px; padding: 0;
  background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 56px;
  align-items: center; padding: 56px 0;
  min-height: calc(100vh - 61px - 97px); /* viewport minus header and footer */
}
.prompt { font-family: var(--mono); font-size: 15px; color: var(--accent); margin: 0 0 10px; }
h1 {
  font-family: var(--serif); font-weight: 700; font-size: 64px; line-height: 1.05;
  letter-spacing: -0.015em; margin: 0 0 24px;
}
h1 em { font-style: normal; font-weight: 700; color: var(--accent); }
.role { list-style: none; padding: 0; font-size: 19px; color: var(--text); margin: 0 0 26px; line-height: 1.8; }
.role .t, .role .o { white-space: nowrap; }
.role .t::after { content: ", "; white-space: pre; }
.role .o { color: var(--muted); }
.interests {
  font-size: 17px; color: var(--muted); margin: 0 0 34px; text-wrap: balance;
  padding-left: 16px; border-left: 3px solid var(--accent);
}
.interests strong { color: var(--accent); font-weight: 500; white-space: nowrap; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500;
  padding: 11px 18px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover { color: #0b1220; }
.photo {
  width: 100%; justify-self: end; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -20px rgba(29, 78, 216, 0.45);
}
.photo img { width: 100%; height: auto; display: block; }

/* Sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
.label { font-family: var(--mono); font-size: 13px; color: var(--faint); margin: 0 0 6px; }
.label b { color: var(--accent); font-weight: 500; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 0 0 18px; letter-spacing: -0.005em; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { color: var(--muted); max-width: 680px; }



.works { list-style: none; margin: 24px 0 0; padding: 0; border: 1px solid var(--line); border-bottom: 0; }
.work {
  position: relative;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start;
  padding: 32px 24px; border-bottom: 1px solid var(--line); background: var(--bg);
  transition: background-color .2s;
}
.work::before {
  content: ""; position: absolute; left: 0; top: 32px; bottom: 32px; width: 3px;
  background: var(--accent); opacity: 0; transition: opacity .2s;
}
.work:hover::before { opacity: 1; }
.work .fig {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--line); padding: 10px;
  transition: border-color .2s, box-shadow .2s;
}
a.fig:hover { border-color: var(--accent); box-shadow: 0 10px 24px -14px rgba(29, 78, 216, .55); }
.work .fig img { display: block; max-width: 100%; max-height: 100%; }
.work .fig.placeholder {
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--surface);
}
.work .fig.placeholder span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); background: var(--surface); padding: 4px 8px; border: 1px solid var(--line);
}
.work .kind {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px;
}
.work .kind span { color: var(--faint); margin: 0 4px; }
.work h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; }
.work h3 a { color: var(--text); }
.work h3 a:hover { color: var(--accent); text-decoration: none; }
.work .authors { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.work .authors span { white-space: nowrap; }
.work .authors b { color: var(--text); font-weight: 600; }
.work .desc { font-size: 15px; color: var(--muted); margin: 0 0 14px; line-height: 1.65; }
.work .pending { font-size: 15px; color: var(--faint); margin: 0 0 14px; }
.work .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.chip {
  font-family: var(--mono); font-size: 12px; padding: 5px 12px;
  border: 1px solid var(--line); color: var(--text); background: transparent;
  transition: border-color .15s, color .15s, background-color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip.later { border-style: dashed; color: var(--faint); cursor: default; }
.chip.later:hover { border-color: var(--line); color: var(--faint); }
.abstract { margin-top: 12px; font-size: 14px; }
.abstract summary {
  cursor: pointer; color: var(--accent); font-family: var(--mono); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; width: max-content;
}
.abstract p { color: var(--muted); margin: 12px 0 0; line-height: 1.7; padding-left: 14px; border-left: 2px solid var(--line); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 28px; align-items: stretch; }
.tl-col { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--bg); padding: 26px 28px 6px; }
.tl-col h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.profile { padding-bottom: 26px; }
.profile .lead { max-width: none; font-size: 16px; line-height: 1.75; color: var(--text); margin: 0; }
.profile .lead + .lead { margin-top: 14px; }
.affiliations { padding-bottom: 26px; }
.logo-grid { flex: 1; background: #fff; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; min-height: 220px; }
.logo-cell { display: flex; align-items: center; justify-content: center; padding: 20px; }
.logo-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.logo-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.logo-cell img { max-width: 100%; max-height: 60px; object-fit: contain; }
.tl-stack { display: flex; flex-direction: column; gap: 28px; }
.tl-stack > .tl-col:last-child { flex: 1; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 22px 30px; }
.tl li::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: -4px; width: 1px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li::after {
  content: ""; position: absolute; left: 0; top: 4px; width: 11px; height: 11px;
  border: 2px solid var(--accent); background: var(--bg); box-sizing: border-box;
}
.tl li.now::after { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl p { margin: 0; }
.tl .when { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.tl .t { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4; }
.tl .o { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* Subpages */
.note { font-family: var(--mono); font-size: 12px; color: var(--faint); margin: 20px 0 0; }
.page-head { padding: 64px 0 0; }
.page-head .lead { margin: 0; }
.page-head h1 { font-size: 44px; margin-bottom: 12px; }
.page-body { padding: 32px 0 72px; } /* same headline-to-content gap on every page */
.page-body .works { margin-top: 0; }

footer { background: var(--bg); border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--faint); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; }
footer a { color: var(--faint); }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 32px 0 48px; min-height: 0; }
  .photo { order: -1; max-width: 420px; justify-self: start; }
}

@media (max-width: 760px) {
  nav { gap: 16px; }
  h1 { font-size: 44px; margin-bottom: 18px; }
  .role { font-size: 17px; line-height: 1.45; }
  .role li { margin-bottom: 10px; }
  .role .t, .role .o { display: block; white-space: normal; }
  .role .o { font-size: 15px; }
  .role .t::after { content: none; }
  .interests { font-size: 16px; }
  .page-head { padding-top: 40px; }
  .page-head h1 { font-size: 36px; }
  .work { grid-template-columns: 1fr; gap: 18px; padding: 28px 16px; }
  .work::before { display: none; }
  .work .fig { max-width: 420px; }
  .work .fig.placeholder { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .tl-stack { gap: 20px; }
  .tl-col { padding: 22px 18px 4px; }
  .profile, .affiliations { padding-bottom: 22px; }
  .logo-grid { min-height: 0; grid-template-rows: 100px 100px; }
  .wrap { padding: 0 16px; }
  footer .wrap { flex-direction: column; }
}

@media (max-width: 440px) {
  nav { gap: 12px; font-size: 13px; }
  .theme-toggle { width: 30px; height: 30px; margin-left: 0; }
}

/* Home: keep the four contact buttons on one line on phones */
@media (max-width: 760px) {
  .hero .links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .hero .links .btn { justify-content: center; gap: 5px; padding: 10px 4px; font-size: 13px; white-space: nowrap; }
  .hero .links .btn svg { width: 14px; height: 14px; flex: none; }
}
@media (max-width: 360px) {
  .hero .links .btn svg { display: none; }
}
