/* ===== Design tokens ===== */
:root {
  --ink: #1c1c1c;
  --muted: #717171;
  --accent: #2563a8;
  --accent-soft: #eef3fa;
  --bg: #ffffff;
  --card: #fafaf8;
  --line: #e8e8e3;
  --line-soft: #f0f0ec;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Layout: fixed sidebar + scrollable content ===== */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 36px;
  display: flex;
  gap: 54px;
  align-items: flex-start;
}

.sidebar {
  flex: 0 0 262px;
  position: sticky;
  top: 44px;
}

.content { flex: 1; min-width: 0; }

/* ===== Sidebar ===== */
.photo {
  width: 200px; height: 200px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-fallback {
  display: none; width: 100%; height: 100%;
  align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-family: "Newsreader", serif; font-size: 64px; font-weight: 600;
}

.sidebar h1 {
  font-family: "Newsreader", serif; font-size: 28px; font-weight: 600;
  margin: 0 0 4px; letter-spacing: -0.01em; line-height: 1.15;
}
.role { margin: 0 0 3px; font-size: 15px; font-weight: 500; }
.affil { margin: 0 0 2px; font-size: 14px; color: var(--muted); }
.affil.sub { margin-bottom: 0; }
.affil a { color: var(--muted); }
.affil a:hover { color: var(--accent); }

.motto {
  margin: 16px 0; font-family: "Newsreader", serif; font-style: italic;
  font-size: 15.5px; color: #3a3a3a; line-height: 1.5;
}

.links { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-bottom: 18px; }
.links a { font-size: 14px; font-weight: 500; position: relative; }
.links a:not(:last-child)::after {
  content: "·"; position: absolute; right: -8px; color: #c8c8c2;
}

.announce {
  background: var(--accent-soft);
  border: 1px solid #d9e4f2;
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.5;
}
.announce p { margin: 0 0 8px; }
.announce p:last-child { margin: 0; }

/* ===== Content sections ===== */
section { margin-bottom: 30px; }
section:first-child { margin-top: 4px; }
section h2 {
  font-family: "Newsreader", serif; font-size: 21px; font-weight: 600;
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
section p { margin: 0 0 12px; }

#about p { font-size: 16px; }
#about p:first-child { margin-top: 0; }
.collab { font-size: 15px; color: #333; }

/* ===== News ===== */
.news-box { max-height: 320px; }
.scroll-box { max-height: 460px; }
.scroll-box.short { max-height: 210px; }
.news-box, .scroll-box { overflow-y: auto; padding-right: 12px; }
.news-box::-webkit-scrollbar, .scroll-box::-webkit-scrollbar { width: 8px; }
.news-box::-webkit-scrollbar-thumb, .scroll-box::-webkit-scrollbar-thumb { background: #d8d8d2; border-radius: 6px; }
.news-box::-webkit-scrollbar-track, .scroll-box::-webkit-scrollbar-track { background: transparent; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  padding: 6px 0;
  font-size: 14.5px; line-height: 1.55;
  border-bottom: 1px solid var(--line-soft);
}
.news-list li:last-child { border-bottom: none; }
.news-list .date {
  color: var(--muted); font-weight: 600;
  font-variant-numeric: tabular-nums; margin-right: 5px;
  white-space: nowrap;
}

/* ===== Publications ===== */
.pub { display: flex; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.pub:last-of-type { border-bottom: none; }
.pub.no-thumb { padding: 10px 0; }
.pub-thumb {
  flex: 0 0 128px; align-self: flex-start;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: #fff; line-height: 0;
}
.pub-thumb img { width: 100%; height: auto; display: block; }
.pub-thumb:hover { border-color: var(--accent); }
.pub-body { flex: 1; min-width: 0; }
.pub-title { font-weight: 600; font-size: 15.5px; margin: 0 0 3px; line-height: 1.35; }
.pub-authors { margin: 0 0 2px; font-size: 14px; }
.pub-venue { margin: 0 0 5px; font-size: 13.5px; color: var(--muted); font-style: italic; }
.pub-actions { margin: 0; font-size: 13.5px; }
.eqnote { font-size: 12.5px; color: var(--muted); margin: 9px 0 0; }

/* ===== Lists ===== */
.plain { list-style: none; padding: 0; margin: 0 0 4px; }
.plain li { padding: 3px 0; font-size: 14.5px; }
.ta-inst { margin: 8px 0 2px; font-size: 14.5px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex; gap: 16px; padding: 6px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 14.5px; align-items: baseline;
}
.timeline li:last-child { border-bottom: none; }
.timeline .yr {
  flex: 0 0 92px; color: var(--muted);
  font-variant-numeric: tabular-nums; font-size: 13px;
}
.timeline .ti { flex: 1; min-width: 0; }
.edu-logo {
  width: 19px; height: 19px; vertical-align: -4px;
  margin-right: 8px; border-radius: 3px; object-fit: contain;
}
.muted { color: var(--muted); font-weight: 400; }
.muted-label { font-size: 12px; color: var(--muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .05em; }
.tools-line { font-size: 14.5px; }

/* ===== Mini grid ===== */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 44px; }
.mini-grid section { margin-bottom: 22px; }
.mini-grid h2 { font-size: 18px; }

/* ===== Footer ===== */
footer {
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .layout { flex-direction: column; gap: 32px; padding: 32px 24px; }
  .sidebar { position: static; flex-basis: auto; width: 100%; }
  .photo { width: 150px; height: 150px; }
  .announce { max-width: 460px; }
}
@media (max-width: 540px) {
  .pub { flex-direction: column; gap: 10px; }
  .pub-thumb { flex-basis: auto; max-width: 180px; }
  .mini-grid { grid-template-columns: 1fr; gap: 0; }
  .timeline li { flex-direction: column; gap: 1px; }
  .timeline .yr { flex-basis: auto; }
}

/* ===== News-flash internship announcement (pulses in place, no movement) ===== */
.flash-line { margin-top: 2px; }
.flash-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 4px;
  margin-right: 3px;
  animation: flashBlink 1.1s steps(1, end) infinite;
}
.flash-text {
  font-weight: 600;
  color: var(--accent);
  animation: flashEmboss 1.1s ease-in-out infinite;
}
/* badge blinks on/off like a news ticker */
@keyframes flashBlink {
  0%, 55%   { opacity: 1; box-shadow: 0 0 8px 1px rgba(37, 99, 168, .55); }
  56%, 100% { opacity: .28; box-shadow: none; }
}
/* text does a bold/unbold emboss in place: thicken glyphs via stroke + shadow (no reflow) */
@keyframes flashEmboss {
  0%, 100% { text-shadow: none; -webkit-text-stroke: 0 currentColor; }
  50%      { text-shadow: 0 0 1px currentColor; -webkit-text-stroke: .35px currentColor; }
}
@media (prefers-reduced-motion: reduce) {
  .flash-badge, .flash-text { animation: none; }
}

/* ===== JHU logo below the announcement ===== */
.jhu-badge { display: block; margin-top: 18px; line-height: 0; text-align: center; }
.jhu-badge img { width: 84px; height: auto; opacity: .9; }
.jhu-badge:hover img { opacity: 1; }
