/* ============================================================
   EASE — Atmospheric design system
   "Photochemical dusk" — warm, editorial, science-grade.
   Palette derived from the EASE logo: amber (sunlight /
   photochemistry), terracotta (combustion), olive (biogenic
   sources), clay (haze). Teal is the cool data counterpoint.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Libre+Franklin:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Ink & paper — warm, never pure black/white */
  --ink:        #241f1b;
  --ink-soft:   #4f463f;
  --ink-faint:  #8c8178;
  --paper:      #faf7f2;
  --paper-warm: #f4ede2;
  --haze:       #efe7db;
  --line:       rgba(36, 31, 27, 0.12);
  --line-soft:  rgba(36, 31, 27, 0.07);

  /* Logo-derived accents */
  --terracotta:      #c0492f;
  --terracotta-deep: #97331f;
  --amber:           #e0943a;
  --amber-soft:      #efb866;
  --olive:           #7e8b3e;
  --clay:            #9a8478;
  --teal:            #2f6b6b;
  --teal-deep:       #214f4f;

  /* Hero atmosphere */
  --dusk-1: #1b1512;
  --dusk-2: #3a201a;
  --dusk-3: #6e3320;

  /* Type */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body:    'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Metrics */
  --maxw: 1140px;
  --read: 760px;
  --nav-h: 56px;

  --shadow-sm: 0 1px 2px rgba(36,31,27,.06), 0 2px 8px rgba(36,31,27,.05);
  --shadow-md: 0 6px 24px rgba(36,31,27,.10), 0 2px 8px rgba(36,31,27,.06);
  --shadow-lg: 0 24px 60px rgba(36,31,27,.18);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* sticky footer: fill the viewport so the footer pins to the bottom
     on short pages instead of leaving the body background showing */
  display: flex;
  flex-direction: column;
  min-height: 100vh;   /* fallback for old browsers */
  min-height: 100dvh;  /* dynamic vh: no jump under mobile URL bars */
}
/* the main content region absorbs the slack and pushes the footer down */
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

p { text-wrap: pretty; }      /* fewer ragged orphans in body copy */

/* line figures up in dates, coordinates and other data */
.when, .news-row .date, .meta-list dd, .rcard__num, .footer__bottom {
  font-variant-numeric: tabular-nums;
}

/* keyboard focus — visible since we removed link underlines */
a:focus-visible,
.btn-ease:focus-visible,
.nav-link:focus-visible,
.person:focus-visible,
.proj-card a:focus-visible,
.form-control:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 2px;
}

/* honour reduced-motion globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

img { max-width: 100%; display: block; }

a { color: var(--teal); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--terracotta); }

sub, sup { line-height: 0; }

::selection { background: var(--amber-soft); color: var(--ink); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 .5em;
  text-wrap: balance;   /* avoid lonely last words in headings */
}

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: .7em;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 2px;
  background: currentColor;
  display: inline-block;
}

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.read { max-width: var(--read); }
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }

/* ---------- Buttons ---------- */
.btn-ease {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--body); font-weight: 600; font-size: .95rem;
  letter-spacing: .01em;
  padding: .8em 1.5em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn-ease .arr { transition: transform .2s ease; }
.btn-ease:hover .arr { transform: translateX(4px); }

.btn-solid {
  background: var(--terracotta); color: #fff;
  box-shadow: 0 6px 18px rgba(192,73,47,.30);
}
.btn-solid:hover { background: var(--terracotta-deep); color: #fff; transform: translateY(-2px); }

.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }

.btn-onhero { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(4px); }
.btn-onhero:hover { background: rgba(255,255,255,.18); color: #fff; transform: translateY(-2px); }

/* ============================================================
   HERO — photochemical dusk
   ============================================================ */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 118%, rgba(224,148,58,.55), rgba(224,148,58,0) 55%),
    radial-gradient(90% 70% at 12% -10%, rgba(126,139,62,.18), rgba(126,139,62,0) 60%),
    linear-gradient(158deg, var(--dusk-1) 0%, var(--dusk-2) 52%, var(--dusk-3) 100%);
  color: #f6ede2;
  padding: calc(var(--nav-h) + clamp(3.5rem, 9vw, 7rem)) 0 clamp(4rem, 9vw, 7rem);
}
/* grain / haze */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .06; mix-blend-mode: overlay;
}
/* smoke-curve motif echoing the logo */
.hero__waves {
  position: absolute; right: -4%; bottom: -2%; width: min(620px, 60%);
  z-index: -1; opacity: .5; pointer-events: none;
}
.hero__waves path { fill: none; stroke-width: 2; }

