:root {
  --paper: #f1f3ec;
  --ink: #1c302d;
  --muted: #61716b;
  --accent: #14786e;
  --highlight: #c85b3e;
  --rule: #cbd4cb;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }
html:has(body.home-page) { min-width: 0; overflow-x: clip; }

.home-page {
  --home-paper: #f3efe4;
  --home-ink: #203931;
  --home-vermilion: #a3422e;
  --home-gold: #d3a047;
  --paper: var(--home-paper);
  --ink: var(--home-ink);
  --muted: color-mix(in srgb, var(--home-ink), var(--home-paper) 25%);
  --accent: var(--home-vermilion);
  --highlight: var(--home-gold);
  --rule: color-mix(in srgb, var(--home-ink), var(--home-paper) 78%);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: .22em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible {
  border-radius: 2px;
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.geometry-scene {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.home-page .geometry-scene { opacity: .55; }
.not-found-page .geometry-scene { opacity: .62; }

.site-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 64px, 1120px);
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--rule), transparent 35%);
}
.site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--paper);
  box-shadow: 0 0 0 100vmax var(--paper);
  clip-path: inset(0 -100vmax);
}

.wordmark {
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
}

.wordmark span { color: var(--highlight); }

.site-header nav { display: flex; gap: clamp(20px, 4vw, 52px); }
.site-header nav a, .site-footer a {
  color: var(--muted);
  font-size: .94rem;
  text-decoration: none;
}
.site-header nav a { padding-block: 12px; }
.site-header nav a:hover, .site-footer a:hover { color: var(--accent); }

#main-content { flex: 1; }

.intro { padding-top: clamp(96px, 16vh, 176px); }
.home-page .intro {
  padding: clamp(96px, 16vh, 176px) 0 84px;
  background: var(--home-ink);
  color: var(--home-paper);
  box-shadow: 0 0 0 100vmax var(--home-ink);
  clip-path: inset(0 -100vmax);
}
.eyebrow {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro h1 {
  display: flex;
  gap: .16em;
  align-items: baseline;
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 8rem;
  font-weight: 400;
  line-height: .9;
  letter-spacing: 0;
}
.intro h1 span:first-child { color: var(--ink); }
.intro .name-initial { color: var(--highlight); font-style: italic; }
.home-page .intro h1 span:first-child { color: var(--home-paper); }
.home-page .intro .name-initial { color: var(--home-gold); }
.profile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 30px 0 0;
}
.profile-details div { min-width: 120px; }
.profile-details dt { color: var(--muted); font-size: .9rem; }
.profile-details dd { margin: 4px 0 0; font-size: 1rem; }
.home-page .profile-details dt { color: color-mix(in srgb, var(--home-paper), transparent 34%); }

.research { margin-top: clamp(64px, 10vh, 112px); padding-bottom: 80px; }
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.section-index { color: var(--ink); font-size: .9rem; }
.section-heading h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 400;
}

