/* ==========================================================================
   Eagle W. H. Liang — personal site
   Palette: ink slate + calibrated teal, amber reserved for the reliability
   curve motif. Type: Zilla Slab (display) / IBM Plex Sans (body) /
   IBM Plex Mono (labels & dates).
   ========================================================================== */

:root {
  --ink:    #16242f;
  --muted:  #5c6f7b;
  --paper:  #f6f8f7;
  --panel:  #ffffff;
  --teal:   #0e7c6b;
  --teal-d: #0a5a4e;
  --amber:  #c77e1f;
  --line:   #dde5e2;
  --radius: 10px;
  --font-display: "Zilla Slab", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1060px; margin-inline: auto; padding-inline: 1.25rem; }

a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-d); }
a:focus-visible, button:focus-visible, label:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; }
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .55rem;
}
.brand-mark {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500;
  background: var(--teal); color: #fff; padding: .15rem .4rem; border-radius: 6px; letter-spacing: .05em;
}
.nav-links { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-mono); font-size: .85rem; color: var(--ink);
  text-decoration: none; letter-spacing: .02em;
}
.nav-links a:hover { color: var(--teal); }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 720px) {
  .nav-burger {
    display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: .5rem;
  }
  .nav-burger span { width: 20px; height: 2px; background: var(--ink); display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--panel);
    border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem;
  }
  .nav-links li { padding: .5rem 0; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
}

/* ---------- Hero ---------- */
.hero { padding: 4rem 0 1.5rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.hero-grid {
  display: grid; grid-template-columns: 1.25fr .9fr; gap: 3rem; align-items: center;
}
.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal); margin: 0 0 .75rem;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem); line-height: 1.05; margin: 0 0 1rem;
}
.hero-sub { font-size: 1.25rem; margin: 0 0 .75rem; max-width: 32ch; }
.hero-sub em { color: var(--teal-d); font-style: normal; border-bottom: 2px solid var(--amber); }
.hero-affil { color: var(--muted); font-size: .95rem; margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  display: inline-block; font-family: var(--font-mono); font-size: .85rem;
  padding: .55rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; background: var(--panel);
  transition: border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--teal); transform: translateY(-1px); color: var(--teal-d); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-d); color: #fff; }

.hero-visual { display: flex; justify-content: center; }
.portrait-frame { position: relative; margin: 0; width: min(320px, 80%); }
.portrait-frame img {
  width: 100%; height: auto; border-radius: 50%;
  border: 4px solid var(--panel);
  box-shadow: 0 8px 32px rgba(22, 36, 47, .16);
  position: relative; z-index: 1;
}
.calib-svg {
  position: absolute; inset: -12% -14% auto auto; width: 62%; z-index: 0; opacity: .9;
}
.calib-grid line { stroke: var(--line); stroke-width: 1; }
.calib-diag { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; }
.calib-curve { stroke: var(--teal); stroke-width: 2.5; fill: none; }
.calib-dot { fill: var(--amber); }
.calib-label { font-family: var(--font-mono); font-size: 9px; fill: var(--muted); }

.hero-banner { margin-top: 2.5rem; }
.hero-banner img { width: 100%; height: auto; display: block; }

@media (max-width: 840px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { order: -1; }
  .portrait-frame { width: min(240px, 70%); }
}

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--panel); border-block: 1px solid var(--line); }
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.9rem;
  margin: 0 0 2rem; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
}
.tick { color: var(--teal); font-family: var(--font-mono); font-size: 1.2rem; }
.title-link { font-family: var(--font-mono); font-size: .85rem; font-weight: 400; margin-left: auto; }

/* ---------- News timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem;
  padding: 1.1rem 0; border-left: 2px solid var(--line); padding-left: 1.25rem;
  position: relative;
}
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 1.6rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--teal); border: 2px solid var(--paper);
}
.tl-date { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); padding-top: .1rem; }
@media (max-width: 600px) {
  .timeline li { grid-template-columns: 1fr; gap: .25rem; }
}

/* ---------- Publications ---------- */
.year-label {
  font-family: var(--font-mono); font-size: .9rem; color: var(--muted);
  letter-spacing: .1em; margin: 2rem 0 .75rem; text-transform: uppercase;
}
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.pub {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; display: flex; justify-content: space-between; gap: 1.5rem;
  transition: border-color .15s, box-shadow .15s;
}
.pub:hover { border-color: var(--teal); box-shadow: 0 2px 12px rgba(14, 124, 107, .08); }
.pub-main { display: grid; gap: .3rem; }
.pub-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
.pub-authors { font-size: .92rem; color: var(--muted); }
.pub-authors strong { color: var(--ink); }
.pub-note { font-size: .88rem; color: var(--muted); }
.pub-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; flex-shrink: 0; }
.badge {
  font-family: var(--font-mono); font-size: .75rem; white-space: nowrap;
  padding: .25rem .6rem; border-radius: 999px;
}
.badge-conf { background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal-d); }
.pub-link { font-family: var(--font-mono); font-size: .8rem; }
@media (max-width: 640px) {
  .pub { flex-direction: column; }
  .pub-meta { flex-direction: row; align-items: center; }
}

/* ---------- Research topics ---------- */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem;
}
.topic {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.topic h4 { margin: 0 0 .4rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.topic p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------- Lab ---------- */
.lab-intro { max-width: 68ch; margin: 0 0 2rem; }
.lab-loc { display: block; margin-top: .5rem; font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.leader-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.leader-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem; border-top: 3px solid var(--teal);
}
.leader-role {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--amber); margin: 0 0 .35rem;
}
.leader-card h3 { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 .6rem; }
.leader-card p:last-child { margin: 0; font-size: .95rem; color: #33454f; }
@media (max-width: 840px) { .leader-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding-block: 1.5rem; font-size: .88rem; color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--teal); }
