/* ---------- Tokens ---------- */
:root {
  --ink: #1d232a;
  --ink-soft: #4b5563;
  --muted: #7b8794;
  --paper: #f6f4ee;
  --paper-2: #ffffff;
  --line: #e3ded3;
  --accent: #1f6f8b;       /* lake blue */
  --accent-2: #b7791f;     /* dry-land ochre */
  --hero-text: #f8fafc;
  --max: 1040px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font: 400 16px/1.7 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- Hero (inspired by the reference: fixed cover image + centred card) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 20px;
  color: var(--hero-text);
  background: #0b1a24 url("../assets/bg.jpg") center / cover no-repeat;
  background-attachment: fixed;
  isolation: isolate;
}
@media (max-width: 900px), (hover: none) {
  .hero { background-attachment: scroll; }
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(6, 18, 28, .55) 0%, rgba(6, 18, 28, .78) 70%, rgba(6, 18, 28, .9) 100%);
}
.hero-card {
  text-align: center;
  width: 100%;
  max-width: 640px;
  animation: fade-in 1.1s ease both;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.avatar {
  width: 168px; height: 168px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 26px;
  border: 3px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.hero h1 {
  font: 500 clamp(36px, 5vw, 52px)/1.1 var(--serif);
  letter-spacing: .01em;
  margin-bottom: 8px;
}
.hero .cn { font-weight: 400; opacity: .8; font-size: .55em; margin-left: .35em; letter-spacing: .2em; }
.hero .role { font-size: 17px; opacity: .92; }
.hero .role span { display: block; opacity: .8; font-size: 15px; }
.hero .tagline {
  margin: 22px auto 14px;
  font: 400 italic clamp(17px, 2.2vw, 21px)/1.5 var(--serif);
  opacity: .95;
}
.hero .tagline em { font-style: normal; color: #ffd97a; }
.hero .loc {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; opacity: .85; margin-bottom: 30px;
}
.hero .loc svg { width: 15px; height: 15px; }

.hero-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px;
  font-size: 14.5px; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 26px;
}
.hero-nav a {
  color: var(--hero-text); opacity: .9; padding: 4px 2px;
  border-bottom: 1px solid transparent;
}
.hero-nav a:hover { text-decoration: none; opacity: 1; border-bottom-color: #ffd97a; }

.social { display: flex; justify-content: center; gap: 14px; }
.social a {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--hero-text);
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.06);
  transition: background .2s, transform .2s;
}
.social a:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); text-decoration: none; }
.social svg { width: 19px; height: 19px; fill: currentColor; }

.scroll-hint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .25em; text-transform: uppercase; opacity: .6;
  color: var(--hero-text);
}
.scroll-hint::after {
  content: ""; display: block; width: 1px; height: 34px; margin: 8px auto 0;
  background: linear-gradient(to bottom, rgba(255,255,255,.7), transparent);
}

/* ---------- Sticky top bar (appears after the hero) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 244, 238, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar .brand { font: 500 18px var(--serif); color: var(--ink); }
.topbar nav { display: flex; gap: 20px; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; }
.topbar nav a { color: var(--ink-soft); }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }
@media (max-width: 640px) { .topbar nav { display: none; } }

/* ---------- Sections ---------- */
main { background: var(--paper); }
section { padding: 84px 20px; }
section:nth-of-type(even) { background: var(--paper-2); }
.wrap { max-width: var(--max); margin: 0 auto; }

.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 36px; }
.sec-head h2 {
  font: 500 clamp(28px, 3.4vw, 36px)/1.15 var(--serif);
  letter-spacing: -.01em;
}
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }
.sec-head .num { font: 500 13px var(--sans); color: var(--accent-2); letter-spacing: .2em; }

.lead { font-size: 18px; color: var(--ink); max-width: 720px; }
p + p { margin-top: 14px; }

/* About layout */
#about .lead { font-size: 20px; line-height: 1.65; max-width: 820px; }
.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 40px; align-items: start; }
@media (max-width: 800px) { .about-cards { grid-template-columns: 1fr; } }

