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

:root {
  --navy:      #1A2540;
  --navy-mid:  #364A70;
  --purple:    #9088C8;
  --lavender:  #7B7EB8;
  --green:     #4CAF72;
  --accent:    var(--green);
  --accent-lt: var(--lavender);
  --text:      var(--navy);
  --muted:     var(--navy-mid);
  --border:    #dde1ea;
  --bg:        #ffffff;
  --max-w:     720px;
  --nav-h:     48px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  padding-top: var(--nav-h);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Nav ───────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--lavender);
  border-bottom: none;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 900px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--navy);
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; color: var(--green); }
.nav-brand:hover .nav-wordmark { color: var(--green); }

.nav-wordmark {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: #ffffff;
  font-weight: 600;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--green); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

/* ── Home ──────────────────────────────────────────────────── */
.home { padding: 0; }

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-h));
}

.home-tree {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  min-height: calc(100vh - var(--nav-h));
}

.home-tree svg {
  width: 80%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 1 / 1;
}

.tree-hint {
  position: absolute;
  bottom: 1.25rem;
  font-size: 0.72rem;
  color: var(--lavender);
  opacity: 0.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

.home-bio {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 3rem 4rem 3rem;
}

.home-bio h1,
.home-role,
.home-contact {
  text-align: center;
}

.home-bio p:not(.home-role) {
  text-align: left;
}

.headshot-wrap {
  width: 163px;
  height: 163px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--purple);
  flex-shrink: 0;
}

.headshot-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.home h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.home-role {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.home-role a { color: var(--muted); }
.home-role a:hover { color: var(--accent); }

.home p {
  font-size: 1.05rem;
  color: #374151;
  margin-bottom: 1rem;
  max-width: 600px;
}

.home-contact {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
}
.contact-icon-link {
  display: flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.contact-icon-link svg {
  width: 40px;
  height: 40px;
  display: block;
}
.contact-icon-link:hover { color: var(--accent); text-decoration: none; }

/* ── Pages ─────────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - var(--nav-h) - 80px); }

.page {
  padding: 3.5rem 0 4rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── Prose ─────────────────────────────────────────────────── */
.page h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--text);
}

.page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

.page p { margin-bottom: 1rem; font-size: 0.97rem; }

.page ul, .page ol {
  padding-left: 1.25rem;
  margin-bottom: 1.25rem;
}

.page li { margin-bottom: 0.5rem; font-size: 0.97rem; }

.page hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.page strong { font-weight: 600; }
.page em { font-style: italic; }

/* ── CV specifics ──────────────────────────────────────────── */
.cv-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.cv-name {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: 0.35rem;
  border: none;
  padding: 0;
}

