/* ═══════════════════════════════════════════════════════════
   RESEARCH SITE — Warm Editorial Theme
   Fonts: Lora (serif display) + DM Sans (body) + DM Mono
   ═══════════════════════════════════════════════════════════ */

/* ── 0. Custom Properties ─────────────────────────────────── */
:root {
  --cream:      #f9f6ee;
  --warm-white: #f0ead8;
  --sand:       #e0d4b0;
  --tan:        #cfb991;
  --rust:       #cfb991;
  --rust-dark:  #b89a60;
  --ink:        #111111;
  --ink-mid:    #2a2a2a;
  --ink-soft:   #4a4a4a;
  --ink-muted:  #7a7a7a;
  --green:      #5a5200;
  --line:       rgba(0,0,0,.12);

  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;

  --max-w: 1200px;
  --nav-h: 60px;

  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ── 0b. Dark Theme ───────────────────────────────────────── */
[data-theme="dark"] {
  --cream:      #0e0e0e;
  --warm-white: #1a1a1a;
  --sand:       #2a2a2a;
  --tan:        #cfb991;
  --rust:       #cfb991;
  --rust-dark:  #e8d4a8;
  --ink:        #f0ead8;
  --ink-mid:    #d4c9b0;
  --ink-soft:   #a89880;
  --ink-muted:  #6a5e50;
  --green:      #c8b96a;
  --line:       rgba(207,185,145,.12);
}

[data-theme="dark"] .site-header {
  background: rgba(14,14,14,.92);
}

[data-theme="dark"] .nav-links.open {
  background: var(--cream);
}

[data-theme="dark"] .hero-photo-frame {
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

[data-theme="dark"] .project-card.featured {
  background: #1c1608;
  border-color: rgba(207,185,145,.25);
}

.advisor-name,
a.advisor-name,
a.advisor-name:visited {
  color: #8E6F3E !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
a.advisor-name:hover {
  color: #6b5230 !important;
}

[data-theme="dark"] .advisor-name,
[data-theme="dark"] a.advisor-name,
[data-theme="dark"] a.advisor-name:visited {
  color: #DDB945 !important;
}
[data-theme="dark"] a.advisor-name:hover {
  color: #f0cc5a !important;
}

[data-theme="dark"] .btn-primary {
  color: #111;
}
[data-theme="dark"] .btn-primary:hover {
  color: #111;
}

[data-theme="dark"] .tag-link:hover {
  color: #111;
}

[data-theme="dark"] .pub-filter-btn.active,
[data-theme="dark"] .pub-filter-btn:hover {
  color: #111;
}

/* ── Dark toggle button ───────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  padding: .28rem .5rem;
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1;
  transition: border-color .18s, color .18s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--rust);
  color: var(--rust);
}

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

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--rust);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: var(--rust-dark); text-decoration: underline; }

/* ── 2. Navigation ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250,247,242,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: .06em;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--rust); text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: .25rem;
  margin-left: auto;
}

.nav-links a {
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding: .3rem .65rem;
  border-radius: 3px;
  transition: background .18s, color .18s;
}
.nav-links a:hover {
  color: var(--ink);
  background: var(--warm-white);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
  margin-left: auto;
}

/* ── 3. Sections / Layout ─────────────────────────────────── */
.section {
  padding: 5rem 2rem;
  border-top: 1px solid var(--line);
  position: relative;
  background-image: url('../assets/img/bio.gif');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cream);
  opacity: .90;
  z-index: 0;
}

.news-section::before,
.cv-section::before {
  background: var(--warm-white);
  opacity: .92;
}

.contact-section {
  background-image: url('../assets/img/kite.gif');
}

.contact-section::before {
  opacity: .70;
}

.news-section {
  background-image: url('../assets/img/news.gif');
}

.news-section::before {
  opacity: .85;
}

.pub-section {
  background-image: url('../assets/img/pub.gif');
}

.pub-section::before {
  opacity: .85;
}

[data-theme="dark"] .section::before {
  opacity: .92;
}

[data-theme="dark"] .contact-section::before {
  opacity: .70;
}

[data-theme="dark"] .news-section::before {
  opacity: .85;
}

[data-theme="dark"] .pub-section::before {
  opacity: .85;
}

.section-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 2rem;
}

.section-lead {
  max-width: 60ch;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* ── 4. Hero ──────────────────────────────────────────────── */
.hero {
  padding: 2.5rem 2rem 2rem;
  position: relative;
  overflow: hidden;
  background-image: url('../assets/img/hero.gif');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cream);
  opacity: .82;
  z-index: 0;
}

[data-theme="dark"] .hero::before {
  background: var(--cream);
  opacity: .88;
}

.hero-grid {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 680px) 300px;
  gap: 3rem;
  align-items: center;
  justify-content: center;
}

