:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --ink: #202c27;
  --muted: #505e57;
  --accent: #245e50;
  --line: #d7dbd1;
  --portrait-bg: #eff1e8;
  --header-height: 3.75rem;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 1rem); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.25rem/1.65 var(--sans);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

p { margin: 0; }

.page-width {
  width: min(100% - 4rem, 60rem);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.site-name {
  flex: none;
  color: var(--ink);
  font: 1.375rem/1.2 var(--serif);
  text-decoration: none;
}

.site-name:hover { color: var(--accent); }

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(0.65rem, 3vw, 1.6rem);
  row-gap: 0;
}

nav a {
  color: var(--muted);
  padding-block: 0.45rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

nav a:hover { text-decoration: underline; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 36rem) clamp(9rem, 21vw, 15rem);
  justify-content: space-between;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
  padding-block: clamp(2rem, 5vw, 3.65rem) clamp(1.9rem, 4.5vw, 3rem);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.affiliation {
  margin-top: 0.6rem;
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 650;
}

.class-affiliation { white-space: nowrap; }
.affiliation-divider { margin-inline: 0.27rem; }

.bio {
  margin-top: 1.15rem;
  line-height: 1.65;
}

.bio p + p { margin-top: 0.7rem; }

.profile-links {
  margin-top: 0.9rem;
  font-weight: 600;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: cover;
  margin-top: 0.2rem;
  border: 1px solid var(--line);
  background: var(--portrait-bg);
}

.section {
  border-top: 1px solid var(--line);
  padding-block: 1.4rem 1.8rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.0rem);
  letter-spacing: -0.032em;
  line-height: 1.12;
}

.current-research {
  max-width: 45rem;
  margin-top: 0.75rem;
}

.paper {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.1rem;
  margin-top: 1.25rem;
}

.paper-type {
  display: flex;
  flex-direction: column;
  padding-top: 0.1rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.paper-type time {
  color: var(--accent);
  font-weight: 650;
}

h3 {
  font-size: clamp(1.4rem, 2.6vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 a {
  color: var(--ink);
  text-decoration: none;
}

h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.authors {
  margin-top: 0.53rem;
  color: var(--muted);
  font-size: 1.25rem;
}

.author-self { font-weight: 500; }

.paper-summary {
  max-width: 45rem;
  margin-top: 0.7rem;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 0.55rem;
  font-size: 1rem;
  font-weight: 650;
}

.paper-links a { padding-block: 0.3rem; }

.secondary-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.secondary-sections p {
  margin-top: 0.4rem;
  color: var(--muted);
}

.secondary-sections h2 + p { margin-top: 0.9rem; }

.secondary-sections .course {
  color: var(--ink);
  font-weight: 650;
}

.email { overflow-wrap: anywhere; }

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 1rem 1.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 820px) {
  .page-width { width: calc(100% - 3rem); }
}

@media (max-width: 500px) {
  :root { --header-height: 3.4rem; }
  .page-width { width: calc(100% - 2.5rem); }
  .header-inner { width: calc(100% - 1.4rem); gap: 0.45rem; }
  .site-name { font-size: 1.125rem; }
  nav { column-gap: 0.5rem; }
  nav a { font-size: 0.875rem; }
  .intro { grid-template-columns: 1fr; gap: 1rem; }
  .portrait { width: min(100%, 10rem); }

  .paper {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 1rem;
  }

  .paper-type {
    flex-direction: row;
    gap: 0.48rem;
  }

  .paper-type span::before {
    content: "·";
    margin-right: 0.48rem;
  }

  .secondary-sections {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 360px) {
  .class-affiliation { display: block; }
  .affiliation-divider { display: none; }
}

.research-section .paper {
  display: block;
}

.research-section .paper h3 {
  width: auto;
  max-width: none;
  margin: 0 0 0.3rem;
}

.research-section .paper .authors {
  margin: 0 0 0.5rem;
}

.research-section .paper {
  position: relative;
  padding-left: 1.2rem;
}

.research-section .paper::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0.15rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
}
