/* =========================================================
   Personal academic homepage — forest green + cream theme
   Plain HTML/CSS, no build step, works on GitHub Pages.
   ========================================================= */

:root {
  /* Palette: warm cream background with deep forest green accents */
  --cream:        #f6f1e4;
  --cream-2:      #efe7d2;
  --paper:        #fbf7ec;
  --ink:          #2b2a24;      /* main body text */
  --ink-soft:     #5a5a50;      /* muted text */
  --line:         #d9cfb5;      /* hairlines */
  --forest:       #2f5d3a;      /* primary green */
  --forest-deep:  #1f4228;      /* hover / strong green */
  --forest-soft:  #6f9a6c;      /* subtle accents */
  --gold:         #b88a3d;      /* warm accent for links/highlights */

  --radius:       10px;
  --radius-lg:    16px;
  --shadow-sm:    0 1px 2px rgba(31, 66, 40, 0.08);
  --shadow-md:    0 6px 20px rgba(31, 66, 40, 0.10);

  --maxw:         1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  color: var(--forest-deep);
  letter-spacing: 0.2px;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 4.2vw, 3.2rem); line-height: 1.15; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--forest-deep); text-decoration-thickness: 2px; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Accessibility: skip-to-content */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: #fff;
  padding: 0.5rem 0.9rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; outline: 2px solid var(--gold); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 236, 0.92);
  backdrop-filter: saturate(1.3) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--forest-deep);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  background: var(--forest);
  color: var(--cream);
  border-radius: 50%;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}
.brand-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
  padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover {
  color: var(--forest-deep);
  border-bottom-color: var(--forest);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--forest-deep);
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}

/* ---------- Hero ---------- */
.hero {
  padding: 4rem 0 3rem;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(111,154,108,0.25), transparent 60%),
    radial-gradient(900px 350px at 90% 0%, rgba(184,138,61,0.18), transparent 60%),
    var(--cream);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.hero h1 .accent { color: var(--forest); }
.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 52ch;
}
.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  transition: transform 0.1s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--forest);
  color: var(--cream);
  border: 1px solid var(--forest);
}
.btn-primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--forest-deep);
  border: 1px solid var(--forest);
}
.btn-ghost:hover { background: var(--forest); color: var(--cream); }

.portrait-frame {
  width: 260px;
  height: 260px;
  margin-left: auto;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--forest), var(--forest-soft));
  box-shadow: var(--shadow-md);
}
.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper);
}