.hero-text {
  margin-top: 0;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--rust);
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1rem;
}
.hero-name em {
  font-style: italic;
  color: var(--rust);
}

.hero-bio {
  max-width: 58ch;
  color: var(--ink-soft);
  margin-bottom: .6rem;
  font-size: .92rem;
}
.hero-bio strong { color: var(--ink-mid); font-weight: 500; }

.hero-links {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: 1rem 0 .75rem;
}

.hero-social {
  font-size: .88rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.hero-social a { color: var(--ink-soft); display: inline-flex; align-items: center; gap: .3rem; }
.hero-social a:hover { color: var(--rust); text-decoration: none; }
.hero-social i { font-size: 1.1em; }
.dot { color: var(--tan); }

/* Photo */
.hero-photo-wrap { display: flex; flex-direction: column; gap: 1.25rem; align-items: center; }

.hero-photo-frame {
  width: 400px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sand);
  box-shadow: 0 8px 40px rgba(28,24,20,.12);
  position: relative;
}
.hero-photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--rust);
  border-radius: 50%;
  pointer-events: none;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-affiliation {
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  width: 400px;
  align-self: center;
  text-align: center;
}
.aff-dept  { font-weight: 500; font-size: .9rem; color: var(--ink-mid); }
.aff-uni   { font-size: .85rem; color: var(--ink-soft); }
.aff-loc   { font-size: .82rem; color: var(--ink-muted); font-family: var(--font-mono); }

/* ── 5. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.4rem;
  border-radius: 3px;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all .2s var(--ease-out);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--rust);
  color: #fff;
  border: 1.5px solid var(--rust);
}
.btn-primary:hover {
  background: var(--rust-dark);
  border-color: var(--rust-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(184,92,56,.28);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-mid);
  border: 1.5px solid var(--sand);
}
.btn-ghost:hover {
  border-color: var(--tan);
  background: var(--warm-white);
  color: var(--ink);
}

/* ── 6. Tag Links ─────────────────────────────────────────── */
.tag-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--rust);
  border: 1px solid rgba(184,92,56,.3);
  border-radius: 2px;
  padding: .1rem .5rem;
  transition: all .15s;
}
.tag-link:hover {
  background: var(--rust);
  color: #fff;
  border-color: var(--rust);
  text-decoration: none;
}

/* ── 7. News ──────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.news-toggle-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--rust);
  cursor: pointer;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 0;
}
.news-toggle-btn:hover { color: var(--rust-dark); text-decoration: underline; }

.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  display: flex;
  gap: 2rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  transition: opacity .3s, max-height .4s var(--ease-out);
}
.news-item:first-child { border-top: 1px solid var(--line); }

.news-date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-muted);
  flex-shrink: 0;
  width: 5.5rem;
  padding-top: .05rem;
  letter-spacing: .02em;
}

.news-text { color: var(--ink-soft); }
.news-text em  { font-style: italic; color: var(--ink-mid); }
.news-text strong { font-weight: 500; color: var(--ink); }

.news-hidden { display: none; }
.news-hidden.visible { display: flex; }

/* ── 8. Research Projects ─────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow .25s, transform .25s var(--ease-out);
}
.project-card:hover {
  box-shadow: 0 6px 28px rgba(28,24,20,.09);
  transform: translateY(-2px);
}
.project-card.featured {
  border-color: rgba(184,92,56,.3);
  background: #fdf6f0;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 400;
}
.project-tag.completed { color: var(--green); }

.project-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.project-desc {
  font-size: .93rem;
  color: var(--ink-soft);
  line-height: 1.65;
  flex: 1;
}

.project-meta {
  list-style: none;
  font-size: .82rem;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-family: var(--font-mono);
}

.project-links { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── 9. Publications ──────────────────────────────────────── */
.pub-filter {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.pub-filter-btn {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .3rem .8rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all .18s;
}
.pub-filter-btn.active,
.pub-filter-btn:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: opacity .2s;
  align-items: flex-start;
}
.pub-item:first-child { border-top: 1px solid var(--line); }
.pub-item.hidden { display: none; }

