:root {
  --bg: #fafbfc;
  --bg-soft: #eef1f4;
  --surface: #ffffff;
  --surface-strong: #fff;
  --ink: #1b1f24;
  --ink-muted: #66707a;
  --line: #e5eaf0;
  --accent: #005f86;
  --accent-soft: #e6f3fa;
  --accent-underline: rgba(0, 95, 134, 0.35);
  --accent-underline-strong: rgba(0, 95, 134, 0.45);
  --ink-underline: rgba(27, 31, 36, 0.35);
  --on-ink: #fff;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1319;
  --bg-soft: #17212a;
  --surface: #121a22;
  --surface-strong: #151f28;
  --ink: #f1f5f8;
  --ink-muted: #b0bcc8;
  --line: #293642;
  --accent: #78cdec;
  --accent-soft: rgba(120, 205, 236, 0.14);
  --accent-underline: rgba(120, 205, 236, 0.45);
  --accent-underline-strong: rgba(120, 205, 236, 0.6);
  --ink-underline: rgba(241, 245, 248, 0.38);
  --on-ink: #0d1319;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1319;
    --bg-soft: #17212a;
    --surface: #121a22;
    --surface-strong: #151f28;
    --ink: #f1f5f8;
    --ink-muted: #b0bcc8;
    --line: #293642;
    --accent: #78cdec;
    --accent-soft: rgba(120, 205, 236, 0.14);
    --accent-underline: rgba(120, 205, 236, 0.45);
    --accent-underline-strong: rgba(120, 205, 236, 0.6);
    --ink-underline: rgba(241, 245, 248, 0.38);
    --on-ink: #0d1319;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Work Sans", "Trebuchet MS", sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.15;
  margin: 0;
}

h1 {
  font-size: 3rem;
  margin-top: 0.25rem;
}

h2 {
  font-size: 1.85rem;
}

a {
  color: var(--ink);
  text-decoration-color: var(--ink-underline);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  text-decoration-color: currentColor;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.container {
  margin: 0 auto;
  max-width: 1000px;
  padding: 0 1.25rem;
}

.skip-link {
  background: var(--ink);
  color: var(--on-ink);
  left: 0;
  padding: 0.5rem 0.75rem;
  position: absolute;
  text-decoration: none;
  top: 0;
  transform: translateY(-100%);
  transition: transform 160ms ease;
  z-index: 20;
}

.skip-link:focus {
  outline: none;
  transform: translateY(0);
}

.section {
  padding: 2.6rem 0;
}

.intro {
  padding-top: 3.5rem;
}

.intro-grid {
  align-items: start;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.3fr 0.9fr;
}

.intro-grid {
  grid-template-columns: 235px minmax(0, 1fr);
}

.portrait {
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.lead {
  color: var(--ink-muted);
  font-size: 1.05rem;
  margin-top: 1rem;
  max-width: 68ch;
}

.lead a {
  color: var(--ink);
  text-decoration-color: var(--ink-underline);
}

.compact-lead {
  margin-top: 0.55rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.profile-links a,
.theme-toggle {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.45rem;
  justify-content: center;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  width: 2.45rem;
}

.theme-toggle {
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.profile-links a:hover,
.profile-links a:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.profile-links svg,
.theme-toggle svg {
  fill: none;
  height: 1.32rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 1.32rem;
}

.theme-icon-sun,
.theme-toggle.is-dark .theme-icon-moon {
  display: none;
}

.theme-toggle.is-dark .theme-icon-sun {
  display: block;
}

.orcid-mark {
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.section-heading {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.paper-links {
  align-items: center;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  gap: 0.45rem 0.8rem;
  margin-top: 0.55rem;
}

.paper-links a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.paper-links a:hover,
.paper-links a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--accent-underline-strong);
}

.paper-award {
  color: var(--accent);
  font-size: 0.95rem;
  font-style: normal;
  margin-top: 0.85rem;
}

.paper-award a {
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}

.paper-award a:hover,
.paper-award a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--accent-underline);
}

.paper-list {
  border-top: 1px solid var(--line);
}

.paper-entry {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 1.05rem 0 1.05rem 2.75rem;
  position: relative;
}

.paper-main h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

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

.paper-main h3 a:hover,
.paper-main h3 a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--accent-underline);
}

.paper-main p:not(.paper-award) {
  color: var(--ink-muted);
}

.paper-main p:not(.paper-award) a,
.paper-main p:not(.paper-award) em {
  color: var(--ink);
}

.paper-main p + p {
  margin-top: 0.25rem;
}

.paper-details {
  margin-top: 0.8rem;
}

.paper-details summary {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  height: 2rem;
  justify-content: center;
  list-style: none;
  position: absolute;
  left: 0;
  top: 1.05rem;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  width: 2rem;
}

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

.paper-details summary::before {
  border: 2px solid currentColor;
  border-radius: 999px;
  content: "";
  display: block;
  height: 0.72rem;
  transform: translate(-0.08rem, -0.08rem);
  width: 0.72rem;
}

.paper-details summary::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  display: block;
  height: 2px;
  position: absolute;
  transform: translate(0.42rem, 0.42rem) rotate(45deg);
  width: 0.5rem;
}

.paper-details summary:hover,
.paper-details summary:focus-visible,
.paper-details[open] summary {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.summary-label {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.details-body {
  background: var(--surface);
  border-left: 2px solid var(--accent-soft);
  color: var(--ink-muted);
  margin-top: 0.65rem;
  padding: 0.15rem 0 0.15rem 1rem;
}

.details-body p + p {
  margin-top: 0.55rem;
}

.details-body a {
  color: var(--accent);
  font-weight: 400;
  text-decoration-color: var(--accent-underline);
}

.details-body a:hover,
.details-body a:focus-visible {
  text-decoration-color: currentColor;
}

.details-body strong {
  color: var(--ink);
  font-weight: 400;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  margin-top: 2rem;
  padding: 1.6rem 0;
}

.site-footer a {
  color: var(--ink);
  text-decoration-color: var(--ink-underline);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  justify-content: space-between;
}

.reveal-motion .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal-motion .reveal.in {
  animation: riseIn 550ms ease-out forwards;
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .portrait {
    max-width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }

  .reveal-motion .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-motion .reveal.in {
    animation: none;
  }
}
