:root {
  color-scheme: light dark;
  --header-height: 66px;
  --page-width: 1240px;
  --bg: #fff;
  --surface: #f7f7f8;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --link: #047857;
  --header: #fff;
  --header-text: #27272a;
  --hero-text: #f4f4f5;
  --paper-bg: #fafafa;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #18181b;
    --surface: #242427;
    --text: #f4f4f5;
    --muted: #d4d4d8;
    --border: #3f3f46;
    --link: #34d399;
    --header: #27272a;
    --header-text: #f4f4f5;
    --paper-bg: #18181b;
    --shadow: none;
  }
}

html[data-theme="dark"] {
  --bg: #18181b;
  --surface: #242427;
  --text: #f4f4f5;
  --muted: #d4d4d8;
  --border: #3f3f46;
  --link: #34d399;
  --header: #27272a;
  --header-text: #f4f4f5;
  --paper-bg: #18181b;
  --shadow: none;
}

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }
body {
  width: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.menu-open { overflow: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.site-header {
  position: sticky;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-height);
  color: var(--header-text);
  background: color-mix(in srgb, var(--header) 96%, transparent);
  box-shadow: 0 1px 0 rgba(127, 127, 127, .08);
  backdrop-filter: blur(12px);
}
.nav {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 12px;
}
.brand {
  justify-self: start;
  color: inherit;
  font-size: 20px;
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 48px;
  height: 100%;
}
.nav-links a {
  display: grid;
  place-items: center;
  height: 100%;
  color: inherit;
  font-weight: 700;
}
.nav-links a:hover { color: var(--link); text-decoration: none; }
.nav-actions {
  justify-self: end;
  display: flex;
  gap: 20px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 38px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.icon-button svg {
  width: 19px;
  height: 19px;
  max-width: 19px;
  max-height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: none; }
html[data-theme="dark"] .moon-icon { display: block; }
.menu-button { display: none; }

.bio-section {
  position: relative;
  isolation: isolate;
  min-height: 610px;
  color: var(--hero-text);
  overflow: hidden;
}
.mountain-background {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: #173e76 url("/site-assets/media/bg.svg") center center / cover no-repeat;
}
.bio-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 650px);
  align-items: center;
  justify-content: center;
  gap: clamp(48px, 6vw, 90px);
  width: min(calc(100% - 48px), 1000px);
  min-height: 610px;
  margin: 0 auto;
  padding: 72px 0 62px;
}
.profile {
  min-width: 0;
  text-align: center;
}
.avatar {
  width: 158px;
  height: 158px;
  margin: 0 auto 14px;
  object-fit: cover;
  border: 4px solid #24272b;
  border-radius: 50%;
}
.profile h1 {
  margin: 0 0 4px;
  font-size: 29px;
  line-height: 1.1;
}
ruby { ruby-position: over; }
rt { font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.role, .organization { margin: 0; font-weight: 700; }
.role { margin-top: 12px; }
.organization { margin-top: 4px; white-space: nowrap; }
.profile-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 13px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.profile-links a { display: grid; place-items: center; color: inherit; }
.profile-links a { width: 20px; height: 20px; }
.profile-links svg { width: 18px; height: 18px; max-width: 18px; max-height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; }
.biography {
  width: 100%;
  min-width: 0;
  max-width: 650px;
  margin-top: 2px;
}
.biography h2 {
  margin: 0 0 24px;
  font-size: 25px;
  line-height: 1.2;
}
.biography > p {
  margin: 0;
  color: #dbe3ef;
  font-size: 17px;
  line-height: 1.68;
}
.bio-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(32px, 5vw, 66px);
  margin-top: 24px;
}
.bio-details h3 {
  margin: 0 0 12px;
  font-size: 21px;
}
.interest-list {
  margin: 0;
  padding-left: 39px;
  color: #dbe3ef;
  font-size: 17px;
  line-height: 1.7;
}
.education-list { margin: 0; padding: 0; list-style: none; }
.education-list li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 12px;
}
.education-list svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  margin-top: 2px;
  fill: none;
  stroke: #dbe3ef;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.education-list span { display: grid; }
