:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-alt: #e9f0f7;
  --ink: #16212d;
  --muted: #4f6072;
  --accent: #0d6a8f;
  --accent-deep: #0a4c68;
  --line: #c9d7e4;
  --shadow: 0 14px 45px rgba(10, 38, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 5%, #d9edf8 0%, transparent 35%),
    radial-gradient(circle at 85% 20%, #e6f1e6 0%, transparent 30%), var(--bg);
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.01em;
  margin: 0;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 248, 251, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  min-height: 4.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--muted);
}

.brand.nav-link-active {
  color: var(--ink);
  font-weight: 700;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--muted);
}

nav a.nav-link-active {
  color: var(--ink);
  font-weight: 700;
}

.hero {
  position: relative;
  padding: 6.5rem 0 5rem;
  overflow: clip;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(13, 106, 143, 0.08), rgba(77, 123, 67, 0.06));
  transform: skewY(-2deg) scale(1.05);
  transform-origin: top left;
}

.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 2.25rem;
  align-items: center;
  animation: reveal 650ms ease-out both;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--accent-deep);
  font-weight: 700;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  line-height: 1.08;
  margin-bottom: 1rem;
}

.lead {
  max-width: 70ch;
  font-size: 1.1rem;
  color: var(--muted);
}

.hero-headshot {
  margin: 0;
  justify-self: end;
}

.hero-headshot img {
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.section {
  padding: 4rem 0;
}

.page-hero {
  padding-top: 5.5rem;
  padding-bottom: 2.5rem;
}

.section-intro {
  margin: 0 0 1.35rem;
  max-width: 75ch;
  color: var(--muted);
}

.section-alt {
  background: linear-gradient(to bottom, rgba(233, 240, 247, 0.6), rgba(233, 240, 247, 0.2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.3rem);
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 1.3rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 700ms ease both;
}

.card h3 {
  margin-bottom: 0.55rem;
  font-size: 1.25rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.inline-cta {
  margin-top: 1rem;
}

.meta {
  margin: 0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #51657b;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
}

.timeline h3 {
  margin: 0.35rem 0;
  font-size: 1.2rem;
}

.timeline p {
  margin: 0;
  color: var(--muted);
}

.timeline a {
  display: inline-block;
  margin-top: 0.55rem;
  font-weight: 600;
}

.publications-list {
  display: grid;
  gap: 2rem;
}

.publications-section h2 {
  margin-bottom: 1rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.experience-panes {
  display: grid;
  gap: 0.95rem;
}

.experience-group + .experience-group {
  margin-top: 2rem;
}

.experience-group h3 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
}

.experience-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
  animation: rise 700ms ease both;
}

.experience-pane h3 {
  margin: 0.35rem 0;
  font-size: 1.2rem;
}

.experience-pane p {
  margin: 0;
  color: var(--muted);
}

.projects-list {
  display: grid;
  gap: 2rem;
}

.project-section {
  display: grid;
  gap: 0.95rem;
}

.project-section-header h3 {
  font-size: 1.45rem;
}

.project-section-description {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.project-section-grid {
  display: grid;
  gap: 1rem;
}

.project-card {
  padding: 1.4rem;
}

.project-header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: start;
}

.project-header h3 {
  margin-bottom: 0.35rem;
}

.project-toggle {
  white-space: nowrap;
}

.project-summary {
  margin-top: 0.75rem;
}

.project-tags {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-tags li {
  font-size: 0.82rem;
  color: #223449;
  background: rgba(13, 106, 143, 0.1);
  border: 1px solid rgba(13, 106, 143, 0.2);
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
}

.project-details {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.projects-error {
  color: #7f1d1d;
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1rem 0 0.55rem;
}

.markdown-body h2 {
  font-size: 1.25rem;
}

.markdown-body h3 {
  font-size: 1.08rem;
}

.markdown-body h4 {
  font-size: 1rem;
}

.markdown-body p {
  margin: 0 0 0.8rem;
}

.markdown-body ul {
  margin: 0 0 0.8rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.markdown-body pre {
  margin: 0 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
}

.markdown-body code {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.92em;
}

.markdown-body figure {
  margin: 1rem 0;
}

.markdown-body img {
  width: min(100%, 860px);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
}

.contact {
  text-align: center;
}

.contact p {
  color: var(--muted);
  margin: 0 auto 1.2rem;
  max-width: 65ch;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.25rem;
}

.contact-links a {
  text-decoration: none;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.site-footer {
  padding: 2rem 0 2.6rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@media (max-width: 860px) {
  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 5.3rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .hero-headshot {
    justify-self: start;
  }

  .hero-headshot img {
    width: min(100%, 260px);
  }

  nav {
    gap: 0.65rem;
  }

  .project-header {
    flex-direction: column;
    align-items: stretch;
  }
}
