/* ---------- Theme ---------- */
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --ink: #141b26;
  --muted: #5a6575;
  --line: #e2e7ed;
  --accent: #4a7299;
  --accent-soft: #e8eff6;
  --sage: #6f8a6c;
  --sidebar-w: 260px;
  --radius: 14px;
  --font-head: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; }
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 32px 28px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 40px;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px; letter-spacing: .04em;
}
.brand-text { font-weight: 600; letter-spacing: .02em; font-size: 15px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

.sidebar-foot { margin-top: auto; font-size: 13px; color: var(--muted); }
.sidebar-foot > a { color: var(--muted); word-break: break-all; }
.social { display: flex; gap: 14px; margin-top: 10px; }
.social a { color: var(--muted); font-weight: 500; }
.social a:hover { color: var(--accent); }

.menu-toggle { display: none; }
.nav .cv-mobile { display: none; }

/* ---------- Main ---------- */
main {
  margin-left: var(--sidebar-w);
  padding: 0 64px;
  max-width: calc(var(--sidebar-w) + 1100px);
}
section { padding: 88px 0 24px; }
section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.section-intro { color: var(--muted); max-width: 680px; margin: -8px 0 28px; font-size: 17px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  align-items: center;
  padding-top: 96px;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em;
  font-size: 12px; font-weight: 600; color: var(--sage); margin: 0 0 12px;
}
.hero h1 { font-size: clamp(44px, 6vw, 68px); font-weight: 700; letter-spacing: -.02em; }
.tagline { font-size: 20px; color: var(--muted); margin: 18px 0 0; }
.lead { font-size: 17px; max-width: 560px; margin: 24px 0 0; }
.hero-actions { display: flex; gap: 12px 16px; align-items: center; margin: 32px 0 0; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 8px;
  font-weight: 600; font-size: 16px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3d6286; text-decoration: none; }
.btn-link { color: var(--ink); font-weight: 600; }
.btn-outline {
  padding: 12px 20px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 15px;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.hero-photo {
  margin: 0; position: relative;
  aspect-ratio: 4 / 5;
  width: 100%; max-width: 340px; justify-self: end;
  border-radius: 20px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -24px rgba(20, 40, 70, .25);
}
.hero-photo img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block;
}
.photo-fallback {
  position: absolute; inset: 10px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-soft), #dfe8df);
  color: var(--accent); font-size: 64px; font-weight: 700;
}

