/* ============================================================
   Academic Portfolio — "Bibliography" Theme
   A CV treated as a bibliography of a career: every section is
   an indexed entry, numbered the way a citation list is numbered.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---------- Tokens: MIT palette ----------
   Cardinal Red (#A31F34) and MIT Grey (#8A8B8C) are MIT's official
   brand colors, set here against black ink on a clean white/light-grey
   ground. */
:root {
  --paper:        #f5f5f5;
  --paper-raised: #ffffff;
  --ink:          #000000;
  --ink-soft:     #3c3c3c;
  --ink-faint:    #8a8b8c;
  --indigo:       #a31f34;
  --indigo-deep:  #75172a;
  --indigo-tint:  #f7e9eb;
  --gold:         #8a8b8c;
  --gold-tint:    #ececec;
  --line:         #d4d4d4;
  --line-strong:  #b3b3b3;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body:    'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Consolas', monospace;

  --max-width: 880px;
  --radius: 6px;
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--indigo); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
ul, ol { padding-left: 1.2rem; }
hr { display: none; } /* replaced by .rule where needed */

/* ---------- Skip link (accessibility) ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--indigo);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 2000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--indigo);
  border-bottom: 3px solid var(--ink);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.nav-name .nav-tagline {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.15rem;
}
.nav-links {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
}
.nav-links a:hover { color: var(--indigo); background: #ffffff; }
.nav-links a.active {
  color: var(--indigo);
  background: #ffffff;
}
.nav-links a.active::before { content: '› '; color: var(--indigo); }

/* ---------- Page shell ---------- */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* ---------- Hero (index page) ---------- */
.hero {
  padding: 3.5rem 0 2.5rem;
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}
.hero-photo img {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--paper-raised);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
.hero-photo .photo-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 0.5rem;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}
.hero-text .role {
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.hero-text .affiliation {
  font-size: 0.92rem;
  color: var(--ink-faint);
  margin-bottom: 1.2rem;
}
.hero-text .affiliation strong { color: var(--ink-soft); font-weight: 600; }
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hero-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--ink-soft);
  background: var(--paper-raised);
}
.hero-links a:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

@media (max-width: 620px) {
  .hero { flex-direction: column; align-items: center; text-align: center; }
  .hero-links { justify-content: center; }
}

/* ---------- Indexed sections (signature motif) ---------- 
   Each major section is numbered like a bibliography entry —
   the CV read as a list of a career's citations. */
.entry {
  position: relative;
  padding: 2.6rem 0 2.6rem 3.2rem;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: none; }
.entry::before {
  content: attr(data-index);
  position: absolute;
  left: 0;
  top: 2.7rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gold);
  background: var(--gold-tint);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1.4;
}
.entry-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.1rem;
  letter-spacing: -0.01em;
}

@media (max-width: 560px) {
  .entry { padding-left: 0; }
  .entry::before { position: static; display: inline-block; margin-bottom: 0.8rem; }
}

/* ---------- Body text ---------- */
.lede {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 68ch;
}
.lede strong { color: var(--ink); }

/* ---------- Research interests / tag grid ---------- */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
  margin-top: 1.3rem;
}
.tag-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  font-size: 0.92rem;
}
.tag-card strong { display: block; margin-bottom: 0.25rem; }
.tag-card span { color: var(--ink-faint); font-size: 0.85rem; }

/* ---------- News / timeline list ---------- */
.record-list { list-style: none; padding: 0; margin: 0; }
.record {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.94rem;
}
.record:last-child { border-bottom: none; }
.record-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
  white-space: nowrap;
}
.record-body { color: var(--ink-soft); }
.record-body strong { color: var(--ink); }

@media (max-width: 500px) {
  .record { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- Timeline (experience) ---------- */
.timeline { position: relative; padding-left: 1.7rem; margin-top: 0.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.7rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--indigo);
}
.timeline-role {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
}
.timeline-org { color: var(--indigo); font-weight: 500; }
.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin: 0.2rem 0 0.5rem;
}
.timeline-detail { font-size: 0.92rem; color: var(--ink-soft); }
.timeline-detail ul { margin-top: 0.4rem; }

/* ---------- Publication list ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.8rem;
}
.pub-item:hover { border-color: var(--indigo); }
.pub-title { font-weight: 600; font-size: 0.98rem; margin-bottom: 0.3rem; }
.pub-authors { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.3rem; }
.pub-authors .me { font-weight: 600; color: var(--ink); }
.pub-venue { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 0.5rem; }
.pub-venue strong { color: var(--indigo); }
.pub-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pub-links a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-soft);
}
.pub-links a:hover { border-color: var(--indigo); color: var(--indigo); }
.tag-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--indigo-tint);
  color: var(--indigo);
  margin-right: 0.3rem;
}
.tag-pill.gold { background: var(--gold-tint); color: var(--gold); }

/* Simple category filter (optional, JS-driven) */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.6rem;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.filter-btn.is-active {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

/* ---------- Honors / awards ---------- */
.honor-list { list-style: none; padding: 0; margin: 0; }
.honor-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--line);
}
.honor-row:last-child { border-bottom: none; }
.honor-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
}

/* ---------- Skills list ---------- */
.skill-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.skill-row:last-child { border-bottom: none; }
.skill-label { font-weight: 600; color: var(--ink); }
.skill-value { color: var(--ink-soft); }

@media (max-width: 560px) {
  .skill-row { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- Buttons / CTA ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--indigo);
  color: var(--indigo);
  background: transparent;
}
.btn:hover { background: var(--indigo); color: #fff; }

/* ---------- Rule / divider ---------- */
.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--indigo);
  border-top: 3px solid var(--ink);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.footer-links a { color: #ffffff; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
