/* ---- tokens ------------------------------------------------------------ */

:root {
  --bg:        #fbfaf8;
  --surface:   #ffffff;
  --text:      #1e2229;
  --muted:     #626b78;
  --faint:     #8b93a0;
  --rule:      #e3e0da;
  --accent:    #2f5d8a;
  --accent-bg: #eef2f7;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14171c;
    --surface:   #1b1f26;
    --text:      #e6e8ec;
    --muted:     #a2abb8;
    --faint:     #78818e;
    --rule:      #2c323b;
    --accent:    #8ab4e0;
    --accent-bg: #202832;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* ---- page -------------------------------------------------------------- */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 2rem) 4rem;
}

a { color: var(--accent); }

/* ---- intro ------------------------------------------------------------- */

.intro {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  margin-bottom: 2.5rem;
}

.portrait {
  width: 148px;
  height: 148px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(0.92);
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 6vw, 2.9rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.45rem;
}

.affiliation {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.45;
}

/* ---- profile icons ----------------------------------------------------- */

.links {
  display: flex;
  gap: 0.55rem;
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}

.links a {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.links svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

.links a:hover,
.links a:focus-visible {
  background: var(--accent);
  color: var(--surface);
  transform: translateY(-1px);
}

/* ---- bio --------------------------------------------------------------- */

.bio p {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.bio p:last-child { margin-bottom: 0; }

/* ---- publications ------------------------------------------------------ */

h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 1.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.papers { margin-top: 3.5rem; }

.paper + .paper {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.paper h3 {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0 0 0.5rem;
}

.paper h3 a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease, color 0.25s ease;
}

.paper h3 a:hover,
.paper h3 a:focus-visible {
  color: var(--accent);
  background-size: 100% 1px;
}

.authors {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.authors strong { color: var(--text); font-weight: 600; }

.venue {
  margin: 0 0 0.75rem;
  font-size: 0.87rem;
  color: var(--faint);
}

.gloss {
  margin: 0 0 0.9rem;
  font-size: 0.97rem;
  color: var(--muted);
}

/* ---- link chips -------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.chips a {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.79rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chips a:hover,
.chips a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

/* ---- abstract disclosure ---------------------------------------------- */

details { margin-top: 0.9rem; }

summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  cursor: pointer;
  list-style: none;
  font-size: 0.79rem;
  letter-spacing: 0.02em;
  color: var(--faint);
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform 0.15s ease;
}

details[open] summary::before { transform: rotate(90deg); }

summary:hover { color: var(--accent); }

details p {
  margin: 0.75rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--rule);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- footer ------------------------------------------------------------ */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--faint);
}

footer p { margin: 0; }

/* ---- small screens ----------------------------------------------------- */

@media (max-width: 34rem) {
  body { font-size: 16px; }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .portrait { width: 112px; height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