.hero__inner { position: relative; }

.hero h1 {
  color: #fdfaf4;
  font-size: clamp(2.6rem, 6.2vw, 5rem);
  font-weight: 600;
  max-width: 16ch;
  margin-bottom: .55em;
}
.hero h1 .accent { color: var(--amber-soft); font-style: italic; font-weight: 400; }

.hero__lead {
  max-width: 56ch;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.7;
  color: rgba(246,237,226,.82);
  margin: 0 0 2.2rem;
}
.hero .eyebrow { color: var(--amber-soft); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* hero content is static — no entrance animation (avoid the generic
   staggered fade-up). .reveal is left as a harmless no-op hook. */

/* ============================================================
   RESEARCH TRIPTYCH
   ============================================================ */
.research { background: var(--paper); position: relative; }
.research__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 2.8rem;
}
.rcard {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink);
  aspect-ratio: 4 / 3.2;
  box-shadow: var(--shadow-md);
}
.rcard img {
  width: 100%; height: 100%; object-fit: cover;
}
.rcard::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(27,21,18,.88) 0%, rgba(27,21,18,.25) 45%, rgba(27,21,18,0) 75%);
}
.rcard__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem 1.4rem; z-index: 2; }
.rcard__num {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .2em;
  color: var(--amber-soft); display: block; margin-bottom: .5rem;
}
.rcard h3 {
  color: #fdfaf4; font-size: 1.5rem; margin: 0;
  font-weight: 600;
}
.rcard__rule {
  width: 56px; height: 3px; background: var(--amber);
  margin-top: .9rem; transform: scaleX(0); transform-origin: left;
  transition: transform .18s ease-out;
}
.rcard:hover .rcard__rule { transform: scaleX(1); }

/* ============================================================
   ABOUT
   ============================================================ */
.about { background: var(--paper-warm); border-top: 1px solid var(--line-soft); }
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about h2 {
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  position: sticky; top: calc(var(--nav-h) + 1.5rem);
}
.about__body p { color: var(--ink-soft); margin: 0 0 1.3rem; }
.about__body p:last-child { margin-bottom: 0; }
.about__body strong, .about__body b { color: var(--terracotta-deep); font-weight: 600; }

.pullquote {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.4;
  color: var(--ink);
  border-left: 3px solid var(--amber);
  padding: .2rem 0 .2rem 1.4rem;
  margin: 2rem 0;
}
.term { font-style: italic; color: var(--teal-deep); }

@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
  .about h2 { position: static; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: rgba(246,237,226,.72);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem;
  font-size: .92rem;
}
.site-footer a { color: rgba(246,237,226,.72); }
.site-footer a:hover { color: var(--amber-soft); }
.footer__top {
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  justify-content: space-between; align-items: flex-start;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(246,237,226,.14);
}
.footer__brand { max-width: 360px; }
.footer__brand .mark {
  font-family: var(--display); font-size: 1.7rem; font-weight: 600;
  color: #fdfaf4; letter-spacing: .02em; margin-bottom: .5rem;
  /* reset Bootstrap's .mark highlight utility (yellow bg + padding) */
  background: none; padding: 0;
}
.footer__nav { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; }
.footer__nav a { font-weight: 500; }
.footer__bottom {
  margin-top: 1.8rem; font-family: var(--mono); font-size: .74rem;
  letter-spacing: .04em; color: rgba(246,237,226,.5);
}

/* ============================================================
   INTERIOR PAGES — shared
   ============================================================ */
