:root {
  color-scheme: light;
  --bg: #fbfaf8;
  --ink: #1f2422;
  --muted: #68706d;
  --line: #d9d6ce;
  --accent: #235f68;
  --accent-soft: #e7efef;
  --surface: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 248, 0.95);
  backdrop-filter: blur(12px);
}

.nav,
.hero,
.section,
.site-footer {
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  font-family: Lora, Georgia, serif;
  font-size: 1.16rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 600;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(260px, 340px);
  gap: clamp(58px, 10vw, 124px);
  align-items: center;
  padding: 82px 0 74px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.math {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

h1,
h2 {
  font-family: Lora, Georgia, serif;
  font-weight: 600;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3.35rem, 7.3vw, 6.25rem);
  line-height: 1;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 5px;
  font-size: 1.04rem;
  line-height: 1.35;
}

.subtitle {
  max-width: 680px;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 700;
}

.intro {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.button-row,
.button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
}

.portrait-frame {
  margin: 0;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.section {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: clamp(26px, 6vw, 78px);
  border-top: 1px solid var(--line);
  padding: 56px 0;
}

.section-label {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-content {
  max-width: 820px;
}

#research {
  width: min(1360px, calc(100% - 48px));
}

#research .section-content {
  max-width: 1120px;
}

.section-content > p {
  color: var(--muted);
  font-size: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  padding: 6px 11px;
  font-size: 0.86rem;
  font-weight: 700;
}

.research-accordion {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.research-item {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.research-row {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(220px, 1fr);
  gap: 34px;
  align-items: center;
}

.research-image {
  display: block;
  width: 100%;
  height: 178px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  object-fit: contain;
}

.research-image-crop {
  display: block;
  height: 178px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.research-image-crop .research-image {
  height: calc(100% + 12px);
  border: 0;
  border-radius: 0;
  transform: translateY(-12px);
}

.research-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.research-toggle::after {
  content: "+";
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
}

.research-toggle[aria-expanded="true"]::after {
  content: "−";
}

.research-panel {
  max-width: 760px;
  margin-left: calc(min(520px, 100%) + 34px);
  color: var(--muted);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.research-item.is-open .research-panel {
  max-width: min(100%, 1080px);
  margin-left: 0;
}

.research-panel[hidden] {
  display: block;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
}

.research-panel p {
  margin: 6px 0 0;
}

.research-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.9fr);
  gap: 12px;
  align-items: start;
  margin-top: 16px;
}

.research-panel-copy p:first-child {
  margin-top: 0;
}

.research-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 22px;
}

.research-gallery-single {
  max-width: 760px;
}

.research-panel-grid .research-gallery {
  margin: 0;
}

.research-panel-grid .research-gallery-single {
  max-width: none;
}

.research-panel-grid .research-gallery figcaption {
  max-width: 100%;
}

.research-gallery figure {
  margin: 0;
}

.research-panel-grid .research-gallery figure {
  display: flex;
  flex-direction: column;
}

.research-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.research-panel-grid .research-gallery img {
  flex: none;
  object-fit: contain;
}

.research-gallery figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.relevant-papers {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.relevant-papers span:first-child {
  font-weight: 800;
}

.relevant-papers a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.relevant-papers a:hover {
  text-decoration: underline;
}

.work-list,
.talk-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list li,
.talk-list li {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.work-list li:last-child,
.talk-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.work-list p,
.talk-list p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.text-links,
.talk-list article > a {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.text-links a,
.talk-list article > a,
.inline-cta {
  color: var(--accent);
  text-decoration: none;
}

.text-links a:hover,
.talk-list article > a:hover,
.inline-cta:hover {
  text-decoration: underline;
}

.inline-cta {
  display: inline-flex;
  margin-top: 24px;
  font-weight: 800;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 0 34px;
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .portrait-frame {
    width: min(340px, 100%);
  }
}

@media (max-width: 820px) {
  .nav,
  .hero,
  .section,
  .site-footer {
    width: min(100% - 36px, 700px);
  }

  .nav {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
  }

  .nav-toggle span:not(.sr-only) {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
  }

  .nav-links {
    position: absolute;
    top: 56px;
    right: 18px;
    display: none;
    width: min(280px, calc(100vw - 36px));
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    padding: 10px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 10px;
  }

  .hero {
    padding: 52px 0 58px;
  }

  .section {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 44px 0;
  }

  .section-label {
    margin-top: 0;
  }

  .research-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .research-panel {
    max-width: 100%;
    margin-left: 0;
  }

  .research-gallery {
    grid-template-columns: 1fr;
  }

  .research-panel-grid {
    grid-template-columns: 1fr;
  }

  .research-gallery-single {
    max-width: 100%;
  }

  .button-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 3.2rem;
  }

  .button-row,
  .button-grid,
  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .research-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .research-panel {
    margin-left: 0;
  }
}
