:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #14181b;
  --muted: #5d6670;
  --faint: #8a929a;
  --line: #e3e1d9;
  --accent: #1d6a4e;      /* forest green — sustainability */
  --accent-ink: #ffffff;
  --accent-2: #1b3d6d;    /* navy */
  --accent-soft: #e2efe7;
  --glow: rgba(29, 106, 78, .10);
  --shadow: 0 1px 2px rgba(20, 30, 25, .04), 0 8px 24px -8px rgba(20, 30, 25, .08);
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1312; --surface: #161b19; --surface-2: #1c2320; --text: #e9ece9;
    --muted: #9aa49f; --faint: #6f7a75; --line: #262e2a;
    --accent: #7fd0a9; --accent-ink: #0f1312; --accent-2: #a9c2ea; --accent-soft: #1d2d25;
    --glow: rgba(127, 208, 169, .08); --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1312; --surface: #161b19; --surface-2: #1c2320; --text: #e9ece9;
  --muted: #9aa49f; --faint: #6f7a75; --line: #262e2a;
  --accent: #7fd0a9; --accent-ink: #0f1312; --accent-2: #a9c2ea; --accent-soft: #1d2d25;
  --glow: rgba(127, 208, 169, .08); --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--glow), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 16.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- layout ---------- */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 32px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 64px;
}
.main > section { margin-top: 80px; }

.label {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint);
}

/* section headings: number + serif title + hairline */
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.sec-head .num { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: .08em; }
.sec-head h2 {
  font: 500 27px/1.2 var(--serif);
  letter-spacing: -.01em;
  color: var(--text);
}
.sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; }