/* ---------- Cards ---------- */
.cards { display: grid; gap: 20px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card-kicker {
  text-transform: uppercase; letter-spacing: .1em; font-size: 12px !important;
  font-weight: 600; color: var(--sage) !important; margin-bottom: 8px !important;
}
.audience { border-top: 3px solid var(--accent); }

/* ---------- Projects ---------- */
.project {
  display: grid; grid-template-columns: 340px 1fr; gap: 32px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  align-items: start;
}
.project.no-img { grid-template-columns: 1fr; }
.project-img { margin: 0; }
.project-img img, .inline-img img {
  width: 100%; display: block; border-radius: 10px; object-fit: cover;
}
.project-img img { aspect-ratio: 4 / 3; }
.project-img.logo img { aspect-ratio: auto; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.inline-img { margin: 16px 0 0; max-width: 360px; }
.project-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
}
.project h3 { font-size: 21px; margin-bottom: 10px; }
.project p { margin: 0 0 12px; color: var(--muted); max-width: 760px; }
details { margin-top: 4px; }
summary {
  cursor: pointer; font-weight: 600; color: var(--accent); font-size: 15px;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 18px; line-height: 1; }
details[open] summary::after { content: "–"; }
details[open] > *:not(summary) { margin-top: 12px; }
details ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); max-width: 760px; }
details li { margin-bottom: 6px; }
.status-book { background: #f1ece3; color: #7a6440; }
.pub-summary { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.status {
  align-self: flex-start; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.status-active { background: #e6efe5; color: #4b6b48; }
.status-done { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Publications ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li {
  display: grid; grid-template-columns: 70px 1fr; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.pubs li.hidden { display: none; }
.pub-year { color: var(--muted); font-weight: 600; font-size: 15px; }
.pub-title { margin: 0 0 4px; font-weight: 600; }
.pub-title a { color: var(--ink); }
.pub-detail { margin: 0; color: var(--muted); font-size: 15px; }
.more { margin-top: 20px; font-weight: 500; }

/* ---------- Contact ---------- */
.email-block { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 28px; }
.email-address {
  font-family: var(--font-head); font-weight: 700; font-size: clamp(22px, 3vw, 30px);
  color: var(--ink); letter-spacing: -.01em; word-break: break-all;
}
.email-address:hover { color: var(--accent); text-decoration: none; }
.copy-email {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.copy-email:hover { border-color: var(--accent); color: var(--accent); }
.contact-hint { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.contact-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.contact-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-weight: 600;
  transition: border-color .15s, transform .15s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.contact-card .arrow { color: var(--accent); }

footer { padding: 72px 0 40px; color: var(--muted); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  main { padding: 0 40px; }
  .cards.three, .cards.four, .contact-options { grid-template-columns: 1fr 1fr; }
  .project { grid-template-columns: 1fr; }
  .project-img img { aspect-ratio: 16 / 9; }
  .project-img.logo img { aspect-ratio: auto; }
  .book-stage { aspect-ratio: 16 / 9; }
  .book-title { font-size: 26px; }
}

@media (max-width: 860px) {
  .sidebar {
    inset: 0 0 auto 0; width: auto; height: auto;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 12px 16px; gap: 0;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .menu-toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: 0; padding: 8px; cursor: pointer;
  }
  .menu-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .sidebar.open .nav { display: flex; }
  .sidebar-foot { display: none; }
  .nav .cv-mobile { display: block; }

  main { margin-left: 0; padding: 64px 16px 0; }
  html { scroll-padding-top: 72px; }
  section { padding-top: 56px; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 32px; padding-top: 24px; }
  .hero-photo { order: -1; max-width: 220px; justify-self: start; }
  .cards.three, .cards.four, .cards.two, .contact-options { grid-template-columns: 1fr; }
  .project { gap: 16px; padding: 18px; }
  .btn-outline { padding: 10px 14px; font-size: 14px; }
  .hero-actions { gap: 12px; }
  .pubs li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- CV link ---------- */
.sidebar-foot .cv-pill {
  display: flex; width: fit-content; align-items: center; gap: 6px;
  margin-bottom: 16px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-weight: 600; font-size: 14px; word-break: normal;
  transition: border-color .15s, color .15s;
}
.sidebar-foot .cv-pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Field Ethics book card ---------- */
.book-stage {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #eef2ea, #e3e9ef);
}
.book {
  position: relative; overflow: hidden;
  height: 84%; aspect-ratio: 2 / 3;
  padding: 9% 9% 8%;
  display: flex; flex-direction: column;
  background: #3f5a48; color: #f3efe4;
  border-radius: 3px 6px 6px 3px;
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, .14), 0 14px 28px -12px rgba(20, 40, 30, .45);
}
.book-contours {
  position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: #c9b98a; stroke-width: 1.2; opacity: .55;
}
.book p { position: relative; margin: 0; color: inherit; max-width: none; }
.book-title {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1; letter-spacing: -.01em;
}
.book-sub { font-size: 10px; line-height: 1.35; margin-top: 8px !important; opacity: .85; }
.book-author {
  margin-top: auto !important;
  font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.book-press { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-top: 3px !important; }

/* ---------- Research keywords ---------- */
/* Every label has a left divider; the negative margin and clip hide the one
   that starts each line, so wrapped lines never begin with a stray divider. */
.keywords {
  list-style: none; margin: 0 0 18px -17px; padding: 0;
  display: flex; flex-wrap: wrap; row-gap: 8px;
  clip-path: inset(0 0 0 17px);
}
.keywords li {
  font-size: 15px; font-weight: 600; color: var(--ink);
  padding: 0 16px; border-left: 1px solid #c5ccd5; line-height: 1.1;
}
.keywords + .section-intro { margin-top: 0; }
