/* ============================================================
   Wang Lab — The Ohio State University
   Single-page lab site. Plain CSS, no build step.
   ============================================================ */

:root {
  --scarlet: #bb0000;
  --scarlet-dark: #8f0000;
  --ink: #1f2328;
  --body: #3b4149;
  --muted: #6b7280;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-hero: #fbf6f6;
  --maxw: 1080px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  overflow-wrap: break-word;
  /* Guard against accidental horizontal overflow WITHOUT breaking `position: sticky`.
     `overflow-x: clip` (unlike `hidden`) does not create a scroll container, so the
     sticky navbar keeps floating on scroll. */
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--scarlet); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; }

/* ---------------------------- NAV ---------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  /* -webkit- prefix kept: unprefixed backdrop-filter only landed in Safari 18, so without
     it the frosted nav silently degrades to flat white on earlier Safari / iOS Safari. */
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.25rem; }
.brand-accent { color: var(--scarlet); }

.nav-menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-menu a {
  display: block; padding: 8px 12px; color: var(--body); font-size: .93rem; font-weight: 500;
  border-radius: 8px;
}
.nav-menu a:hover { color: var(--scarlet); background: var(--bg-alt); text-decoration: none; }
.nav-menu a.active { color: var(--scarlet); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px;
  background: none; border: 0; cursor: pointer; padding: 9px 8px;
}
.nav-toggle span { height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------- HERO ---------------------------- */
.hero { background: linear-gradient(180deg, var(--bg-hero), var(--bg)); border-bottom: 1px solid var(--line); }
.hero-inner { padding: 84px 24px 72px; }
.hero-text { max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600;
  color: var(--scarlet); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0 0 18px; letter-spacing: -.02em; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--body); margin: 0 0 18px; }
.pi-line { color: var(--muted); margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn { display: inline-block; padding: 11px 22px; border-radius: 999px; font-weight: 600;
  font-size: .95rem; cursor: pointer; transition: .18s; border: 1.5px solid transparent; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--scarlet); color: #fff; }
.btn-primary:hover { background: var(--scarlet-dark); }
.btn-ghost { border-color: var(--scarlet); color: var(--scarlet); background: #fff; }
.btn-ghost:hover { background: var(--bg-hero); }

/* ---------------------------- SECTIONS ---------------------------- */
.section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin: 0 0 8px; }
.section-title::after {
  content: ""; display: block; width: 52px; height: 3px; background: var(--scarlet);
  border-radius: 3px; margin-top: 12px;
}
.section-intro { max-width: 780px; color: var(--body); margin: 20px 0 34px; font-size: 1.05rem; }

/* ---------------------------- CARDS ---------------------------- */
.cards { display: grid; gap: 20px; }
/* The four research themes are laid out as a fixed 2x2. An auto-fit grid would fit three
   across at desktop widths and leave a single orphan card alone on the second row. */
.research-cards { grid-template-columns: repeat(2, 1fr); }
.resource-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 14px 32px rgba(0,0,0,.08); }
.card-icon { font-size: 1.8rem; margin-bottom: 12px; }
.card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.card p { margin: 0; color: var(--body); font-size: .97rem; }
.resource-card h3 { color: var(--scarlet); }
.resource-links { margin-top: 14px !important; }
.tag { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .85rem; color: var(--muted); background: var(--bg-alt); }

/* ---------------------------- PEOPLE ---------------------------- */
.person { display: flex; gap: 30px; align-items: flex-start; }
.person-photo { width: 190px; height: 190px; object-fit: cover; border-radius: var(--radius);
  box-shadow: var(--shadow); flex-shrink: 0; }
.person-body h3 { font-size: 1.4rem; margin: 0 0 2px; }
.person-body h3 .degrees { font-weight: 400; color: var(--muted); }
.person-role { color: var(--scarlet); font-weight: 600; margin: 0 0 6px; }
.person-affil { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.person-bio { margin: 0 0 14px; }
.person-links a { font-weight: 500; }
.person-links .dot, .contact-links .dot { color: var(--line); margin: 0 6px; }
.email { color: var(--body); white-space: nowrap; }

.openings-note {
  margin-top: 34px; padding: 20px 24px; background: var(--bg-hero);
  border: 1px solid #f0dede; border-left: 4px solid var(--scarlet); border-radius: 10px;
}
.openings-note p { margin: 0; }

/* ---------------------------- PUBLICATIONS ---------------------------- */
.pub-legend { color: var(--muted); font-size: .92rem; }
.pub-list { margin: 0; padding-left: 22px; }
.pub-list li { margin-bottom: 20px; padding-left: 6px; line-height: 1.6; }
.pub-list li::marker { color: var(--scarlet); font-weight: 700; }
.pub-list em { color: var(--ink); }
.pub-note { display: inline; color: var(--muted); font-size: .9rem; font-style: italic; }
.pub-doi {
  display: inline-block; margin-left: 6px; padding: 1px 9px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--scarlet); border-radius: 6px; color: var(--scarlet); vertical-align: middle;
}
.pub-doi:hover { background: var(--scarlet); color: #fff; text-decoration: none; }

/* ---------------------------- NEWS ---------------------------- */
.news-list { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.news-list li { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-list li:last-child { border-bottom: 0; }
.news-date { flex: 0 0 92px; font-weight: 600; color: var(--scarlet); font-size: .92rem; padding-top: 1px; }
.news-body { color: var(--body); }

/* ---------------------------- JOIN ---------------------------- */
.join-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.join-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px; }
.join-item h3 { font-size: 1.08rem; margin: 0 0 8px; }
.join-item p { margin: 0; font-size: .97rem; }
.join-cta { margin-top: 28px; font-size: 1.05rem; }

/* ---------------------------- CONTACT + FOOTER ---------------------------- */
.contact-address { font-style: normal; line-height: 1.8; color: var(--body); }
.contact-email { margin: 16px 0 6px; }
.contact-links { color: var(--muted); }

.site-footer { background: #14181d; color: #c7ccd3; padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-inner p { margin: 0; font-size: .9rem; }
.site-footer a { color: #e6a3a3; }

/* ---------------------------- RESPONSIVE ---------------------------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .nav-menu.open { max-height: 460px; }
  .nav-menu li { border-top: 1px solid var(--line); }
  .nav-menu a { padding: 14px 24px; border-radius: 0; }

  .person { flex-direction: column; gap: 20px; }
  .person-photo { width: 150px; height: 150px; }
  .news-list li { flex-direction: column; gap: 2px; }
  .news-date { flex-basis: auto; }
  .hero-inner { padding: 60px 24px 52px; }
  .section { padding: 56px 0; }
}

@media (max-width: 620px) {
  /* Below this the 2x2 research grid gets too narrow to read; stack it. */
  .research-cards { grid-template-columns: 1fr; }
}