/* ---------- hero ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 13px; color: var(--muted);
}
.dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: #2fa36b; box-shadow: 0 0 0 4px rgba(47, 163, 107, .18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(47, 163, 107, .05); } }
.hero h1 {
  font: 500 clamp(38px, 5.2vw, 56px)/1.08 var(--serif);
  letter-spacing: -.02em;
  color: var(--accent-2);
}
.hero h1 .phd { font-style: italic; color: var(--accent); }
.tagline {
  margin: 16px 0 0;
  font: 500 12.5px/1.6 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.summary { margin: 24px 0 0; font-size: 18.5px; line-height: 1.65; max-width: 62ch; }
.summary em {
  font-style: normal; font-weight: 600; color: var(--accent);
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
}
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 0; font-size: 13.5px; color: var(--muted); }
.facts span::before { content: "✓"; color: var(--accent); margin-right: 7px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14.5px; font-weight: 500;
  transition: border-color .15s, transform .15s, background .15s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 48px !important;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 20px 20px 18px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat b { display: block; font: 500 36px/1 var(--serif); color: var(--accent); }
.stat span { display: block; margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:has(.stretch):hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -12px rgba(20, 60, 40, .18);
}
.kind { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.card h3 { margin-top: 10px; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.card h3, .card h3 a { color: var(--text); }
.card h3 a:hover { text-decoration: none; }
/* whole card is clickable; interactive bits sit above the overlay */
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card details, .card .tags { position: relative; z-index: 1; }
.card p { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
details { margin-top: 10px; }
summary {
  display: inline-block; cursor: pointer; list-style: none;
  font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
summary:hover { color: var(--text); }
summary::-webkit-details-marker { display: none; }
summary::after { content: " +"; }
details[open] summary::after { content: " −"; }
details p { font-size: 14px !important; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.cta {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13.5px; font-weight: 600;
  transition: background .2s, color .2s;
}
.tags + .cta { margin-top: 18px; }
.cta i { font-style: normal; transition: transform .2s; }
.card:hover .cta { background: var(--accent); color: var(--accent-ink); }
.card:hover .cta i { transform: translate(2px, -2px); }

/* ---------- experience ---------- */
.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.jobs li:first-child { padding-top: 0; }
.when { font: 500 12.5px/1.9 var(--mono); color: var(--faint); }
.what h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.what .org { font-size: 14px; color: var(--accent-2); margin-top: 2px; }
.what .where { color: var(--muted); white-space: nowrap; }
.what .where::before { content: "· "; }
.what p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }

.sub-head { margin: 36px 0 14px; font: 500 20px/1.2 var(--serif); }
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.edu-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.edu-item h4 { margin-top: 4px; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.edu-item p { margin: 6px 0 0; font-size: 13.5px; color: var(--accent-2); line-height: 1.45; }
.edu-item small { color: var(--muted); font-size: 12.5px; }
.yr { font: 500 12px/1.6 var(--mono); color: var(--faint); }

/* ---------- expertise bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.tile {
  grid-column: span 2;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.tile.wide { grid-column: span 3; }
.tile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.ico svg { width: 20px; height: 20px; }
.tile h3 { font-size: 15.5px; font-weight: 600; }
.tile-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-size: 13px; line-height: 1.3; padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); color: var(--text);
}
.chips li.soft { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

/* ---------- publications (one line each) ---------- */
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pubs a {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 18px; gap: 16px; align-items: center;
  padding: 13px 10px; margin: 0 -10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: background .15s;
}
.pubs a:hover { text-decoration: none; background: var(--surface); }
.pubs .t { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pubs a:hover .t { color: var(--accent); }
.venue { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.arr { color: var(--faint); transition: transform .15s, color .15s; }
.pubs a:hover .arr { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- service ---------- */
.service { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.service li {
  font-size: 14px; line-height: 1.45;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px;
}
.role { display: block; margin-bottom: 4px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.service a { font-weight: 600; }
.desc { display: block; color: var(--muted); }

.footer {
  grid-column: 1 / -1;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--muted);
}
.footer a { color: var(--muted); }

/* ---------- sidebar: sticky profile card ---------- */
.side {
  position: sticky; top: 32px; align-self: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px;
  box-shadow: var(--shadow);
}
.profile { display: flex; flex-direction: column; gap: 14px; }
.photo {
  width: 120px; height: 120px; border-radius: 20px;
  overflow: hidden; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line);
}
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.initials { color: #fff; font-size: 36px; font-weight: 600; }
.who { display: flex; flex-direction: column; line-height: 1.4; }
.who b { font: 600 18px/1.25 var(--serif); }
.who span { font-size: 14px; color: var(--muted); }
.who .loc::before { content: "⌖ "; }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.side-actions .btn { padding: 9px 8px; font-size: 13.5px; }
.contact { list-style: none; margin: 16px 0 0; padding: 0; font-size: 13.5px; }
.contact li { display: flex; align-items: center; gap: 10px; margin: 6px 0; color: var(--muted); min-width: 0; }
.contact svg { flex: none; }
.contact a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .label { margin: 22px 0 10px; }
.toc { display: flex; flex-direction: column; }
.toc a {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 13.5px; color: var(--muted);
  padding: 5px 0 5px 12px; border-left: 2px solid var(--line);
  transition: color .15s, border-color .15s;
}
.toc a span { font: 500 10.5px/1 var(--mono); color: var(--faint); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.toc a.active span { color: var(--accent); }
.langs p { margin: 0; font-size: 13px; line-height: 1.6; }
.langs small { color: var(--faint); font-size: 11.5px; }

/* ---------- theme toggle ---------- */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 10;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: grid; place-items: center; cursor: pointer;
}
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .tile, .tile.wide { grid-column: span 3; }
  .tile:last-child { grid-column: span 6; }
}
@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; gap: 32px; padding: 64px 20px 32px; }
  .side { position: static; order: -1; display: grid; grid-template-columns: auto 1fr; gap: 0 20px; align-items: center; }
  .profile { grid-row: span 2; }
  .profile .who { display: none; }
  .photo { width: 104px; height: 104px; }
  .side-actions { margin-top: 0; }
  .toc, .langs { display: none; }
  .main > section { margin-top: 64px; }
}
@media (max-width: 640px) {
  .page { padding: 64px 16px 28px; }
  .side { grid-template-columns: 1fr; padding: 18px; }
  .profile { grid-row: auto; flex-direction: row; align-items: center; }
  .profile .who { display: flex; }
  .profile .who b { display: none; }  /* name is already in the hero */
  .who span { font-size: 15px; }
  .photo { width: 72px; height: 72px; border-radius: 16px; }
  .side-actions { margin-top: 16px; }
  .cards, .edu, .service { grid-template-columns: 1fr; }
  .tile, .tile.wide, .tile:last-child { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat b { font-size: 32px; }
  .summary { font-size: 17px; }
  .sec-head h2 { font-size: 24px; }
  .jobs li { grid-template-columns: 1fr; gap: 2px; }
  .pubs a { grid-template-columns: 1fr 18px; gap: 2px 12px; }
  .pubs .yr { grid-column: 1; }
  .pubs .t { grid-column: 1; white-space: normal; }
  .pubs .venue { grid-column: 1; }
  .pubs .arr { grid-column: 2; grid-row: 1 / 4; }
}

/* short laptop screens: keep the sticky card within the viewport */
@media (min-width: 961px) and (max-height: 760px) {
  .side { top: 16px; padding: 18px; }
  .photo { width: 92px; height: 92px; }
  .langs { display: none; }
}

@media print {
  body { background: #fff; }
  .theme-toggle, .side-actions, .toc, .cta { display: none; }
  .page { display: block; padding: 0; }
  .side { position: static; box-shadow: none; margin-top: 24px; }
  .reveal { opacity: 1; transform: none; }
}