/* ---------- Sections ---------- */
.section {
  padding: 4rem 0;
}
.section-alt {
  background: var(--cream-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-intro {
  color: var(--ink-soft);
  max-width: 65ch;
  margin-bottom: 2rem;
}

/* ---------- About ---------- */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.quick-facts {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}
.quick-facts h3 {
  margin-top: 0;
  color: var(--forest-deep);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  margin-bottom: 0.25rem;
}
.quick-facts ul { list-style: none; padding: 0; margin: 0; }
.quick-facts li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.96rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.quick-facts li:last-child { border-bottom: none; }
.quick-facts .qf-icon { font-size: 1rem; flex-shrink: 0; }
.quick-facts strong { color: var(--forest); min-width: 5.5rem; display: inline-block; }

/* ---------- Research cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { margin-top: 0.25rem; }
.card-media {
  height: 120px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47,93,58,0.18), rgba(184,138,61,0.18)),
    repeating-linear-gradient(45deg, var(--cream) 0 10px, var(--cream-2) 10px 20px);
  margin-bottom: 0.8rem;
}
.card-media-img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 0.8rem;
  display: block;
}

/* ---------- Publications ---------- */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Card base */
.pub-list li {
  position: relative;
  padding: 1.2rem 1.5rem 1.2rem 4rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(31,66,40,0.08), 0 0 0 1px rgba(31,66,40,0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.pub-list li:hover {
  box-shadow: 0 6px 18px rgba(31,66,40,0.13), 0 0 0 1px rgba(31,66,40,0.09);
  transform: translateY(-2px);
}

/* Accent stripe: forest for even, gold for odd */
.pub-list li.pub-even {
  border-left: 3px solid var(--forest-soft);
}
.pub-list li.pub-odd {
  border-left: 3px solid var(--gold);
}

/* Number badge */
.pub-list li::before {
  content: attr(data-num);
  position: absolute;
  left: 0.9rem;
  top: 1.2rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: var(--cream);
  border-radius: 50%;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 1px 4px rgba(31,66,40,0.25);
  flex-shrink: 0;
}

.pub-ref {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Row layout: odd = image left, even = image right */
.pub-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.pub-even .pub-row {
  flex-direction: row-reverse;
}
.pub-odd .pub-row {
  flex-direction: row;
}

.pub-toc-img {
  width: 300px;
  min-width: 300px;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

@media (max-width: 760px) {
  .pub-row,
  .pub-even .pub-row,
  .pub-odd .pub-row { flex-direction: column; }
  .pub-toc-img { width: 100%; max-height: 220px; min-width: unset; }
}

.pub-title { font-weight: 600; margin: 0 0 0.2rem; color: var(--ink); }
.pub-meta { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.pub-link {
  display: inline-block;
  padding: 0.07rem 0.5rem;
  border-radius: 4px;
  background: rgba(47,93,58,0.1);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.25rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.pub-link:hover { background: var(--forest); color: var(--cream); }

/* ---------- News timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.timeline li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(31,66,40,0.07);
  transition: box-shadow 0.2s, transform 0.2s;
}
.timeline li:hover {
  box-shadow: 0 4px 12px rgba(31,66,40,0.12);
  transform: translateY(-1px);
}
.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.timeline time {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  color: var(--forest-deep);
  font-size: 1.05rem;
}
.timeline-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18em 0.65em;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-grant   { background: #d4edda; color: #1a5c2e; }
.badge-pub     { background: #dce8f7; color: #1a3a5c; }
.badge-talk    { background: #fff3cd; color: #7a5800; }
.badge-position{ background: #e8e0f5; color: #4a2080; }
.badge-degree  { background: #fde8d8; color: #8a3010; }
.timeline p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- CV ---------- */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.cv-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(31,66,40,0.07);
}
.cv-grants { margin-bottom: 1.25rem; }
.cv-card h3 {
  margin-top: 0;
  color: var(--forest-deep);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cv-icon { font-size: 1.05rem; }
.cv-list { list-style: none; padding: 0; margin: 0; }
.cv-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.cv-list li:last-child { border-bottom: 0; }
.cv-main { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; }
.cv-main strong { color: var(--ink); }
.cv-sub { color: var(--ink-soft); font-size: 0.88rem; }
.cv-year { color: var(--forest-deep); font-weight: 600; font-size: 0.88rem; white-space: nowrap; padding-top: 0.1rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}
.contact-links-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(31,66,40,0.07);
}
.contact-links-card p { margin-top: 0; color: var(--ink-soft); font-size: 0.97rem; }
.contact-links {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.contact-links li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.97rem;
}
.contact-links li:last-child { border-bottom: 0; }
.contact-links li > span {
  color: var(--forest-deep);
  font-weight: 600;
  min-width: 6.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cl-icon { font-size: 1rem; }
.contact-links a { color: var(--gold); text-decoration: none; }
.contact-links a:hover { text-decoration: underline; }
.address-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-style: normal;
  color: var(--ink-soft);
  box-shadow: 0 1px 3px rgba(31,66,40,0.07);
}
.address-card strong { color: var(--ink); }

/* ---------- Research map ---------- */
.map-section { margin-top: 2rem; }
.map-section h3 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}
#research-map {
  height: 420px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 0; /* keep below sticky header */
}
.map-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.map-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px currentColor;
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--cream-2);
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .portrait-frame { margin: 0; width: 200px; height: 200px; }
  .two-col, .contact-grid, .cv-grid, .contact-links-card { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
  }
  .site-nav.open { max-height: 400px; }
  .site-nav ul {
    flex-direction: column;
    padding: 0.5rem 1.25rem 1rem;
    gap: 0.25rem;
  }
  .site-nav a {
    display: block;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
  }
  .site-nav li:last-child a { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