.side-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 24px 18px;
}
section:nth-of-type(even) .side-card { background: var(--paper); }
.side-card h3 {
  font: 500 13px var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.edu { list-style: none; }
.edu li { padding: 12px 0; border-top: 1px solid var(--line); }
.edu li:first-child { border-top: 0; padding-top: 0; }
.edu .deg { font-weight: 600; }
.edu .sch { color: var(--ink-soft); font-size: 15px; }
.edu .yr { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
  background: rgba(31,111,139,.08); color: var(--accent); border: 1px solid rgba(31,111,139,.18);
}

/* Research cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px;
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
section:nth-of-type(odd) .card { background: var(--paper-2); }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(29,35,42,.08); }
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
}
.card:nth-child(2)::before { background: var(--accent-2); }
.card:nth-child(3)::before { background: #3b8b6a; }
.card .icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 14px; }
.card:nth-child(2) .icon { color: var(--accent-2); }
.card:nth-child(3) .icon { color: #3b8b6a; }
.card h3 { font: 500 21px/1.3 var(--serif); margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 15px; }

/* Publications */
.pubs { list-style: none; counter-reset: pub; }
.pubs li {
  display: grid; grid-template-columns: 64px 1fr; gap: 18px;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.pubs li:last-child { border-bottom: 1px solid var(--line); }
.pubs .yr { font: 500 15px var(--serif); color: var(--accent-2); padding-top: 3px; }
.pubs .title { font-weight: 600; font-size: 17px; line-height: 1.45; color: var(--ink); }
.pubs .title a { color: inherit; }
.pubs .title a:hover { color: var(--accent); text-decoration: none; }
.pubs .authors { color: var(--ink-soft); font-size: 15px; margin-top: 4px; }
.pubs .authors b { font-weight: 600; color: var(--ink); }
.pubs .venue { font-style: italic; color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.pubs .links { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.pubs .links a, .btn-ghost {
  font-size: 12.5px; letter-spacing: .04em; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink-soft); background: var(--paper-2);
}
.pubs .links a:hover, .btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.more { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; transition: background .2s;
}
.btn:hover { background: #185a71; text-decoration: none; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }

/* Talks */
.timeline { max-width: 760px; }
.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -22px; top: 8px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper);
}
section:nth-of-type(even) .timeline li::before { border-color: var(--paper-2); }
.timeline .yr { font-size: 13px; letter-spacing: .1em; color: var(--accent-2); font-weight: 600; }
.timeline .t { font-weight: 600; margin-top: 2px; }
.timeline .v { color: var(--ink-soft); font-size: 15px; }

/* Field work gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #dfe7ea, #cbd8dd);
  border: 1px solid var(--line);
}
.gallery figure.tall { grid-row: span 2; aspect-ratio: auto; min-height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px;
  color: #fff; font-size: 13.5px;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
}
.gallery .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 13px; padding: 20px;
}
.gallery .placeholder svg { width: 30px; height: 30px; margin: 0 auto 8px; opacity: .5; }
.note { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* Footer */
footer {
  background: #0f1c25; color: #c9d3da; padding: 56px 20px 40px;
  background-image: linear-gradient(rgba(15,28,37,.92), rgba(15,28,37,.97)), url("../assets/bg.jpg");
  background-size: cover; background-position: center;
}
footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: start; }
@media (max-width: 700px) { footer .wrap { grid-template-columns: 1fr; } }
footer h3 { font: 500 24px var(--serif); color: #fff; margin-bottom: 8px; }
footer p { font-size: 14.5px; max-width: 520px; }
footer a { color: #ffd97a; }
footer .social { justify-content: flex-start; margin-top: 18px; }
footer .social a { border-color: rgba(255,255,255,.3); color: #fff; }
footer .fine { grid-column: 1 / -1; margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: #8fa0ad; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer .fine a { color: #b7c4cf; }
