/* The whole look of the site. Colors follow the reader's light/dark setting. */

:root {
  --bg: #ffffff;
  --fg: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f3f4f6;
  --accent: #b91c1c; /* the site's red */
  --serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --fg: #e5e5e5;
    --muted: #9ca3af;
    --line: #2a2a2a;
    --soft: #1c1c1c;
    --accent: #f87171;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 64rem;
  padding: 0 1.5rem;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.7 var(--sans);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.3; }

/* header & footer */
.site-header {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  justify-content: space-between; align-items: center;
  padding: 1rem 0;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--serif); font-weight: 600; }
.site-header nav { display: flex; gap: 1.25rem; font-family: var(--serif); }
.site-header nav a[aria-current] { color: var(--accent); }
.site-footer {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  margin-top: 5rem; padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
}
.site-footer p { margin: 0.2rem 0; }
.links { margin: 1rem 0; font-family: var(--serif); }
.links a { color: var(--accent); }
.links span { color: var(--muted); margin: 0 0.15rem; }
.affiliation { margin: 0; color: var(--muted); font-family: var(--serif); }
.affiliation a:hover { color: var(--accent); }
.button { display: inline-block; padding: 0.3rem 0.9rem; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 0.9rem; }
.button:hover { background: var(--accent); color: var(--bg); }

/* shared */
.portrait { border-radius: 50%; object-fit: cover; width: 15rem; height: 15rem; box-shadow: 0 20px 40px rgb(0 0 0 / 0.25); }
.portrait.small { width: 6rem; height: 6rem; box-shadow: none; }
.name { font-size: 1.5rem; margin: 1rem 0 0.25rem; }
.rule { width: 3rem; height: 4px; border-radius: 2px; background: var(--accent); margin: 0.5rem auto 1rem; }

/* home */
.hero { max-width: 40rem; margin: 2.5rem auto 0; text-align: center; }
.hero .prose h1 { font-size: 1.8rem; margin: 0.5rem 0; }
.projects { text-align: center; margin-top: 3rem; }
.projects h2 { font-size: 1.8rem; margin-bottom: 0.25rem; }
.projects > p { margin-top: 0; color: var(--muted); }
.cards {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  text-align: left;
}
.cards li { border-radius: 0.6rem; overflow: hidden; box-shadow: 0 4px 16px rgb(0 0 0 / 0.12); background: var(--bg); }
.cards img { display: block; width: 100%; height: 10rem; object-fit: cover; }
.cards h3 { font-family: var(--sans); font-weight: 700; font-size: 1rem; margin: 0; padding: 0.9rem 1rem 0.7rem; border-bottom: 1px solid var(--line); }
.cards p { margin: 0; padding: 0.6rem 1rem 1rem; font-size: 0.875rem; }

/* about */
.about { display: grid; grid-template-columns: 1fr 2fr; gap: 2rem; max-width: 52rem; margin: 2.5rem auto 0; }
.about aside { text-align: center; padding-right: 2rem; border-right: 1px solid var(--line); }
.publications { max-width: 52rem; margin: 3rem auto 0; }
.publications h2 { font-size: 1.6rem; margin-top: 2.5rem; }
.publications .year { font-size: 1.05rem; color: var(--muted); margin: 1.75rem 0 0.25rem; border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; }
.pubs { list-style: none; padding: 0; margin: 0.5rem 0; }
.pubs li { margin: 0.75rem 0; font-family: var(--serif); }
.pubs li a { white-space: nowrap; }
.full-list { margin-top: 2rem; font-family: var(--serif); }

/* project pages and text */
.project { max-width: 44rem; margin: 2.5rem auto 0; }
.project h1 { font-size: 1.9rem; text-align: center; }
.prose p, .prose ul, .prose ol { margin: 1.1rem 0; }
.prose figure { margin: 2rem auto; text-align: center; max-width: 90%; }
.prose img { max-width: 100%; height: auto; border-radius: 0.4rem; }
.prose figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }
.prose blockquote { margin-left: 0; padding-left: 1.2rem; border-left: 3px solid var(--line); color: var(--muted); }

/* the Earth cutaway: the globe stays put while the captions scroll past */
.earth { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2rem 0; }
.earth-stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; }
.earth-stage canvas, .earth-fallback { width: 100%; max-width: 34rem; height: auto; aspect-ratio: 1; }
.earth canvas { display: none; }
.earth.is-live canvas { display: block; }
.earth.is-live .earth-fallback { display: none; }
.earth-steps { padding: 25vh 0 35vh; }
.earth-step { min-height: 75vh; display: flex; flex-direction: column; justify-content: center; }
.earth-step h2 { font-size: 1.7rem; margin: 0 0 0.5rem; }
.earth-step p { margin: 0; max-width: 26rem; color: var(--muted); }
.credit { font-size: 0.75rem; color: var(--muted); }
.credit a { text-decoration: underline; }

/* citations */
#refs .csl-entry { padding-left: 2rem; text-indent: -2rem; margin: 0.5rem 0; font-size: 0.92rem; font-family: var(--serif); }
#references { text-align: center; font-size: 1.3rem; margin-top: 3rem; }

@media (max-width: 48rem) {
  .earth { grid-template-columns: 1fr; gap: 0; }
  .earth-stage { height: 55vh; z-index: 0; }
  .earth-steps { position: relative; z-index: 1; padding: 0 0 30vh; }
  .earth-step { min-height: 90vh; justify-content: flex-end; }
  .earth-card { background: var(--bg); border: 1px solid var(--line); border-radius: 0.6rem; padding: 1rem 1.1rem; box-shadow: 0 6px 24px rgb(0 0 0 / 0.12); }
  .earth-step h2 { font-size: 1.35rem; }
}
@media (max-width: 40rem) {
  body { padding: 0 1rem; }
  .about { grid-template-columns: 1fr; }
  .about aside { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
  .portrait { width: 11rem; height: 11rem; }
}
