/* ====== base ====== */
:root {
  --ink: #1b2733;
  --ink-soft: #45596b;
  --accent: #1769aa;
  --accent-deep: #0f4c81;
  --accent-warm: #e8704a;
  --paper: #ffffff;
  --paper-alt: #f2f6f9;
  --line: #dbe4ec;
  --hero-grad: linear-gradient(135deg, #0d2b45 0%, #11436b 55%, #155a8a 100%);
  --radius: 14px;
  --shadow: 0 2px 14px rgba(16, 42, 67, .10);
  --shadow-lg: 0 10px 30px rgba(16, 42, 67, .16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== nav ====== */
#navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13, 43, 69, .92);
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: .65rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-dot { color: var(--accent-warm); }
#nav-links { display: flex; gap: 1.4rem; list-style: none; }
#nav-links a { color: #cfe0ee; font-size: .92rem; font-weight: 500; }
#nav-links a:hover { color: #fff; text-decoration: none; }
#nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* ====== hero ====== */
.hero { background: var(--hero-grad); color: #fff; padding: 4.5rem 1.2rem 0; }
.hero-inner { max-width: 1080px; margin: 0 auto; }
.hero-kicker {
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
  color: #9fc3e0; margin-bottom: .8rem;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); line-height: 1.05; margin-bottom: 1rem; }
.hero-tagline { font-size: clamp(1.05rem, 2.4vw, 1.35rem); color: #dcebf7; margin-bottom: 1.1rem; }
.hero-tagline strong { color: #fff; }
.hero-blurb { max-width: 46rem; color: #b9d2e6; font-size: .98rem; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 3rem; }
.btn {
  display: inline-block; padding: .65rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent-warm); color: #fff; box-shadow: 0 4px 14px rgba(232,112,74,.4); }
.btn-ghost { border: 1.5px solid #7fa8c9; color: #e8f1f8; }
.hero-stats {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,.18);
  padding: 1.4rem 0 1.6rem; gap: 1rem;
}
.stat { text-align: left; }
.stat-num { display: block; font-size: 2.1rem; font-weight: 700; color: #fff; line-height: 1.1; }
.stat-num small { font-size: 1.1rem; font-weight: 600; margin-left: .1em; }
.stat-label { font-size: .82rem; color: #a7c6de; }

/* ====== sections ====== */
.section { max-width: 1080px; margin: 0 auto; padding: 4rem 1.2rem 3.5rem; }
.section-alt {
  max-width: none; background: var(--paper-alt);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section-alt > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.section h2 { font-size: 1.9rem; margin-bottom: .6rem; }
.sec-num { color: var(--accent-warm); font-size: 1.05rem; vertical-align: .35em; margin-right: .4rem; font-weight: 700; }
.sec-lead { color: var(--ink-soft); max-width: 52rem; margin-bottom: 2.2rem; }

/* ====== research theme cards ====== */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.theme-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.theme-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.theme-card h3 { font-size: 1.08rem; margin-bottom: .6rem; color: var(--accent-deep); }
.theme-card p { font-size: .9rem; color: var(--ink-soft); }

/* ====== publications ====== */
.pub-filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-btn {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft);
  padding: .42rem 1.1rem; border-radius: 999px; font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

.pub-list { display: flex; flex-direction: column; gap: 1.6rem; }
.pub {
  display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow);
}
.pub.hidden { display: none; }
.pub-fig { position: relative; align-self: start; }
.pub-fig img {
  width: 100%; height: 210px; object-fit: cover; object-position: center top;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
  cursor: zoom-in; transition: transform .18s ease;
}
.pub-fig img:hover { transform: scale(1.02); }
.fig-cap { display: block; font-size: .72rem; color: #7b8da0; margin-top: .4rem; font-style: italic; }
.pub-meta { display: flex; align-items: center; gap: .7rem; margin-bottom: .45rem; }
.pub-year { font-weight: 800; color: var(--accent-deep); font-size: 1.02rem; }
.pub-tag {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  padding: .18rem .6rem; border-radius: 999px;
}
.tag-journal { background: #e3f0fa; color: #0f5c96; }
.tag-conf { background: #fdeee7; color: #c05224; }
.tag-thesis { background: #eae7f7; color: #5b4a9e; }
.tag-proj { background: #e7f5ec; color: #1e7a45; }
.pub-body h3 { font-size: 1.12rem; line-height: 1.35; margin-bottom: .4rem; }
.pub-authors { font-size: .86rem; color: var(--ink-soft); margin-bottom: .55rem; }
.pub-summary { font-size: .9rem; color: var(--ink-soft); margin-bottom: .5rem; }
.pub-links { font-size: .84rem; }

.pub-pending {
  margin-top: 2.6rem; background: var(--paper); border: 1px dashed #b8c8d6;
  border-radius: var(--radius); padding: 1.4rem 1.6rem;
}
.pub-pending h3 { font-size: 1rem; color: var(--accent-deep); margin-bottom: .7rem; }
.pub-pending ul { list-style: none; }
.pub-pending li { font-size: .88rem; color: var(--ink-soft); padding: .3rem 0; border-bottom: 1px solid var(--paper-alt); }
.pub-pending li:last-child { border-bottom: 0; }

/* ====== projects ====== */
.proj {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 2rem;
  align-items: center; margin-bottom: 3rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow);
}
.proj-rev { grid-template-columns: 1.15fr 1fr; }
.proj-rev .proj-media { order: 2; }
.proj-rev .proj-body { order: 1; }
.proj-media img, .proj-media video {
  width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.proj-body h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.proj-body > p { font-size: .93rem; color: var(--ink-soft); margin-bottom: .8rem; }
.proj-points { list-style: none; }
.proj-points li {
  font-size: .88rem; color: var(--ink-soft); padding: .42rem 0 .42rem 1.3rem; position: relative;
}
.proj-points li::before {
  content: "▸"; position: absolute; left: .2rem; color: var(--accent-warm); font-weight: 700;
}

/* ====== skills ====== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.skill-group {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.skill-group h3 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent-warm); margin-bottom: .7rem;
}
.skill-group ul { list-style: none; }
.skill-group li { font-size: .89rem; padding: .22rem 0; color: var(--ink-soft); }
.skills-note { margin-top: 1.8rem; font-size: .88rem; color: var(--ink-soft); font-style: italic; }

/* ====== education ====== */
.edu-list { display: flex; flex-direction: column; }
.edu {
  display: grid; grid-template-columns: 140px 1fr; gap: 1.4rem;
  padding: 1.3rem 0; border-bottom: 1px solid var(--line);
}
.edu:last-child { border-bottom: 0; }
.edu-when { font-weight: 700; color: var(--accent-deep); }
.edu-body h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.edu-note { font-size: .88rem; color: var(--ink-soft); margin-bottom: .3rem; }
.edu-courses { font-size: .82rem; color: #7b8da0; }
.edu-courses b { color: var(--accent-deep); }

/* ====== contact ====== */
.section-contact { text-align: center; padding-bottom: 5rem; }
.contact-lead { color: var(--ink-soft); margin-bottom: 1.6rem; }
.contact-row { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.contact-chip {
  display: inline-block; padding: .7rem 1.5rem; border-radius: 999px;
  background: var(--paper-alt); border: 1px solid var(--line);
  font-weight: 600; font-size: .95rem; color: var(--ink);
}
a.contact-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ====== footer ====== */
footer {
  background: #0d2b45; color: #8fb3cf; text-align: center;
  font-size: .8rem; padding: 1.6rem 1rem;
}

/* ====== lightbox ====== */
#lightbox {
  position: fixed; inset: 0; background: rgba(10, 24, 38, .92); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 3vh 3vw;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 94vw; max-height: 88vh; width: auto; height: auto;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
#lightbox .lb-cap {
  position: absolute; bottom: 2.5vh; left: 0; right: 0; text-align: center;
  color: #cfe0ee; font-size: .9rem; font-style: italic;
}

/* ====== reveal animation ====== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ====== responsive ====== */
@media (max-width: 900px) {
  .cards-3, .skills-grid { grid-template-columns: 1fr 1fr; }
  .proj, .proj-rev { grid-template-columns: 1fr; }
  .proj-rev .proj-media { order: 0; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  #nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(13, 43, 69, .98); flex-direction: column; gap: 0; padding: .5rem 0;
  }
  #nav-links.open { display: flex; }
  #nav-links li { padding: .55rem 1.4rem; }
  #nav-toggle { display: block; }
  .cards-3, .skills-grid { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; }
  .pub-fig img { height: auto; max-height: 260px; }
  .edu { grid-template-columns: 1fr; gap: .2rem; }
}
