/* =========================================================
   COLORS & FONTS — change these to restyle the whole site
   ========================================================= */
:root {
  --bg: #FBF8F3;          /* page background, warm paper */
  --tint: #F2ECE2;        /* alternate section background, sand */
  --ink: #221C14;         /* main text */
  --muted: #6B6052;       /* secondary text */
  --accent: #2E6C8E;      /* main accent, valley sky */
  --accent-dark: #1E4F69;
  --highlight: #B07D28;   /* small highlights, ochre dust */
  --line: #E0D6C6;        /* borders */

  --font-head: "Cormorant Garamond", Garamond, Georgia, serif;
  --font-body: "Public Sans", "Segoe UI", Arial, sans-serif;

  --max: 1120px;          /* max content width */
  --header-bg: rgba(251, 248, 243, 0.94);
  --card: #FFFFFF;
}

/* ============ DARK THEME ============ */
/* Used when the visitor's device is in dark mode (unless they picked light) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130E; --tint: #1F1A13; --ink: #EFE7D9; --muted: #A89A86;
    --accent: #7FB6D4; --accent-dark: #1E4F69; --highlight: #D7A94E; --line: #342C21;
    --header-bg: rgba(22, 19, 14, 0.94); --card: #1F1A13;
  }
}
/* Used when the visitor clicks the Dark button */
:root[data-theme="dark"] {
  --bg: #16130E; --tint: #1F1A13; --ink: #EFE7D9; --muted: #A89A86;
  --accent: #7FB6D4; --accent-dark: #1E4F69; --highlight: #D7A94E; --line: #342C21;
  --header-bg: rgba(22, 19, 14, 0.94); --card: #1F1A13;
}

