/* =========================================================
   Haonan (Eric) Gao — personal site
   Clean, modern, minimal. Edit the variables below to retheme.
   ========================================================= */
:root{
  --ink:#1b2430;        /* primary text / big headings */
  --navy:#1e3a5f;       /* primary accent (buttons, eyebrows) */
  --navy-2:#2c5a8c;     /* links / subtitle */
  --muted:#5d6675;      /* secondary text */
  --line:#e7e9ee;       /* borders */
  --bg:#ffffff;
  --bg-alt:#f6f7f9;     /* alternating section background */
  --chip:#eef2f7;
  --serif:Georgia,"Times New Roman",serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --maxw:1400px;
}
[id]{scroll-margin-top:84px;}  /* keep anchored sections clear of the sticky nav */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;color:var(--ink);font-family:var(--sans);line-height:1.65;background:var(--bg);
  min-height:100vh;display:flex;flex-direction:column;}
img{max-width:100%;display:block}
a{color:var(--navy-2)}
.container{max-width:var(--maxw);margin:0 auto;padding:0 24px;}
.eyebrow{margin:0 0 .6rem;color:var(--navy);font-size:.80rem;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;}
h2.section-title{font-family:var(--serif);font-weight:400;color:var(--ink);
  font-size:clamp(1.7rem,3vw,2.25rem);line-height:1.15;margin:0 0 1.6rem;}

/* ---------- nav ---------- */
.nav{position:sticky;top:0;z-index:30;background:rgba(255,255,255,.9);
  backdrop-filter:saturate(180%) blur(10px);border-bottom:1px solid var(--line);}
.nav-inner{max-width:var(--maxw);margin:0 auto;padding:.7rem 24px;display:flex;
  align-items:center;justify-content:space-between;gap:1rem;}
.brand{display:flex;align-items:center;gap:.65rem;text-decoration:none;color:var(--ink);min-width:0;}
.brand img{width:38px;height:38px;border-radius:50%;object-fit:cover;}
.brand .nm{font-weight:600;font-size:.95rem;line-height:1.15;}
.brand .sb{font-size:.80rem;color:var(--muted);line-height:1.15;}
.navlinks{display:flex;gap:.2rem;flex-wrap:wrap;}
.navlinks a{color:var(--ink);text-decoration:none;font-size:.9rem;font-weight:500;
  padding:.4rem .7rem;border-radius:7px;transition:background .15s,color .15s;}