/* Page header (light banner under the nav) */
.page-head {
  position: relative;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
  padding: clamp(2.2rem, 5vw, 3.4rem) 0 clamp(1.8rem, 4vw, 2.6rem);
  overflow: hidden;
}
.page-head::after {
  content: "";
  position: absolute; left: 0; bottom: -1px; height: 3px; width: 96px;
  background: linear-gradient(90deg, var(--amber), var(--terracotta));
}
.page-head h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0;
}
.page-head .eyebrow { margin-bottom: .8rem; }
.page-head .lead { color: var(--ink-soft); max-width: 60ch; margin: .9rem 0 0; }

/* Generic interior section + heading */
.page-section { padding: clamp(2.6rem, 5vw, 4rem) 0; }
.section-head {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0 0 1.8rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: .7rem;
}
.section-head::before {
  content: ""; width: 10px; height: 10px; flex: none;
  background: var(--amber); transform: translateY(-2px);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); /* tiny mountain mark */
}

.prose p { color: var(--ink-soft); margin: 0 0 1.2rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong, .prose b { color: var(--terracotta-deep); }

/* ---- PI block (People) ---- */
.pi { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.pi__photo {
  width: 100%; border-radius: 6px; box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.pi__name { font-size: clamp(2rem, 3.4vw, 2.6rem); margin: 0 0 .2rem; }
.pi__role { color: var(--terracotta); font-weight: 600; margin: 0 0 1.4rem; font-family: var(--body); }
.pi h4 {
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint);
  margin: 1.4rem 0 .6rem;
}
.pi ul { list-style: none; padding: 0; margin: 0; }
.pi li { margin-bottom: .35rem; color: var(--ink-soft); }
.pi__bio { color: var(--ink-soft); line-height: 1.75; margin-top: 1.6rem; text-align: justify; }
.pi__links { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---- People grid ---- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px;
}
.person {
  display: block; color: inherit; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.person:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; color: inherit; }
.person__img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; filter: saturate(.97); }
.person__body { padding: .9rem 1rem 1.1rem; }
.person__name { font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.person__role { font-size: .85rem; color: var(--ink-faint); margin-top: .2rem; }

/* ---- Alumni ---- */
.alumni { list-style: none; padding: 0; margin: 0; }
.alumni li {
  padding: .8rem 0 .8rem 1.6rem; position: relative;
  border-bottom: 1px solid var(--line-soft); color: var(--ink-soft);
}
.alumni li::before {
  content: ""; position: absolute; left: 0; top: 1.25rem;
  width: 8px; height: 8px; background: var(--olive); border-radius: 50%;
}
.alumni strong { color: var(--ink); }

@media (max-width: 640px) {
  .pi { grid-template-columns: 1fr; }
  .pi__photo { max-width: 240px; }
}

/* ---- Publications ---- */
.pub-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.6rem; }
.pub-item {
  display: grid; grid-template-columns: 168px minmax(0,1fr); gap: 1.5rem;
  align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 1.2rem 1.4rem; transition: box-shadow .22s ease, border-color .22s ease;
}
.pub-item:hover { box-shadow: var(--shadow-md); border-color: transparent; }
.pub-item > img {
  width: 168px; height: 118px; object-fit: cover; border-radius: 4px;
  background: var(--haze);
}
.pub-item h3 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 .5rem; }
.pub-journal { font-family: var(--display); font-style: italic; color: var(--teal-deep); margin: 0 0 .35rem; font-size: 1rem; }
.pub-authors { font-size: .92rem; color: var(--ink-faint); margin: 0 0 .9rem; line-height: 1.55; }
.pub-authors strong { color: var(--terracotta-deep); }
.pub-more { display: inline-flex; align-items: center; gap: .4em; font-family: var(--mono); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--terracotta); }
.pub-more:hover { color: var(--terracotta-deep); }
.pub-fulllist { text-align: center; padding: 1rem 0 0; }

/* ---- News ---- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem;
  padding: 1rem 0; border-bottom: 1px solid var(--line-soft);
}
.news-row a { color: var(--ink); font-weight: 500; flex: 1; }
.news-row a:hover { color: var(--terracotta); }
.news-row .date {
  flex: none; font-family: var(--mono); font-size: .8rem; letter-spacing: .04em;
  color: var(--ink-faint); white-space: nowrap;
}

/* ---- Projects ---- */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.proj-card {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.proj-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.proj-card__media { background: var(--haze); aspect-ratio: 16/9; overflow: hidden; }
.proj-card__media img { width: 100%; height: 100%; object-fit: contain; }
.proj-card__body { padding: 1.1rem 1.3rem 1.4rem; }
.proj-card__title { font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--terracotta-deep); }
.proj-card__title:hover { color: var(--terracotta); }
.proj-card__desc { color: var(--ink-soft); font-size: .95rem; margin-top: .5rem; line-height: 1.55; }

