@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300;1,9..144,700&family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap");

/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  --bg: #faf8f5;
  --text: #1c1917;
  --heading: #0f0e0d;
  --accent: #00274c;
  --accent2: #4a6741;
  --surface: #f0ece6;
  --border: #d6d0c4;
  --dim: #78716c;

  --um-maize: #ffcb05;
  --um-blue: #00274c;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
}

[data-theme="dark"] {
  --bg: #1c1917;
  --text: #e7e5e4;
  --heading: #fafaf9;
  --accent: #818cf8;
  --accent2: #6b9e60;
  --surface: #292524;
  --border: #44403c;
  --dim: #a8a29e;
}

/* ============================================================
   Reset
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background 0.25s,
    color 0.25s;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.2;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--text);
}

::selection {
  background: rgba(194, 65, 12, 0.15);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition:
    background 0.25s,
    border-color 0.25s;
}

.nav-inner {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  letter-spacing: -0.01em;
}
.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a,
.nav-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--dim);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
}

.nav-links a:hover,
.nav-btn:hover {
  color: var(--text);
}

.nav-btn {
  padding: 0;
  line-height: inherit;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1;
}

@media (max-width: 600px) {
  .nav-inner {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
  .hamburger {
    display: block;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-top: 0.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a,
  .nav-links .nav-btn {
    display: block;
    padding: 0.45rem 0;
    border-bottom: none;
  }
}

/* ============================================================
   Main layout
   ============================================================ */
.main-content {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

@media (max-width: 600px) {
  .main-content {
    padding: 1.5rem 1rem 3.5rem;
  }
}

/* ============================================================
   Home
   ============================================================ */
.home-header {
  display: flex;
  align-items: flex-start;
  gap: 1.4rem;
  margin-bottom: 1.2rem;
}

.home-photo {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
  margin-top: 0.45rem;
}

h1.site-name {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  color: var(--heading);
  display: inline-block;
  margin-bottom: 0.2rem;
}

h1.site-name::after {
  content: "";
  display: block;
  width: 4rem;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--um-maize) 50%,
    var(--um-blue) 50%
  );
  margin-top: 0.3rem;
  border-radius: 2px;
}

.role {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: var(--dim);
  letter-spacing: 0.025em;
  margin-top: 0.7rem;
  line-height: 1.65;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  padding: 0.24rem 0.58rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  color: var(--dim);
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(55, 48, 163, 0.06);
}
[data-theme="dark"] .pill:hover {
  background: rgba(129, 140, 248, 0.08);
}

/* ============================================================
   Research maps strip
   ============================================================ */
.maps-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  margin: 0.5rem 0 1.75rem;
  overflow: hidden;
  background: var(--surface);
}

.map-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.map-fig:first-child {
  border-right: 1px solid var(--border);
}

.map-img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  object-position: center;
  display: block;
  min-height: 180px;
  max-height: 300px;
}

.map-caption {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0.28rem 0.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

[data-theme="dark"] .map-img {
  filter: brightness(0.78) contrast(1.08);
}

@media (max-width: 600px) {
  .maps-strip {
    grid-template-columns: 1fr;
  }
  .map-fig:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================
   Bio
   ============================================================ */
.bio p {
  color: var(--text);
  margin-bottom: 1rem;
}
.bio p:last-child {
  margin-bottom: 0;
}

.bio .email {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--dim);
  margin-top: 0.5rem;
}

/* ============================================================
   Section separator
   ============================================================ */
.section-sep {
  border: none;
  border-top: 2px solid var(--border);
  margin: 3rem 0;
}

/* ============================================================
   Page titles
   ============================================================ */
.page-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin-bottom: 2rem;
}

/* ============================================================
   Publications
   ============================================================ */
.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pub-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.3rem;
  line-height: 1.45;
}

.pub-authors {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--dim);
  margin-bottom: 0.15rem;
}

.pub-journal {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--dim);
  font-style: italic;
  margin-bottom: 0.65rem;
}

.pub-doi {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--um-blue);
  letter-spacing: 0.02em;
}
.pub-doi:hover {
  color: var(--text);
}

/* ============================================================
   CV
   ============================================================ */
.cv-embed {
  border: 2px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.cv-embed iframe {
  width: 100%;
  height: 780px;
  border: none;
  display: block;
}

.download-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.download-link:hover {
  color: var(--text);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 2px solid var(--border);
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.site-footer a {
  color: var(--dim);
}
.site-footer a:hover {
  color: var(--accent);
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-d1 {
  transition-delay: 0.08s;
}
.reveal-d2 {
  transition-delay: 0.16s;
}

/* ============================================================
   Accessibility
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Mobile tweaks
   ============================================================ */
@media (max-width: 600px) {
  h1.site-name {
    font-size: 2.4rem;
  }
  .home-header {
    flex-direction: column;
    gap: 0;
  }
  .home-photo {
    margin-bottom: 0.8rem;
  }
  .page-title {
    font-size: 1.8rem;
  }
}
