:root {
  --bg: #ffffff;
  --surface: #f7f6f3;
  --border: #e4e2dc;
  --text-1: #111111;
  --text-2: #444444;
  --text-3: #777777;
  --accent: #c94b1a;
  --accent-dark: #9e3912;
  --nav-bg: rgb(15, 25, 35);
  --nav-text: #f0ede8;
  --max-w: 860px;
  --font: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── Navigation ── */
nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 54px;
}

.nav-brand {
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 15px;
  width: auto;
  flex-shrink: 0;
  margin-right: 12px;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.nav-brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: #a8a09a;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--nav-text);
}

/* ── MIT logo (nav right) ── */
.nav-mit {
  margin-left: auto;
  margin-right: 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-mit-logo {
  height: 16px;
  width: auto;
  opacity: 0.65;
  filter: brightness(0) invert(1);
  transition: opacity 0.15s;
}

.nav-mit:hover .nav-mit-logo { opacity: 1; }

/* ── Hamburger ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-mit { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-top: 1px solid #1a2a38;
    padding: 8px 0;
    z-index: 99;
  }

  .nav-links.open { display: flex; }

  .nav-links li a {
    display: block;
    padding: 12px 24px;
    font-size: 15px;
  }

  .nav-inner { position: relative; }
}

/* ── Page wrapper ── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Hero (index only) ── */
.hero {
  padding: 72px 24px 56px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-1);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-2);
  max-width: 640px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text-2);
}

.btn-outline:hover { border-color: var(--text-2); color: var(--text-1); }

/* ── Section divider ── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Content sections ── */
.content-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 24px;
}

.content-section + .content-section {
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.content-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.content-section p {
  color: var(--text-2);
  margin-bottom: 16px;
  max-width: 700px;
}

.content-section p:last-child { margin-bottom: 0; }

.content-section p a,
.page p a {
  color: var(--text-2);
  text-decoration: underline;
}

.content-section p a:hover,
.page p a:hover { color: var(--text-1); }

/* ── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 32px 0 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.4;
}

/* ── Dark page hero (inner pages) ── */
.page-hero {
  background: var(--nav-bg);
  padding: 0 24px;
}

.page-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 0 44px;
}

.page-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6a8a9a;
  margin-bottom: 20px;
}

.page-hero-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: #6a8a9a;
}

.page-hero-inner h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f0ede8;
  margin-bottom: 12px;
  line-height: 1.1;
}

.page-hero-sub {
  font-size: 15px;
  color: #8a9aa8;
  line-height: 1.65;
  max-width: 560px;
}

.page-hero-sub a {
  color: #8a9aa8;
  text-decoration: underline;
}

.page-hero-sub a:hover { color: #f0ede8; }

.page-header p a {
  color: var(--text-2);
  text-decoration: underline;
}

.page-header p a:hover {
  color: var(--text-1);
}

/* ── People grid ── */
.people-group {
  margin-bottom: 44px;
}

.people-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.people-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 18px 0;
}

.person-card {
  display: flex;
  gap: 16px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
  margin: -10px;
  transition: background 0.2s;
}

.person-card:hover {
  background: var(--surface);
}

.person-info { flex: 1; }

.person-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}

.person-name a {
  color: inherit;
  text-decoration: none;
}

.person-name a:hover { color: var(--accent); }

.person-title {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.person-affil {
  font-size: 13px;
  color: var(--text-3);
}

.person-bio {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 8px;
  line-height: 1.6;
}

.person-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* ── Publications list ── */
.pub-year-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pub-year-heading:first-child { margin-top: 0; }

.pub-list {
  list-style: none;
}

.pub-item {
  padding: 18px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.pub-item:hover { background: var(--surface); }

.pub-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
  line-height: 1.5;
}

.pub-title a {
  color: inherit;
  text-decoration: none;
}

.pub-title a:hover { color: var(--accent); text-decoration: underline; }

.pub-featured {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1.6;
}

.pub-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1.6;
}

.pub-authors {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.pub-venue {
  font-size: 13px;
  color: var(--text-3);
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  text-decoration: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.6;
  transition: color 0.15s, border-color 0.15s;
}

.pub-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.pub-btn.copied {
  color: #2a7a3a;
  border-color: #2a7a3a;
}

.pub-btn svg {
  flex-shrink: 0;
}

.pub-copy-all-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* ── RFC page ── */
.rfc-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 24px 28px;
  margin: 32px 0;
}

.rfc-intro p {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.7;
}

.rfc-intro p:last-child { margin-bottom: 0; }

.rfc-intro cite {
  font-style: normal;
  font-weight: 600;
  color: var(--text-1);
}

.rfc-list {
  list-style: none;
  margin-top: 28px;
}

.rfc-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.rfc-item:last-child { border-bottom: none; }

.rfc-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  white-space: nowrap;
  margin-top: 2px;
  min-width: 80px;
}

.rfc-body { flex: 1; }

.rfc-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
}

.rfc-title a {
  color: inherit;
  text-decoration: none;
}

.rfc-title a:hover { color: var(--accent); }

.rfc-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 52px 24px 32px;
  font-size: 13px;
  color: var(--text-3);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: block;
  margin-bottom: 14px;
}

.footer-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.footer-brand-name span { color: var(--accent); }

.footer-tagline {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 220px;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-logo-mit {
  height: 32px;
  width: auto;
  display: block;
  filter: brightness(0);
}

.footer-logo-julialab {
  height: 32px;
  width: auto;
  display: block;
}

.footer-logo-csail {
  height: 52px;
  width: auto;
  display: block;
  opacity: 0.75;
}

.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
}

.footer-col-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-links a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col-links a:hover { color: var(--text-1); }

.footer-col-links li { line-height: 1.4; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a { color: var(--text-3); text-decoration: underline; }
.footer-bottom a:hover { color: var(--text-1); }

.footer-ai-disclaimer {
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #b0aba4;
  font-style: italic;
  margin-top: 10px;
  order: 10;
}

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .people-pair { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ── MIT badge ── */
.affil-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 28px;
}

.affil-badge:hover { border-color: var(--text-3); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 48px 20px 40px; }
  .page { padding: 40px 20px 60px; }
  .content-section { padding: 40px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .rfc-item { flex-direction: column; gap: 6px; }
  .rfc-num { min-width: unset; }
  .pub-title { font-size: 14px; }
  .people-pair { grid-template-columns: 1fr; }
}