/* ============ BASE ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 3px;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.2; margin: 0; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
strong { font-weight: 500; }
p { margin: 0 0 1rem; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 4px;
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { border-color: var(--accent); color: var(--accent); }
.btn-secondary:hover { background: var(--accent); color: var(--bg); }
.btn-light { background: #fff; color: var(--accent-dark); }
.btn-light:hover { background: var(--tint); }
.btn-outline-light { border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }

/* ============ NAVIGATION ============ */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max); margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 1.6rem; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; align-items: center; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 0.86rem; font-weight: 400; }
.nav-links a:hover { color: var(--accent); }
.nav-links .nav-cta { color: var(--accent); border-bottom: 2px solid var(--accent); }
.theme-toggle, .nav-toggle {
  background: none; border: 1px solid var(--line); border-radius: 4px;
  padding: 0.3rem 0.7rem; font: inherit; font-size: 0.8rem; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.nav-right .theme-toggle { order: 2; }
.nav-toggle { display: none; }

/* ============ HERO (full-bleed field photo) ============ */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex; align-items: flex-end;
  padding: 1.5rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 40%;
}
/* Dark gradient so the type stays readable over the photo */
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,16,10,0.88) 0%, rgba(20,16,10,0.62) 40%, rgba(20,16,10,0.15) 100%);
}
.hero-inner {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  width: 100%;
  padding: 3rem 0 3.5rem;
  color: #fff;
  animation: rise 0.9s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-eyebrow {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #E7C98A; margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 500; letter-spacing: -0.015em;
  color: #fff; margin-bottom: 1.1rem; max-width: 14ch;
}
.hero-role {
  font-family: var(--font-head); font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: rgba(255,255,255,0.92); max-width: 40ch; margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.btn-ghost { border-color: rgba(255,255,255,0.75); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.14); }
.hero .btn-primary { background: #fff; color: #1E4F69; }
.hero .btn-primary:hover { background: #E7C98A; color: #221C14; }
.hero-credit {
  position: absolute; right: 1.5rem; bottom: 0.85rem;
  font-size: 0.7rem; color: rgba(255,255,255,0.65); max-width: 34ch; text-align: right;
}

/* ============ AT A GLANCE ============ */
.glance { background: var(--tint); padding: 2.5rem 1.5rem; border-bottom: 1px solid var(--line); }
.glance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.glance-i { width: 32px; height: 32px; color: var(--accent); margin-bottom: 0.75rem; display: block; }
.glance-k {
  display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--highlight); margin-bottom: 0.5rem;
}
.glance-v { display: block; font-size: 0.92rem; color: var(--ink); max-width: 36ch; }

/* ============ ABOUT PHOTO ============ */
.about-photo { float: right; margin: 0 0 1.5rem 2rem; width: 190px; }
.about-photo img { width: 100%; height: auto; border-radius: 4px; box-shadow: 10px 10px 0 var(--tint); }

/* ============ SECTIONS ============ */
.section { padding: 4.5rem 1.5rem; }
.section-tinted { background: var(--tint); }
.section-inner { max-width: var(--max); margin: 0 auto; }
.section-inner > h2 { margin-bottom: 2.5rem; }
.two-col { display: grid; grid-template-columns: 1fr 2.2fr; gap: 3rem; }
.two-col > h2 { margin-bottom: 0; }
.prose { max-width: 68ch; }
.section-lede { color: var(--muted); }

.skill-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-list li { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.8rem; font-size: 0.8rem; color: var(--muted); background: var(--card); }

/* ============ EXPERIENCE TIMELINE ============ */
.timeline { list-style: none; margin: 0; padding: 0; }
.job {
  display: grid; grid-template-columns: 170px 1fr; gap: 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.job:last-child { border-bottom: 1px solid var(--line); }
.job-when { font-size: 0.8rem; font-weight: 500; color: var(--highlight); padding-top: 0.2rem; }
.job-body { max-width: 70ch; }
.job-body h3 { margin-bottom: 0.25rem; }
.job-org { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.job-body > p:last-child { margin-bottom: 0; }

details { margin-top: 0.5rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 400; font-size: 0.84rem; width: fit-content; }
summary:hover { text-decoration: underline; }
details ul { margin: 0.75rem 0 0; padding-left: 1.2rem; }
details li { margin-bottom: 0.4rem; }

.sub-heading { margin: 3rem 0 1rem; font-size: 1.05rem; letter-spacing: 0.02em; }

/* ============ PROJECTS ============ */
.project { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.5rem 0; max-width: 70ch; }
.project h3 { margin-bottom: 0.6rem; }
.project .skill-list { margin-top: 1rem; }
.project-link { margin: 1rem 0 0; }
.funding-note { margin: 1rem 0 0; font-size: 0.82rem; color: var(--muted); }
.btn-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.media-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.media-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.media-link svg { display: inline; vertical-align: 0.05em; color: var(--accent); }
.org-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.org-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.field-photo { margin: 1.5rem 0 0; }
.field-photo img { width: 100%; height: auto; border-radius: 4px; }
.field-photo figcaption { margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted); }

.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.photo-row figure { margin: 0; }
.photo-row img { width: 100%; height: 180px; object-fit: cover; border-radius: 4px; }
.photo-row figcaption { margin-top: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.photo-row--two { grid-template-columns: repeat(2, 1fr); max-width: 620px; }
.photo-row--two img { height: 220px; }
.photo-row--one { grid-template-columns: 1fr; max-width: 360px; }
.photo-row--one img { height: 240px; }
.job .photo-row { margin-top: 1.25rem; max-width: 620px; }
.job .photo-row img { height: 180px; }
.photo-row--wide,
.job .photo-row--wide { max-width: 620px; }
.photo-row--wide img,
.job .photo-row--wide img { height: auto; aspect-ratio: 2 / 1; }
.media-note { display: block; margin-top: 0.15rem; font-size: 0.8rem; color: var(--muted); }

.video-still { margin: 1.25rem 0 0; max-width: 620px; }
.video-still a { display: block; }
.video-still img { display: block; width: 100%; border-radius: 4px; border: 1px solid var(--line); }
.video-still figcaption { margin-top: 0.5rem; font-size: 0.82rem; }

/* ============ PUBLICATIONS ============ */
.research-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 4rem; }
.research-grid h3 { margin-bottom: 1rem; }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.pub-title { max-width: 60ch; }
.pub-date { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.research-profiles { margin-top: 1.25rem; color: var(--muted); }
.recognition h3:not(:first-child) { margin-top: 2rem; }

.talk-list { list-style: none; padding: 0; margin: 0; }
.talk-list li { padding: 0.85rem 0; border-top: 1px solid var(--line); }
.talk-t { display: block; max-width: 66ch; }
.talk-m strong { font-weight: 500; color: var(--ink); }
.talk-m { display: block; margin-top: 0.25rem; font-size: 0.78rem; color: var(--muted); }

.course-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.course-list li { padding: 1rem 0; border-top: 1px solid var(--line); }
.course-list li:last-child { border-bottom: 1px solid var(--line); }
.course-c { display: block; font-weight: 500; margin-bottom: 0.3rem; }
.course-d { display: block; font-size: 0.88rem; color: var(--muted); max-width: 68ch; }

.edu-note { font-size: 0.82rem; margin-top: 0.3rem !important; max-width: 70ch; }

/* ============ EDUCATION ============ */
.edu-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.edu-list li { padding: 1rem 0; border-top: 1px solid var(--line); }
.edu-list li:last-child { border-bottom: 1px solid var(--line); }
.edu-list h3 { margin-bottom: 0.2rem; }
.edu-list p { color: var(--muted); margin: 0; }
.edu-list h3 a { text-decoration-color: var(--muted); text-underline-offset: 4px; }
.edu-list h3 a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.earlier-teaching { max-width: 70ch; color: var(--muted); }
.cert-heading { margin-bottom: 1rem; }
.cert-heading + .plain-list { margin-bottom: 2rem; }
.plain-list { padding-left: 1.2rem; margin: 0; }
.plain-list li { margin-bottom: 0.5rem; }

/* ============ CONTACT ============ */
.contact { background: var(--accent-dark); color: #fff; }
.contact h2 { margin-bottom: 1rem !important; }
.contact-lede { color: rgba(255,255,255,0.8); max-width: 55ch; font-size: 1rem; }
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin: 2.5rem 0 0; }
.contact-k { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.65); margin-bottom: 0.6rem; font-family: var(--font-body); font-weight: 500; }
.pronounce { font-family: var(--font-head); font-style: italic; font-size: 1.15rem; color: #fff; margin: 0; }
.email { color: #fff; margin: 0 0 0.4rem; cursor: pointer; border-bottom: 1px dotted rgba(255,255,255,0.5); display: inline-block; }
.email:hover { border-bottom-style: solid; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { margin-bottom: 0.4rem; }
.contact-list a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.4); text-underline-offset: 3px; }
.contact-list a:hover { text-decoration-color: #fff; }
.contact-form { margin-top: 2.5rem; max-width: 460px; display: grid; gap: 1rem; }
.contact-form label { display: grid; gap: 0.35rem; font-size: 0.82rem; color: rgba(255,255,255,0.8); }
.contact-form input, .contact-form textarea { font: inherit; font-size: 0.9rem; padding: 0.6rem 0.7rem; border: 1px solid rgba(255,255,255,0.35); border-radius: 4px; background: rgba(255,255,255,0.08); color: #fff; }
.contact-form button { justify-self: start; border: none; cursor: pointer; }
.honeypot { position: absolute; left: -9999px; }

/* ============ NAV: current section ============ */
.nav-links a.current { color: var(--accent); }

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 20;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--card); color: var(--ink);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, border-color 0.2s;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 860px) { .back-to-top { right: 1rem; bottom: 1rem; } }

/* ============ FOOTER ============ */
.site-footer { text-align: center; padding: 2rem 1.5rem; color: var(--muted); font-size: 0.82rem; }
.site-footer p { margin: 0; }
.footer-links { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ============ MOBILE ============ */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-right { gap: 0.6rem; }
  .nav-right .theme-toggle { order: -1; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.7rem 0; }
  .nav-links .nav-cta { border-bottom: none; }

  .hero { min-height: 72vh; }
  .hero-credit { display: none; }
  .glance-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-photo { float: none; margin: 0 0 1.5rem; width: 160px; }

  .contact-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .two-col, .research-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .research-grid { gap: 3rem; }
  .pub-list li { flex-direction: column; gap: 0.2rem; }
  .job { grid-template-columns: 1fr; gap: 0.4rem; }
  .photo-row { grid-template-columns: 1fr; }
  .photo-row img { height: 220px; }
  .job .photo-row { grid-template-columns: 1fr; }
  .job .photo-row img { height: 220px; }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-curve path { animation: none; stroke-dashoffset: 0; }
}
