/* ==========================================================================
   CliGenAILab / Cong Liu — shared site styles
   Palette: Harvard crimson + Boston Children's Hospital blue
   ========================================================================== */

:root {
  --crimson: #a51c30;
  --crimson-dark: #7e1526;
  --crimson-tint: #f8ecee;
  --bch-blue: #164989;
  --bch-blue-dark: #0f3566;
  --bch-blue-tint: #eaf0f8;
  --ink: #1d2330;
  --ink-soft: #4a5263;
  --muted: #6b7385;
  --line: #e3e6ec;
  --paper: #ffffff;
  --page: #f7f7f5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--bch-blue); text-decoration-color: rgba(22, 73, 137, .35); text-underline-offset: 3px; }
a:hover { color: var(--crimson); text-decoration-color: currentColor; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.65rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(6px);
  border-top: 4px solid var(--crimson);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.hms-lockup { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.hms-lockup img { height: 38px; width: auto; }
.hms-lockup span { font-family: var(--serif); font-size: .78rem; line-height: 1.1; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.brand-divider { width: 1px; height: 34px; background: var(--line); }
.bch-logo { height: 38px; width: auto; display: block; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  font-size: .93rem; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--bch-blue); background: var(--bch-blue-tint); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(135deg, var(--bch-blue-dark) 0%, var(--bch-blue) 60%, #1f5ea8 100%);
  color: #fff;
  padding: 64px 0 56px;
  position: relative;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--crimson); }
.hero h1 { color: #fff; margin-bottom: .2em; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; opacity: .85; margin-bottom: .8em; }
.hero .lead { font-size: 1.25rem; max-width: 46ch; opacity: .95; margin-bottom: 1.4em; }
.hero .affil { font-size: .95rem; opacity: .8; }
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1.5px solid transparent; margin: 0 8px 8px 0;
}
.btn-light { background: #fff; color: var(--bch-blue); }
.btn-light:hover { background: var(--crimson-tint); color: var(--crimson); }
.btn-ghost { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--paper); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.section-title h2 { margin: 0; }
.section-title::before { content: ""; width: 28px; height: 3px; background: var(--crimson); border-radius: 2px; transform: translateY(-6px); flex: none; }
.section-sub { color: var(--muted); margin-top: -12px; margin-bottom: 24px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split { display: grid; grid-template-columns: 1.7fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35em; }
.card p:last-child { margin-bottom: 0; }
.card-accent { border-top: 3px solid var(--bch-blue); }
.card-accent.crimson { border-top-color: var(--crimson); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { background: var(--bch-blue-tint); color: var(--bch-blue-dark); font-weight: 600; font-size: .9rem; padding: 5px 12px; border-radius: 999px; }

/* ---------- News timeline ---------- */
.news-year { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--crimson); margin: 28px 0 10px; }
.news-year:first-of-type { margin-top: 0; }
.news { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.news li { position: relative; padding: 8px 0 10px 22px; }
.news li::before {
  content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--bch-blue);
}
.news li.highlight::before { background: var(--crimson); border-color: var(--crimson); }
.news time { display: inline-block; min-width: 72px; font-weight: 700; color: var(--ink-soft); font-size: .9rem; }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 1px 8px; border-radius: 4px; margin-right: 6px; vertical-align: 2px;
  background: var(--bch-blue-tint); color: var(--bch-blue-dark);
}
.tag.pub { background: var(--crimson-tint); color: var(--crimson-dark); }
.tag.talk { background: #eef5ec; color: #2f6a2a; }
.tag.team { background: #fdf3e3; color: #8a5a00; }
details.more { margin-top: 18px; }
details.more summary {
  cursor: pointer; font-weight: 600; color: var(--bch-blue); list-style: none; display: inline-block;
  padding: 6px 14px; border: 1.5px solid var(--bch-blue); border-radius: 999px; font-size: .92rem;
}
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 12px; }
details.more summary:hover { background: var(--bch-blue-tint); }

/* ---------- People ---------- */
.person { display: flex; gap: 14px; align-items: center; }
.avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.1rem;
  color: #fff; background: var(--bch-blue);
}
.avatar.c2 { background: var(--crimson); }
.avatar.c3 { background: #2f6f8f; }
.avatar.c4 { background: #5a4f8a; }
.person .name { font-weight: 700; line-height: 1.3; }
.person .role { color: var(--muted); font-size: .92rem; line-height: 1.35; }
.pi-card { display: flex; gap: 20px; align-items: center; }
.pi-card .avatar { width: 72px; height: 72px; font-size: 1.5rem; }
.group-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 30px 0 12px; }
.alumni { columns: 2 300px; column-gap: 32px; padding-left: 18px; margin: 0; }
.alumni li { margin-bottom: 6px; break-inside: avoid; }
.alumni .role { color: var(--muted); }

/* ---------- Publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pubs li { padding: 12px 0 12px 0; border-bottom: 1px dashed var(--line); }
.pubs li:last-child { border-bottom: 0; }
.pubs .title { font-weight: 600; }
.pubs .venue { font-style: italic; }
.pubs .authors { color: var(--ink-soft); }

/* ---------- Prose pages ---------- */
.page-head { padding: 48px 0 8px; }
.page-head .eyebrow { color: var(--crimson); text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; margin-bottom: .6em; }
.page-head .sub { color: var(--muted); font-size: 1.15rem; }
.prose { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px clamp(20px, 5vw, 48px); box-shadow: var(--shadow); margin: 24px auto 56px; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.callout { background: var(--bch-blue-tint); border-left: 4px solid var(--bch-blue); padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5em 0; }
.callout.crimson { background: var(--crimson-tint); border-left-color: var(--crimson); }
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.link-list a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.link-list a strong { display: block; color: var(--bch-blue); }
.link-list a span { color: var(--muted); font-size: .92rem; }
.link-list a:hover { border-color: var(--crimson); }
.link-list a:hover strong { color: var(--crimson); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bch-blue-dark); color: rgba(255, 255, 255, .85); padding: 40px 0 28px; font-size: .95rem; border-top: 4px solid var(--crimson); }
.site-footer a { color: #fff; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.footer-logos { display: flex; align-items: center; gap: 16px; }
.footer-logos .hms-lockup { color: #fff; }
.footer-logos .bch-logo { height: 44px; }
.footer-meta { font-size: .85rem; opacity: .75; width: 100%; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 16px; }

@media (max-width: 640px) {
  html { scroll-padding-top: 0; }
  body { font-size: 16px; }
  .site-header { position: static; }
  .hms-lockup span { display: none; }
  .site-nav a { padding: 4px 8px; font-size: .88rem; }
  .hero { padding: 44px 0 40px; }
  .section { padding: 40px 0; }
}

@media print {
  .site-header, .site-footer, .hero .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card, .prose { box-shadow: none; }
}