.cv-title {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.cv-contact {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.cv-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cv-section-head h2 {
  margin: 0;
}

.cv-download-btn {
  display: inline-block;
  margin-top: 0;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #aab0be;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.cv-download-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  margin: 1rem 0 1.5rem;
}

.page table td, .page table th {
  padding: 0.4rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.page table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.page table td:first-child {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-right: 1rem;
}

/* ── Press Page ────────────────────────────────────────────── */
.press-topic {
  margin-bottom: 3.5rem;
}

.press-banner {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.press-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(26,37,64,0.82) 0%, rgba(26,37,64,0.35) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem 1.5rem;
}

.press-banner-overlay h2 {
  color: white;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  border: none;
  padding: 0;
}

.press-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.press-items li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
}

.press-items li:last-child {
  border-bottom: none;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-links a {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }

.footer-copy {
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-copy a { color: var(--muted); }

/* ── Program Sections ──────────────────────────────────────── */
.programs-inner {
  max-width: var(--max-w);
}

.program-title {
  font-size: 1.15rem !important;
  font-weight: 600;
  margin-bottom: 1.25rem !important;
  color: var(--text) !important;
}

.program-title a {
  color: var(--accent);
  text-decoration: none;
}
.program-title a:hover { text-decoration: underline; }

.program-title--light a { color: #D6D0F5; }
.program-title--light a:hover { color: var(--green); }

.program-years {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.program-years--light {
  color: #7B7EB8;
}

.role-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(76,175,114,0.12);
  color: var(--green);
  border: 1px solid rgba(76,175,114,0.3);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tool-name {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}

.scroll-section--dark-program {
  background: var(--navy);
}

.scroll-section--dark-program .program-title--light { color: var(--lavender); }
.scroll-section--dark-program .tool-name { color: #9088C8; }
.scroll-section--dark-program .scroll-section-body p,
.scroll-section--dark-program .tufte-body p { color: #9088C8; }
.scroll-section--dark-program .tufte-margin-label { color: #7B7EB8; }
.scroll-section--dark-program .tufte-margin-pubs p { color: #7B7EB8 !important; }
.scroll-section--dark-program .tufte-margin-pubs { border-left-color: rgba(144,136,200,0.3); }
.scroll-section--dark-program em { color: #9088C8; }

/* ── Tufte Margin Layout ───────────────────────────────────── */
.tufte-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 2rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.tufte-row.full {
  grid-template-columns: 1fr;
}

.tufte-margin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.1rem;
}

.tufte-margin img {
  width: 100%;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  transition: transform 0.2s;
  margin-bottom: 0.75rem;
}
.tufte-margin img:hover { transform: scale(1.03); }

.tufte-margin-caption {
  font-size: 0.68rem;
  color: var(--purple);
  text-align: center;
  line-height: 1.4;
  font-weight: 500;
}

.tufte-margin-link {
  font-size: 0.68rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.tufte-margin-link:hover { text-decoration: underline; }

.tufte-margin-pubs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-left: 2px solid var(--lavender);
  padding-left: 0.75rem;
}

.tufte-margin-pubs p {
  font-size: 0.68rem !important;
  line-height: 1.45 !important;
  color: var(--muted) !important;
  margin: 0 !important;
}

.tufte-margin-pubs a {
  color: var(--accent);
  font-size: 0.68rem;
}

.tufte-margin-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* ── Scroll / Work Page ────────────────────────────────────── */
.scroll-page {
  position: relative;
  padding-left: 0;
}

.scroll-intro {
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.scroll-intro::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  margin: 2rem auto 0;
  background: var(--purple);
  border-radius: 1px;
  opacity: 0.6;
}

.scroll-intro h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.scroll-intro-desc {
  font-size: 1.05rem;
  color: #374151;
  max-width: 600px;
  line-height: 1.7;
  margin-left: auto;
  margin-right: auto;
}

/* ── Timeline Nav (horizontal) ─────────────────────────────── */
.timeline-nav {
  position: sticky;
  top: var(--nav-h);
  height: 152px;
  background: white;
  border-bottom: 1px solid var(--border);
  z-index: 50;
  display: flex;
  align-items: stretch;
}

.tl-chart {
  flex: 1;
  position: relative;
  margin: 0 24px;
}

.tl-axis {
  position: absolute;
  left: 0; right: 0;
  top: 128px;
  height: 1px;
  background: var(--border);
}

.tl-tick {
  position: absolute;
  width: 1px;
  height: 6px;
  top: 123px;
  background: var(--border);
}

.tl-tick-label {
  position: absolute;
  top: 132px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tl-bar {
  position: absolute;
  height: 8px;
  border-radius: 3px;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.2s, height 0.15s;
}

.tl-bar:hover { opacity: 0.75; }
.tl-bar.active { opacity: 1; height: 10px; }

.tl-bar--present::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: inherit;
  animation: tl-pulse 2s infinite;
}

@keyframes tl-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.tl-connector { display: none; }
.tl-dot { display: none; }

.tl-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  background: white;
  padding: 1px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: opacity 0.15s;
  z-index: 5;
}

/* ── Section photos ────────────────────────────────────────── */
.section-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.75rem;
}

.section-photos figure {
  margin: 0;
}

.section-photos figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.section-photos-credit {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #aab0be;
}

.section-photos.section-photos--mini {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 520px;
  align-items: start;
}

.section-photos--mini img {
  aspect-ratio: auto;
  object-fit: contain;
}

.section-photos img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.section-photos--single {
  grid-template-columns: 1fr;
  max-width: 460px;
}

.section-photos--single img {
  aspect-ratio: auto;
  object-fit: contain;
}

.section-photos--covers {
  max-width: 620px;
  align-items: start;
}

.section-photos--covers img {
  aspect-ratio: auto;
  object-fit: contain;
}

@media (max-width: 640px) {
  .section-photos { grid-template-columns: 1fr; }
}

/* ── Page hero image ───────────────────────────────────────── */
.page-hero {
  margin: 0 0 2rem;
}

.page-hero img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.page-hero figcaption {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: #aab0be;
  text-align: right;
}

/* ── Centered page header + intro ──────────────────────────── */
.page--centered .page-title {
  text-align: center;
}

.page--centered .page-intro,
.page--centered .page-intro .tufte-body {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

/* ── DSxD book showcase ────────────────────────────────────── */
.dsxd-books {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0 1rem;
}

.dsxd-books figure {
  margin: 0;
  text-align: center;
}

.dsxd-books img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: left center;
  border-radius: 10px;
  display: block;
}

.dsxd-books figcaption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .dsxd-books { grid-template-columns: 1fr; }
}

/* ── Work page section colors ──────────────────────────────── */
.scroll-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
}

#end-plastic-pollution                      { background: rgba(76,175,114,0.08);  border-left-color: #4CAF72; }
#reduce-greenhouse-gases                    { background: white;                  border-left-color: #9088C8; }
#environmental-stewardship                  { background: rgba(136,200,168,0.08); border-left-color: #88c8a8; }
#open-geospatial-data                       { background: white;                  border-left-color: #d4a830; }
#biological--environmental-data-collections { background: rgba(42,99,71,0.08);   border-left-color: #2a6347; }
#data-science-as-a-practice                 { background: white;                  border-left-color: #b86e18; }
#genome-evolution                           { background: rgba(54,74,112,0.08);   border-left-color: #364A70; }
#genetic-regulation-of-plant-morphology     { background: white;                  border-left-color: #a83828; }

.scroll-section--alt {
  background: #ededf7;
}

.scroll-section-inner {
  max-width: 720px;
}

.scroll-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.scroll-section-body p {
  font-size: 1rem;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.scroll-section-body em { font-style: italic; }

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--lavender);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--purple);
    padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .home-grid { grid-template-columns: 1fr; }
  .home-tree { min-height: 60vw; }
  .home-bio { padding: 3rem 1.5rem 2rem; }
  .home h1 { font-size: 1.6rem; }
  .page-title { font-size: 1.4rem; }
  .scroll-nav { display: none; }
  .timeline-nav { display: none; }
  .scroll-page { padding-left: 0; }
  .tufte-row { display: block; }
  .tufte-margin { margin-top: 1rem; padding-left: 0; border-left: none; font-size: 0.85rem; color: var(--muted); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