.navlinks a:hover{background:var(--bg-alt);color:var(--navy);}
.navlinks a.active{background:#eaf0f7;color:var(--navy);}

/* ---------- hero ---------- */
.hero{display:grid;grid-template-columns:1.45fr 1fr;gap:10rem;align-items:center;
  padding:3.8rem 0 3.2rem;}
.hero h1{font-family:var(--serif);font-weight:400;color:var(--ink);
  font-size:clamp(2.2rem,4.6vw,3.4rem);line-height:1.08;margin:.1rem 0 .5rem;}
.hero .title{color:var(--navy-2);font-weight:700;font-size:1.08rem;margin:0 0 1.1rem;}
.hero .bio{color:#39414e;font-size:1.02rem;margin:0 0 1.6rem;}
.btn-row{display:flex;gap:.7rem;flex-wrap:wrap;margin-bottom:1.1rem;}
.btn{display:inline-block;text-decoration:none;font-weight:600;font-size:.95rem;
  padding:.62rem 1.25rem;border-radius:8px;transition:transform .12s,box-shadow .15s,background .15s,border-color .15s;}
.btn.primary{background:var(--navy);color:#fff;box-shadow:0 6px 16px rgba(30,58,95,.22);}
.btn.primary:hover{transform:translateY(-1px);box-shadow:0 9px 22px rgba(30,58,95,.3);}
.btn.ghost{background:#fff;color:var(--navy);border:1.5px solid #cdd6e2;}
.btn.ghost:hover{border-color:var(--navy);background:var(--bg-alt);}
.textlinks{display:flex;gap:1.1rem;flex-wrap:wrap;font-size:.92rem;}
.textlinks a{color:var(--muted);text-decoration:none;font-weight:600;
  border-bottom:1.5px solid transparent;transition:color .15s,border-color .15s;}
.textlinks a:hover{color:var(--navy);border-color:var(--navy);}
.hero-photo{width:95%;border-radius:14px;box-shadow:0 14px 40px rgba(27,36,48,.16);}

/* ---------- sections ---------- */
.section{padding:3.4rem 0;}
.section.alt{background:var(--bg-alt);border-top:1px solid var(--line);border-bottom:1px solid var(--line);}

/* research themes */
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:1.4rem;}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1.4rem;}
.card{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;
  display:flex;flex-direction:column;transition:transform .18s,box-shadow .2s,border-color .2s;}
.card:hover{transform:translateY(-3px);box-shadow:0 14px 30px rgba(27,36,48,.1);border-color:#d7dde6;}
.card .fig{width:100%;height:380px;object-fit:contain;background:var(--bg-alt);border-bottom:1px solid var(--line);}
.card .body{padding:1.1rem 1.2rem 1.25rem;display:flex;flex-direction:column;flex:1;}
.card .body h3{font-size:1.08rem;line-height:1.3;margin:0 0 .5rem;color:var(--ink);font-weight:700;}
.card .body p{color:var(--muted);font-size:.94rem;margin:0;flex:1;}

/* publications */
.year{font-family:var(--serif);font-weight:400;color:var(--ink);font-size:1.4rem;margin:1.8rem 0 .3rem;}
.year-rule{border:0;border-top:1px solid var(--line);margin:0 0 1.1rem;}
.pub{background:var(--bg-alt);border:1px solid var(--line);border-radius:12px;
  padding:1.2rem 1.4rem;margin-bottom:1.1rem;}
.pub .pt{font-weight:700;color:var(--ink);font-size:1.02rem;margin:0 0 .3rem;line-height:1.35;}
.pub .pt a{color:inherit;text-decoration:none;}
.pub .pt a:hover{color:var(--navy);}
.pub .au{color:#39414e;font-size:.94rem;margin:0 0 .2rem;}
.pub .au .me{font-weight:700;color:var(--navy);}
.pub .ve{color:var(--navy-2);font-style:italic;font-size:.92rem;margin:0 0 .55rem;}
.tags{display:flex;gap:.4rem;flex-wrap:wrap;}

/* abstract preview toggle */
.pub .abs{margin-top:.7rem;}
.pub .abs summary{cursor:pointer;display:inline-block;color:var(--navy);font-size:.86rem;
  font-weight:700;list-style:none;border-bottom:1.5px solid transparent;transition:border-color .15s;}
.pub .abs summary::-webkit-details-marker{display:none;}
.pub .abs summary::before{content:"\25B8  ";font-size:.8em;}
.pub .abs[open] summary::before{content:"\25BE  ";}
.pub .abs summary:hover{border-color:var(--navy);}
.pub .abs .abs-body{margin-top:.6rem;color:#39414e;font-size:.93rem;line-height:1.6;
  background:#fff;border:1px solid var(--line);border-radius:8px;padding:.8rem 1rem;}
.tag{background:var(--chip);color:var(--navy);font-size:.72rem;font-weight:700;padding:.2rem .6rem;border-radius:999px;}

/* education */
.edu{background:#fff;border:1px solid var(--line);border-radius:10px;padding:1.3rem 1.35rem;}
.edu .deg{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--navy);margin:0 0 .55rem;}
.edu .fd{font-weight:700;color:var(--ink);margin:0;}
.edu .sc{font-weight:700;color:var(--ink);margin:.15rem 0;}
.edu .lo{color:var(--muted);font-size:.92rem;margin:0;}
.edu .yr{color:var(--navy-2);font-weight:700;font-size:.9rem;margin:.6rem 0 0;}

/* contact cards */
.contact-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:1.3rem 1.4rem;}
.contact-card .lbl{font-family:var(--serif);font-weight:700;color:var(--ink);font-size:1.08rem;margin:0 0 .4rem;}
.contact-card a{color:var(--navy-2);text-decoration:none;font-size:.95rem;word-break:break-word;}
.contact-card a:hover{text-decoration:underline;}
.contact-card .val{color:var(--navy-2);font-size:.95rem;word-break:break-word;}

/* footer */
.footer{background:var(--bg-alt);border-top:1px solid var(--line);padding:2.2rem 0;margin-top:auto;}
.footer-inner{max-width:var(--maxw);margin:0 auto;padding:0 24px;display:flex;
  justify-content:space-between;gap:1rem;flex-wrap:wrap;}
.footer .nm{font-weight:700;color:var(--ink);}
.footer .sb{color:var(--muted);font-size:.92rem;}
.footer .rt{color:var(--muted);font-size:.92rem;text-align:right;}
.footer .rt a{color:var(--navy);text-decoration:none;}

/* card footer link (home research themes -> research page) */
.card .body .more{margin-top:.9rem;align-self:flex-start;color:var(--navy);
  text-decoration:none;font-size:.88rem;font-weight:700;}
.card .body .more:hover{text-decoration:underline;}

/* ---------- inner page header ---------- */
.page-head{padding:3rem 0 1rem;}
.page-head h1{font-family:var(--serif);font-weight:400;color:var(--ink);
  font-size:clamp(2rem,4vw,2.8rem);line-height:1.1;margin:.2rem 0 .6rem;}
.page-head p.lead{color:#39414e;font-size:1.05rem;margin:0;max-width:60rem;}

/* ---------- research theme blocks ---------- */
.theme-block{padding:2.4rem 0;border-top:1px solid var(--line);}
.theme-block:first-of-type{border-top:0;}
.theme-block h2{font-family:var(--serif);font-weight:400;color:var(--ink);
  font-size:clamp(1.5rem,2.6vw,2rem);margin:.2rem 0 .4rem;}
.theme-block .theme-desc{color:var(--muted);margin:0 0 1.6rem;max-width:60rem;}

/* project = left figure (with caption) + right text, wrapped in a soft gray frame */
.project{display:grid;grid-template-columns:minmax(0,1.05fr) 1fr;gap:1.8rem;
  align-items:start;margin-bottom:1.4rem;
  background:var(--bg-alt);border:1px solid var(--line);border-radius:12px;padding:1.5rem;}
.project .pfig{margin:0;background:#fff;border:1px solid var(--line);
  border-radius:10px;padding:14px;}
.project .pfig img{width:100%;height:auto;display:block;border-radius:6px;}
.project .pfig figcaption{margin-top:.65rem;color:var(--muted);font-size:.82rem;line-height:1.45;}
.project .pbody{padding:0;}
.project .pbody h3{font-family:var(--serif);font-size:1.35rem;line-height:1.28;
  margin:0 0 .5rem;color:var(--ink);font-weight:600;}
.project .pbody h3 a{color:inherit;text-decoration:none;}
.project .pbody h3 a:hover{color:var(--navy);}
.project .pmeta{font-size:.98rem;margin:0 0 .8rem;color:var(--navy-2);font-weight:500;}
.project .pmeta b{color:var(--navy);font-weight:700;}
.project .pmeta .pbadge{display:inline-block;background:var(--chip);color:var(--navy);
  font-size:.85rem;font-weight:700;padding:.14rem .55rem;border-radius:999px;margin:0 .12rem;vertical-align:.06em;}
.project .pdesc{color:#39414e;font-size:.98rem;margin:0 0 1.05rem;}
.project .plinks{display:flex;gap:1.2rem;flex-wrap:wrap;}
.project .plinks a{color:var(--navy);font-size:.9rem;font-weight:700;text-decoration:none;
  border-bottom:1.5px solid transparent;transition:border-color .15s;}
.project .plinks a:hover{border-color:var(--navy);}
.project.no-fig{grid-template-columns:1fr;}

/* ---------- list blocks (activities / awards) ---------- */
.list-block{padding:1.6rem 0;border-top:1px solid var(--line);}
.list-block:first-of-type{border-top:0;}
.list-block h2{font-family:var(--serif);font-weight:400;color:var(--ink);font-size:1.4rem;margin:0 0 .9rem;}
.list-block h3{font-size:.78rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--navy);margin:1.1rem 0 .5rem;}
.simple-list{list-style:none;margin:0;padding:0;}
.simple-list li{padding:.55rem 0;border-bottom:1px solid var(--line);display:flex;
  justify-content:space-between;gap:1rem;flex-wrap:wrap;}
.simple-list li:last-child{border-bottom:0;}
.simple-list .l b{color:var(--ink);}
.simple-list .l .sub{color:var(--muted);font-size:.9rem;display:block;}
.simple-list .yr{color:var(--navy-2);font-weight:700;font-size:.9rem;white-space:nowrap;}

@media(max-width:860px){
  .hero{grid-template-columns:1fr;gap:1.8rem;padding:2.6rem 0;}
  .hero-photo{max-width:300px;}
  .grid-2,.grid-3{grid-template-columns:1fr;}
  .project{grid-template-columns:1fr;}
  .project .fig{min-height:160px;max-height:220px;border-right:0;border-bottom:1px solid var(--line);}
  .brand .sb{display:none;}
}
