:root {
  --bg: #f6f7f5;
  --panel: #ffffff;
  --ink: #142028;
  --ink-2: #4a5963;
  --line: #dde3e1;
  --accent: #0b5f75;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0f3;
  --ok: #1c7a45;
  --ok-soft: #e3f3e9;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1518; --panel: #172025; --ink: #e6ecee; --ink-2: #9fb0b8; --line: #2a363c;
    --accent: #5cc3dc; --accent-ink: #0f1518; --accent-soft: #163640; --ok: #5fd08f; --ok-soft: #173326;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 0.9em; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-2); }

.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 6px 11px; border-radius: 8px; font-size: 0.95rem; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }

.hero {
  display: grid; grid-template-columns: 260px 1fr; grid-template-areas: "photo name" "photo body";
  column-gap: 40px; align-items: start; padding-top: 48px; padding-bottom: 24px;
}
.hero-name { grid-area: name; }
.hero-body { grid-area: body; }
/* The photo runs from the top of the letters of the name (0.27 em of the heading size) to the bottom of the
   link buttons: it stretches over both rows and is cropped to fit. */
.hero .photo {
  grid-area: photo; align-self: stretch; height: auto; aspect-ratio: auto; min-height: 0;
  margin-top: calc(clamp(2rem, 4vw, 2.9rem) * 0.27); object-fit: cover; object-position: 50% 30%;
}
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -0.015em; margin-bottom: 6px; }
.title { font-size: 1.25rem; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.place { font-size: 0.95rem; color: var(--ink-2); }
.photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.links a {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 13px; font-size: 0.93rem;
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.links svg { width: 16px; height: 16px; fill: currentColor; }

section.block { padding-top: 36px; }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feature { border: 2px solid var(--accent); display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: start; }
.feature .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--ok-soft); color: var(--ok); margin-left: 8px; vertical-align: 2px; }
.btn { display: inline-block; text-decoration: none; font-size: 0.92rem; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.card .meta { font-size: 0.88rem; color: var(--ink-2); margin-bottom: 8px; }
.card ul { margin: 0 0 10px; padding-left: 18px; color: var(--ink-2); font-size: 0.95rem; }
.project-list { display: flex; flex-direction: column; gap: 14px; }
.project { display: grid; grid-template-columns: minmax(240px, 1fr) 2.4fr; gap: 6px 40px; align-items: start; }
.project h3 { margin-bottom: 6px; }
.project .meta { margin-bottom: 0; }
.project-body > :last-child { margin-bottom: 0; }
.project-body ul { columns: 2; column-gap: 32px; }
.project-body li { break-inside: avoid; }
.refs { font-size: 0.88rem; margin: 0; }
.refs a { margin-right: 10px; white-space: nowrap; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.timeline .when { font: 600 0.85rem/1.4 var(--mono); color: var(--ink-2); }
.timeline .role { font-weight: 700; margin: 2px 0; }
.timeline p { margin: 0; color: var(--ink-2); font-size: 0.96rem; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 40px; }
.cols > * { min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font-size: 0.9rem; }

.prose { padding-top: 40px; overflow-wrap: break-word; }
.prose h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.prose h2 { font-size: 1.3rem; margin-top: 1.4em; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font: 600 1.3rem/1.3 var(--mono); }
.stat span { font-size: 0.85rem; color: var(--ink-2); }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font: 0.88rem/1.5 var(--mono); }

.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 22px 0 32px; font-size: 0.9rem; color: var(--ink-2); }
.site-footer p { margin: 0 0 4px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 112px 1fr; grid-template-areas: "photo name" "body body"; column-gap: 16px; row-gap: 18px; padding-top: 24px; }
  .hero-name { align-self: center; }
  .hero .photo { width: 112px; height: auto; aspect-ratio: 1; border-radius: 12px; align-self: center; margin-top: 0; }
  .hero h1 { font-size: 1.65rem; margin-bottom: 4px; }
  .hero .title { font-size: 1.02rem; margin-bottom: 0; }
  .cols { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .project-body ul { columns: 1; }
}
@media (max-width: 600px) {
  .header-row { flex-wrap: wrap; gap: 2px; padding-top: 10px; padding-bottom: 6px; }
  .nav { flex-wrap: nowrap; width: 100%; justify-content: space-between; margin: 0 -6px; }
  .nav a { padding: 4px 6px; font-size: 0.88rem; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .card { padding: 16px; }
}