/* ---- Data / datasets ---- */
.dataset { list-style: none; padding: 0; margin: 0; }
.dataset li {
  padding: 1rem 0; border-bottom: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline;
}
.dataset .species {
  font-family: var(--mono); font-weight: 500; color: var(--ink);
  min-width: 130px; letter-spacing: .03em;
}
.dataset .sites { display: flex; flex-wrap: wrap; gap: .4rem .7rem; }
.dataset .sites a {
  font-size: .92rem; padding: .15rem .7rem; border: 1px solid var(--line);
  border-radius: 999px; color: var(--teal-deep);
}
.dataset .sites a:hover { border-color: var(--amber); color: var(--terracotta); background: rgba(224,148,58,.08); }

/* ---- Contact card ---- */
.contact-card {
  margin-top: 2.2rem; padding: 1.4rem 1.6rem; border-radius: 6px;
  background: var(--paper-warm); border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
}
.contact-card h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.contact-card p { margin: 0; color: var(--ink-soft); }

/* ---- Coming soon placeholder ---- */
.coming-soon { display: grid; place-items: center; padding: clamp(2rem,8vw,5rem) 0; }
.coming-soon img { width: min(60%, 460px); opacity: .9; }

/* ============================================================
   DETAIL / ARTICLE PAGES (students, projects, data, news)
   ============================================================ */
/* page-head meta line (dates, investigators, etc.) */
.page-head .meta {
  margin: 1rem 0 0; color: var(--ink-faint); font-size: .95rem; line-height: 1.6;
}
.page-head .meta .when { font-family: var(--mono); font-size: .82rem; letter-spacing: .04em; }

/* readable article column */
.article { max-width: var(--read); }
.article p { color: var(--ink-soft); line-height: 1.8; margin: 0 0 1.3rem; text-align: justify; }
.article p:lang(zh) { text-align: justify; }
.article strong, .article b { color: var(--terracotta-deep); }
.article h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 2.2rem 0 1rem; }
.article ul { padding-left: 1.3rem; margin: 0 0 1.3rem; }
.article li { color: var(--ink-soft); margin-bottom: .6rem; line-height: 1.7; }

/* figure with caption; can float beside text on wide screens */
.article-figure { margin: 0 0 1.6rem; }
.article-figure img { width: 100%; border-radius: 6px; box-shadow: var(--shadow-md); }
.article-figure figcaption { font-size: .85rem; color: var(--ink-faint); text-align: center; margin-top: .5rem; }
.article-figure.float-right { float: right; width: min(340px, 42%); margin: .3rem 0 1.2rem 1.6rem; }
@media (max-width: 600px) { .article-figure.float-right { float: none; width: 100%; margin: 0 0 1.4rem; } }

/* metadata definition list (data pages) */
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1.4rem; margin: 0 0 1.5rem; }
.meta-list dt { font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--terracotta); padding-top: .15rem; }
.meta-list dd { margin: 0; color: var(--ink); }
@media (max-width: 540px) { .meta-list { grid-template-columns: 1fr; gap: .15rem; } .meta-list dd { margin-bottom: .8rem; } }

/* reference / related-publication list */
.ref-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.ref-list li { padding: .9rem 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); line-height: 1.6; font-size: .95rem; }
.ref-list i { color: var(--teal-deep); }
.ref-list strong { color: var(--terracotta-deep); }

/* back link */
.back-link { display: inline-flex; align-items: center; gap: .4em; font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1.4rem; }
.back-link:hover { color: var(--terracotta); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .research__grid { grid-template-columns: 1fr; }
  .rcard { aspect-ratio: 16 / 9; }
  .proj-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pub-item { grid-template-columns: 1fr; }
  .pub-item > img { width: 100%; height: 180px; }
  .news-row { flex-direction: column; gap: .2rem; }
}