.pub-thumb {
  flex-shrink: 0;
  width: 280px;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--sand);
  overflow: hidden;
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

.pub-year {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--rust);
  flex-shrink: 0;
  width: 3.5rem;
  font-weight: 400;
  padding-top: .15rem;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .35rem;
}
.pub-title a { color: var(--ink); }
.pub-title a:hover { color: var(--rust); text-decoration: none; }

.pub-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(58,107,74,.3);
  border-radius: 2px;
  padding: .05rem .4rem;
  margin-left: .5rem;
  vertical-align: middle;
  font-weight: 400;
}

.pub-authors {
  font-size: .9rem;
  color: var(--ink-soft);
  margin-bottom: .2rem;
}
.pub-authors strong { color: var(--ink); font-weight: 500; }

.pub-venue {
  font-size: .88rem;
  color: var(--ink-muted);
  margin-bottom: .6rem;
}

.pub-links { display: flex; gap: .4rem; flex-wrap: wrap; }

.pub-note {
  text-align: center;
  margin-top: 2.5rem;
  font-size: .9rem;
  color: var(--ink-muted);
}

/* ── 10. CV ───────────────────────────────────────────────── */

.cv-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.cv-header-row .section-title { margin-bottom: 0; }

.cv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.cv-group-title {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 1.75rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.cv-group-title:first-child { margin-top: 0; }

.cv-entry {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.1rem;
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.cv-entry strong { color: var(--ink-mid); font-weight: 500; }
.cv-entry em     { font-style: italic; font-size: .9em; }

.cv-date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-muted);
  flex-shrink: 0;
  width: 5.5rem;
  padding-top: .1rem;
}

.cv-skills { display: flex; flex-wrap: wrap; gap: .5rem; }

.skill-tag {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-mid);
  background: var(--sand);
  border-radius: 3px;
  padding: .2rem .6rem;
  letter-spacing: .02em;
}

/* ── 11. Contact ──────────────────────────────────────────── */
.contact-inner { max-width: 700px; }

.contact-lead {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 52ch;
  margin-bottom: 2.5rem;
}

.contact-cards {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.contact-card {
  flex: 1;
  min-width: 220px;
  background: var(--warm-white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.contact-icon { font-size: 1.4rem; }
.contact-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.contact-value {
  font-size: .95rem;
  color: var(--ink-mid);
  line-height: 1.5;
}
a.contact-value { color: var(--rust); }

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.contact-social a {
  font-size: .88rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  letter-spacing: .03em;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.contact-social a:hover { color: var(--rust); }

/* ── 12. Footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  background: var(--ink);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-muted);
  letter-spacing: .04em;
}
.site-footer a { color: var(--tan); }
.site-footer a:hover { color: #fff; }

/* ── 13. Placeholder SVG photo ────────────────────────────── */
/* (Used until you replace with your real photo) */

/* ── 14. Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo-wrap {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .hero-photo-frame { width: 380px; flex-shrink: 0; aspect-ratio: 1; border-radius: 50%; }
  .hero-affiliation  { flex: 1; }

  .cv-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 1rem 2rem;
    gap: .25rem;
  }
  .nav-toggle { display: block; }

  .hero-photo-wrap { flex-direction: column; }
  .hero-photo-frame { width: 100%; max-width: 460px; margin: 0 auto; }
  .hero-affiliation  { text-align: center; }

  .pub-item { flex-direction: column; gap: .5rem; }
  .pub-year { width: auto; }
  .pub-thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; }

  .news-item { flex-direction: column; gap: .1rem; }
  .news-date { width: auto; }

  .contact-cards { flex-direction: column; }

  .section { padding: 3.5rem 1.25rem; }
  .hero     { padding: 3rem 1.25rem 2.5rem; }
}

/* ── 15. Page Load Animation ──────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-label  { animation: fadeUp .6s .05s var(--ease-out) both; }
.hero-name   { animation: fadeUp .7s .15s var(--ease-out) both; }
.hero-bio    { animation: fadeUp .6s .25s var(--ease-out) both; }
.hero-links  { animation: fadeUp .6s .35s var(--ease-out) both; }
.hero-social { animation: fadeUp .5s .42s var(--ease-out) both; }
.hero-photo-wrap { animation: fadeUp .7s .2s  var(--ease-out) both; }