.education-list strong { color: #dbe3ef; font-size: 16px; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
.education-list small { color: #dbe3ef; font-size: 14px; }

.home-section { padding: 94px 24px; background: var(--paper-bg); }
.section-container { width: min(100%, var(--page-width)); margin: 0 auto; }
.home-section h2 { margin: 0 0 56px; text-align: center; font-size: 32px; line-height: 1.2; }
.citation { max-width: 980px; margin: 0 auto; }
.citation p { margin: 0; font-size: 17px; }
.paper-links { display: flex; gap: 16px; margin-top: 14px; }
.paper-links a {
  padding: 5px 10px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
}
.reports-section { background: var(--bg); }
.section-intro {
  max-width: 720px;
  margin: -34px auto 32px;
  color: var(--muted);
  text-align: center;
}
.report-list {
  display: grid;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}
.report-item,
.empty-state {
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.report-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}
.report-label {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  color: var(--link);
  background: color-mix(in srgb, var(--link) 12%, transparent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.report-item h3,
.empty-state h3 { margin: 14px 0 8px; font-size: 21px; }
.report-item p,
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.report-authors { font-size: 15px; }
.report-authors strong { color: var(--text); }
.report-byline {
  max-width: none;
  font-size: 15px;
  line-height: 1.65;
}
.report-byline strong { color: var(--text); }
.report-article { margin-bottom: 32px; }
.projects-section { background: var(--bg); }
.project-list { display: grid; gap: 28px; max-width: 850px; margin: 0 auto; }
.project-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  color: var(--text);
}
.project-item:hover { text-decoration: none; }
.project-item img { width: 120px; height: 72px; object-fit: contain; border-radius: 5px; }
.project-item span { display: grid; gap: 8px; }
.project-item strong { font-size: 21px; }
.project-item small { color: var(--muted); font-size: 16px; }
.site-footer { padding: 38px 20px; text-align: center; color: var(--muted); background: var(--paper-bg); font-size: 14px; }

.search-dialog {
  width: min(680px, calc(100% - 30px));
  margin-top: 12vh;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
}
.search-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(3px); }
.search-box { position: relative; display: grid; gap: 14px; padding: 28px; }
.search-box label { font-size: 24px; font-weight: 700; }
.search-box input { width: 100%; padding: 13px 15px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; }
.search-close { position: absolute; top: 12px; right: 14px; font-size: 28px; }
.search-results { display: grid; gap: 8px; }
.search-results a { padding: 9px 10px; color: var(--text); background: var(--bg); border-radius: 4px; }

/* Shared inner-page components */
.shell { width: min(calc(100% - 40px), 1120px); margin: 0 auto; }
body:not(.home-page) main { min-height: calc(100vh - var(--header-height) - 110px); }
.hero { padding: 70px 0 30px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.hero-copy, .profile-card, .entry, .rich-text, .card { padding: 28px; }
.hero-copy h1 { margin: 8px 0 14px; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; }
.eyebrow, .pill { display: inline-flex; padding: 5px 10px; color: var(--link); background: color-mix(in srgb, var(--link) 12%, transparent); border-radius: 999px; font-size: 14px; }
.lead, .card p, .entry p, .rich-text p, .rich-text li, .muted { color: var(--muted); }
.section { padding: 30px 0; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.card.wide { grid-column: 1 / -1; }
.card img, .rich-text > img, .media-frame img { width: 100%; border-radius: 5px; }
.card img[src*="/media/project/"],
.profile-card img[src*="/media/project/"] {
  width: min(180px, 100%);
  height: 110px;
  margin-inline: auto;
  object-fit: contain;
}
.card h2, .card h3 { margin: 16px 0 10px; }
.button-row, .tag-list, .meta-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.button { display: inline-flex; padding: 8px 13px; color: var(--text); border: 1px solid var(--border); border-radius: 5px; }
.button:hover { text-decoration: none; border-color: var(--link); }
.button.primary { color: white; background: #047857; border-color: #047857; }
.hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 22px; }
.stack { display: grid; gap: 18px; }
.entry-header, .section-head { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.rich-text { margin-bottom: 30px; }
.rich-text h2 { margin-top: 34px; }
.rich-text pre { overflow: auto; padding: 18px; color: #e4e4e7; background: #27272a; border-radius: 5px; }
.note { padding: 14px 16px; color: #713f12; background: #fef3c7; border-left: 4px solid #f59e0b; }
.media-frame { margin: 20px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.footer { padding: 35px 0; color: var(--muted); }

@media (max-width: 900px) {
  .bio-section { min-height: 0; }
  .bio-layout {
    grid-template-columns: minmax(0, 680px);
    gap: 48px;
    width: min(calc(100% - 48px), 680px);
    min-height: 0;
    padding: 64px 0 72px;
  }
  .profile { width: min(100%, 320px); margin: 0 auto; }
  .biography { max-width: 680px; margin: 0 auto; }
  .biography h2 { text-align: center; }
  .biography > p { text-align: left; }
  .bio-details { gap: 44px; }
}

@media (max-width: 760px) {
  :root { --header-height: 58px; }
  .nav { grid-template-columns: 1fr auto; padding: 0 16px; }
  .menu-button {
    position: absolute;
    top: 10px;
    right: 16px;
    display: grid;
  }
  .nav-actions { display: none; }
  .nav-links {
    position: fixed;
    inset: var(--header-height) 0 auto;
    display: none;
    height: auto;
    padding: 18px 20px 22px;
    background: var(--header);
    box-shadow: 0 12px 20px rgba(0,0,0,.2);
  }
  .nav-links.open { display: grid; gap: 4px; }
  .nav-links a { justify-content: start; height: 42px; }
  .bio-layout {
    width: min(calc(100% - 34px), 650px);
    gap: 46px;
    padding: 54px 0 64px;
  }
  .profile { width: 100%; }
  .biography { width: 100%; max-width: 100%; }
  .biography > p { max-width: 100%; overflow-wrap: break-word; }
  .organization { white-space: normal; }
  .home-section { padding: 66px 20px; }
  .home-section h2 { margin-bottom: 36px; }
  .section-intro { margin-top: -18px; }
  .report-meta { display: grid; gap: 8px; }
  .report-item, .empty-state { padding: 22px 20px; }
  .project-item { grid-template-columns: 84px minmax(0, 1fr); gap: 15px; }
  .project-item img { width: 84px; height: 56px; }
  .cards, .hero-grid { grid-template-columns: 1fr; }
  .entry-header, .section-head { display: grid; }
}

@media (max-width: 420px) {
  .avatar { width: 145px; height: 145px; }
  .biography > p { font-size: 16px; }
}

@media (max-width: 600px) {
  .bio-details { grid-template-columns: 1fr; gap: 28px; }
  .interest-list { padding-left: 28px; }
  .education-list strong { font-size: 15px; }
  .home-section { padding-inline: 17px; }
  .citation p { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