.research-entry {
  display: grid;
  grid-template-columns: minmax(180px, .82fr) minmax(0, 1.18fr);
  gap: clamp(24px, 6vw, 88px);
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--rule);
}
.home-page .section-heading { border-bottom-width: 2px; }
.home-page .section-heading h2 { font-size: 2.7rem; }
.home-page .research-entry {
  margin-top: 14px;
  padding: 24px 26px 26px;
  border: 1px solid color-mix(in srgb, var(--rule), transparent 20%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--home-paper), transparent 20%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.home-page .research-list .research-entry:first-child { margin-top: 24px; }
.home-page .research-meta { padding-left: 16px; border-left: 2px solid var(--home-gold); }
.home-page .research-entry:nth-child(even) .research-meta { border-left-color: var(--home-vermilion); }
.research-meta h3, .research-detail p { margin: 0; }
.research-meta h3 { font-size: 1.16rem; font-weight: 600; }
.research-meta p, .research-detail { color: var(--ink); font-size: 1rem; line-height: 1.8; }
.research-meta p { margin-top: 10px; }
.research-meta .research-role { color: var(--accent); }
.research-detail .institution { margin-bottom: 7px; color: var(--accent); }
.home-page .research-detail .institution { color: var(--home-ink); font-weight: 600; }
.home-page .education,
.home-page .coursework { margin-top: 24px; padding-bottom: 0; }
.home-page .education + .coursework { margin-top: 8px; }
.home-page .coursework-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 24px;
}
.home-page .coursework-panel {
  padding: 6px 16px;
  border: 1px solid color-mix(in srgb, var(--rule), transparent 20%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--home-paper), transparent 20%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.home-page .coursework-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-page .coursework-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.home-page .coursework-list li:last-child { border-bottom: 0; }
.home-page .recent-posts { margin-top: 48px; padding-bottom: 0; }
.recent-posts-all { margin-left: auto; color: var(--accent); font-size: .95rem; font-weight: 600; text-decoration: none; }
.recent-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.recent-post-card {
  display: flex;
  min-width: 0;
  min-height: 250px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--home-gold);
  border-radius: 4px;
  background: color-mix(in srgb, var(--home-paper), transparent 20%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.recent-post-card:nth-child(3n + 2) { border-top-color: var(--home-vermilion); }
.recent-post-card:nth-child(3n) { border-top-color: var(--home-ink); }
.recent-post-card time { color: var(--muted); font-size: .88rem; }
.recent-post-card h3 {
  margin: 12px 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.15;
}
.recent-post-card h3 a { text-decoration: none; }
.recent-post-card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.65; }
.recent-post-link { margin-top: auto; padding-top: 20px; color: var(--accent); font-size: .9rem; font-weight: 600; text-decoration: none; }
.cv-download {
  display: flex;
  justify-content: flex-end;
  margin-top: 32px;
  padding: 28px 0 72px;
  border-top: 1px solid var(--rule);
}
.cv-download-link {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .8rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cv-download-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.cv-download-link span { transition: transform .2s ease; }
.cv-download-link:hover span { transform: translateY(2px); }

.document { max-width: 800px; margin: clamp(72px, 13vh, 140px) auto 96px; }
.document-heading { margin-bottom: 42px; }
.document-heading h1, .not-found h1 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 5.2rem;
  font-weight: 400;
  line-height: .98;
}
.document-heading time, .post-entry time { display: block; margin-top: 14px; color: var(--muted); font-size: .9rem; }
.prose { font-size: 1.06rem; line-height: 1.85; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { margin-top: 2.2em; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
.prose img, .embedded-video { max-width: 100%; height: auto; }
.text-justify { text-align: justify; }

.post-list { margin-top: 54px; }
.post-entry { padding: 24px 0 30px; border-top: 1px solid var(--rule); }
.post-entry h2 { margin: 8px 0 10px; font-family: "Instrument Serif", Georgia, serif; font-size: 2rem; font-weight: 400; }
.post-entry h2 a { text-decoration: none; }
.draft-label {
  display: inline-block;
  margin-left: .5rem;
  padding: .25em .5em;
  border: 1px solid var(--highlight);
  border-radius: 2px;
  color: var(--highlight);
  font-family: "DM Sans", sans-serif;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  vertical-align: middle;
}
.post-entry .prose { max-width: 62ch; color: var(--muted); font-size: 1rem; }
.post-entry .summary-actions { margin-top: 16px; }
.post-entry .read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .72rem 1.08rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.post-entry .read-more:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.not-found { min-height: min(72vh, 680px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.not-found h1 { font-size: 8rem; }
.not-found h1 span { color: var(--highlight); font-style: italic; }
.return-link { margin-top: 32px; color: var(--accent); font-size: 1rem; }
.return-link span { display: inline-block; margin-left: 8px; }

.site-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  border-top: 1px solid color-mix(in srgb, var(--rule), transparent 35%);
  color: var(--muted);
  font-size: .92rem;
}
.site-footer span { margin-right: auto; }

@media (max-width: 640px) {
  .site-shell { width: min(100% - 40px, 1120px); }
  .site-header { min-height: 72px; }
  .site-header nav { gap: 18px; }
  .site-header nav a { font-size: 1rem; }
  .wordmark { font-size: 1rem; }
  .intro { padding-top: 17vh; }
  .home-page .intro { padding: 17vh 0 64px; }
  .intro h1 { font-size: 3.8rem; }
  .research { margin-top: 76px; }
  .section-heading h2 { font-size: 1.9rem; }
  .home-page .section-heading h2 { font-size: 2.15rem; }
  .research-entry { grid-template-columns: 1fr; gap: 12px; }
  .home-page .research-entry { padding: 20px 18px 22px; }
  .home-page .coursework-columns { grid-template-columns: 1fr; gap: 10px; }
  .home-page .coursework-panel { padding: 4px 14px; }
  .home-page .recent-posts { margin-top: 36px; }
  .recent-post-grid { grid-template-columns: 1fr; }
  .recent-post-card { min-height: 0; }
  .document { margin-top: 72px; }
  .document-heading h1 { font-size: 3rem; }
  .not-found { min-height: 72vh; }
  .not-found h1 { font-size: 3.6rem; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .recent-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .intro h1 { font-size: 3.2rem; }
  .home-page .site-header nav { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}